aboutsummaryrefslogtreecommitdiff
path: root/build/diagnostics.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build/diagnostics.cxx')
-rw-r--r--build/diagnostics.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/build/diagnostics.cxx b/build/diagnostics.cxx
index 2fad0d3..bc157ed 100644
--- a/build/diagnostics.cxx
+++ b/build/diagnostics.cxx
@@ -57,6 +57,24 @@ namespace build
return p.string ();
}
+ string
+ diag_relative (const dir_path& d, bool cur)
+ {
+ string r (diag_relative (static_cast<const path&> (d)));
+
+ // Translate "." to empty.
+ //
+ if (!cur && d.absolute () && r == ".")
+ r.clear ();
+
+ // Add trailing '/'.
+ //
+ if (!r.empty () && !dir_path::traits::is_separator (r.back ()))
+ r += '/';
+
+ return r;
+ }
+
// diag_do(), etc.
//
string