X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=token.c;h=124179fc8013e38372bc829c7632fb7895dd9180;hp=4067711be2ff7ddd1dcd5e4f51fb04cc3cad6795;hb=be5c1cb1a3ca24f29789437675fa8cd22e1edd45;hpb=9d0b53158275f8f9f542fb4d4a873d54789fe027 diff --git a/token.c b/token.c index 4067711..124179f 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;