ecere/gui/EditBox: Fixed broken highlighting of hexadecimal numbers
authorJerome St-Louis <jerome@ecere.com>
Tue, 27 Aug 2013 23:32:57 +0000 (19:32 -0400)
committerJerome St-Louis <jerome@ecere.com>
Tue, 27 Aug 2013 23:37:03 +0000 (19:37 -0400)
ecere/src/gui/controls/EditBox.ec

index dc6546b..e10e6bb 100644 (file)
@@ -1724,11 +1724,11 @@ private:
                         {
                            char * dot = strchr(word, '.');
                            char * s = null;
-                           if(dot && dot == word + wordLen)
-                              strtod(dot+1, &s);
+                           if(dot)
+                              strtod((dot == word + wordLen) ? (dot+1) : word, &s);
                            else
-                              strtod(word, &s);
-                           if(s)
+                              strtol(word, &s, 0);
+                           if(s && s != word)
                            {
                               if((dot && *s == 'f' && !isalnum(s[1]) && s[1] != '_') || (!isalpha(*s) && *s != '_'))
                               {