From: Michael Wallner Date: Wed, 18 Apr 2018 11:47:32 +0000 (+0200) Subject: cpp: search local dir only for quoted headers X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=67c27f814ac095b81aff030b516665f70007f344;p=m6w6%2Fext-psi cpp: search local dir only for quoted headers --- diff --git a/src/cpp.c b/src/cpp.c index 5ab6492..908c21f 100644 --- a/src/cpp.c +++ b/src/cpp.c @@ -469,7 +469,7 @@ bool psi_cpp_include(struct psi_cpp *cpp, const struct psi_token *file, unsigned bool parsed = false; int f_len = strlen(file->text); - if (!(flags & PSI_CPP_INCLUDE_NEXT) || *file->text == '/') { + if (file->type == PSI_T_QUOTED_STRING && (!(flags & PSI_CPP_INCLUDE_NEXT) || *file->text == '/')) { /* first try as is, full or relative path */ char temp[PATH_MAX], *path = temp; @@ -499,7 +499,7 @@ bool psi_cpp_include(struct psi_cpp *cpp, const struct psi_token *file, unsigned } } - if (!(flags & PSI_CPP_INCLUDE_NEXT) || !cpp->search) { + if (!(flags & PSI_CPP_INCLUDE_NEXT)) { cpp->search = PSI_G(search_path); }