summaryrefslogtreecommitdiff
path: root/src/token.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2011-02-04 22:53:22 -0500
committerJohn Wiegley <johnw@newartisans.com>2011-02-04 22:53:22 -0500
commit0f8e0251f412f82fe3217f3a301ba0f3574aea12 (patch)
treebc0791335400502c34e49c0310c0c8592fdbb9ee /src/token.cc
parent2208ac1226bb3be82be550d465f08fc1dd7c1bae (diff)
downloadfork-ledger-0f8e0251f412f82fe3217f3a301ba0f3574aea12.tar.gz
fork-ledger-0f8e0251f412f82fe3217f3a301ba0f3574aea12.tar.bz2
fork-ledger-0f8e0251f412f82fe3217f3a301ba0f3574aea12.zip
Fixed a bug preventing g++ 4.6 from working
Diffstat (limited to 'src/token.cc')
-rw-r--r--src/token.cc7
1 files changed, 7 insertions, 0 deletions
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<std::size_t>(in.tellg() - pos);