about summary refs log tree commit diff
path: root/src/libexpr/parser.y
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/parser.y')
-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 e54f6fe0a7b5..449123a1f82c 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);
     }