rasmus Thu Apr 9 16:04:15 2009 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/standard strnatcmp.c
/php-src/ext/standard/tests/array bug44929.phpt
Log:
Don't strip leading zeros on floating point numbers
And fix the test case
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/strnatcmp.c?r1=1.10.6.1&r2=1.10.6.2&diff_format=u
Index: php-src/ext/standard/strnatcmp.c
diff -u php-src/ext/standard/strnatcmp.c:1.10.6.1
php-src/ext/standard/strnatcmp.c:1.10.6.2
--- php-src/ext/standard/strnatcmp.c:1.10.6.1 Wed Apr 8 18:16:06 2009
+++ php-src/ext/standard/strnatcmp.cThu Apr 9 16:04:15 2009
@@ -38,7 +38,7 @@
#if 0
static char const *version UNUSED =
-"$Id: strnatcmp.c,v 1.10.6.1 2009/04/08 18:16:06 rasmus Exp $";
+"$Id: strnatcmp.c,v 1.10.6.2 2009/04/09 16:04:15 rasmus Exp $";
#endif
/* {{{ compare_right
*/
@@ -116,10 +116,10 @@
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 */
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/bug44929.phpt?r1=1.1.4.2&r2=1.1.4.3&diff_format=u
Index: php-src/ext/standard/tests/array/bug44929.phpt
diff -u php-src/ext/standard/tests/array/bug44929.phpt:1.1.4.2
php-src/ext/standard/tests/array/bug44929.phpt:1.1.4.3
--- php-src/ext/standard/tests/array/bug44929.phpt:1.1.4.2 Wed Apr 8
18:16:06 2009
+++ php-src/ext/standard/tests/array/bug44929.phpt Thu Apr 9 16:04:15 2009
@@ -10,12 +10,12 @@
array(10) {
[6]=>
string(4) "-123"
- [7]=>
- string(5) "0.002"
[8]=>
string(2) "00"
[9]=>
string(1) "0"
+ [7]=>
+ string(5) "0.002"
[0]=>
string(3) "001"
[4]=>
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php