summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorkingofoz <kingofoz@qq.com>2016-08-05 21:43:18 +0800
committerkingofoz <kingofoz@qq.com>2016-08-05 21:43:18 +0800
commitd00a2536c40f7d5a8dc6668db0317ce851c45a41 (patch)
treee276e3fb51809265a02e4d364e10accf466212d2 /compiler
parent1b55f57b26e2e66a29fca024312f7cddd38c39b8 (diff)
downloadNim-d00a2536c40f7d5a8dc6668db0317ce851c45a41.tar.gz
fix #4568
Diffstat (limited to 'compiler')
-rw-r--r--compiler/pragmas.nim8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim
index 781aab687..354e5bdc6 100644
--- a/compiler/pragmas.nim
+++ b/compiler/pragmas.nim
@@ -400,8 +400,12 @@ proc relativeFile(c: PContext; n: PNode; ext=""): string =
     s = addFileExt(s, ext)
   result = parentDir(n.info.toFullPath) / s
   if not fileExists(result):
-    if isAbsolute(s): result = s
-    else: result = findFile(s)
+    if isAbsolute(s):
+      result = s
+    else:
+      result = findFile(s)
+      if result.len == 0:
+        result = s
 
 proc processCompile(c: PContext, n: PNode) =
   let found = relativeFile(c, n)
an> ^
110c4aca7 ^
b87ec1457 ^
110c4aca7 ^
b87ec1457 ^

















b87ec1457 ^







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51