Mercurial > hg > octave-shane > gnulib-hg
changeset 2816:bd9c110a1342
(regex_compile) <normal_char>: Pay attention to multibyteness.
(analyse_first) <exactn>: Setup fastmap correctly for
eight-bit-control characters.
author | Kenichi Handa <handa@m17n.org> |
---|---|
date | Fri, 11 Aug 2000 01:56:59 +0000 |
parents | 0568c0a9bea5 |
children | 00319a3d4087 |
files | regex.c |
diffstat | 1 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/regex.c +++ b/regex.c @@ -3064,7 +3064,12 @@ GET_BUFFER_SPACE (MAX_MULTIBYTE_LENGTH); { - int len = CHAR_STRING (c, b); + int len; + + if (multibyte) + len = CHAR_STRING (c, b); + else + *b = c, len = 1; b += len; (*pending_exact) += len; } @@ -3375,7 +3380,15 @@ with `break'. */ case exactn: - if (fastmap) fastmap[p[1]] = 1; + if (fastmap) + { + int c = RE_STRING_CHAR (p + 1, pend - p); + + if (SINGLE_BYTE_CHAR_P (c)) + fastmap[c] = 1; + else + fastmap[p[1]] = 1; + } break;