str.cxx

changeset 30
6c4efed2dbdd
parent 17
b4fcc69e426a
child 32
d11a034aabfd
--- a/str.cxx	Mon Jul 16 04:15:49 2012 +0300
+++ b/str.cxx	Mon Jul 16 04:26:27 2012 +0300
@@ -309,9 +309,16 @@
 
 // ============================================================================
 bool str::isnumber () {
-	ITERATE_STRING (u)
+	ITERATE_STRING (u) {
+		// Minus sign as the first character is allowed for negatives
+		if (!u && text[u] == '-') {
+			printf ("%u was minus sign\n", u);
+			continue;
+		}
+		
 		if (text[u] < '0' || text[u] > '9')
 			return false;
+	}
 	return true;
 }
 

mercurial