vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
commit d3dc4d2cf3f4f34ad8f915bf8718cacf4d150e4a parent 4b686d95d6319f2d4f4eba52dc8ae51a3b69b431 Author: Marc André Tanner <mat@brain-dump.org> Date: Tue, 15 Sep 2015 09:06:33 +0200 Add utfnext utility function Diffstat:
| M | libutf.c | | | 7 | +++++++ |
| M | libutf.h | | | 2 | ++ |
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/libutf.c b/libutf.c @@ -1,5 +1,12 @@ /* libutf8 © 2012-2015 Connor Lane Smith <cls@lubutu.com> */ #include "libutf.h" +#include "util.h" + +const char *utfnext(const char *s) { + while (!ISUTF8(*s)) + s++; + return s; +} int runelen(Rune r) diff --git a/libutf.h b/libutf.h @@ -1,6 +1,8 @@ #ifndef LIBUTF_H #define LIBUTF_H +const char *utfnext(const char *s); + /* libutf8 © 2012-2015 Connor Lane Smith <cls@lubutu.com> */ #include <stddef.h> #include <stdint.h>