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. --- tccpp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tccpp.c') diff --git a/tccpp.c b/tccpp.c index 720115d..1f3b083 100644 --- a/tccpp.c +++ b/tccpp.c @@ -1792,7 +1792,8 @@ ST_FUNC void preprocess(int is_bof) /* search in file's dir if "header.h" */ if (c != '\"') continue; - path = file->filename; + /* https://savannah.nongnu.org/bugs/index.php?50847 */ + path = file->filename2; pstrncpy(buf1, path, tcc_basename(path) - path); } else { -- cgit v1.3.1