[macruby-changes] [5184] MacRuby/trunk/string.c

source_changes at macosforge.org source_changes at macosforge.org
Thu Jan 20 03:38:55 PST 2011


Revision: 5184
          http://trac.macosforge.org/projects/ruby/changeset/5184
Author:   vincent.isambart at gmail.com
Date:     2011-01-20 03:38:55 -0800 (Thu, 20 Jan 2011)
Log Message:
-----------
fixed a bug in str_append_uchar32 when appending a non-ASCII character in UTF-8

should fix #1122

Modified Paths:
--------------
    MacRuby/trunk/string.c

Modified: MacRuby/trunk/string.c
===================================================================
--- MacRuby/trunk/string.c	2011-01-20 03:08:29 UTC (rev 5183)
+++ MacRuby/trunk/string.c	2011-01-20 11:38:55 UTC (rev 5184)
@@ -289,7 +289,8 @@
 	if (len > 0) {
 	    str_resize_bytes(self, self->length_in_bytes + len);
 	    U8_APPEND_UNSAFE(self->bytes, self->length_in_bytes, c);
-	    self->length_in_bytes += len;
+	    // U8_APPEND_UNSAFE increments length_in_bytes
+	    // by the number of bytes appended
 	}
     }
     else if (IS_NATIVE_UTF32_ENC(self->encoding)) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20110120/84c5509d/attachment.html>


More information about the macruby-changes mailing list