diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-09-07 06:59:46 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-09-07 06:59:46 +0000 |
commit | 6fc752bf7da30898ff8e570f9354cab9419cf3cf (patch) | |
tree | 69ef1c65eafc080502ce7cb838a7d8a34904980e /regex.c | |
parent | a509e67c5a690ad83bde66299d73bcf967f84dc1 (diff) |
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regex.c')
-rw-r--r-- | regex.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -3137,7 +3137,7 @@ re_search(bufp, string, size, startpos, range, regs) /* If the search isn't to be a backwards one, don't waste time in a search for a pattern that must be anchored. */ - if (bufp->used>0) { + if (bufp->used > 0) { switch ((enum regexpcode)bufp->buffer[0]) { case begbuf: begbuf_match: @@ -3196,6 +3196,7 @@ re_search(bufp, string, size, startpos, range, regs) if (range > 0 && (bufp->options & RE_OPTIMIZE_EXACTN)) { startpos += pos; range -= pos; + if (range < 0) return -1; } } |