Merge branch 'master' into bugfix/c4d_obj_export_mtllib_after_g

This commit is contained in:
Josh Faust
2018-02-27 18:47:11 -08:00
committed by GitHub
3 changed files with 33 additions and 3 deletions

View File

@@ -178,9 +178,17 @@ void BaseImporter::GetExtensionList(std::set<std::string>& extensions)
}
*cur2 = '\0';
std::string token;
for (unsigned int i = 0; i < numTokens;++i) {
ai_assert(NULL != tokens[i]);
const char* r = strstr(buffer,tokens[i]);
ai_assert( nullptr != tokens[i] );
size_t len( strlen( tokens[ i ] ) );
token.clear();
const char *ptr( tokens[ i ] );
for ( size_t tokIdx = 0; tokIdx < len; ++tokIdx ) {
token.push_back( tolower( *ptr ) );
++ptr;
}
const char* r = strstr( buffer, token.c_str() );
if( !r ) {
continue;
}

View File

@@ -141,7 +141,8 @@ bool IFCImporter::CanRead( const std::string& pFile, IOSystem* pIOHandler, bool
// it is only unambiguous as long as we don't support any further
// file formats with STEP as their encoding.
const char* tokens[] = {"ISO-10303-21"};
return SearchFileHeaderForToken(pIOHandler,pFile,tokens,1);
const bool found( SearchFileHeaderForToken( pIOHandler, pFile, tokens, 1 ) );
return found;
}
return false;
}