diff options
author | kingofoz <kingofoz@qq.com> | 2016-08-05 21:43:18 +0800 |
---|---|---|
committer | kingofoz <kingofoz@qq.com> | 2016-08-05 21:43:18 +0800 |
commit | d00a2536c40f7d5a8dc6668db0317ce851c45a41 (patch) | |
tree | e276e3fb51809265a02e4d364e10accf466212d2 /compiler | |
parent | 1b55f57b26e2e66a29fca024312f7cddd38c39b8 (diff) | |
download | Nim-d00a2536c40f7d5a8dc6668db0317ce851c45a41.tar.gz |
fix #4568
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/pragmas.nim | 8 |
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) |