diff options
Diffstat (limited to 'ext/standard')
-rw-r--r-- | ext/standard/strnatcmp.c | 6 | ||||
-rw-r--r-- | ext/standard/tests/strings/bug29075.phpt | 14 |
2 files changed, 3 insertions, 17 deletions
diff --git a/ext/standard/strnatcmp.c b/ext/standard/strnatcmp.c index e1f491a3df..f0cc8f8672 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; } } diff --git a/ext/standard/tests/strings/bug29075.phpt b/ext/standard/tests/strings/bug29075.phpt deleted file mode 100644 index 7fe7da6c49..0000000000 --- a/ext/standard/tests/strings/bug29075.phpt +++ /dev/null @@ -1,14 +0,0 @@ ---TEST-- -Bug #29075 (strnatcmp() incorrectly handles whitespace) ---FILE-- -<?php - var_dump( - strnatcmp('foo ', 'foo '), - strnatcmp('foo', 'foo'), - strnatcmp(' foo', ' foo') - ); -?> ---EXPECT-- -int(0) -int(0) -int(0) |