From 79e54cc404c679c7cce1c0a9ace4728f8e99b5b8 Mon Sep 17 00:00:00 2001 From: Hecklezz Date: Wed, 9 Sep 2026 07:56:55 +1000 Subject: Fix crash loading chatlogs with unicode in the names --- indra/llfilesystem/lldiriterator.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'indra/llfilesystem/lldiriterator.cpp') diff --git a/indra/llfilesystem/lldiriterator.cpp b/indra/llfilesystem/lldiriterator.cpp index 60b55c7bf3..ca00d25fb7 100644 --- a/indra/llfilesystem/lldiriterator.cpp +++ b/indra/llfilesystem/lldiriterator.cpp @@ -126,20 +126,27 @@ bool LLDirIterator::Impl::next(std::string &fname) { while (mIter != end_itr && !found) { - boost::smatch match; - std::string name = mIter->path().filename().string(); - found = ll_regex_match(name, match, mFilterExp); - if (found) + try { - fname = name; + boost::smatch match; + std::string name = fsyspath(mIter->path().filename()).string(); + found = ll_regex_match(name, match, mFilterExp); + if (found) + { + fname = name; + } + } + catch (const std::system_error& e) + { + LL_WARNS() << "Exception accessing directory entry: " << e.what() << LL_ENDL; } ++mIter; } } - catch (const fs::filesystem_error& e) + catch (const std::system_error& e) { - LL_WARNS() << e.what() << LL_ENDL; + LL_WARNS() << "Exception iterating directory: " << e.what() << LL_ENDL; } return found; -- cgit v1.3