- Bugfix : Fix build of Obj-FileImporter ( this is currently only a work-around, loader is leaking memory, I am working on it ).

- Update : Merge fixes from GitHub, thanks to Riku Palomäki ( more fixes will merged soon ).

git-svn-id: https://assimp.svn.sourceforge.net/svnroot/assimp/trunk@1213 67173fc5-114c-0410-ac8e-9d2fd5bffc1f
This commit is contained in:
kimmi
2012-03-20 20:31:14 +00:00
parent e65087c338
commit b724ac5c2c
3 changed files with 17 additions and 9 deletions

View File

@@ -110,7 +110,8 @@ void BaseImporter::SetupProperties(const Importer* /*pImp*/)
const std::string& pFile,
const char** tokens,
unsigned int numTokens,
unsigned int searchBytes /* = 200 */)
unsigned int searchBytes /* = 200 */,
bool tokensSol /* false */)
{
ai_assert(NULL != tokens && 0 != numTokens && 0 != searchBytes);
if (!pIOHandler)
@@ -142,7 +143,13 @@ void BaseImporter::SetupProperties(const Importer* /*pImp*/)
for (unsigned int i = 0; i < numTokens;++i) {
ai_assert(NULL != tokens[i]);
if (::strstr(buffer,tokens[i])) {
const char* r = strstr(buffer,tokens[i]);
if (!r)
continue;
// We got a match, either we don't care where it is, or it happens to
// be in the beginning of the file / line
if (!tokensSol || r == buffer || r[-1] == '\r' || r[-1] == '\n') {
DefaultLogger::get()->debug(std::string("Found positive match for header keyword: ") + tokens[i]);
return true;
}