summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorkosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-03-22 15:03:40 +0000
committerkosako <kosako@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-03-22 15:03:40 +0000
commit0fa1086760eb0a5964789eb619769764107458ca (patch)
treed0f568425d4c6cc55881ae6c9d40375350bf1548 /string.c
parenta350e9c6e2935b2c2d358b94327a0c7028668c11 (diff)
add back reference by name in replace string
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index a9adc6200a..84f9e843dc 100644
--- a/string.c
+++ b/string.c
@@ -1848,7 +1848,7 @@ rb_str_sub_bang(int argc, VALUE *argv, VALUE str)
rb_backref_set(match);
}
else {
- repl = rb_reg_regsub(repl, str, regs);
+ repl = rb_reg_regsub(repl, str, regs, pat);
}
if (OBJ_TAINTED(repl)) tainted = 1;
plen = END(0) - BEG(0);
@@ -1966,7 +1966,7 @@ str_gsub(int argc, VALUE *argv, VALUE str, int bang)
rb_backref_set(match);
}
else {
- val = rb_reg_regsub(repl, str, regs);
+ val = rb_reg_regsub(repl, str, regs, pat);
}
if (OBJ_TAINTED(val)) tainted = 1;
len = (bp - buf) + (beg - offset) + RSTRING(val)->len + 3;