X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=regex.c;h=97cc409b545237df80d9dd884af2ed525fef376a;hb=98dccf6477ac680d228a4e1687731cc3dc86cab9;hp=1b796c088868c7f26bec95a9fcc5f2610db67173;hpb=1d7122be37d5b0197fed436497c5d2b5df809859;p=gnulib.git diff --git a/regex.c b/regex.c index 1b796c088..97cc409b5 100644 --- a/regex.c +++ b/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;