aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build2/cc/compile.cxx18
-rw-r--r--build2/utility.hxx2
2 files changed, 3 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;
diff --git a/build2/utility.hxx b/build2/utility.hxx
index a6f6fa6..2fa7e6e 100644
--- a/build2/utility.hxx
+++ b/build2/utility.hxx
@@ -74,6 +74,8 @@ namespace build2
using butl::throw_generic_error;
using butl::throw_system_error;
+ using butl::eof;
+
// Basic string utilities.
//