about summary refs log tree commit diff
path: root/Src/math.c
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2000-05-15 17:54:58 +0000
committerClint Adams <clint@users.sourceforge.net>2000-05-15 17:54:58 +0000
commit18b193f241c6d4257a249b174283ba3148710349 (patch)
tree940a1e0ee025a4754da364a11dd246a8d8c57bc0 /Src/math.c
parent0e5666e2adf19dc86457a958a622a6f58c9f9ff0 (diff)
downloadzsh-18b193f241c6d4257a249b174283ba3148710349.tar.gz
zsh-18b193f241c6d4257a249b174283ba3148710349.tar.xz
zsh-18b193f241c6d4257a249b174283ba3148710349.zip
11385: parse 0[0-9]+ as octal in arithmetic expressions
Diffstat (limited to 'Src/math.c')
-rw-r--r--Src/math.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Src/math.c b/Src/math.c
index aee318cfc..75f0106bb 100644
--- a/Src/math.c
+++ b/Src/math.c
@@ -357,6 +357,10 @@ zzlex(void)
 		yyval.u.l = zstrtol(++ptr, &ptr, lastbase = 16);
 		return NUM;
 	    }
+	    else if (idigit(*ptr) && (memchr(ptr, '.', strlen(ptr)) == NULL)) {
+	        yyval.u.l = zstrtol(ptr, &ptr, lastbase = 8);
+	        return NUM;
+	    }
 	/* Fall through! */
 	default:
 	    if (idigit(*--ptr) || *ptr == '.') {