dropEmptyInitThenConcatStringsSep -> concatStringSep: PATH handling
It's still wrong, but one step closer to correct. Not that anyone should use "" or "." in their PATH, but that is not for us to intervene.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "command.hh"
|
||||
#include "run.hh"
|
||||
#include "strings.hh"
|
||||
|
||||
using namespace nix;
|
||||
|
||||
@@ -92,9 +93,10 @@ struct CmdShell : InstallablesCommand, MixEnvironment
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: split losslessly; empty means .
|
||||
auto unixPath = tokenizeString<Strings>(getEnv("PATH").value_or(""), ":");
|
||||
unixPath.insert(unixPath.begin(), pathAdditions.begin(), pathAdditions.end());
|
||||
auto unixPathString = dropEmptyInitThenConcatStringsSep(":", unixPath);
|
||||
auto unixPathString = concatStringsSep(":", unixPath);
|
||||
setEnv("PATH", unixPathString.c_str());
|
||||
|
||||
Strings args;
|
||||
|
||||
Reference in New Issue
Block a user