From e1cc0c3160a7337649d431cf642b47d03704e20a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 25 Aug 2013 13:17:11 +0200 Subject: [PATCH] RETRO_ENVIRONMENT_SET_LIBRETRO_PATH - returns false if path file doesn't exist --- dynamic.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dynamic.c b/dynamic.c index 34d4ea48a9..17cc937d83 100644 --- a/dynamic.c +++ b/dynamic.c @@ -758,7 +758,11 @@ bool rarch_environment_cb(unsigned cmd, void *data) case RETRO_ENVIRONMENT_SET_LIBRETRO_PATH: RARCH_LOG("Environ (Private) SET_LIBRETRO_PATH.\n"); - strlcpy(g_settings.libretro, (const char*)data, sizeof(g_settings.libretro)); + + if (path_file_exists((const char*)data)) + strlcpy(g_settings.libretro, (const char*)data, sizeof(g_settings.libretro)); + else + return false; break; case RETRO_ENVIRONMENT_EXEC: