Fixed URLs that link to files

This commit is contained in:
cxziaho 2017-09-19 12:24:38 +12:00
parent a9d3cee60d
commit 12116311f3
2 changed files with 15 additions and 4 deletions

View File

@ -112,6 +112,7 @@ int getFieldFromHeader(const char *src, const char *field, const char **data, un
if (res < 0) {
*data = "";
*valueLen = 0;
res = 0;
}
ERROR_EXIT:

18
qr.c
View File

@ -143,9 +143,19 @@ int qr_scan_thread(SceSize args, void *argp) {
}
if (headerLen <= 0) {
initMessageDialog(SCE_MSG_DIALOG_BUTTON_TYPE_YESNO, language_container[QR_OPEN_WEBSITE], data);
setDialogStep(DIALOG_STEP_QR_OPEN_WEBSITE);
return sceKernelExitDeleteThread(0);
char *next;
fileName = strdup(data);
while ((next = strpbrk(fileName + 1, "\\/"))) fileName = next;
if (fileName != last_qr) fileName++;
char *ext = strrchr(fileName, '.');
if (ext) {
vpk = getFileType(fileName) == FILE_TYPE_VPK;
} else {
initMessageDialog(SCE_MSG_DIALOG_BUTTON_TYPE_YESNO, language_container[QR_OPEN_WEBSITE], data);
setDialogStep(DIALOG_STEP_QR_OPEN_WEBSITE);
return sceKernelExitDeleteThread(0);
}
} else {
if (strstr(headerData, "inline") != NULL) {
initMessageDialog(SCE_MSG_DIALOG_BUTTON_TYPE_YESNO, language_container[QR_OPEN_WEBSITE], data);
@ -254,7 +264,7 @@ NETWORK_FAILURE:
sceKernelDelayThread(10 * 1000);
}
initMessageDialog(SCE_MSG_DIALOG_BUTTON_TYPE_OK, language_container[QR_SHOW_CONTENTS], data);
initMessageDialog(SCE_MSG_DIALOG_BUTTON_TYPE_YESNO, language_container[QR_SHOW_CONTENTS], data);
setDialogStep(DIALOG_STEP_QR_SHOW_CONTENTS);
return sceKernelExitDeleteThread(0);
}