Skip to content

Commit

Permalink
dugh
Browse files Browse the repository at this point in the history
  • Loading branch information
israpps committed Feb 27, 2024
1 parent 2e52cb1 commit db80341
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/filer.c
Original file line number Diff line number Diff line change
Expand Up @@ -3945,7 +3945,7 @@ int getFilePath(char *out, int cnfmode)
browser_pushed = FALSE;
sprintf(msg0, "%s.", LNG(This_file_isnt_an_ELF));
out[0] = 0;
} else if ( ((cnfmode == USBD_IRX_CNF) || (cnfmode == USBKBD_IRX_CNF) || (cnfmode == USBMASS_IRX_CNF))&&(checkELFheader(out, TRUE) < 0) ) {
} else if (((cnfmode == USBD_IRX_CNF) || (cnfmode == USBKBD_IRX_CNF) || (cnfmode == USBMASS_IRX_CNF))&&(checkELFheader(out, TRUE) < 0) ) {
browser_pushed = FALSE;
sprintf(msg0, "%s.", LNG(This_file_isnt_an_IRX));
out[0] = 0;
Expand Down
25 changes: 16 additions & 9 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1871,17 +1871,17 @@ static void load_irx_manual(void)
char IRX_path[MAX_PATH];
char *tmp;

if (getFilePath(IRX_path, USBKBD_IRX_CNF)>0)
return;
getFilePath(IRX_path, USBKBD_IRX_CNF);
}
static void load_irx_dlg(char* IRX_path) {
if (exists(IRX_path)) {
tmp = strrchr(IRX_path, '/');
if (tmp == NULL)
tmp = "IRX LOAD";
else
tmp++;
id = SifLoadStartModule(IRX_path, 0, NULL, &ret);
sprintf(mainMsg, "%s: id:%d, ret:%d (%s)", tmp, id, ret, (id>0 && ret != 1) ? LNG(OK) : LNG(Failed));
DPRINTF(mainMsg);
if (tmp == NULL) tmp = "IRX LOAD"; else tmp++;
if (ynDialog("do you want to load this IRX module?") > 0) {
id = SifLoadStartModule(IRX_path, 0, NULL, &ret);
sprintf(mainMsg, "%s: id:%d, ret:%d (%s)", tmp, id, ret, (id>0 && ret != 1) ? LNG(OK) : LNG(Failed));
DPRINTF(mainMsg);
}
}
}
//------------------------------
Expand Down Expand Up @@ -2432,6 +2432,8 @@ static void Execute(char *pathin)
CheckELF_fullpath:
if ((t = checkELFheader(fullpath, FALSE)) <= 0)
goto ELFnotFound;
if ((t = checkELFheader(fullpath, TRUE)) <= 0)
goto IRXNotFound; else goto LoadIRX;
ELFchecked:
CleanUp();
RunLoaderElf(fullpath, party);
Expand All @@ -2443,6 +2445,11 @@ static void Execute(char *pathin)
else
sprintf(mainMsg, "%s: %s.", LNG(This_file_isnt_an_ELF), fullpath);
return;
IRXNotFound:
sprintf(mainMsg, "%s: %s.", LNG(This_file_isnt_an_IRX), fullpath);
return;
LoadIRX:
load_irx_dlg(fullpath);
}
}
//------------------------------
Expand Down

0 comments on commit db80341

Please sign in to comment.