mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a509e67c5a
commit
6fc752bf7d
11 changed files with 111 additions and 78 deletions
3
regex.c
3
regex.c
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue