X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=token.c;h=30f529d018b95084e621a18c99cf272df071e5b7;hp=4067711be2ff7ddd1dcd5e4f51fb04cc3cad6795;hb=1feb728a9eb579b6441daf0124d81483f600365c;hpb=66be644c3e5fbd7446d86c79e9e51b75c0442b49 diff --git a/token.c b/token.c index 4067711..30f529d 100644 --- a/token.c +++ b/token.c @@ -314,6 +314,11 @@ int ExpandMacro(char * src, char * dest, int destsiz) if (dst >= edst) goto overflow; + // Skip comments in case a loose @ or \ is in there + // In that case the tokeniser was trying to expand it. + if (*s == '*' || *s == ';' || ((*s == '/') && (*(s + 1) == '/'))) + goto skipcomments; + *dst++ = *s++; } // Do macro expansion @@ -604,6 +609,8 @@ strcopy: } } +skipcomments: + *dst = EOS; DEBUG { printf("ExM: dst=\"%s\"\n", dest); } return OK;