From 0f8e0251f412f82fe3217f3a301ba0f3574aea12 Mon Sep 17 00:00:00 2001 From: John Wiegley Date: Fri, 4 Feb 2011 22:53:22 -0500 Subject: Fixed a bug preventing g++ 4.6 from working --- src/token.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/token.cc') diff --git a/src/token.cc b/src/token.cc index 64a5e9f9..7bfaf162 100644 --- a/src/token.cc +++ b/src/token.cc @@ -439,6 +439,13 @@ void expr_t::token_t::next(std::istream& in, const parse_flags_t& pflags, unexpected(expecting); } } else { + if (! in.good()) { + in.clear(); + in.seekg(0, std::ios::end); + if (in.fail()) + throw_(parse_error, _("Failed to reset input stream")); + } + kind = VALUE; value = temp; length = static_cast(in.tellg() - pos); -- cgit v1.2.3