diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-17 08:02:20 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-07-17 08:02:20 +0000 |
commit | 83fa0928d735f7076a7b755ff150cdec741a32ed (patch) | |
tree | c346640fe3a6accf7acacc21fe0c6ad339d95569 /re.c | |
parent | eabd490119df3f6c15be62d26ed1f4d523a65f17 (diff) | |
download | ruby-83fa0928d735f7076a7b755ff150cdec741a32ed.tar.gz |
* 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.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -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) { |