mirror of
https://github.com/mirror/tinycc.git
synced 2025-01-01 04:20:09 +08:00
Considering the effect of CH_EOF on line_num
This commit is contained in:
parent
698b16960a
commit
89134dd7b0
2
libtcc.c
2
libtcc.c
@ -581,7 +581,7 @@ static void error1(TCCState *s1, int is_warning, const char *fmt, va_list ap)
|
||||
strcat_printf(buf, sizeof(buf), "In file included from %s:%d:\n",
|
||||
(*pf)->filename, (*pf)->line_num);
|
||||
if (line_num > 0) {
|
||||
if(tok == TOK_LINEFEED)
|
||||
if(tok == TOK_LINEFEED || (tok == CH_EOF && line_num > 1))
|
||||
line_num--;
|
||||
strcat_printf(buf, sizeof(buf), "%s:%d: ",
|
||||
f->filename, line_num);
|
||||
|
Loading…
Reference in New Issue
Block a user