diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2004-07-15 01:26:03 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2004-07-15 01:26:03 +0000 |
| commit | a75608c1de2b34a1c48bcb8ca474449a1566d5f0 (patch) | |
| tree | 8a26b49cc14ef537cb4ed4050781feb4594b4411 /ext/standard/strnatcmp.c | |
| parent | 5a9875f293e0cf664315ca2b54a5165d8c1f626d (diff) | |
| download | php-git-a75608c1de2b34a1c48bcb8ca474449a1566d5f0.tar.gz | |
Fixed Bug #29075 (strnatcmp() incorrectly handles whitespace).
# Original Patch by: curt@php.net
Diffstat (limited to 'ext/standard/strnatcmp.c')
| -rw-r--r-- | ext/standard/strnatcmp.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; } } |
