Excludes windows platfrom from $PATH tilde expansion. Refs #2358.

This commit is contained in:
Grzegorz Adam Hankiewicz
2015-03-17 20:07:20 +01:00
parent 79934b9d68
commit 1320efcf90

View File

@@ -1874,7 +1874,10 @@ proc findExe*(exe: string): string {.tags: [ReadDirEffect, ReadEnvEffect].} =
if existsFile(result): return
var path = string(os.getEnv("PATH"))
for candidate in split(path, PathSep):
var x = expandTilde(candidate) / result
when defined(windows):
var x = candidate / result
else:
var x = expandTilde(candidate) / result
if existsFile(x): return x
result = ""