aboutsummaryrefslogtreecommitdiff
path: root/build2/cc/compile.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2017-11-21 14:07:17 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2017-11-21 14:07:17 +0200
commit489faa4e8a06ecaf9a42924690b1978ede4c2a12 (patch)
tree07179ba4906a6642cf6438eb4a77d18f860c45bb /build2/cc/compile.cxx
parent035c945aed68af2c725263a1d9123943ecd22004 (diff)
Move eof() utility to libbutl
Diffstat (limited to 'build2/cc/compile.cxx')
-rw-r--r--build2/cc/compile.cxx18
1 files changed, 1 insertions, 17 deletions
diff --git a/build2/cc/compile.cxx b/build2/cc/compile.cxx
index 0b9c20b..83230b2 100644
--- a/build2/cc/compile.cxx
+++ b/build2/cc/compile.cxx
@@ -2419,22 +2419,6 @@ namespace build2
fdstream_mode::text | fdstream_mode::skip,
ifdstream::badbit);
- // If an input stream operation has failed, return true if
- // because of the eof and throw is_error otherwise.
- //
- auto eof = [] (std::istream& is) -> bool
- {
- if (is.fail ())
- {
- if (is.eof ())
- return true;
-
- throw io_error ("");
- }
-
- return false;
- };
-
// In some cases we may need to ignore the error return status.
// The good_error flag keeps track of that. Similarly we
// sometimes expect the error return status based on the output
@@ -2444,7 +2428,7 @@ namespace build2
size_t skip (skip_count);
string l; // Reuse.
- for (bool first (true), second (false); !(restart || is.eof ());)
+ for (bool first (true), second (false); !restart; )
{
if (eof (getline (is, l)))
break;