mirror of
https://github.com/NixOS/nix.git
synced 2025-11-13 14:02:42 +01:00
pathExists: isDir when endswith /.
(cherry picked from commit f8a3893e8d)
This commit is contained in:
parent
9e212344f9
commit
860f64c345
2 changed files with 24 additions and 1 deletions
|
|
@ -1528,7 +1528,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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue