added warning for nested comment
This commit is contained in:
parent
a3f1aaa41f
commit
031b9dfee2
1 changed files with 8 additions and 2 deletions
|
@ -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 ?");
|
||||
}
|
||||
oldc = '*';
|
||||
} else {
|
||||
oldc = c;
|
||||
c = GetChar();
|
||||
}
|
||||
} else c = GetChar();
|
||||
}
|
||||
NoUnstack--;
|
||||
return op;
|
||||
|
|
Loading…
Reference in a new issue