aboutsummaryrefslogtreecommitdiff
path: root/src/ir.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2017-03-26 06:39:28 -0400
committerAndrew Kelley <superjoe30@gmail.com>2017-03-26 06:39:28 -0400
commit5bc9feb5cb98fc13db62d01b2b9fec15677310a7 (patch)
tree12972dfc1f9b964bb74428ec0d6766e77b9b0be7 /src/ir.cpp
parent7ce753a16b0c16b4c6494467f42f2d5fe9a235e6 (diff)
downloadzig-5bc9feb5cb98fc13db62d01b2b9fec15677310a7.tar.gz
zig-5bc9feb5cb98fc13db62d01b2b9fec15677310a7.zip
organize std and make import relative to current file
closes #216
Diffstat (limited to 'src/ir.cpp')
-rw-r--r--src/ir.cpp5
1 files changed, 4 insertions, 1 deletions
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;