summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-01 07:40:39 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-04-01 07:40:39 +0000
commit06c88786ed55e2056565d08b6a16d3c34ff5cb93 (patch)
tree9962d1d7ba222f814da36fed6293734fe2a2e8ad /re.c
parent0ccfe451346bd2f3e13fdd9bd69bd07a331d5fab (diff)
* re.c (match_setter): it's OK to assign nil to $~.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@2313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/re.c b/re.c
index ae09f8b673..b3e80646f4 100644
--- a/re.c
+++ b/re.c
@@ -1338,7 +1338,9 @@ static void
match_setter(val)
VALUE val;
{
- Check_Type(val, T_MATCH);
+ if (!NIL_P(val)) {
+ Check_Type(val, T_MATCH);
+ }
rb_backref_set(val);
}