summaryrefslogtreecommitdiff
path: root/regex.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-06-11 10:03:21 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1998-06-11 10:03:21 +0000
commit1bc6f594d3de8dbfb5c165835eaec99bd49327c8 (patch)
treed535a84c63a5cf779aa1ae83f89ed64f22040471 /regex.c
parent3f5b1ec9cb657375a0c467ac70fdd6fbdc97f018 (diff)
1.1b9_25
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regex.c')
-rw-r--r--regex.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/regex.c b/regex.c
index 16bdd0a671..a9ac531e24 100644
--- a/regex.c
+++ b/regex.c
@@ -1670,7 +1670,6 @@ re_compile_pattern(pattern, size, bufp)
GET_UNSIGNED_NUMBER(lower_bound);
if (c == ',') {
GET_UNSIGNED_NUMBER(upper_bound);
- if (upper_bound < 0) upper_bound = RE_DUP_MAX;
}
else
/* Interval such as `{1}' => match exactly once. */
@@ -1679,8 +1678,9 @@ re_compile_pattern(pattern, size, bufp)
if (lower_bound < 0 || c != '}')
goto unfetch_interval;
- if (lower_bound > RE_DUP_MAX || upper_bound > RE_DUP_MAX)
+ if (lower_bound >= RE_DUP_MAX || upper_bound >= RE_DUP_MAX)
FREE_AND_RETURN(stackb, "too big quantifier in {,}");
+ if (upper_bound < 0) upper_bound = RE_DUP_MAX;
if (lower_bound > upper_bound)
FREE_AND_RETURN(stackb, "can't do {n,m} with n > m");