When Parse_Error is called after the top-level Makefile is closed we
have no CURFILE anymore so we cannot print a file name or line number. When ParseSkipLine() returns NULL (it does this when it has detected an EOF in an .if block) try to pop the input stack and process the next line
This commit is contained in:
parent
18ca5d4e9f
commit
da722414da
@ -299,7 +299,9 @@ Parse_Error(int type, const char *fmt, ...)
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
fprintf(stderr, "\"%s\", line %d: ", CURFILE->fname, CURFILE->lineno);
|
||||
if (CURFILE != NULL)
|
||||
fprintf(stderr, "\"%s\", line %d: ",
|
||||
CURFILE->fname, CURFILE->lineno);
|
||||
if (type == PARSE_WARNING)
|
||||
fprintf(stderr, "warning: ");
|
||||
vfprintf(stderr, fmt, ap);
|
||||
@ -2233,8 +2235,10 @@ ParseReadLine(void)
|
||||
line = ParseSkipLine(1, 0);
|
||||
} while (line &&
|
||||
Cond_Eval(line, CURFILE->lineno) != COND_PARSE);
|
||||
if (line == NULL)
|
||||
break;
|
||||
if (line == NULL) {
|
||||
/* try to pop input stack */
|
||||
goto again;
|
||||
}
|
||||
/*FALLTHRU*/
|
||||
|
||||
case COND_PARSE:
|
||||
|
Loading…
x
Reference in New Issue
Block a user