aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/functions-path.cxx8
-rw-r--r--build2/variable.cxx9
2 files changed, 10 insertions, 7 deletions
diff --git a/build2/functions-path.cxx b/build2/functions-path.cxx
index 6fff94d..81cd01f 100644
--- a/build2/functions-path.cxx
+++ b/build2/functions-path.cxx
@@ -74,8 +74,7 @@ namespace build2
// string
//
- f["string"] = [](path p) {return move (p).string ();};
- f["string"] = [](dir_path p) {return move (p).string ();};
+ f["string"] = [](path p) {return move (p).string ();};
f["string"] = [](paths v)
{
@@ -95,8 +94,7 @@ namespace build2
// representation
//
- f["representation"] = [](path p) {return move (p).representation ();};
- f["representation"] = [](dir_path p) {return move (p).representation ();};
+ f["representation"] = [](path p) {return move (p).representation ();};
f["representation"] = [](paths v)
{
@@ -116,7 +114,7 @@ namespace build2
// canonicalize
//
- f["canonicalize"] = [](path p) {p.canonicalize (); return p;};
+ f["canonicalize"] = [](path p) {p.canonicalize (); return p;};
f["canonicalize"] = [](dir_path p) {p.canonicalize (); return p;};
f["canonicalize"] = [](paths v)
diff --git a/build2/variable.cxx b/build2/variable.cxx
index bcf9d62..8e32b30 100644
--- a/build2/variable.cxx
+++ b/build2/variable.cxx
@@ -568,7 +568,12 @@ namespace build2
{
return 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.
+ }
}
// Fall through.
@@ -627,7 +632,7 @@ namespace build2
{
type_name,
sizeof (dir_path),
- nullptr, // No base, or should it be path?
+ &value_traits<path>::value_type, // Assume direct cast works for both.
&default_dtor<dir_path>,
&default_copy_ctor<dir_path>,
&default_copy_assign<dir_path>,