From 7bd65996343618eaba3493e65440fd50ca29107a Mon Sep 17 00:00:00 2001 From: Themaister Date: Sat, 28 Dec 2013 23:29:34 +0100 Subject: [PATCH] Fix -L arg when default libretro is set. --- general.h | 1 + retroarch.c | 2 ++ settings.c | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/general.h b/general.h index 493215e0c2..33125bba6a 100644 --- a/general.h +++ b/general.h @@ -356,6 +356,7 @@ struct global bool has_set_save_path; bool has_set_state_path; bool has_set_libretro_device[MAX_PLAYERS]; + bool has_set_libretro; #ifdef HAVE_RMENU char menu_texture_path[PATH_MAX]; diff --git a/retroarch.c b/retroarch.c index b0f362a591..abff5b0300 100644 --- a/retroarch.c +++ b/retroarch.c @@ -793,6 +793,7 @@ static void parse_input(int argc, char *argv[]) g_extern.libretro_dummy = false; g_extern.has_set_save_path = false; g_extern.has_set_state_path = false; + g_extern.has_set_libretro = false; if (argc < 2) { @@ -1015,6 +1016,7 @@ static void parse_input(int argc, char *argv[]) #ifdef HAVE_DYNAMIC case 'L': strlcpy(g_settings.libretro, optarg, sizeof(g_settings.libretro)); + g_extern.has_set_libretro = true; break; #endif diff --git a/settings.c b/settings.c index e79b1f7e55..4cfcdca284 100644 --- a/settings.c +++ b/settings.c @@ -417,7 +417,7 @@ void config_set_defaults(void) if (default_shader_dir) fill_pathname_expand_special(g_settings.video.shader_dir, default_shader_dir, sizeof(g_settings.video.shader_dir)); - if (default_libretro_path) + if (default_libretro_path && !g_extern.has_set_libretro) fill_pathname_expand_special(g_settings.libretro, default_libretro_path, sizeof(g_settings.libretro)); if (default_libretro_info_path) @@ -800,7 +800,7 @@ bool config_load_file(const char *path) CONFIG_GET_STRING(input.joypad_driver, "input_joypad_driver"); CONFIG_GET_STRING(input.keyboard_layout, "input_keyboard_layout"); - if (!*g_settings.libretro) + if (!g_extern.has_set_libretro) CONFIG_GET_PATH(libretro, "libretro_path"); CONFIG_GET_BOOL(fps_show, "fps_show");