diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-27 04:51:45 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-08-27 04:51:45 +0000 |
commit | 33983864046b0f09ebba5907a71a9ba280b49e70 (patch) | |
tree | 637b212b714c75283e2b4581a5ceb2091ef93fc9 /string.c | |
parent | 57a285edf74b7b304fc00991b1b4fd5e2d62a703 (diff) | |
download | ruby-33983864046b0f09ebba5907a71a9ba280b49e70.tar.gz ruby-33983864046b0f09ebba5907a71a9ba280b49e70.tar.xz ruby-33983864046b0f09ebba5907a71a9ba280b49e70.zip |
* string.c (tr_trans): wrong condition for mbmaxlen==1 strings.
[ruby-dev:31652]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@13281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -3264,13 +3264,14 @@ tr_trans(VALUE str, VALUE src, VALUE repl, int sflag) while (s < send) { VALUE v = rb_hash_aref(hash, INT2FIX(*s)); if (!NIL_P(v)) { - if (cflag) { - *s = last; - } - else { + if (!cflag) { c = FIX2INT(v); *s = c & 0xff; + modify = 1; } + } + else if (cflag) { + *s = last; modify = 1; } s++; |