about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Src/math.c4
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index fdbe1cbe4..989e9f692 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2000-05-15  Clint Adams  <schizo@debian.org>
+	* 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  <wischnow@zsh.org>
 
 	* 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 == '.') {