From 18b193f241c6d4257a249b174283ba3148710349 Mon Sep 17 00:00:00 2001 From: Clint Adams Date: Mon, 15 May 2000 17:54:58 +0000 Subject: [PATCH] 11385: parse 0[0-9]+ as octal in arithmetic expressions --- ChangeLog | 5 +++++ Src/math.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index fdbe1cbe4..989e9f692 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2000-05-15 Clint Adams + * 11385: Src/math.c: interpret integer constants beginning + with '0' as octal to conform to IEEE Std 1003.2-1992 + (ISO 9945-2:1993). + 2000-05-15 Sven Wischnowsky * 11380: Src/subst.c: detect additional characters in parameter 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 == '.') {