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 | 74271c786adc78b3f657dd146828e0165f511f88 (patch) | |
| tree | c346640fe3a6accf7acacc21fe0c6ad339d95569 /re.c | |
| parent | de295ad3f3d8e105a0eb35d5e7190da87fcdb6e5 (diff) | |
| download | ruby-74271c786adc78b3f657dd146828e0165f511f88.tar.gz ruby-74271c786adc78b3f657dd146828e0165f511f88.tar.xz ruby-74271c786adc78b3f657dd146828e0165f511f88.zip | |
* string.c (rb_str_match_m): String#match should also take
optional argument. [ruby-core:03205]
git-svn-id: http://svn.ruby-lang.org/repos/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) { |
