Merge pull request #11907 from pcjco/wii-usb1

Issue when argv[0] is usb1:/... on Wii
This commit is contained in:
Autechre 2021-01-20 04:36:59 +01:00 committed by GitHub
commit 8359cfc29c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,6 +192,12 @@ static void frontend_gx_get_env(
* as a result the cfg file is not found. */
if (*argc > 2 && argv[1] != NULL && argv[2] != NULL)
{
if (strncmp("usb1", argv[0], 4) == 0 || strncmp("usb2", argv[0], 4) == 0)
{
strncpy(g_defaults.dirs[DEFAULT_DIR_CORE],argv[0], strlen(argv[0]));
strncpy(g_defaults.dirs[DEFAULT_DIR_CORE]," usb", 4);
memmove(g_defaults.dirs[DEFAULT_DIR_CORE], g_defaults.dirs[DEFAULT_DIR_CORE]+1, strlen(g_defaults.dirs[DEFAULT_DIR_CORE]));
}
if(gx_devices[GX_DEVICE_SD].mounted)
{
chdir("sd:/");