From 4dbbb9384a25f54bfdcbda17d6307750f92133aa Mon Sep 17 00:00:00 2001 From: cignoni Date: Wed, 31 Oct 2012 21:03:05 +0000 Subject: [PATCH] better check of emtpy line skipping in obj parsing --- wrap/io_trimesh/import_obj.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wrap/io_trimesh/import_obj.h b/wrap/io_trimesh/import_obj.h index 28d3d1ff..b1d901ad 100644 --- a/wrap/io_trimesh/import_obj.h +++ b/wrap/io_trimesh/import_obj.h @@ -643,9 +643,9 @@ public: } } } - while (( line.length()==0 || line[0] == '#') && !stream.eof()); // skip comments and empty lines + while (( line.empty() || (!line.empty() && line[0] == '#')) && !stream.eof()); // skip comments and empty lines - if ( (line.length() == 0)||(line[0] == '#') ) // can be true only on last line of file + if ( (line.length() == 0)||(!line.empty() && line[0] == '#') ) // can be true only on last line of file return; size_t from = 0;