aboutsummaryrefslogtreecommitdiff
path: root/build2/variable.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build2/variable.cxx')
-rw-r--r--build2/variable.cxx34
1 files changed, 33 insertions, 1 deletions
diff --git a/build2/variable.cxx b/build2/variable.cxx
index 8000913..0c07db6 100644
--- a/build2/variable.cxx
+++ b/build2/variable.cxx
@@ -600,7 +600,20 @@ namespace build2
catch (invalid_path& e)
{
n.value = move (e.path); // Restore the name object for diagnostics.
+ // Fall through.
+ }
+ }
+ // Reassemble split dir/value.
+ //
+ if (n.untyped () && n.unqualified ())
+ {
+ try
+ {
+ return n.dir / n.value;
+ }
+ catch (const invalid_path&)
+ {
// Fall through.
}
}
@@ -649,7 +662,26 @@ namespace build2
{
return dir_path (move (n.value));
}
- catch (const invalid_path&) {} // Fall through.
+ catch (invalid_path& e)
+ {
+ n.value = move (e.path); // Restore the name object for diagnostics.
+ // Fall through.
+ }
+ }
+
+ // Reassemble split dir/value.
+ //
+ if (n.untyped () && n.unqualified ())
+ {
+ try
+ {
+ n.dir /= n.value;
+ return move (n.dir);
+ }
+ catch (const invalid_path&)
+ {
+ // Fall through.
+ }
}
// Fall through.