Bugfix : If bool property is written and conatins 0x20 in file, reader will fail (Thanks to Simon Flöry for the patch)

Unittest: Added test case for this bug



git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@957 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Jan Möbius
2013-09-17 13:09:19 +00:00
parent 9d550bd5e5
commit 5094916ff6
2 changed files with 79 additions and 0 deletions

View File

@@ -93,6 +93,13 @@ bool _OMReader_::read(const std::string& _filename, BaseImporter& _bi, Options&
// Open file
std::ifstream ifs(_filename.c_str(), std::ios::binary);
/* Clear formatting flag skipws (Skip whitespaces). If set, operator>> will
* skip bytes set to whitespace chars (e.g. 0x20 bytes) in
* Property<bool>::restore.
*/
ifs.unsetf(std::ios::skipws);
if (!ifs.is_open() || !ifs.good()) {
omerr() << "[OMReader] : cannot not open file " << _filename << std::endl;
return false;