diff options
| author | 2026-01-10 11:50:55 +0100 | |
|---|---|---|
| committer | 2026-01-10 11:50:55 +0100 | |
| commit | 828c85c8d3c565f03dd794296305caecc428f467 (patch) | |
| tree | 7c54bf88bdd455b6e0799ce4756e6b017a50a006 | |
| parent | 40bd2090ddc53cecadd2b4ec1be6895059c05941 (diff) | |
cpp: prioritize internal headers over system headers
| -rw-r--r-- | c/lex.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1605,6 +1605,12 @@ ppinclude(struct lexer *lx, const struct span *span0) path[end - base + tk.len] = 0; if (tryinclude(lx, &span, path)) return; } + /* try embedded files pseudo-path */ + xbgrow(&path, tk.len + 3); + path[0] = '@', path[1] = ':'; + memcpy(path+2, tk.s, tk.len); + path[tk.len+2] = 0; + if (tryinclude(lx, &span, path)) return; /* try system paths */ for (struct inclpaths *p = cinclpaths; p; p = p->next) { int ndir = strlen(p->path); @@ -1615,12 +1621,6 @@ ppinclude(struct lexer *lx, const struct span *span0) path[ndir + tk.len] = 0; if (tryinclude(lx, &span, path)) return; } - /* try embedded files pseudo-path */ - xbgrow(&path, tk.len + 3); - path[0] = '@', path[1] = ':'; - memcpy(path+2, tk.s, tk.len); - path[tk.len+2] = 0; - if (tryinclude(lx, &span, path)) return; NotFound: error(&tk.span, "file not found: %'S", tk.s, tk.len); } else { |