Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: octal in arithmetic expressions



http://www.pasc.org/interps/unofficial/db/p1003.2/pasc-1003.2-173.html

This should make zsh conform to POSIX in this regard.

Index: Src/math.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/math.c,v
retrieving revision 1.2
diff -u -r1.2 math.c
--- Src/math.c	2000/04/30 17:58:35	1.2
+++ Src/math.c	2000/05/15 17:44:51
@@ -357,6 +357,10 @@
 		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 == '.') {



Messages sorted by: Reverse Date, Date, Thread, Author