1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-29 07:58:28 +00:00

(regex_compile) <normal_char>: Pay attention to multibyteness.

(analyse_first) <exactn>: Setup fastmap correctly for
eight-bit-control characters.
This commit is contained in:
Kenichi Handa 2000-08-11 01:56:59 +00:00
parent c371f69a68
commit e0277a4716

View File

@ -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;