ruby-changes:18752
From: kosaki <ko1@a...>
Date: Fri, 4 Feb 2011 12:16:29 +0900 (JST)
Subject: [ruby-changes:18752] Ruby:r30779 (trunk): * string.c (str_utf8_nth): fixed a conditon of optimized lead
kosaki 2011-02-04 12:14:57 +0900 (Fri, 04 Feb 2011) New Revision: 30779 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=30779 Log: * string.c (str_utf8_nth): fixed a conditon of optimized lead byte counting. [Bug #4366][ruby-dev:43170] Modified files: trunk/ChangeLog trunk/string.c Index: ChangeLog =================================================================== --- ChangeLog (revision 30778) +++ ChangeLog (revision 30779) @@ -1,3 +1,8 @@ +Fri Feb 4 12:11:51 2011 KOSAKI Motohiro <kosaki.motohiro@g...> + + * string.c (str_utf8_nth): fixed a conditon of optimized lead + byte counting. [Bug #4366][ruby-dev:43170] + Fri Feb 4 01:50:13 2011 KOSAKI Motohiro <kosaki.motohiro@g...> * string.c (count_utf8_lead_bytes_with_word): wrote function Index: string.c =================================================================== --- string.c (revision 30778) +++ string.c (revision 30779) @@ -1548,7 +1548,7 @@ str_utf8_nth(const char *p, const char *e, long *nthp) { long nth = *nthp; - if ((int)SIZEOF_VALUE < e - p && (int)SIZEOF_VALUE * 2 < nth) { + if ((int)SIZEOF_VALUE * 2 < e - p && (int)SIZEOF_VALUE * 2 < nth) { const VALUE *s, *t; const VALUE lowbits = sizeof(VALUE) - 1; s = (const VALUE*)(~lowbits & ((VALUE)p + lowbits)); -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/