summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-12-01 09:24:48 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>1999-12-01 09:24:48 +0000
commita3f29338ad53c1027eeef0d3c7168d3355105d20 (patch)
treebcccfeb74a7a975d713727a964e89fd53cc80e05 /re.c
parent40517ecac82e4b406227bd30fd89d05c2e90bc87 (diff)
19991201
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@573 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/re.c b/re.c
index 540ae28..9452e42 100644
--- a/re.c
+++ b/re.c
@@ -275,7 +275,9 @@ static VALUE
rb_reg_source(re)
VALUE re;
{
- return rb_str_new(RREGEXP(re)->str,RREGEXP(re)->len);
+ VALUE str = rb_str_new(RREGEXP(re)->str,RREGEXP(re)->len);
+ if (OBJ_TAINTED(re)) OBJ_TAINT(str);
+ return str;
}
static VALUE
@@ -715,7 +717,8 @@ match_to_s(match)
{
VALUE str = rb_reg_last_match(match);
- if (NIL_P(str)) return rb_str_new(0,0);
+ if (NIL_P(str)) str = rb_str_new(0,0);
+ if (OBJ_TAINTED(match)) OBJ_TAINT(str);
return str;
}