bugfix: environment var caching is now thread safe
This commit is contained in:
parent
f1f458137b
commit
cc490b35b0
1 changed files with 3 additions and 3 deletions
|
|
@ -554,7 +554,7 @@ proc cmpPaths*(pathA, pathB: string): int {.
|
||||||
proc isAbsolute*(path: string): bool {.rtl, noSideEffect, extern: "nos$1".} =
|
proc isAbsolute*(path: string): bool {.rtl, noSideEffect, extern: "nos$1".} =
|
||||||
## Checks whether a given `path` is absolute.
|
## Checks whether a given `path` is absolute.
|
||||||
##
|
##
|
||||||
## on Windows, network paths are considered absolute too.
|
## On Windows, network paths are considered absolute too.
|
||||||
when doslike:
|
when doslike:
|
||||||
var len = len(path)
|
var len = len(path)
|
||||||
result = (len > 1 and path[0] in {'/', '\\'}) or
|
result = (len > 1 and path[0] in {'/', '\\'}) or
|
||||||
|
|
@ -694,8 +694,8 @@ proc execShellCmd*(command: string): int {.rtl, extern: "nos$1".} =
|
||||||
# iterator depends on ``environment``.
|
# iterator depends on ``environment``.
|
||||||
|
|
||||||
var
|
var
|
||||||
envComputed: bool = false
|
envComputed {.threadvar.}: bool = false
|
||||||
environment: seq[string] = @[]
|
environment {.threadvar.}: seq[string] = @[]
|
||||||
|
|
||||||
when defined(windows):
|
when defined(windows):
|
||||||
# because we support Windows GUI applications, things get really
|
# because we support Windows GUI applications, things get really
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue