From fa950307aeb2a060be72fc73e0017e5497cb4ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 15 Sep 2015 09:06:33 +0200 Subject: Add utfnext utility function --- libutf.c | 7 +++++++ libutf.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/libutf.c b/libutf.c index 5f6ff45..c9d77dc 100644 --- a/libutf.c +++ b/libutf.c @@ -1,5 +1,12 @@ /* libutf8 © 2012-2015 Connor Lane Smith */ #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 index 4d3f91c..b255961 100644 --- 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 */ #include #include -- cgit v1.2.3