From ace1743f7f78bb13f99553d6e97ad1beecf1ba99 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 13 Apr 2015 15:50:17 +0200 Subject: Add separate type to represent directory paths --- build/dump.cxx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'build/dump.cxx') diff --git a/build/dump.cxx b/build/dump.cxx index 05ec679..b41e489 100644 --- a/build/dump.cxx +++ b/build/dump.cxx @@ -25,7 +25,12 @@ namespace build for (const prerequisite& p: t.prerequisites) { - os << ' ' << p; + os << ' '; + + if (p.target != nullptr) + os << *p.target; + else + os << p; } } @@ -36,15 +41,14 @@ namespace build string& ind, set& rts) { - string d (relative (p.path ()).string ()); - - if (d.back () != path::traits::directory_separator) - d += '/'; - - os << ind << d << ":" << endl + // 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. + // + os << ind << relative (p.path ()) << ":" << endl << ind << '{'; - const path* orb (relative_base); + const dir_path* orb (relative_base); relative_base = &p.path (); ind += " "; -- cgit v1.1