summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-09-29 21:36:49 +0300
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2026-09-30 00:47:00 +0300
commit4598c539e2fd44a08bbd340ba8a50d8618598f89 (patch)
treec088e3912f7b9e0e32efc263ea17ee2de92156ed
parent546782857fef92f1c745d58e30275138ee1e49f8 (diff)
#6276 Fix filesystem path processing for cache
-rw-r--r--indra/llfilesystem/lldiskcache.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp
index e7b43e15e2..5af801a1df 100644
--- a/indra/llfilesystem/lldiskcache.cpp
+++ b/indra/llfilesystem/lldiskcache.cpp
@@ -34,6 +34,7 @@
#include "llapp.h"
#include "llassettype.h"
#include "lldir.h"
+#include "llstring.h"
#include <chrono>
#include <filesystem>
@@ -116,14 +117,14 @@ void LLDiskCache::purge()
}
if (std::filesystem::is_regular_file(*iter, ec) && !ec)
{
- if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos)
+ if (fsyspath((*iter).path()).string().find(CACHE_FILENAME_PREFIX) != std::string::npos)
{
uintmax_t file_size = std::filesystem::file_size(*iter, ec);
if (ec)
{
continue;
}
- const std::string file_path = (*iter).path().string();
+ const std::string file_path = fsyspath((*iter).path()).string();
const std::filesystem::file_time_type file_time = std::filesystem::last_write_time(*iter, ec);
if (ec)
{
@@ -165,7 +166,7 @@ void LLDiskCache::purge()
}
if (should_remove)
{
- std::filesystem::remove(entry.second.second, ec);
+ std::filesystem::remove(fsyspath(entry.second.second), ec);
if (ec)
{
LL_WARNS() << "Failed to delete cache file " << entry.second.second << ": " << ec.message() << LL_ENDL;
@@ -245,7 +246,7 @@ void LLDiskCache::clearCache()
{
if (std::filesystem::is_regular_file(*iter, ec) && !ec)
{
- if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos)
+ if (fsyspath((*iter).path()).string().find(CACHE_FILENAME_PREFIX) != std::string::npos)
{
std::filesystem::remove(*iter, ec);
if (ec)
@@ -274,8 +275,9 @@ void LLDiskCache::removeOldVFSFiles()
{
if (std::filesystem::is_regular_file(*iter, ec) && !ec)
{
- if (((*iter).path().string().find(CACHE_FORMAT) != std::string::npos) ||
- ((*iter).path().string().find(DB_FORMAT) != std::string::npos))
+ const std::string file_path = fsyspath((*iter).path()).string();
+ if ((file_path.find(CACHE_FORMAT) != std::string::npos) ||
+ (file_path.find(DB_FORMAT) != std::string::npos))
{
std::filesystem::remove(*iter, ec);
if (ec)
@@ -311,7 +313,7 @@ uintmax_t LLDiskCache::dirFileSize(const std::string& dir)
{
if (std::filesystem::is_regular_file(*iter, ec) && !ec)
{
- if ((*iter).path().string().find(CACHE_FILENAME_PREFIX) != std::string::npos)
+ if (fsyspath((*iter).path()).string().find(CACHE_FILENAME_PREFIX) != std::string::npos)
{
uintmax_t file_size = std::filesystem::file_size(*iter, ec);
if (!ec)