diff options
-rw-r--r-- | src/ChangeLog | 4 | ||||
-rw-r--r-- | src/regex.c | 4 |
2 files changed, 6 insertions, 2 deletions
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 <rms@gnu.org> + + * regex.c (regex_compile): Fix end-of-pattern case for space. + 2004-12-03 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> * 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; |