From 267e8daba555e87f04787300e0f9df91f320f524 Mon Sep 17 00:00:00 2001 From: MineBill Date: Sun, 5 Nov 2023 19:36:01 +0200 Subject: [PATCH] Honor the XDG_DATA_HOME env var and use the approved default as per specification. --- Source/Engine/Platform/Linux/LinuxFileSystem.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Engine/Platform/Linux/LinuxFileSystem.cpp b/Source/Engine/Platform/Linux/LinuxFileSystem.cpp index 8da3a378b..97cde4a1c 100644 --- a/Source/Engine/Platform/Linux/LinuxFileSystem.cpp +++ b/Source/Engine/Platform/Linux/LinuxFileSystem.cpp @@ -679,8 +679,14 @@ void LinuxFileSystem::GetSpecialFolderPath(const SpecialFolder type, String& res result = TEXT("/usr/share"); break; case SpecialFolder::LocalAppData: - result = home; + { + String dataHome; + if (!Platform::GetEnvironmentVariable(TEXT("XDG_DATA_HOME"), dataHome)) + result = dataHome; + else + result = home / TEXT(".local/share"); break; + } case SpecialFolder::ProgramData: result = String::Empty; break;