stat(path) before trying to launch a nro
This commit is contained in:
parent
65f23b0bde
commit
2024ef81ef
@ -68,6 +68,16 @@ static void launchFile(const char* path, argData_s* args)
|
|||||||
|
|
||||||
init_args(argBuf, sizeof(argBuf)-1, args->buf, sizeof(args->buf));
|
init_args(argBuf, sizeof(argBuf)-1, args->buf, sizeof(args->buf));
|
||||||
|
|
||||||
|
struct stat st;
|
||||||
|
|
||||||
|
if (stat(path, &st) == -1) {
|
||||||
|
memset(msg, 0, sizeof(msg));
|
||||||
|
snprintf(msg, sizeof(msg)-1, "Couldn't find executable: %s", path);
|
||||||
|
|
||||||
|
menuCreateMsgBox(780, 300, msg);
|
||||||
|
menuScan(".");
|
||||||
|
}
|
||||||
|
else {
|
||||||
Result rc = envSetNextLoad(path, argBuf);
|
Result rc = envSetNextLoad(path, argBuf);
|
||||||
if(R_FAILED(rc)) {
|
if(R_FAILED(rc)) {
|
||||||
memset(msg, 0, sizeof(msg));
|
memset(msg, 0, sizeof(msg));
|
||||||
@ -78,6 +88,7 @@ static void launchFile(const char* path, argData_s* args)
|
|||||||
else {
|
else {
|
||||||
uiExitLoop();
|
uiExitLoop();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const loaderFuncs_s loader_builtin =
|
const loaderFuncs_s loader_builtin =
|
||||||
|
Loading…
Reference in New Issue
Block a user