aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2023-10-02 14:08:25 +0200
committerGitHub <noreply@github.com>2023-10-02 14:08:25 +0200
commit7e2399b12360d267af8dac033c3d0d95a00b874d (patch)
tree9f12b71e4b6d19029d52b24fe51a8d709c55bb64 /src/libexpr/primops.cc
parent9e212344f948e3f362807581bfe3e3d535372618 (diff)
parent860f64c345ac170763d39310dedcc624bd8f70a4 (diff)
Merge pull request #9079 from hercules-ci/backport-9022-to-2.18-maintenance
[Backport 2.18-maintenance] pathExists: isDir when endswith /.
Diffstat (limited to 'src/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index cd9a05bb2..d8d3e8bee 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -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);