aboutsummaryrefslogtreecommitdiff
path: root/build2/variable.ixx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2019-06-03 15:52:14 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2019-06-03 16:21:53 +0300
commit7afc8fe90ea5b894c6ef63c62012988e07f8bf42 (patch)
tree9286dddca98435cfad35d47edd0f6efdea9a94ee /build2/variable.ixx
parentd37709e5c27b1fe7b98de57247449c6272c79580 (diff)
Fix `print $subprojects` failure
This print directive was failing with the message like "error: invalid project_name element key 'tests/'".
Diffstat (limited to 'build2/variable.ixx')
-rw-r--r--build2/variable.ixx12
1 files changed, 12 insertions, 0 deletions
diff --git a/build2/variable.ixx b/build2/variable.ixx
index a92ef3c..559151b 100644
--- a/build2/variable.ixx
+++ b/build2/variable.ixx
@@ -641,6 +641,18 @@ namespace build2
new (&v.data_) project_name (move (x));
}
+ inline name value_traits<project_name>::
+ reverse (const project_name& x)
+ {
+ // Make work for the special unnamed subproject representation (see
+ // find_subprojects() in file.cxx for details).
+ //
+ const string& s (x.string ());
+ return name (s.empty () || path::traits_type::is_separator (s.back ())
+ ? empty_string
+ : s);
+ }
+
// vector<T> value
//
template <typename T>