diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2008-08-31 23:31:07 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2008-08-31 23:31:07 -0400 |
commit | f06e47e4c02793186e0cb85966d7e4aac63c0618 (patch) | |
tree | e0e5c5a1b672ec8400035f6df507d4019e9a020d /src/LYStrings.c | |
parent | a4209b5bd5a43a905b9fa6af78a028e50a89d640 (diff) | |
download | lynx-snapshots-f06e47e4c02793186e0cb85966d7e4aac63c0618.tar.gz |
snapshot of project "lynx", label v2-8-7dev_9f
Diffstat (limited to 'src/LYStrings.c')
-rw-r--r-- | src/LYStrings.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/LYStrings.c b/src/LYStrings.c index 2177377d..bb0d7a09 100644 --- a/src/LYStrings.c +++ b/src/LYStrings.c @@ -1,4 +1,4 @@ -/* $LynxId: LYStrings.c,v 1.134 2008/07/04 15:06:56 tom Exp $ */ +/* $LynxId: LYStrings.c,v 1.135 2008/08/31 18:54:07 tom Exp $ */ #include <HTUtils.h> #include <HTCJK.h> #include <UCAux.h> @@ -636,18 +636,22 @@ const char *LYmbcs_skip_glyphs(const char *data, if (n_glyphs < 0) n_glyphs = 0; - if (!data) - return NULL; - if (!utf_flag) - return (data + n_glyphs); - - while (*data) { - if (IS_NEW_GLYPH(*data)) { - if (i_glyphs++ >= n_glyphs) { - return data; + if (!isEmpty(data)) { + if (!utf_flag) { + while (n_glyphs-- > 0) { + if (!*++data) + break; + } + } else { + while (*data) { + if (IS_NEW_GLYPH(*data)) { + if (i_glyphs++ >= n_glyphs) { + break; + } + } + data++; } } - data++; } return data; } |