minor code cleanup
authorHolger Schemel <info@artsoft.org>
Fri, 10 Jun 2022 09:32:12 +0000 (11:32 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 10 Jun 2022 09:32:12 +0000 (11:32 +0200)
src/main.c

index 3ef3df989bd6e5380d6ce39a64db2bf9b4b23fab..1cf3c9e6162e9fd429edf1440630a2cab189fa64 100644 (file)
@@ -7799,9 +7799,6 @@ static void InitProgramConfig(char *command_filename)
   char *config_filename = getProgramConfigFilename(command_filename);
   char *userdata_basename = getBaseNameNoSuffix(command_filename);
   char *userdata_subdir;
-#if defined(PLATFORM_UNIX)
-  char *userdata_subdir_unix;
-#endif
 
   // read default program config, if existing
   if (fileExists(config_filename))
@@ -7819,11 +7816,6 @@ static void InitProgramConfig(char *command_filename)
     LoadSetupFromFilename(config_filename);
   }
 
-#if defined(PLATFORM_UNIX)
-  // set user data directory for Linux/Unix (but not Mac OS X)
-  userdata_subdir_unix = getStringCat2(".", userdata_basename);
-#endif
-
   // set program title from potentially redefined program title
   if (setup.internal.program_title != NULL &&
       strlen(setup.internal.program_title) > 0)
@@ -7842,7 +7834,7 @@ static void InitProgramConfig(char *command_filename)
 #if defined(PLATFORM_WIN32) || defined(PLATFORM_MACOSX) || defined(PLATFORM_EMSCRIPTEN)
   userdata_subdir = program_title;
 #elif defined(PLATFORM_UNIX)
-  userdata_subdir = userdata_subdir_unix;
+  userdata_subdir = getStringCat2(".", userdata_basename);
 #else
   userdata_subdir = USERDATA_DIRECTORY_OTHER;
 #endif