diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-06-11 10:03:21 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-06-11 10:03:21 +0000 |
commit | 1bc6f594d3de8dbfb5c165835eaec99bd49327c8 (patch) | |
tree | d535a84c63a5cf779aa1ae83f89ed64f22040471 /regex.c | |
parent | 3f5b1ec9cb657375a0c467ac70fdd6fbdc97f018 (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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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"); |