Only set CORE_TYPE_PLAIN for non-directory -L.

Fixes crash on Android startup which uses -L <core-dir> CLI argument.

-L can also set core directory, even though it's not supposed to
be used anymore.

Also, on Android, the cores directory might not be populated, so ignore
arguments which are not valid.
This commit is contained in:
Hans-Kristian Arntzen 2016-03-23 00:46:15 +01:00
parent 23c8150b6e
commit b96d365968

View File

@ -829,14 +829,20 @@ static void parse_input(int argc, char *argv[])
"Setting libretro_directory to \"%s\" instead.\n",
optarg);
}
else
else if (path_file_exists(optarg))
{
runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, optarg);
global->has_set.libretro = true;
/* We requested explicit core, so use PLAIN core type. */
current_core_type = CORE_TYPE_PLAIN;
}
else
{
RARCH_WARN("--libretro argument \"%s\" is neither a file nor directory. Ignoring.\n",
optarg);
}
/* We requested explicit core, so use PLAIN core type. */
current_core_type = CORE_TYPE_PLAIN;
break;
#endif
case 'P':