From: eck Date: Tue, 10 Apr 1990 10:52:52 +0000 (+0000) Subject: added warning for nested comment X-Git-Tag: release-5-5~1745 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=031b9dfee279a1314b5c76701bff016d69981aa8;p=ack.git added warning for nested comment --- diff --git a/lang/cem/cpp.ansi/preprocess.c b/lang/cem/cpp.ansi/preprocess.c index 1a31034ab..025af03e8 100644 --- a/lang/cem/cpp.ansi/preprocess.c +++ b/lang/cem/cpp.ansi/preprocess.c @@ -378,7 +378,7 @@ char *op; int *lineno; { char *ob = &_obuf[OBUFSIZE]; - register int c; + register int c, oldc = '\0'; NoUnstack++; if (options['C']) { @@ -410,8 +410,14 @@ int *lineno; echo(c); } break; /* for(;;) */ + } else if (oldc == '/') { + warning("comment inside comment ?"); } - } else c = GetChar(); + oldc = '*'; + } else { + oldc = c; + c = GetChar(); + } } NoUnstack--; return op;