1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 12:41:15 +02:00

EvalCache: Store string contexts

This commit is contained in:
Eelco Dolstra 2020-06-29 19:08:37 +02:00
parent b681408879
commit 50f13b06fb
6 changed files with 101 additions and 27 deletions

View file

@ -30,18 +30,6 @@ namespace nix {
*************************************************************/
/* Decode a context string !<name>!<path> into a pair <path,
name>. */
std::pair<string, string> decodeContext(const string & s)
{
if (s.at(0) == '!') {
size_t index = s.find("!", 1);
return std::pair<string, string>(string(s, index + 1), string(s, 1, index - 1));
} else
return std::pair<string, string>(s.at(0) == '/' ? s : string(s, 1), "");
}
InvalidPathError::InvalidPathError(const Path & path) :
EvalError("path '%s' is not valid", path), path(path) {}