From 37999a4fbf3487b363fd0c2f9b7ab622401b202a Mon Sep 17 00:00:00 2001 From: Larry Doolittle Date: Tue, 25 Apr 2017 12:32:41 -0700 Subject: Simple-minded fix for bug #50847 bug #50847: #line directive corrupts #include search path Keep a second copy of the filename, that isn't changed by the #line directive, and use that on the initial search path for #include files. --- libtcc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libtcc.c') diff --git a/libtcc.c b/libtcc.c index 9243e49..c6bc00f 100644 --- a/libtcc.c +++ b/libtcc.c @@ -581,6 +581,7 @@ ST_FUNC void tcc_open_bf(TCCState *s1, const char *filename, int initlen) bf->buf_end = bf->buffer + initlen; bf->buf_end[0] = CH_EOB; /* put eob symbol */ pstrcpy(bf->filename, sizeof(bf->filename), filename); + pstrcpy(bf->filename2, sizeof(bf->filename2), filename); #ifdef _WIN32 normalize_slashes(bf->filename); #endif -- cgit v1.3.1