os.nim: revert findExe 'improvement' that breaks our builds

This commit is contained in:
Andreas Rumpf
2017-09-01 21:35:46 +02:00
parent a43eae8e6c
commit 3bc7dbbd97

View File

@@ -141,12 +141,7 @@ proc findExe*(exe: string, followSymlinks: bool = true;
## meets the actual file. This behavior can be disabled if desired.
for ext in extensions:
result = addFileExt(exe, ext)
if existsFile(result):
# on Posix ensure we do not yield binaries in the cwd:
when defined(posix):
if isAbsolute(result): return
else:
return
if existsFile(result): return
var path = string(getEnv("PATH"))
for candidate in split(path, PathSep):
when defined(windows):