diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-28 07:46:49 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-02-28 07:46:49 +0000 |
commit | 4960e66ab64350c6a6cc89b3b40fcd842dfa65d9 (patch) | |
tree | d656abf4ffd0da64f0ac0082603224e1ac24ec62 /string.c | |
parent | 3fec2bee37ebbb54f5e7fc2fee3ba832a2994882 (diff) | |
download | ruby-4960e66ab64350c6a6cc89b3b40fcd842dfa65d9.tar.gz |
* string.c (tr_trans): when the hash for multibyte repl is empty,
tr is inverse mode, and a character doesn't much the table, the
character should be replaced by last replacement. Bug #4449
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -5060,7 +5060,7 @@ tr_trans(VALUE str, VALUE src, VALUE repl, int sflag) else c = NUM2INT(tmp); } else { - c = errc; + c = cflag ? last : errc; } if (c != errc) { tlen = rb_enc_codelen(c, enc); |