ref: 1accaa337ab984f599a4fe9c951ef14b7155f844
parent: e277d35b631a1687a4eb1daca98397be829e3d11
author: Roberto E. Vargas Caballero <k0ga@shike2.com>
date: Wed Oct 7 16:06:07 EDT 2015
Use isdigit() in readint() EBCDIC has letters before digits, so the previous code was not working for it. Some boss in IBM will happy today if he knows that scc is portable to IBM machines.
--- a/cc1/lex.c
+++ b/cc1/lex.c
@@ -273,7 +273,7 @@
++s;
for (u = 0; isxdigit(c = *s++); u = u*base + val) {
- val = (c <= '9') ? c - '0' : 10 + toupper(c) - 'A';
+ val = (isdigit(c)) ? c - '0' : 10 + toupper(c) - 'A';
repeat:
if (u <= max/base && u*base <= max - val)
continue;
--
⑨