the current directory is no longer taken into account when resolving module paths

This commit is contained in:
Zahary Karadjov 2011-12-11 12:41:06 +02:00
commit caa4766a33
5 changed files with 24 additions and 30 deletions

View file

@ -186,21 +186,14 @@ iterator iterSearchPath*(): string =
var it = PStrEntry(SearchPaths.head)
while it != nil:
yield it.data
it = PStrEntry(it.Next)
it = PStrEntry(it.Next)
proc rawFindFile(f: string): string =
template ret(e: expr) =
result = e.canonicalizePath
return
if ExistsFile(f):
ret f
else:
for it in iterSearchPath():
result = JoinPath(it, f)
if ExistsFile(result):
ret result
result = ""
for it in iterSearchPath():
result = JoinPath(it, f)
if ExistsFile(result):
return result.canonicalizePath
result = ""
proc FindFile*(f: string): string =
result = rawFindFile(f)