In PLY import consume comments that appear before format header

This commit is contained in:
Dave Gargan 2020-01-31 11:22:03 +00:00
parent 683c8ceed6
commit 2f97d9bd8f
1 changed files with 18 additions and 0 deletions

View File

@ -1052,6 +1052,24 @@ int PlyFile::OpenRead( const char * filename )
error = E_UNESPECTEDEOF; error = E_UNESPECTEDEOF;
goto error; goto error;
} }
while (!strcmp(token, COMMENT))
{
comments.push_back(string(token + strlen(token) + 1));
if (pb_fgets(buf, MAXB - 1, gzfp) == 0)
{
error = E_UNESPECTEDEOF;
goto error;
}
header.append(buf);
#ifdef __MINGW32__
token = strtok(buf, SEP);
#else
token = strtok_r(buf, SEP, &tokenPtr);
#endif
}
if( strcmp(token,FORMAT) ) if( strcmp(token,FORMAT) )
{ {
error = E_NOFORMAT; error = E_NOFORMAT;