From cefbe2a8ebaeff6bd20640e6865ba5b055fc5198 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Thu, 9 Apr 2009 15:55:46 +0000 Subject: [PATCH] Don't strip a leading 0 in a floating point number --- ext/standard/strnatcmp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/strnatcmp.c b/ext/standard/strnatcmp.c index dbed3c71cc..2459e46e66 100644 --- a/ext/standard/strnatcmp.c +++ b/ext/standard/strnatcmp.c @@ -116,10 +116,10 @@ PHPAPI int strnatcmp_ex(char const *a, size_t a_len, char const *b, size_t b_len ca = *ap; cb = *bp; /* skip over leading spaces or zeros */ - while (isspace((int)(unsigned char)ca) || (ca == '0' && ap+1 < aend)) + while (isspace((int)(unsigned char)ca) || (ca == '0' && (ap+1 < aend) && (*(ap+1)!='.'))) ca = *++ap; - while (isspace((int)(unsigned char)cb) || (cb == '0' && bp+1 < bend)) + while (isspace((int)(unsigned char)cb) || (cb == '0' && (bp+1 < bend) && (*(bp+1)!='.'))) cb = *++bp; /* process run of digits */ -- 2.50.1