From 47c60f2bbf6a430eb6ba45299a9d0b2122c637df Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Thu, 26 Oct 2023 20:28:43 +0900 Subject: [PATCH] [qfcc] Handle quote includes better The path for the current file wasn't being set correctly at startup and "error: success" never makes much sense. --- tools/qfcc/source/cpp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/qfcc/source/cpp.c b/tools/qfcc/source/cpp.c index c4f409da1..97e57b27d 100644 --- a/tools/qfcc/source/cpp.c +++ b/tools/qfcc/source/cpp.c @@ -51,6 +51,7 @@ #endif #include #include +#include #include "QF/dstring.h" #include "QF/sys.h" @@ -567,6 +568,9 @@ cpp_find_file (const char *name, int quote, bool *is_system) return path; } } + if (!errno) { + errno = ENOENT; + } return 0; } @@ -574,12 +578,12 @@ void cpp_set_quote_file (const char *path) { if (!path) { - cpp_quote_start = pr.comp_dir; + cpp_quote_start = ""; return; } const char *e = strrchr (path, '/'); if (!e) { - cpp_quote_start = pr.comp_dir; + cpp_quote_start = ""; return; } cpp_quote_start = save_substring (path, e - path);