summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-07-15 01:46:28 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-07-15 01:46:28 +0000
commit9638f4c8ffda34a4f999b55f55a75d96c7ece8fe (patch)
tree524207f49642c9062c487b5ca66d026091d69a66
parentd61681ffe880155ecbb5d59c0f5b86cb4f0db1e0 (diff)
downloadphp-git-9638f4c8ffda34a4f999b55f55a75d96c7ece8fe.tar.gz
MFH: Fixed Bug #29075 (strnatcmp() incorrectly handles whitespace).
-rw-r--r--NEWS2
-rw-r--r--ext/standard/strnatcmp.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 1357fc63df..f030186426 100644
--- 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)
diff --git a/ext/standard/strnatcmp.c b/ext/standard/strnatcmp.c
index f0cc8f8672..e1f491a3df 100644
--- a/ext/standard/strnatcmp.c
+++ b/ext/standard/strnatcmp.c
@@ -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;
}
}