commit ebcda96d082604b10e93af543fd719ed037f4746
parent 1e0f1124de63a6ef2e30314484fca2e2f60da4ad
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Wed, 20 May 2026 10:01:37 +0200
cc1: Use isspace() around concat operator
The spec indicates that a preprocessor white space is any of ' ',
\t, \f, \v and \n. As we use the default C locale that is equivalent
to use isspace(), which is already used in other places of the cpp,
even when there are (very rare) cases where it could produce problems.
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/cmd/scc-cc/cc1/cpp.c b/src/cmd/scc-cc/cc1/cpp.c
@@ -341,9 +341,9 @@ copymacro(Macro *mp)
case CONCAT:
/* token concatenation operator */
DBG("MACRO concat");
- while (bp[-1] == ' ')
+ while (isspace(bp[-1]))
--bp, ++bufsiz;
- while (s[1] == ' ')
+ while (isspace(s[1]))
++s;
break;
case STRINGIZE: