summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-17 08:02:20 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2004-07-17 08:02:20 +0000
commit83fa0928d735f7076a7b755ff150cdec741a32ed (patch)
treec346640fe3a6accf7acacc21fe0c6ad339d95569 /re.c
parenteabd490119df3f6c15be62d26ed1f4d523a65f17 (diff)
* string.c (rb_str_match_m): String#match should also take
optional argument. [ruby-core:03205] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6659 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/re.c b/re.c
index 4340cf2982..2cc90ae312 100644
--- a/re.c
+++ b/re.c
@@ -1496,6 +1496,10 @@ rb_reg_match_pos(re, str, pos)
VALUE re, str;
long pos;
{
+ if (NIL_P(str)) {
+ rb_backref_set(Qnil);
+ return Qnil;
+ }
StringValue(str);
if (pos != 0) {
if (pos < 0) {