From 89134dd7b021389331d91e0552babf6de5108588 Mon Sep 17 00:00:00 2001 From: jiang <30155751@qq.com> Date: Wed, 28 May 2014 21:51:50 +0800 Subject: [PATCH] Considering the effect of CH_EOF on line_num --- libtcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libtcc.c b/libtcc.c index 721eaed..d761582 100644 --- a/libtcc.c +++ b/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);