Move core_info string to front on Android.

Searching for libretro_ at start of string would cause path to become
empty.
This commit is contained in:
Themaister 2013-10-11 09:22:54 +02:00
parent 48602cbdbb
commit baf694d4f6
1 changed files with 4 additions and 1 deletions

View File

@ -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));