summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-08 06:04:26 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-01-08 06:04:26 +0000
commit389abf1b3b9e65b5944fa3616bea93259b137a92 ()
treec0509023ea5b2a24c2b0ec76d2326fe32c07dd0f
parent893ee3097885c83df17273d7de5ed54438de5d20 (diff)
* string.c (str_gsub): avoid appending empty pre-match substr.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14944 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog4
-rw-r--r--string.c4
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,7 @@
Tue Jan 8 13:05:57 2008 Nobuyoshi Nakada <[email protected]>
* compile.c (iseq_build_from_ary), iseq.c (iseq_load): fix for format change.
@@ -2720,7 +2720,9 @@ str_gsub(int argc, VALUE *argv, VALUE str, int bang)
if (OBJ_TAINTED(val)) tainted = 1;
len = beg - offset; /* copy pre-match substr */
- rb_enc_str_buf_cat(dest, cp, len, str_enc);
rb_str_buf_append(dest, val);