From 9d091ee99a9b962c72b3cb9485a89ba028dd1155 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Sat, 6 Aug 2011 18:45:28 +0000 Subject: [PATCH] * Handle the case where the search path element is a regular file. --- src/libexpr/parser.y | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); }