From 39623df224608e77b5a62dabd35b09783198bc87 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 2 Jul 2015 08:01:42 +0200 Subject: Various improvements to cli module --- build/cli/module.cxx | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) (limited to 'build/cli/module.cxx') diff --git a/build/cli/module.cxx b/build/cli/module.cxx index 96da40d..30f8d3e 100644 --- a/build/cli/module.cxx +++ b/build/cli/module.cxx @@ -97,22 +97,15 @@ namespace build process pr (args, false, false, true); ifdstream is (pr.in_ofd); - for (bool first (true); !is.eof (); ) - { - string l; - getline (is, l); - - if (first) - { - // The version is the last word on the first line. - // - auto p (l.rfind (' ')); - if (p != string::npos) - ver = string (l, p + 1); - - first = false; - } - } + // The version should be the last word on the first line. + // + string l; + getline (is, l); + auto p (l.rfind (' ')); + if (p != string::npos) + ver = string (l, p + 1); + + is.close (); // Don't block the other end. if (!pr.wait ()) throw failed (); -- cgit v1.1