fixed null-pointer constants and SkipToNewLine()

This commit is contained in:
eck
1989-12-12 12:52:03 +00:00
parent 24a1c0d390
commit b3a142e244
7 changed files with 62 additions and 47 deletions

View File

@@ -63,10 +63,24 @@ SkipToNewLine()
{
register int ch;
register int garbage = 0;
#ifndef NOPP
register int delim = 0;
#endif
while ((ch = GetChar()) != '\n') {
#ifndef NOPP
if (ch == '/') {
if (delim) {
if (ch == '\\') {
if (GetChar() == '\n') break;
} else if (ch == delim) {
delim = 0;
}
continue;
}
else if (ch == '\'' || ch == '\"') {
delim = ch;
garbage = 1;
} else if (ch == '/') {
if ((ch = GetChar()) == '*'
&& !InputLevel
) {
@@ -78,6 +92,9 @@ SkipToNewLine()
if (!is_wsp(ch))
garbage = 1;
}
#ifndef NOPP
if (delim) strict("unclosed opening %c", delim);
#endif
++LineNumber;
return garbage;
}