diff -r e9a568cc86e3 -r 5c69a36729cb lemon/lgf_reader.h --- a/lemon/lgf_reader.h Fri Dec 12 21:41:05 2008 +0000 +++ b/lemon/lgf_reader.h Fri Dec 12 22:14:29 2008 +0000 @@ -870,7 +870,9 @@ while (readSuccess() && line >> c && c != '@') { readLine(); } - line.putback(c); + if (readSuccess()) { + line.putback(c); + } } void readNodes() { @@ -1699,7 +1701,9 @@ while (readSuccess() && line >> c && c != '@') { readLine(); } - line.putback(c); + if (readSuccess()) { + line.putback(c); + } } void readNodes() { @@ -2226,7 +2230,9 @@ while (readSuccess() && line >> c && c != '@') { readLine(); } - line.putback(c); + if (readSuccess()) { + line.putback(c); + } } public: @@ -2567,7 +2573,9 @@ while (readSuccess() && line >> c && c != '@') { readLine(); } - line.putback(c); + if (readSuccess()) { + line.putback(c); + } } void readMaps(std::vector& maps) {