diff options
author | Kenichi Handa <handa@m17n.org> | 2000-08-11 01:56:59 +0000 |
---|---|---|
committer | Kenichi Handa <handa@m17n.org> | 2000-08-11 01:56:59 +0000 |
commit | e0277a471613d6e3d38fa13d965bf7855d249822 (patch) | |
tree | 3d0c498f4c5ab00830da2216bfed6beefac6141a /src/regex.c | |
parent | c371f69a68bde3cf713adc0bb4f0204a34671b1b (diff) | |
download | emacs-e0277a471613d6e3d38fa13d965bf7855d249822.tar.gz |
(regex_compile) <normal_char>: Pay attention to multibyteness.
(analyse_first) <exactn>: Setup fastmap correctly for
eight-bit-control characters.
Diffstat (limited to 'src/regex.c')
-rw-r--r-- | src/regex.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/regex.c b/src/regex.c index 1b796c08886..97cc409b545 100644 --- a/src/regex.c +++ b/src/regex.c @@ -3064,7 +3064,12 @@ regex_compile (pattern, size, syntax, bufp) 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 @@ analyse_first (p, pend, fastmap, multibyte) 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; |