1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-30 14:10:59 +01:00

Encode virtual paths as /nix/store/virtual000<N>

This makes lib.isStorePath in nixpkgs return true for source trees and
fixes some cases where /__nix_virtual__ showed up in the NixOS manual.
This commit is contained in:
Eelco Dolstra 2022-10-27 15:57:56 +02:00
parent e424a8b196
commit a653e98f55
4 changed files with 19 additions and 10 deletions

View file

@ -58,6 +58,14 @@ public:
const std::string & abs() const
{ return path; }
/* Like abs(), but return an empty string if this path is
'/'. Thus the returned string never ends in a slash. */
const std::string & absOrEmpty() const
{
const static std::string epsilon;
return isRoot() ? epsilon : path;
}
const char * c_str() const
{ return path.c_str(); }