added warning for nested comment

This commit is contained in:
eck 1990-04-10 10:52:52 +00:00
parent a3f1aaa41f
commit 031b9dfee2

View file

@ -378,7 +378,7 @@ char *op;
int *lineno; int *lineno;
{ {
char *ob = &_obuf[OBUFSIZE]; char *ob = &_obuf[OBUFSIZE];
register int c; register int c, oldc = '\0';
NoUnstack++; NoUnstack++;
if (options['C']) { if (options['C']) {
@ -410,8 +410,14 @@ int *lineno;
echo(c); echo(c);
} }
break; /* for(;;) */ break; /* for(;;) */
} else if (oldc == '/') {
warning("comment inside comment ?");
} }
} else c = GetChar(); oldc = '*';
} else {
oldc = c;
c = GetChar();
}
} }
NoUnstack--; NoUnstack--;
return op; return op;