summaryrefslogtreecommitdiff
path: root/regex.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-18 08:47:48 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-03-18 08:47:48 +0000
commitae08a031a6560fee564a113f4ba7799430f887f7 (patch)
treed0fbfc339af319089b5032e2e17c732e3a3c11c9 /regex.c
parent15281f2e23d9a947626af5b64659520595bfd783 (diff)
extended regexp bug fix
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/regex.c b/regex.c
index efc3bd7..adac91d 100644
--- a/regex.c
+++ b/regex.c
@@ -1848,7 +1848,7 @@ re_compile_pattern(pattern, size, bufp)
c1 = 0;
GET_UNSIGNED_NUMBER(c1);
- if (p < pend) PATUNFETCH;
+ if (!ISDIGIT(c)) PATUNFETCH;
if (c1 >= regnum) {
/* need to get octal */
@@ -2892,9 +2892,11 @@ re_match(bufp, string_arg, size, pos, regs)
/* If not end of string, try backtracking. Otherwise done. */
if (d != dend)
{
+ while (stackp != stackb && (int)stackp[-1] == 1)
+ POP_FAILURE_POINT();
if (stackp != stackb)
{
- /* More failure points to try. */
+ /* More failure points to try. */
/* If exceeds best match so far, save it. */
if (! best_regs_set || (d > best_regend[0]))
@@ -3419,8 +3421,6 @@ re_match(bufp, string_arg, size, pos, regs)
SET_REGS_MATCHED;
break;
}
- if (stackp != stackb && (int)stackp[-1] == 1)
- POP_FAILURE_POINT();
continue; /* Successfully executed one pattern command; keep going. */
/* Jump here if any matching operation fails. */