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

source_changes at macosforge.org source_changes at macosforge.org
Mon Aug 16 18:35:29 PDT 2010


Revision: 4428
          http://trac.macosforge.org/projects/ruby/changeset/4428
Author:   lsansonetti at apple.com
Date:     2010-08-16 18:35:27 -0700 (Mon, 16 Aug 2010)
Log Message:
-----------
fixed a bug when string-formatting numeric types (patch contributed by watson1978 at gmail.com)

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

Modified: MacRuby/trunk/string.c
===================================================================
--- MacRuby/trunk/string.c	2010-08-17 01:18:06 UTC (rev 4427)
+++ MacRuby/trunk/string.c	2010-08-17 01:35:27 UTC (rev 4428)
@@ -6495,7 +6495,14 @@
     unum_close(nf);
 
     if (end_offset != NULL) {
-	*end_offset = (long)parse_pos;
+	long offset = (long)pos;
+	do {
+	    if (!isdigit(chars[offset])) {
+		break;
+	    }
+	}
+	while (++offset < parse_pos);
+	*end_offset = offset;
     }
     return val;
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20100816/12f0551a/attachment-0001.html>


More information about the macruby-changes mailing list