diff -r 62f9787c516c -r 33e9699c7d3a lemon/lgf_reader.h --- a/lemon/lgf_reader.h Mon Dec 01 14:33:42 2008 +0100 +++ b/lemon/lgf_reader.h Mon Dec 08 20:23:33 2008 +0100 @@ -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) {