Merge branch 'master' into file_extension

pull/5157/head
Kim Kulling 2023-07-10 11:19:27 +02:00 committed by GitHub
commit e2b19ef776
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -158,7 +158,7 @@ void BaseImporter::GetExtensionList(std::set<std::string> &extensions) {
std::size_t numTokens, std::size_t numTokens,
unsigned int searchBytes /* = 200 */, unsigned int searchBytes /* = 200 */,
bool tokensSol /* false */, bool tokensSol /* false */,
bool noAlphaBeforeTokens /* false */) { bool noGraphBeforeTokens /* false */) {
ai_assert(nullptr != tokens); ai_assert(nullptr != tokens);
ai_assert(0 != numTokens); ai_assert(0 != numTokens);
ai_assert(0 != searchBytes); ai_assert(0 != searchBytes);
@ -207,8 +207,9 @@ void BaseImporter::GetExtensionList(std::set<std::string> &extensions) {
continue; continue;
} }
// We need to make sure that we didn't accidentally identify the end of another token as our token, // We need to make sure that we didn't accidentally identify the end of another token as our token,
// e.g. in a previous version the "gltf " present in some gltf files was detected as "f " // e.g. in a previous version the "gltf " present in some gltf files was detected as "f ", or a
if (noAlphaBeforeTokens && (r != buffer && isalpha(static_cast<unsigned char>(r[-1])))) { // Blender-exported glb file containing "Khronos glTF Blender I/O " was detected as "o "
if (noGraphBeforeTokens && (r != buffer && isgraph(static_cast<unsigned char>(r[-1])))) {
continue; continue;
} }
// We got a match, either we don't care where it is, or it happens to // We got a match, either we don't care where it is, or it happens to

View File

@ -259,7 +259,7 @@ public: // static utilities
std::size_t numTokens, std::size_t numTokens,
unsigned int searchBytes = 200, unsigned int searchBytes = 200,
bool tokensSol = false, bool tokensSol = false,
bool noAlphaBeforeTokens = false); bool noGraphBeforeTokens = false);
// ------------------------------------------------------------------- // -------------------------------------------------------------------
/** @brief Check whether a file has a specific file extension /** @brief Check whether a file has a specific file extension