aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/parser.y3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index e54f6fe0a..449123a1f 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -558,7 +558,8 @@ Path EvalState::findFile(const string & path)
if (path.compare(0, i->first.size(), i->first) != 0 ||
(path.size() > i->first.size() && path[i->first.size()] != '/'))
continue;
- res = i->second + "/" + string(path, i->first.size());
+ res = i->second +
+ (path.size() == i->first.size() ? "" : "/" + string(path, i->first.size()));
}
if (pathExists(res)) return canonPath(res);
}