Mercurial > minori
diff src/core/filesystem.cc @ 202:71832ffe425a
animia: re-add kvm fd source
this is all being merged from my wildly out-of-date laptop. SORRY!
in other news, I edited the CI file to install the wayland client
as well, so the linux CI build might finally get wayland stuff.
author | Paper <paper@paper.us.eu.org> |
---|---|
date | Tue, 02 Jan 2024 06:05:06 -0500 |
parents | 8548dc425697 |
children | 53211cb1e7f5 |
line wrap: on
line diff
--- a/src/core/filesystem.cc Sun Nov 19 19:13:28 2023 -0500 +++ b/src/core/filesystem.cc Tue Jan 02 06:05:06 2024 -0500 @@ -39,21 +39,31 @@ #ifdef WIN32 std::filesystem::path path; wchar_t* buf; + if (SHGetKnownFolderPath(FOLDERID_RoamingAppData, KF_FLAG_CREATE, NULL, &buf) == S_OK) path = buf; else return std::filesystem::path(); + CoTaskMemFree(buf); + return path / CONFIG_DIR; #elif defined(MACOSX) - return std::filesystem::path(osx::GetApplicationSupportDirectory()) / CONFIG_DIR; + std::string appsupport; + if (!osx::GetApplicationSupportDirectory(appsupport)) + return ""; + + return std::filesystem::path(appsupport) / CONFIG_DIR; #else // just assume POSIX std::filesystem::path path; const char* home = getenv("HOME"); + # ifdef __linux__ if (!home) home = getpwuid(getuid())->pw_dir; # endif // __linux__ + + /* only do this if the home directory was really found */ if (home) return std::filesystem::path(home) / ".config" / CONFIG_DIR; else