aboutsummaryrefslogtreecommitdiffhomepage
path: root/c
diff options
context:
space:
mode:
Diffstat (limited to 'c')
-rw-r--r--c/lex.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/c/lex.c b/c/lex.c
index 7eb1a2c..f1dab08 100644
--- a/c/lex.c
+++ b/c/lex.c
@@ -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 {