summaryrefslogtreecommitdiff
path: root/src/parser/parser_stmt.c
diff options
context:
space:
mode:
authorZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-15 14:50:44 +0000
committerZuhaitz Méndez Fernández de Aránguiz <zuhaitz@debian>2026-01-15 14:50:44 +0000
commit2e12c7f63c8f667e3f2834604898ac155a1b421a (patch)
tree2e71bfd0c324408ca509a9c09e42c0df04bdf981 /src/parser/parser_stmt.c
parent7411d71fbde5d652f04cc8851ed93bd15513968b (diff)
Zen facts now only trigger in clean builds (no errors/warnings).
Diffstat (limited to 'src/parser/parser_stmt.c')
-rw-r--r--src/parser/parser_stmt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/parser/parser_stmt.c b/src/parser/parser_stmt.c
index 24dfa10..6f93dbf 100644
--- a/src/parser/parser_stmt.c
+++ b/src/parser/parser_stmt.c
@@ -3725,6 +3725,14 @@ ASTNode *parse_import(ParserContext *ctx, Lexer *l)
}
}
+ // Canonicalize path to avoid duplicates (for example: "./std/io.zc" vs "std/io.zc")
+ char *real_fn = realpath(fn, NULL);
+ if (real_fn)
+ {
+ free(fn);
+ fn = real_fn;
+ }
+
// Check if file already imported
if (is_file_imported(ctx, fn))
{