Always use absolute path for config.home_dir

And by extension config.save_dir. This fixes an issue where paths
retrieved by system.GetSaveFolderName and then passed to gamedir_path
would become invalid.

Fixes #115
This commit is contained in:
Nunuhara Cabbage
2023-05-06 08:29:12 -07:00
parent e808d770a9
commit cff6272c18
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -224,7 +224,7 @@ static char *get_xsystem4_home(void)
}
// If all else fails, use the current directory
return xstrdup(".");
return realpath_utf8(".");
}
static char *get_save_path(const char *dir_name)
@@ -491,7 +491,7 @@ int main(int argc, char *argv[])
if (argc < 1) {
if (!config_init_with_dir(".")) {
if (!config_init_with_dir("../"))
if (!config_init_with_dir(".."))
usage_error("Failed to find game in current or parent directory");
}
} else if (argc > 1) {