diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-22 17:29:39 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-22 17:29:39 +0000 |
commit | a47dfe276352f2c02aa96341cb0a37ce7d5b4b69 (patch) | |
tree | 65e334506c36d6028a4aa82afb680191d268e8c3 /regex.c | |
parent | 7f6df101caca14f3bc68226ff33b7301ffbe6d74 (diff) |
Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regex.c')
-rw-r--r-- | regex.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -3177,6 +3177,10 @@ re_search(bufp, string, size, startpos, range, regs) /* Check for out-of-range starting position. */ if (startpos < 0 || startpos > size) return -1; + if (!string) { + if (size == 0) string = ""; + else return -1; + } /* Update the fastmap now if not correct already. */ if (fastmap && !bufp->fastmap_accurate) { |