From 7f717c8dfc8c1d5595764ba14e527f21c60ec9d2 Mon Sep 17 00:00:00 2001 From: kosako Date: Wed, 22 Mar 2006 15:03:40 +0000 Subject: 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 --- string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'string.c') 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; -- cgit