From d00a2536c40f7d5a8dc6668db0317ce851c45a41 Mon Sep 17 00:00:00 2001 From: kingofoz Date: Fri, 5 Aug 2016 21:43:18 +0800 Subject: [PATCH] fix #4568 --- compiler/pragmas.nim | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/compiler/pragmas.nim b/compiler/pragmas.nim index 781aab6874..354e5bdc63 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)