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

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 17 18:34:31 PDT 2010


Revision: 3790
          http://trac.macosforge.org/projects/ruby/changeset/3790
Author:   lsansonetti at apple.com
Date:     2010-03-17 18:34:30 -0700 (Wed, 17 Mar 2010)
Log Message:
-----------
fixed another minor bug in rb_reg_regsub()

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

Modified: MacRuby/trunk/string.c
===================================================================
--- MacRuby/trunk/string.c	2010-03-18 01:07:57 UTC (rev 3789)
+++ MacRuby/trunk/string.c	2010-03-18 01:34:30 UTC (rev 3790)
@@ -3187,6 +3187,9 @@
 	if (c != '\\') {
 	    continue;
 	}
+	if (i + 1 == str_chars_len) {
+	    break;
+	}
 
 	if (val == 0) {
 	    val = rb_unicode_str_new(NULL, 0);
@@ -3194,9 +3197,6 @@
 	str_concat_uchars(RSTR(val), &str_chars[pos], i - pos);
 
 	i++;
-	if (i == str_chars_len) {
-	    break;
-	}
 	pos = i + 1;
 
 	int no = -1;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100317/46d25202/attachment.html>


More information about the macruby-changes mailing list