os.findExe on Windows can deal with quotes

This commit is contained in:
Andreas Rumpf
2016-01-26 12:43:07 +01:00
parent c527969059
commit d338744d7a

View File

@@ -567,7 +567,9 @@ when declared(getEnv) or defined(nimscript):
var path = string(getEnv("PATH"))
for candidate in split(path, PathSep):
when defined(windows):
var x = candidate / result
var x = (if candidate[0] == '"' and candidate[^1] == '"':
substr(candidate, 1, candidate.len-2) else: candidate) /
result
else:
var x = expandTilde(candidate) / result
if existsFile(x): return x