[macruby-changes] [4967] MacRuby/trunk/ext/libyaml/rubyext.c

source_changes at macosforge.org source_changes at macosforge.org
Thu Dec 2 14:18:14 PST 2010


Revision: 4967
          http://trac.macosforge.org/projects/ruby/changeset/4967
Author:   watson1978 at gmail.com
Date:     2010-12-02 14:18:11 -0800 (Thu, 02 Dec 2010)
Log Message:
-----------
fixed the bug of YAML which is relation to parse numeric strings. see #1017.

Modified Paths:
--------------
    MacRuby/trunk/ext/libyaml/rubyext.c

Modified: MacRuby/trunk/ext/libyaml/rubyext.c
===================================================================
--- MacRuby/trunk/ext/libyaml/rubyext.c	2010-12-02 08:58:44 UTC (rev 4966)
+++ MacRuby/trunk/ext/libyaml/rubyext.c	2010-12-02 22:18:11 UTC (rev 4967)
@@ -290,6 +290,7 @@
     }
     char c;
     bool point = false;
+    bool numeric = false;
     while ((c = *str++) != '\0') {
 	if (!isdigit(c)) {
 	    if (c == '.') {
@@ -302,9 +303,12 @@
 		return false;
 	    }
 	}
+	else if (!point) {
+	    numeric = true;
+	}
     }
     *has_point = point;
-    return true;
+    return numeric;
 }
 
 static inline bool
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20101202/741605ab/attachment.html>


More information about the macruby-changes mailing list