From c1445526410d96c9feaad580b2ce3ab186c47b16 Mon Sep 17 00:00:00 2001 From: Patryk Obara Date: Fri, 17 Apr 2020 17:50:58 +0200 Subject: [PATCH] Avoid spaces in config file name on macOS There's no reason to having a different name for .conf file on every platform, it only makes things more difficult from user and developer perspective. --- src/misc/cross.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/misc/cross.cpp b/src/misc/cross.cpp index fb0c2d49..0518e543 100644 --- a/src/misc/cross.cpp +++ b/src/misc/cross.cpp @@ -152,15 +152,9 @@ void Cross::GetPlatformConfigDir(std::string& in) { in += CROSS_FILESPLIT; } -void Cross::GetPlatformConfigName(std::string& in) { -#ifdef WIN32 -#define DEFAULT_CONFIG_FILE "dosbox-" CONF_BRAND ".conf" -#elif defined(MACOSX) -#define DEFAULT_CONFIG_FILE "DOSBox " CONF_BRAND " Preferences" -#else /*linux freebsd*/ -#define DEFAULT_CONFIG_FILE "dosbox-" CONF_BRAND ".conf" -#endif - in = DEFAULT_CONFIG_FILE; +void Cross::GetPlatformConfigName(std::string &in) +{ + in = "dosbox-" CONF_BRAND ".conf"; } void Cross::CreatePlatformConfigDir(std::string &in) @@ -170,9 +164,9 @@ void Cross::CreatePlatformConfigDir(std::string &in) in += "\\DOSBox"; mkdir(in.c_str()); #elif defined(MACOSX) - in = "~/Library/Preferences"; + in = "~/Library/Preferences/DOSBox"; ResolveHomedir(in); - //Don't create it. Assume it exists + mkdir(in.c_str(), 0700); #else assert(!cached_conf_path.empty()); in = cached_conf_path.c_str();