summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-03-15 14:47:43 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-03-15 14:47:43 +0200
commit94a517651ccd3945088224de3869bd550d99b835 (patch)
tree8db1ac01e29dd52362d5e1949af54fe4fd62c7b9
parent5420571976e8b2c7378232cf3e044cf2f78749f9 (diff)
App: Decode URLs passed via command line arguments
-rw-r--r--src/app.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/app.c b/src/app.c
index 6261c74b..6a6c5b7d 100644
--- a/src/app.c
+++ b/src/app.c
@@ -540,14 +540,13 @@ static void init_App_(iApp *d, int argc, char **argv) {
540 startsWithCase_Rangecc(arg, "finger:") || startsWithCase_Rangecc(arg, "file:") || 540 startsWithCase_Rangecc(arg, "finger:") || startsWithCase_Rangecc(arg, "file:") ||
541 startsWithCase_Rangecc(arg, "data:") || startsWithCase_Rangecc(arg, "about:"); 541 startsWithCase_Rangecc(arg, "data:") || startsWithCase_Rangecc(arg, "about:");
542 if (isKnownScheme || fileExistsCStr_FileInfo(cstr_Rangecc(arg))) { 542 if (isKnownScheme || fileExistsCStr_FileInfo(cstr_Rangecc(arg))) {
543 pushBack_StringList( 543 iString *decUrl =
544 openCmds, 544 isKnownScheme ? urlDecodeExclude_String(collectNewRange_String(arg), "/?#:")
545 collectNewFormat_String("open newtab:%d url:%s", 545 : makeFileUrl_String(collectNewRange_String(arg));
546 newTab, 546 pushBack_StringList(openCmds,
547 isKnownScheme 547 collectNewFormat_String(
548 ? cstr_Rangecc(arg) 548 "open newtab:%d url:%s", newTab, cstr_String(decUrl)));
549 : cstrCollect_String(makeFileUrl_String( 549 delete_String(decUrl);
550 collectNewRange_String(arg)))));
551 newTab = iTrue; 550 newTab = iTrue;
552 } 551 }
553 else { 552 else {