]> granicus.if.org Git - php/commitdiff
MFH: Fixed Bug #29075 (strnatcmp() incorrectly handles whitespace).
authorIlia Alshanetsky <iliaa@php.net>
Thu, 15 Jul 2004 01:46:28 +0000 (01:46 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 15 Jul 2004 01:46:28 +0000 (01:46 +0000)
NEWS
ext/standard/strnatcmp.c

diff --git a/NEWS b/NEWS
index 1357fc63df683510e501e0507ea8b8c6ee83c46f..f0301864269c202c2db22ad447a5d9d062063bcd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ PHP 4                                                                      NEWS
   for doing performance stats without warnings in server-log. (Uwe Schindler)
 - Fixed bug #29116 (Zend constant warning uses memory after free). (Marcus,
   jdolecek at NetBSD dot org)
+- Fixed Bug #29075 (strnatcmp() incorrectly handles whitespace). (Curt, Ilia)
 - Fixed bug #29049 (array sorting via user function/method does not validate 
   it). (Ilia)
 - Fixed bug #29038 (extract() with EXTR_PREFIX_SAME prefixes empty strings).
@@ -14,7 +15,6 @@ PHP 4                                                                      NEWS
   (Ilia)
 - Fixed bug #28974 (overflow in array_slice(), array_splice(), substr,
   substr_replace(), strspn(), strcspn()). (Andrey)
-- Fixed bug #28963 (Missing space for \0 in address allocation). (Ilia)
 - Fixed bug #28897 (ibase: -1 returned as -0.000 for 64-bit scaled int). (Ard)
 - Fixed bug #28879 (Implicit/Explicit array creation inconsistency when using
   Resources, Arrays, or Objects as indices). (Sara)
index f0cc8f8672ddfba9b901115e65c192e0a951b615..e1f491a3df48b8f743d65b70362509ad99ad0dde 100644 (file)
@@ -153,13 +153,13 @@ PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len
                        return +1;
 
                ++ap; ++bp;
-               if (ap == aend && bp == bend)
+               if (ap >= aend && bp >= bend)
                        /* The strings compare the same.  Perhaps the caller
                           will want to call strcmp to break the tie. */
                        return 0;
-               else if (ap == aend)
+               else if (ap >= aend)
                        return -1;
-               else if (bp == bend)
+               else if (bp >= bend)
                        return 1;
        }
 }