about summary refs log tree commit diff
path: root/src/libexpr/eval.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libexpr/eval.cc')
-rw-r--r--src/libexpr/eval.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index db135844e5b7..d8a4193a8e64 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -1419,7 +1419,7 @@ string EvalState::copyPathToStore(PathSet & context, const Path & path)
     else {
         dstPath = settings.readOnlyMode
             ? computeStorePathForPath(checkSourcePath(path)).first
-            : store->addToStore(checkSourcePath(path), true, htSHA256, defaultPathFilter, repair);
+            : store->addToStore(baseNameOf(path), checkSourcePath(path), true, htSHA256, defaultPathFilter, repair);
         srcToStore[path] = dstPath;
         printMsg(lvlChatty, format("copied source ‘%1%’ -> ‘%2%’")
             % path % dstPath);