Could you add some test for this bug too?

--Jani


On 09/28/2009 04:29 PM, Rasmus Lerdorf wrote:
rasmus                                   Mon, 28 Sep 2009 13:29:53 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=288896

Log:
Fix for bug #49698

Bug: http://bugs.php.net/49698 (Open) Unexpected change in strnatcasecmp()

Changed paths:
     U   php/php-src/branches/PHP_5_2/ext/standard/strnatcmp.c
     U   php/php-src/branches/PHP_5_3/ext/standard/strnatcmp.c
     U   php/php-src/trunk/ext/standard/strnatcmp.c

Modified: php/php-src/branches/PHP_5_2/ext/standard/strnatcmp.c
===================================================================
--- php/php-src/branches/PHP_5_2/ext/standard/strnatcmp.c       2009-09-28 
13:11:21 UTC (rev 288895)
+++ php/php-src/branches/PHP_5_2/ext/standard/strnatcmp.c       2009-09-28 
13:29:53 UTC (rev 288896)
@@ -116,12 +116,12 @@
        while (1) {
                ca = *ap; cb = *bp;

-               /* skip over leading zeros unless they are followed by 
punctuation */
-               while (leading&&  ca == '0'&&  (ap+1<  aend)&&  
!ispunct(*(ap+1))) {
+               /* skip over leading zeros */
+               while (leading&&  ca == '0'&&  (ap+1<  aend)&&  
isdigit(*(ap+1))) {
                        ca = *++ap;
                }

-               while (leading&&  cb == '0'&&  (bp+1<  bend)&&  
!ispunct(*(bp+1))) {
+               while (leading&&  cb == '0'&&  (bp+1<  bend)&&  
isdigit(*(bp+1))) {
                        cb = *++bp;
                }


Modified: php/php-src/branches/PHP_5_3/ext/standard/strnatcmp.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/standard/strnatcmp.c       2009-09-28 
13:11:21 UTC (rev 288895)
+++ php/php-src/branches/PHP_5_3/ext/standard/strnatcmp.c       2009-09-28 
13:29:53 UTC (rev 288896)
@@ -116,12 +116,12 @@
        while (1) {
                ca = *ap; cb = *bp;

-               /* skip over leading zeros unless they are followed by 
punctuation */
-               while (leading&&  ca == '0'&&  (ap+1<  aend)&&  
!ispunct(*(ap+1))) {
+               /* skip over leading zeros */
+               while (leading&&  ca == '0'&&  (ap+1<  aend)&&  
isdigit(*(ap+1))) {
                        ca = *++ap;
                }

-               while (leading&&  cb == '0'&&  (bp+1<  bend)&&  
!ispunct(*(bp+1))) {
+               while (leading&&  cb == '0'&&  (bp+1<  bend)&&  
isdigit(*(bp+1))) {
                        cb = *++bp;
                }


Modified: php/php-src/trunk/ext/standard/strnatcmp.c
===================================================================
--- php/php-src/trunk/ext/standard/strnatcmp.c  2009-09-28 13:11:21 UTC (rev 
288895)
+++ php/php-src/trunk/ext/standard/strnatcmp.c  2009-09-28 13:29:53 UTC (rev 
288896)
@@ -112,12 +112,12 @@
        while (1) {
                ca = a[ai]; cb = b[bi];

-               /* skip over leading zeros unless they are followed by 
punctuation */
-               while (leading&&  ca == '0'&&  (ai+1<  a_len)&&  
!ispunct(a[ai+1])) {
+               /* skip over leading zeros */
+               while (leading&&  ca == '0'&&  (ai+1<  a_len)&&  
isdigit(a[ai+1])) {
                        ca = a[++ai];
                }

-               while (leading&&  cb == '0'&&  (bi+1<  b_len)&&  
!ispunct(b[bi+1])) {
+               while (leading&&  cb == '0'&&  (bi+1<  b_len)&&  
isdigit(a[ai+1])) {
                        cb = b[++bi];
                }





--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to