summaryrefslogtreecommitdiff
path: root/Src/math.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@zsh.org>2013-11-14 11:49:22 +0000
committerPeter Stephenson <pws@zsh.org>2013-11-14 11:49:22 +0000
commit4c611f9323a516b95c3da19065e3f9040074de7e (patch)
treec289d8059a1faca14795c1345e6c31f2642e3369 /Src/math.c
parent7a94960957e37c198e93dfbd7af864799b01650d (diff)
downloadzsh-4c611f9323a516b95c3da19065e3f9040074de7e.tar.gz
zsh-4c611f9323a516b95c3da19065e3f9040074de7e.zip
31982: detection of floating point constants was problematic.
Remove the cause and fix the original problem with floating point numbers with leading zeros (users/17445) a different way.
Diffstat (limited to 'Src/math.c')
-rw-r--r--Src/math.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/Src/math.c b/Src/math.c
index b21a3adee..42355f885 100644
--- a/Src/math.c
+++ b/Src/math.c
@@ -448,9 +448,7 @@ lexconstant(void)
if (*nptr == '-')
nptr++;
- if (*nptr == '0' &&
- (memchr(nptr, '.', strlen(nptr)) == NULL))
- {
+ if (*nptr == '0') {
nptr++;
if (*nptr == 'x' || *nptr == 'X') {
/* Let zstrtol parse number with base */
@@ -491,11 +489,8 @@ lexconstant(void)
nptr = ptr2;
}
}
- else
- {
- while (idigit(*nptr) || *nptr == '_')
- nptr++;
- }
+ while (idigit(*nptr) || *nptr == '_')
+ nptr++;
if (*nptr == '.' || *nptr == 'e' || *nptr == 'E') {
char *ptr2;