[前][次][番号順一覧][スレッド一覧]

ruby-changes:3180

From: ko1@a...
Date: 25 Dec 2007 15:55:30 +0900
Subject: [ruby-changes:3180] nobu - Ruby:r14673 (trunk): * string.c (rb_str_succ): fix for string with non-alphanumeric chars.

nobu	2007-12-25 15:55:16 +0900 (Tue, 25 Dec 2007)

  New Revision: 14673

  Modified files:
    trunk/ChangeLog
    trunk/string.c

  Log:
    * string.c (rb_str_succ): fix for string with non-alphanumeric chars.


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/string.c?r1=14673&r2=14672
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=14673&r2=14672

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 14672)
+++ ChangeLog	(revision 14673)
@@ -1,3 +1,7 @@
+Tue Dec 25 15:55:14 2007  Nobuyoshi Nakada  <nobu@r...>
+
+	* string.c (rb_str_succ): fix for string with non-alphanumeric chars.
+
 Tue Dec 25 15:42:49 2007  Yukihiro Matsumoto  <matz@r...>
 
 	* io.c (rb_io_external_encoding): should return nil for
Index: string.c
===================================================================
--- string.c	(revision 14672)
+++ string.c	(revision 14673)
@@ -1886,16 +1886,13 @@
 	    }
 	    n = s - sbeg;
 	}
-	else {
-	    break;
-	}
     }
     if (c == -1) {		/* str contains no alnum */
 	c = '\001';
 	s = e;
 	while ((s = rb_enc_prev_char(sbeg, s, enc)) != 0) {
 	    int limit = 256;
-	    if (cc == 0) cc = rb_enc_codepoint(s, e, enc);
+	    cc = rb_enc_codepoint(s, e, enc);
 	    while ((l = rb_enc_mbcput(++cc, carry, enc)) < 0 && --limit);
 	    if (l > 0) {
 		if (l == (o = e - s)) goto overlay;

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]