aboutsummaryrefslogtreecommitdiff
path: root/build2/dump.cxx
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2016-12-02 01:24:02 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2016-12-05 17:21:48 +0300
commitd04cd568c85262d486f7a0de0a374c80d466c58e (patch)
treef69056aa0d98299807ee53fa891d8775d41f9f26 /build2/dump.cxx
parent26bdc152246f6a1caf1f0667b5f04f1804d599fa (diff)
Use empty path for root scope
Diffstat (limited to 'build2/dump.cxx')
-rw-r--r--build2/dump.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/build2/dump.cxx b/build2/dump.cxx
index 9c26235..b959d9d 100644
--- a/build2/dump.cxx
+++ b/build2/dump.cxx
@@ -260,12 +260,17 @@ namespace build2
const dir_path& d (i->first);
++i;
- // We don't want the extra notations (e.g., ~/) provided by
- // diag_relative() since we want the path to be relative to
- // the outer scope.
+ // We don't want the extra notations (e.g., ~/) provided by diag_relative()
+ // since we want the path to be relative to the outer scope. Print the root
+ // scope path (represented by an empty one) as a platform-dependent path
+ // separator.
//
- os << ind << relative (d) << ":" << endl
- << ind << '{';
+ if (d.empty ())
+ os << ind << dir_path::traits::directory_separator;
+ else
+ os << ind << relative (d);
+
+ os << ":" << endl << ind << '{';
const dir_path* orb (relative_base);
relative_base = &d;