diff options
author | Richard M. Stallman <rms@gnu.org> | 1998-12-30 20:44:39 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1998-12-30 20:44:39 +0000 |
commit | ba5c004d4be7664fba1350c0714f1e065c9127ba (patch) | |
tree | 8a62849cd235bbb679d61352e9f357391a3a3ac2 /src/regex.c | |
parent | e38dff0c25c0a20ed9b85b687fe18c516472c577 (diff) | |
download | emacs-ba5c004d4be7664fba1350c0714f1e065c9127ba.tar.gz |
(re_compile_fastmap): Do something similar to the
previous change, for charset_not, wordchar, notwordchar,
categoryspec, notcategoryspec.
Diffstat (limited to 'src/regex.c')
-rw-r--r-- | src/regex.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/regex.c b/src/regex.c index a700c887da8..0983c17e795 100644 --- a/src/regex.c +++ b/src/regex.c @@ -3323,9 +3323,11 @@ re_compile_fastmap (bufp) case charset_not: - /* Chars beyond end of map must be allowed. End of map is - `127' if bufp->multibyte is nonzero. */ - simple_char_max = bufp->multibyte ? 0x80 : (1 << BYTEWIDTH); + /* Chars beyond end of bitmap are possible matches. + All the single-byte codes can occur in multibyte buffers. + So any that are not listed in the charset + are possible matches, even in multibyte buffers. */ + simple_char_max = (1 << BYTEWIDTH); for (j = CHARSET_BITMAP_SIZE (&p[-1]) * BYTEWIDTH; j < simple_char_max; j++) fastmap[j] = 1; @@ -3352,7 +3354,9 @@ re_compile_fastmap (bufp) case wordchar: - simple_char_max = bufp->multibyte ? 0x80 : (1 << BYTEWIDTH); + /* All the single-byte codes can occur in multibyte buffers, + and they may have word syntax. So do consider them. */ + simple_char_max = (1 << BYTEWIDTH); for (j = 0; j < simple_char_max; j++) if (SYNTAX (j) == Sword) fastmap[j] = 1; @@ -3365,7 +3369,9 @@ re_compile_fastmap (bufp) case notwordchar: - simple_char_max = bufp->multibyte ? 0x80 : (1 << BYTEWIDTH); + /* All the single-byte codes can occur in multibyte buffers, + and they may not have word syntax. So do consider them. */ + simple_char_max = (1 << BYTEWIDTH); for (j = 0; j < simple_char_max; j++) if (SYNTAX (j) != Sword) fastmap[j] = 1; @@ -3445,7 +3451,7 @@ re_compile_fastmap (bufp) case categoryspec: k = *p++; - simple_char_max = bufp->multibyte ? 0x80 : (1 << BYTEWIDTH); + simple_char_max = (1 << BYTEWIDTH); for (j = 0; j < simple_char_max; j++) if (CHAR_HAS_CATEGORY (j, k)) fastmap[j] = 1; @@ -3459,7 +3465,7 @@ re_compile_fastmap (bufp) case notcategoryspec: k = *p++; - simple_char_max = bufp->multibyte ? 0x80 : (1 << BYTEWIDTH); + simple_char_max = (1 << BYTEWIDTH); for (j = 0; j < simple_char_max; j++) if (!CHAR_HAS_CATEGORY (j, k)) fastmap[j] = 1; |