Make -d:tempDir switch work once again [bugfix] (#11442)

Fixes https://github.com/nim-lang/Nim/issues/11441.
This commit is contained in:
Kaushal Modi
2019-06-09 02:54:15 -04:00
committed by Andreas Rumpf
parent bce908f6ee
commit 3c62d41468

View File

@@ -798,12 +798,13 @@ proc getTempDir*(): string {.rtl, extern: "nos$1",
## * `expandTilde proc <#expandTilde,string>`_
## * `getCurrentDir proc <#getCurrentDir>`_
## * `setCurrentDir proc <#setCurrentDir,string>`_
const tempDirDefault = "/tmp/"
when defined(tempDir):
const tempDir {.strdefine.}: string = nil
const tempDir {.strdefine.}: string = tempDirDefault
return tempDir
elif defined(windows): return string(getEnv("TEMP")) & "\\"
elif defined(android): return getHomeDir()
else: return "/tmp/"
else: return tempDirDefault
proc expandTilde*(path: string): string {.
tags: [ReadEnvEffect, ReadIOEffect].} =