diff options
author | Bart Schaefer <schaefer@zsh.org> | 2023-06-22 13:36:40 -0700 |
---|---|---|
committer | Bart Schaefer <schaefer@zsh.org> | 2023-06-22 13:36:40 -0700 |
commit | 4345eed1fe5dd6c881b948331cfa8f4a48beda42 (patch) | |
tree | 9f97cb82b069adcad8b7fc71fae88c23e5ef1182 /Src/math.c | |
parent | e7a8dbb16c6c779211c56ecd20cd82ecc138ed2a (diff) | |
download | zsh-4345eed1fe5dd6c881b948331cfa8f4a48beda42.tar.gz zsh-4345eed1fe5dd6c881b948331cfa8f4a48beda42.tar.xz zsh-4345eed1fe5dd6c881b948331cfa8f4a48beda42.zip |
51887: namespaces recognized in math, incorrect usages rejected.
Diffstat (limited to 'Src/math.c')
-rw-r--r-- | Src/math.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/Src/math.c b/Src/math.c index 12c8d6f6b..a060181ed 100644 --- a/Src/math.c +++ b/Src/math.c @@ -641,7 +641,9 @@ zzlex(void) return MINUSEQ; } if (unary) { - if (idigit(*ptr) || *ptr == '.') { + if (idigit(*ptr) || + (*ptr == '.' && + (idigit(ptr[1]) || !itype_end(ptr, INAMESPC, 0)))) { int ctype = lexconstant(); if (ctype == NUM) { @@ -835,7 +837,9 @@ zzlex(void) case Dnull: break; default: - if (idigit(*--ptr) || *ptr == '.') + if (idigit(*--ptr) || + (*ptr == '.' && + (idigit(ptr[1]) || !itype_end(ptr, INAMESPC, 0)))) return lexconstant(); if (*ptr == '#') { if (*++ptr == '\\' || *ptr == '#') { @@ -857,7 +861,7 @@ zzlex(void) } cct = 1; } - if ((ie = itype_end(ptr, IIDENT, 0)) != ptr) { + if ((ie = itype_end(ptr, INAMESPC, 0)) != ptr) { int func = 0; char *p; |