diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2018-05-21 17:31:23 +0200 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-05-21 17:31:23 +0200 |
commit | cb6a4ffa865850b254680e47bf04817727e20558 (patch) | |
tree | e38fcc940794725757a69bcafe14eede2db724f7 /lib/pure/os.nim | |
parent | feef109e60fd33ff350cbcf82298a7cae83bbd72 (diff) | |
parent | dc809bd485ae9a104666a4ee4a3728eab9e2b39f (diff) | |
download | Nim-cb6a4ffa865850b254680e47bf04817727e20558.tar.gz |
Merge branch 'devel' into araq-big-refactoring
Diffstat (limited to 'lib/pure/os.nim')
-rw-r--r-- | lib/pure/os.nim | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 9f3045224..0d6690ebd 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -139,6 +139,7 @@ proc findExe*(exe: string, followSymlinks: bool = true; ## is added the `ExeExts <#ExeExts>`_ file extensions if it has none. ## If the system supports symlinks it also resolves them until it ## meets the actual file. This behavior can be disabled if desired. + if exe.len == 0: return template checkCurrentDir() = for ext in extensions: result = addFileExt(exe, ext) @@ -149,6 +150,7 @@ proc findExe*(exe: string, followSymlinks: bool = true; checkCurrentDir() let path = string(getEnv("PATH")) for candidate in split(path, PathSep): + if candidate.len == 0: continue when defined(windows): var x = (if candidate[0] == '"' and candidate[^1] == '"': substr(candidate, 1, candidate.len-2) else: candidate) / @@ -1649,4 +1651,4 @@ proc setLastModificationTime*(file: string, t: times.Time) = var ft = t.toWinTime.toFILETIME let res = setFileTime(h, nil, nil, ft.addr) discard h.closeHandle - if res == 0'i32: raiseOSError(osLastError()) \ No newline at end of file + if res == 0'i32: raiseOSError(osLastError()) |