summaryrefslogtreecommitdiff
path: root/regex.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-22 17:29:39 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-04-22 17:29:39 +0000
commita47dfe276352f2c02aa96341cb0a37ce7d5b4b69 (patch)
tree65e334506c36d6028a4aa82afb680191d268e8c3 /regex.c
parent7f6df101caca14f3bc68226ff33b7301ffbe6d74 (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.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/regex.c b/regex.c
index a7a831286e..45f7e20738 100644
--- a/regex.c
+++ b/regex.c
@@ -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) {