From 1da974e3fa7344d351db399b1cc2ab8708bc788a Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 28 Nov 2022 10:32:45 +0100 Subject: [PATCH] fs/StandardDirectory: use PACKAGE_NAME from version.h --- src/fs/StandardDirectory.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/fs/StandardDirectory.cxx b/src/fs/StandardDirectory.cxx index 761ffa0d5..ec2e3af04 100644 --- a/src/fs/StandardDirectory.cxx +++ b/src/fs/StandardDirectory.cxx @@ -53,6 +53,12 @@ #include "Main.hxx" #endif +#ifdef USE_XDG +#include "Version.h" // for PACKAGE_NAME +#define APP_FILENAME PATH_LITERAL(PACKAGE_NAME) +static constexpr Path app_filename = Path::FromFS(APP_FILENAME); +#endif + #if !defined(_WIN32) && !defined(ANDROID) class PasswdEntry { @@ -307,7 +313,7 @@ GetAppRuntimeDir() noexcept #ifdef USE_XDG if (const auto user_dir = GetUserRuntimeDir(); !user_dir.IsNull()) { - auto dir = user_dir / Path::FromFS("mpd"); + auto dir = user_dir / app_filename; mkdir(dir.c_str(), 0777); return dir; }