diff options
| author | Andrey Kleshchev <andreykproductengine@lindenlab.com> | 2025-08-16 09:27:10 +0300 | 
|---|---|---|
| committer | Andrey Kleshchev <117672381+akleshchev@users.noreply.github.com> | 2025-08-16 17:25:01 +0300 | 
| commit | 89b8490dedb3f8c41c6027da6af0be4552d81a23 (patch) | |
| tree | d05a88020ee519feea13831012bf2c88327e810f | |
| parent | 99001eaa4ffdac78953a64797d9d8163b9d32791 (diff) | |
#4544 Fix extension check being case sensitive
| -rw-r--r-- | indra/newview/llfloatermodelpreview.cpp | 15 | 
1 files changed, 8 insertions, 7 deletions
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 08d3488ef2..96a03ce2a6 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -1322,18 +1322,19 @@ void LLFloaterModelPreview::createSmoothComboBox(LLComboBox* combo_box, float mi      }  } -std::string get_source_file_extr(const std::string& filename) +std::string get_source_file_format(const std::string& filename)  { -    if (std::string::npos != filename.rfind(".gltf") -        || std::string::npos != filename.rfind(".glb")) +    const std::string extension = gDirUtilp->getExtension(filename); +    if (extension == "gltf" +        || extension == "glb")      {          return "gltf";      } -    else if (std::string::npos != filename.rfind(".dae")) +    else if (extension == "dae")      {          return "dae";      } -    else if (std::string::npos != filename.rfind(".slm")) +    else if (extension == "slm")      {          return "slm";      } @@ -1366,7 +1367,7 @@ void LLFloaterModelPreview::fillLODSourceStatistics(LLFloaterModelPreview::lod_s          else if (mLODMode[lod] == LLModelPreview::LOD_FROM_FILE)          {              const std::string& file = mModelPreview->mLODFile[lod]; -            lod_sources[lod_string] = get_source_file_extr(file); +            lod_sources[lod_string] = get_source_file_format(file);          }          else          { @@ -1391,7 +1392,7 @@ void LLFloaterModelPreview::fillLODSourceStatistics(LLFloaterModelPreview::lod_s          {              // There is a chance it will misfire if someone tries to upload a cube.dae mesh,              // but should be negligible enough. -            lod_sources["physics"] = get_source_file_extr(file); +            lod_sources["physics"] = get_source_file_format(file);          }          else          {  | 
