diff options
Diffstat (limited to 'build/cli/module.cxx')
-rw-r--r-- | build/cli/module.cxx | 25 |
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 (); |