stat(path) before trying to launch a nro (#129)
This commit is contained in:
parent
95411fe5e9
commit
aef37e10f7
@ -133,6 +133,12 @@ const char* const g_strings[StrId_Max][17] =
|
|||||||
STR_ZH_HANT("開啓檔案失敗:\n%s"),
|
STR_ZH_HANT("開啓檔案失敗:\n%s"),
|
||||||
},
|
},
|
||||||
|
|
||||||
|
[StrId_NroNotFound] =
|
||||||
|
{
|
||||||
|
STR_EN("Could not find executable: %s"),
|
||||||
|
STR_FR("Impossible trouver l'exécutable : %s"),
|
||||||
|
},
|
||||||
|
|
||||||
[StrId_NoAppsFound_Title] =
|
[StrId_NoAppsFound_Title] =
|
||||||
{
|
{
|
||||||
STR_EN("No applications found"),
|
STR_EN("No applications found"),
|
||||||
|
@ -11,6 +11,7 @@ typedef enum
|
|||||||
StrId_DefaultPublisher,
|
StrId_DefaultPublisher,
|
||||||
StrId_IOError,
|
StrId_IOError,
|
||||||
StrId_CouldNotOpenFile,
|
StrId_CouldNotOpenFile,
|
||||||
|
StrId_NroNotFound,
|
||||||
|
|
||||||
StrId_NoAppsFound_Title,
|
StrId_NoAppsFound_Title,
|
||||||
StrId_NoAppsFound_Msg,
|
StrId_NoAppsFound_Msg,
|
||||||
|
@ -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, textGetString(StrId_NroNotFound), 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