mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2025-01-31 23:46:48 +02: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.
This commit is contained in:
parent
c3fb2aa1f9
commit
b9e7f5aa2d
1 changed files with 3 additions and 2 deletions
|
@ -475,8 +475,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 a new issue