diff options
Diffstat (limited to 'games/xu4/profile_path.diff')
-rw-r--r-- | games/xu4/profile_path.diff | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/games/xu4/profile_path.diff b/games/xu4/profile_path.diff index b436ac55d98f1..0c5f2060628ac 100644 --- a/games/xu4/profile_path.diff +++ b/games/xu4/profile_path.diff @@ -1,29 +1,34 @@ -diff -Naur xu4-20111026_svn/src/settings.cpp xu4-20111026_svn.patched//src/settings.cpp ---- xu4-20111026_svn/src/settings.cpp 2011-06-23 13:36:06.000000000 -0400 -+++ xu4-20111026_svn.patched//src/settings.cpp 2011-10-27 17:27:02.000000000 -0400 -@@ -81,12 +81,6 @@ +diff -Naur xu4-1.2.1/src/settings.cpp xu4-1.2.1.patched/src/settings.cpp +--- xu4-1.2.1/src/settings.cpp 2022-12-06 13:21:00.000000000 -0500 ++++ xu4-1.2.1.patched/src/settings.cpp 2023-01-13 03:37:36.452626171 -0500 +@@ -55,15 +55,6 @@ * Initialize the settings. */ - void Settings::init(const bool useProfile, const string profileName) { -- if (useProfile) { -- userPath = "./profiles/"; -- userPath += profileName.c_str(); -- userPath += "/"; -- } else { + void Settings::init(const char* profileName) { +- if (profileName && profileName[0]) { +- userPath = "./profiles/"; +- userPath += profileName; +- userPath += "/"; - - #if defined(MACOSX) - FSRef folder; - OSErr err = FSFindFolder(kUserDomain, kApplicationSupportFolderType, kCreateFolder, &folder); -@@ -150,7 +144,12 @@ +- profile = profileName; +- if (profile.length() > 20) +- errorFatal("Profile name must be no more than 20 characters."); +- } else { + profile.clear(); + + #if defined(ANDROID) +@@ -123,6 +114,14 @@ userPath = "./"; #endif -+ if (useProfile) { -+ userPath += "profiles/"; -+ userPath += profileName.c_str(); -+ userPath += "/"; - } ++ if (profileName && profileName[0]) { ++ userPath += "profiles/"; ++ userPath += profileName; ++ userPath += "/"; + - FileSystem::createDirectory(userPath); ++ profile = profileName; ++ if (profile.length() > 20) ++ errorFatal("Profile name must be no more than 20 characters."); + } - filename = userPath + SETTINGS_BASE_FILENAME; + #ifndef ANDROID |