1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-24 22:11:15 +02:00

throw BadStorePath for empty string

some of the functional tests that run config check wouldn't tolerate some
oddities in `PATH`, something like a null string entry (e.g. `::` in the
middle or a trailing `:`) I think. This allows the test pass.

Signed-off-by: Samuli Thomasson <samuli.thomasson@pm.me>
This commit is contained in:
Samuli Thomasson 2025-06-02 01:53:59 +02:00
parent 8f56724e2b
commit 6041531716
No known key found for this signature in database
GPG key ID: 6B8903D2645A5B48

View file

@ -77,6 +77,9 @@ StorePath StorePath::random(std::string_view name)
StorePath MixStoreDirMethods::parseStorePath(std::string_view path) const
{
if (path.empty())
throw BadStorePath("empty path is not a valid store path");
// On Windows, `/nix/store` is not a canonical path. More broadly it
// is unclear whether this function should be using the native
// notion of a canonical path at all. For example, it makes to