summaryrefslogtreecommitdiffstats
path: root/Src/math.c
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2023-06-22 13:36:40 -0700
committerBart Schaefer <schaefer@zsh.org>2023-06-22 13:36:40 -0700
commit4345eed1fe5dd6c881b948331cfa8f4a48beda42 (patch)
tree9f97cb82b069adcad8b7fc71fae88c23e5ef1182 /Src/math.c
parentMissed ChangeLog entry from previous commit. (diff)
downloadzsh-4345eed1fe5dd6c881b948331cfa8f4a48beda42.tar
zsh-4345eed1fe5dd6c881b948331cfa8f4a48beda42.tar.gz
zsh-4345eed1fe5dd6c881b948331cfa8f4a48beda42.tar.bz2
zsh-4345eed1fe5dd6c881b948331cfa8f4a48beda42.tar.lz
zsh-4345eed1fe5dd6c881b948331cfa8f4a48beda42.tar.xz
zsh-4345eed1fe5dd6c881b948331cfa8f4a48beda42.tar.zst
zsh-4345eed1fe5dd6c881b948331cfa8f4a48beda42.zip
51887: namespaces recognized in math, incorrect usages rejected.
Diffstat (limited to 'Src/math.c')
-rw-r--r--Src/math.c10
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;