ruby-changes:1790
From: ko1@a...
Date: 27 Aug 2007 13:51:55 +0900
Subject: [ruby-changes:1790] matz - Ruby:r13281 (trunk): * string.c (tr_trans): wrong condition for mbmaxlen==1 strings.
matz 2007-08-27 13:51:45 +0900 (Mon, 27 Aug 2007) New Revision: 13281 Modified files: trunk/ChangeLog trunk/string.c Log: * string.c (tr_trans): wrong condition for mbmaxlen==1 strings. [ruby-dev:31652] http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/string.c?r1=13281&r2=13280 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13281&r2=13280 Index: ChangeLog =================================================================== --- ChangeLog (revision 13280) +++ ChangeLog (revision 13281) @@ -1,3 +1,8 @@ +Mon Aug 27 13:11:56 2007 Yukihiro Matsumoto <matz@r...> + + * string.c (tr_trans): wrong condition for mbmaxlen==1 strings. + [ruby-dev:31652] + Mon Aug 27 00:41:13 2007 Yukihiro Matsumoto <matz@r...> * io.c (rb_io_each_byte): caused infinite loop. [ruby-dev:31652] Index: string.c =================================================================== --- string.c (revision 13280) +++ string.c (revision 13281) @@ -3264,13 +3264,14 @@ 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++; -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml