diff options
| author | Karl Heuer | 1998-12-10 03:09:12 +0000 |
|---|---|---|
| committer | Karl Heuer | 1998-12-10 03:09:12 +0000 |
| commit | d18b62f2111990ea8d083163e0a334e80fe29fb2 (patch) | |
| tree | f88ff5eb10fe85f853db287e34f1ea6598b6423c | |
| parent | 538b98473f4cd7d7e3d0f56287bb11d167c24c8b (diff) | |
| download | emacs-d18b62f2111990ea8d083163e0a334e80fe29fb2.tar.gz emacs-d18b62f2111990ea8d083163e0a334e80fe29fb2.zip | |
(re_compile_fastmap): For anychar, set all fastmap
elements for all possible unibyte chars (except newline).
| -rw-r--r-- | src/regex.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/regex.c b/src/regex.c index 0dcdedec517..a700c887da8 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -3381,21 +3381,13 @@ re_compile_fastmap (bufp) | |||
| 3381 | { | 3381 | { |
| 3382 | int fastmap_newline = fastmap['\n']; | 3382 | int fastmap_newline = fastmap['\n']; |
| 3383 | 3383 | ||
| 3384 | /* `.' matches anything (but if bufp->multibyte is | 3384 | /* `.' matches anything, except perhaps newline. |
| 3385 | nonzero, matches `\000' .. `\127' and possible multibyte | 3385 | Even in a multibyte buffer, it should match any |
| 3386 | character) ... */ | 3386 | conceivable byte value for the fastmap. */ |
| 3387 | if (bufp->multibyte) | 3387 | if (bufp->multibyte) |
| 3388 | { | 3388 | match_any_multibyte_characters = true; |
| 3389 | simple_char_max = 0x80; | ||
| 3390 | |||
| 3391 | for (j = 0x80; j < 0xA0; j++) | ||
| 3392 | if (BASE_LEADING_CODE_P (j)) | ||
| 3393 | fastmap[j] = 1; | ||
| 3394 | match_any_multibyte_characters = true; | ||
| 3395 | } | ||
| 3396 | else | ||
| 3397 | simple_char_max = (1 << BYTEWIDTH); | ||
| 3398 | 3389 | ||
| 3390 | simple_char_max = (1 << BYTEWIDTH); | ||
| 3399 | for (j = 0; j < simple_char_max; j++) | 3391 | for (j = 0; j < simple_char_max; j++) |
| 3400 | fastmap[j] = 1; | 3392 | fastmap[j] = 1; |
| 3401 | 3393 | ||