From baf694d4f6c75d49c263031f759efe4a0eea38d9 Mon Sep 17 00:00:00 2001 From: Themaister Date: Fri, 11 Oct 2013 09:22:54 +0200 Subject: [PATCH] Move core_info string to front on Android. Searching for libretro_ at start of string would cause path to become empty. --- core_info.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core_info.c b/core_info.c index 19e00906d5..596c7bbeb4 100644 --- a/core_info.c +++ b/core_info.c @@ -61,13 +61,16 @@ core_info_list_t *core_info_list_new(const char *modules_path) // Android libs are deployed with a prefix 'lib' (libretro_*.so, etc) // Non-Android Libs (mobile/console) are deployed with a system name suffix (*_ios.dylib, *_qnx.so, etc). #ifdef ANDROID + size_t prefix_len = strlen("libretro_"); char *substr = strstr(info_path_base, "libretro_"); + if (substr && substr == info_path_base) + memmove(info_path_base, info_path_base + prefix_len, strlen(info_path_base) + 1 - prefix_len); #else char *substr = strrchr(info_path_base, '_'); -#endif if (substr) *substr = '\0'; #endif +#endif #ifdef ANDROID strlcat(info_path_base, "_libretro", sizeof(info_path_base));