]> granicus.if.org Git - php/commitdiff
Don't strip a leading 0 in a floating point number
authorRasmus Lerdorf <rasmus@php.net>
Thu, 9 Apr 2009 15:55:46 +0000 (15:55 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Thu, 9 Apr 2009 15:55:46 +0000 (15:55 +0000)
ext/standard/strnatcmp.c

index dbed3c71cc50e6d8d456603e93f4dcbe1c4ebe7d..2459e46e66d1ac29dfa422a60f2876f9a8f445a5 100644 (file)
@@ -116,10 +116,10 @@ PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len
                ca = *ap; cb = *bp;
 
                /* skip over leading spaces or zeros */
-               while (isspace((int)(unsigned char)ca) || (ca == '0' && ap+1 < aend))
+               while (isspace((int)(unsigned char)ca) || (ca == '0' && (ap+1 < aend) && (*(ap+1)!='.')))
                        ca = *++ap;
 
-               while (isspace((int)(unsigned char)cb) || (cb == '0' && bp+1 < bend))
+               while (isspace((int)(unsigned char)cb) || (cb == '0' && (bp+1 < bend) && (*(bp+1)!='.')))
                        cb = *++bp;
 
                /* process run of digits */