Make -d:tempDir switch work once again [bugfix] (#11442)
Fixes https://github.com/nim-lang/Nim/issues/11441.
This commit is contained in:
parent
bce908f6ee
commit
3c62d41468
1 changed files with 3 additions and 2 deletions
|
|
@ -798,12 +798,13 @@ proc getTempDir*(): string {.rtl, extern: "nos$1",
|
||||||
## * `expandTilde proc <#expandTilde,string>`_
|
## * `expandTilde proc <#expandTilde,string>`_
|
||||||
## * `getCurrentDir proc <#getCurrentDir>`_
|
## * `getCurrentDir proc <#getCurrentDir>`_
|
||||||
## * `setCurrentDir proc <#setCurrentDir,string>`_
|
## * `setCurrentDir proc <#setCurrentDir,string>`_
|
||||||
|
const tempDirDefault = "/tmp/"
|
||||||
when defined(tempDir):
|
when defined(tempDir):
|
||||||
const tempDir {.strdefine.}: string = nil
|
const tempDir {.strdefine.}: string = tempDirDefault
|
||||||
return tempDir
|
return tempDir
|
||||||
elif defined(windows): return string(getEnv("TEMP")) & "\\"
|
elif defined(windows): return string(getEnv("TEMP")) & "\\"
|
||||||
elif defined(android): return getHomeDir()
|
elif defined(android): return getHomeDir()
|
||||||
else: return "/tmp/"
|
else: return tempDirDefault
|
||||||
|
|
||||||
proc expandTilde*(path: string): string {.
|
proc expandTilde*(path: string): string {.
|
||||||
tags: [ReadEnvEffect, ReadIOEffect].} =
|
tags: [ReadEnvEffect, ReadIOEffect].} =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue