From 5bc9feb5cb98fc13db62d01b2b9fec15677310a7 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Sun, 26 Mar 2017 06:39:28 -0400 Subject: organize std and make import relative to current file closes #216 --- src/ir.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ir.cpp') diff --git a/src/ir.cpp b/src/ir.cpp index 14fa780a40..9619ffd8ba 100644 --- a/src/ir.cpp +++ b/src/ir.cpp @@ -10385,7 +10385,10 @@ static TypeTableEntry *ir_analyze_instruction_import(IrAnalyze *ira, IrInstructi // try it as a filename target_package = import->package; import_target_path = import_target_str; - search_dir = &import->package->root_src_dir; + + // search relative to importing file + search_dir = buf_alloc(); + os_path_dirname(import->path, search_dir); } Buf full_path = BUF_INIT; -- cgit v1.2.3