From b323a8950ccd43cb1eec2b6f4721faa3e094dc2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Sat, 23 Mar 2019 09:54:45 -0700 Subject: [PATCH] texturev: Fixed recognizing file extension on files with extensions with multiple period separators. --- tools/texturev/texturev.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/texturev/texturev.cpp b/tools/texturev/texturev.cpp index 0fa763629..988df0b6b 100644 --- a/tools/texturev/texturev.cpp +++ b/tools/texturev/texturev.cpp @@ -317,7 +317,7 @@ private: const bx::StringView& m_str; bx::StringView m_token; char m_ch; -}; +}; bool openFileSelectionDialog( bx::FilePath& _inOutFilePath @@ -424,7 +424,7 @@ bool openFileSelectionDialog( bx::write(&writer, line, &err); bx::write(&writer, '\0', &err); bx::write(&writer, '\0', &err); - } + } } bx::write(&writer, '\0', &err); @@ -925,7 +925,9 @@ struct View bool supported = false; for (uint32_t ii = 0; ii < BX_COUNTOF(s_supportedExt); ++ii) { - if (0 == bx::strCmpI(ext, s_supportedExt[ii]) ) + const bx::StringView supportedExt(s_supportedExt[ii]); + + if (0 == bx::strCmpI(bx::max(ext.getPtr(), ext.getTerm() - supportedExt.getLength() ), supportedExt) ) { supported = true; break;