summaryrefslogtreecommitdiffstats
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
commit7f717c8dfc8c1d5595764ba14e527f21c60ec9d2 (patch)
treed0f568425d4c6cc55881ae6c9d40375350bf1548 /string.c
parentbc04619d1324f4fb9b276caa36d05d697c156798 (diff)
downloadruby-7f717c8dfc8c1d5595764ba14e527f21c60ec9d2.tar.gz
ruby-7f717c8dfc8c1d5595764ba14e527f21c60ec9d2.tar.xz
ruby-7f717c8dfc8c1d5595764ba14e527f21c60ec9d2.zip
add back reference by name in replace string
git-svn-id: http://svn.ruby-lang.org/repos/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 a9adc6200..84f9e843d 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;