summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-17 12:15:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-12-17 12:15:45 +0000
commit49fc21f31e84663c02660bdbfee72adcf4040947 (patch)
treedaf9f28696d53f9251eeafbee4ef213840a1272a /re.c
parentdd8a919a006794be7d88b9701724f784b9d9eb95 (diff)
* re.c (rb_reg_nth_match): tail sharing.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3163 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/re.c b/re.c
index 8d48273..52fca7c 100644
--- a/re.c
+++ b/re.c
@@ -778,8 +778,8 @@ rb_reg_nth_match(nth, match)
if (start == -1) return Qnil;
end = RMATCH(match)->END(nth);
len = end - start;
- str = rb_str_new(RSTRING(RMATCH(match)->str)->ptr + start, len);
- if (OBJ_TAINTED(match)) OBJ_TAINT(str);
+ str = rb_str_substr(RMATCH(match)->str, start, len);
+ OBJ_INFECT(str, match);
return str;
}