aboutsummaryrefslogtreecommitdiff
path: root/build/cli/module.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-07-02 08:01:42 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-07-02 08:01:42 +0200
commit39623df224608e77b5a62dabd35b09783198bc87 (patch)
tree3da359b809055fa737faec8d72d9ed1844e5c447 /build/cli/module.cxx
parentd236d61ee9821abc4e8d3e3928ac2dfa9cb57d98 (diff)
Various improvements to cli module
Diffstat (limited to 'build/cli/module.cxx')
-rw-r--r--build/cli/module.cxx25
1 files changed, 9 insertions, 16 deletions
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 ();