aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2024-01-16 09:04:34 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2024-01-16 09:04:34 +0200
commitbcde39204f0f15f207a10da59347db514936c617 (patch)
treeae21d33f02756763d436490ce783c3c658547cde
parent7d16f94b6c359930c8c69358b2fc8a120e13a271 (diff)
Fix bug in import_load() (GH issue #357)
-rw-r--r--libbuild2/file.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/libbuild2/file.cxx b/libbuild2/file.cxx
index 33f380d..88f1a9b 100644
--- a/libbuild2/file.cxx
+++ b/libbuild2/file.cxx
@@ -2726,6 +2726,9 @@ namespace build2
{
name n;
+ if (src_root.empty ())
+ src_root = root->src_path ();
+
n.dir = move (src_root);
n.dir /= *altn ? alt_export_dir : std_export_dir;
if (!tgt.dir.empty ())
@@ -2778,6 +2781,9 @@ namespace build2
if (cache_out_root.empty ())
cache_out_root = out_root;
+ if (src_root.empty ())
+ src_root = root->src_path ();
+
ts.assign (ctx.var_out_root) = move (out_root);
ts.assign (ctx.var_src_root) = move (src_root);