Skip to content

Commit

Permalink
Workaround for bizarre muxml misbehaviour at the end of file.
Browse files Browse the repository at this point in the history
Newer stdlib versions seem to have changed their iostream flags
behaviour when the end of file has been reached, which muxml chokes on.
This is not really an elegant solution, but it appears to work for our
uses.
  • Loading branch information
ursg committed Aug 22, 2017
1 parent 96bbcf1 commit ba8c97c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion muxml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,10 @@ bool MuXML::read(std::istream& in,XMLNode* parent,const int& level,const char& c
while ((c == ' ' || c == '\t' || c == '\n') && in.good() == true) in >> c;
}

if (in.good() == false) return false;
if (in.good() == false && in.eof() == false) return false;
if (in.eof() == true) {
return true;
}
} while (success == true);
return true;
}
Expand Down

0 comments on commit ba8c97c

Please sign in to comment.