summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-05-30 21:05:26 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-05-31 03:04:45 +0200
commit4886cde781b84f036aebf7021931725665d115b1 (patch)
treea0591c6cf8080444b5e1f73673b0447b12c739a2
parent4ebd7d0744017a02e402f97df1640cf978cdbc0a (diff)
downloadNim-4886cde781b84f036aebf7021931725665d115b1.tar.gz
fixes #765
-rw-r--r--compiler/vmdeps.nim6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/vmdeps.nim b/compiler/vmdeps.nim
index e7ead17b6..678a765f4 100644
--- a/compiler/vmdeps.nim
+++ b/compiler/vmdeps.nim
@@ -7,7 +7,7 @@
 #    distribution, for details about the copyright.
 #
 
-import ast, types, msgs, osproc, streams, options, idents, securehash
+import ast, types, msgs, os, osproc, streams, options, idents, securehash
 
 proc readOutput(p: Process): string =
   result = ""
@@ -51,7 +51,9 @@ proc opGorge*(cmd, input, cache: string): string =
 
 proc opSlurp*(file: string, info: TLineInfo, module: PSym): string =
   try:
-    let filename = file.findFile
+    var filename = parentDir(info.toFullPath) / file
+    if not fileExists(filename):
+      filename = file.findFile
     result = readFile(filename)
     # we produce a fake include statement for every slurped filename, so that
     # the module dependencies are accurate: