From: Richard M. Stallman Date: Sun, 5 Dec 2004 23:34:44 +0000 (+0000) Subject: (regex_compile): Fix end-of-pattern case for space. X-Git-Tag: ttn-vms-21-2-B4~3425 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c721eee5e3f5fcd0ef53de43cea712146d08d131;p=emacs.git (regex_compile): Fix end-of-pattern case for space. --- diff --git a/src/ChangeLog b/src/ChangeLog index 198bbb931c7..d21df41fe56 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-12-05 Richard M. Stallman + + * regex.c (regex_compile): Fix end-of-pattern case for space. + 2004-12-03 YAMAMOTO Mitsuharu * macterm.h (cfstring_create_with_utf8_cstring): Add prototype. diff --git a/src/regex.c b/src/regex.c index a53eac29216..130765134f5 100644 --- a/src/regex.c +++ b/src/regex.c @@ -2558,8 +2558,8 @@ regex_compile (pattern, size, syntax, bufp) } /* If the spaces are followed by a repetition op, treat them normally. */ - if (p1 == pend - || (*p1 == '*' || *p1 == '+' || *p1 == '?' + if (p1 != pend + && (*p1 == '*' || *p1 == '+' || *p1 == '?' || (*p1 == '\\' && p1 + 1 != pend && p1[1] == '{'))) goto normal_char;