cvs: php-src(PHP_5_2) /ext/standard strnatcmp.c /ext/standard/tests/array bug44929.phpt
| From: | Rasmus Lerdorf | Date: | Wed, 08 Apr 2009 18:16:06 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/standard strnatcmp.c /ext/standard/tests/array bug44929.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-56960@lists.php.net to get a copy of this message | ||
rasmus Wed Apr 8 18:16:06 2009 UTC
Added files: (Branch: PHP_5_2)
/php-src/ext/standard/tests/array bug44929.phpt
Modified files:
/php-src/ext/standard strnatcmp.c
Log:
Fixed bug #44929 - Better handling of leading zeros
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/strnatcmp.c?r1=1.10&r2=1.10.6.1&diff_format=u
Index: php-src/ext/standard/strnatcmp.c
diff -u php-src/ext/standard/strnatcmp.c:1.10 php-src/ext/standard/strnatcmp.c:1.10.6.1
--- php-src/ext/standard/strnatcmp.c:1.10 Thu Jul 15 01:26:03 2004
+++ php-src/ext/standard/strnatcmp.c Wed Apr 8 18:16:06 2009
@@ -38,7 +38,7 @@
#if 0
static char const *version UNUSED =
- "$Id: strnatcmp.c,v 1.10 2004/07/15 01:26:03 iliaa Exp $";
+ "$Id: strnatcmp.c,v 1.10.6.1 2009/04/08 18:16:06 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))
+ while (isspace((int)(unsigned char)ca) || (ca == '0' && ap+1 < aend))
ca = *++ap;
- while (isspace((int)(unsigned char)cb))
+ while (isspace((int)(unsigned char)cb) || (cb == '0' && bp+1 < bend))
cb = *++bp;
/* process run of digits */
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/array/bug44929.phpt?view=markup&rev=1.1
Index: php-src/ext/standard/tests/array/bug44929.phpt
+++ php-src/ext/standard/tests/array/bug44929.phpt