aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2000-08-11 01:56:59 +0000
committerKenichi Handa2000-08-11 01:56:59 +0000
commite0277a471613d6e3d38fa13d965bf7855d249822 (patch)
tree3d0c498f4c5ab00830da2216bfed6beefac6141a /src
parentc371f69a68bde3cf713adc0bb4f0204a34671b1b (diff)
downloademacs-e0277a471613d6e3d38fa13d965bf7855d249822.tar.gz
emacs-e0277a471613d6e3d38fa13d965bf7855d249822.zip
(regex_compile) <normal_char>: Pay attention to multibyteness.
(analyse_first) <exactn>: Setup fastmap correctly for eight-bit-control characters.
Diffstat (limited to 'src')
-rw-r--r--src/regex.c17
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)
3064 3064
3065 GET_BUFFER_SPACE (MAX_MULTIBYTE_LENGTH); 3065 GET_BUFFER_SPACE (MAX_MULTIBYTE_LENGTH);
3066 { 3066 {
3067 int len = CHAR_STRING (c, b); 3067 int len;
3068
3069 if (multibyte)
3070 len = CHAR_STRING (c, b);
3071 else
3072 *b = c, len = 1;
3068 b += len; 3073 b += len;
3069 (*pending_exact) += len; 3074 (*pending_exact) += len;
3070 } 3075 }
@@ -3375,7 +3380,15 @@ analyse_first (p, pend, fastmap, multibyte)
3375 with `break'. */ 3380 with `break'. */
3376 3381
3377 case exactn: 3382 case exactn:
3378 if (fastmap) fastmap[p[1]] = 1; 3383 if (fastmap)
3384 {
3385 int c = RE_STRING_CHAR (p + 1, pend - p);
3386
3387 if (SINGLE_BYTE_CHAR_P (c))
3388 fastmap[c] = 1;
3389 else
3390 fastmap[p[1]] = 1;
3391 }
3379 break; 3392 break;
3380 3393
3381 3394