diff options
Diffstat (limited to 'pkgs/games/gimx/env.patch')
-rw-r--r-- | pkgs/games/gimx/env.patch | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/pkgs/games/gimx/env.patch b/pkgs/games/gimx/env.patch new file mode 100644 index 000000000000..e1f8ed8bb6f1 --- /dev/null +++ b/pkgs/games/gimx/env.patch @@ -0,0 +1,30 @@ +--- a/core/config_reader.c ++++ b/core/config_reader.c +@@ -1353,8 +1353,10 @@ static int read_file(char* file_path) + int read_config_file(const char* file) + { + char file_path[PATH_MAX]; +- +- snprintf(file_path, sizeof(file_path), "%s%s%s%s", gimx_params.homedir, GIMX_DIR, CONFIG_DIR, file); ++ char* e = getenv("GIMXCONF"); if (e) { snprintf(file_path, sizeof(file_path), "%s/%s", e, file); } ++ else { ++ snprintf(file_path, sizeof(file_path), "%s%s%s%s", gimx_params.homedir, GIMX_DIR, CONFIG_DIR, file); ++ } + + if(read_file(file_path) == -1) + { +--- a/core/gimx.c ++++ b/core/gimx.c +@@ -190,8 +190,10 @@ void show_config() + } + + char file_path[PATH_MAX]; +- +- snprintf(file_path, sizeof(file_path), "%s%s%s%s", gimx_params.homedir, GIMX_DIR, CONFIG_DIR, gimx_params.config_file); ++ char* e = getenv("GIMXCONF"); if (e) { snprintf(file_path, sizeof(file_path), "%s/%s", e, gimx_params.config_file); } ++ else { ++ snprintf(file_path, sizeof(file_path), "%s%s%s%s", gimx_params.homedir, GIMX_DIR, CONFIG_DIR, gimx_params.config_file); ++ } + + FILE * fp = gfile_fopen(file_path, "r"); + if (fp == NULL) |