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

pathExists: isDir when endswith /.

(cherry picked from commit f8a3893e8d)
(cherry picked from commit 860f64c345)
This commit is contained in:
Robert Hensing 2023-09-02 22:47:38 +02:00 committed by github-actions[bot]
parent 0529a89988
commit 7cebcde9cc
2 changed files with 24 additions and 1 deletions

View file

@ -1518,7 +1518,9 @@ static void prim_pathExists(EvalState & state, const PosIdx pos, Value * * args,
auto path = realisePath(state, pos, arg, { .checkForPureEval = false });
/* SourcePath doesn't know about trailing slash. */
auto mustBeDir = arg.type() == nString && arg.str().ends_with("/");
auto mustBeDir = arg.type() == nString
&& (arg.str().ends_with("/")
|| arg.str().ends_with("/."));
try {
auto checked = state.checkSourcePath(path);