Fix (2nd time) round for: #define S "//foo" #define S "/*foo" #define S(s) "s" Reference: /n/sources/patch/applied/macbody-cheese Date: Fri Feb 11 06:04:11 CET 2005 --- /sys/src/cmd/cc/macbody Fri Feb 11 06:01:36 2005 +++ /sys/src/cmd/cc/macbody Fri Feb 11 06:01:34 2005 @@ -173,6 +173,7 @@ Sym *s, *a; char *args[NARG], *np, *base; int n, i, c, len; + int ischr; s = getsym(); if(s == S) @@ -209,6 +210,7 @@ c = getnsc(); base = hunk; len = 1; + ischr = 0; for(;;) { if(isalpha(c) || c == '_') { np = symb; @@ -232,6 +234,25 @@ base = allocn(base, len, 2); base[len++] = '#'; base[len++] = 'a' + i; + continue; + } + if (c == '"' || c == '\'') { + base = allocn(base, len, 1); + base[len++] = c; + ischr = !ischr; + c = getc(); + continue; + } + if (ischr) { + base = allocn(base, len, 1); + if (c == '\\') { + base[len++] = c; + c = getc(); + base = allocn(base, len, 1); + } + + base[len++] = c; + c = getc(); continue; } if(c == '/') {