mirror of
https://github.com/NixOS/nix.git
synced 2025-02-21 11:22:35 +00:00
fix: Treat empty XDG_RUNTIME_DIR as unset
See preceding commit. Not observed in the wild, but is sensible
and consistent with TMPDIR behavior.
(cherry picked from commit b9e7f5aa2d
)
This commit is contained in:
parent
1a336bf865
commit
c1f69dfc5e
@ -457,8 +457,9 @@ static void main_nix_build(int argc, char * * argv)
|
|||||||
// Set the environment.
|
// Set the environment.
|
||||||
auto env = getEnv();
|
auto env = getEnv();
|
||||||
|
|
||||||
auto tmp = getEnv("TMPDIR");
|
auto tmp = getEnvNonEmpty("TMPDIR");
|
||||||
if (!tmp || tmp->empty()) tmp = getEnv("XDG_RUNTIME_DIR").value_or("/tmp");
|
if (!tmp)
|
||||||
|
tmp = getEnvNonEmpty("XDG_RUNTIME_DIR").value_or("/tmp");
|
||||||
|
|
||||||
if (pure) {
|
if (pure) {
|
||||||
decltype(env) newEnv;
|
decltype(env) newEnv;
|
||||||
|
Loading…
Reference in New Issue
Block a user