summaryrefslogtreecommitdiff
path: root/src/app.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/app.c')
-rw-r--r--src/app.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/app.c b/src/app.c
index 3767495c..d06aeaac 100644
--- a/src/app.c
+++ b/src/app.c
@@ -634,11 +634,10 @@ iBool handleCommand_App(const char *cmd) {
634 return iTrue; 634 return iTrue;
635 } 635 }
636 else if (equal_Command(cmd, "open")) { 636 else if (equal_Command(cmd, "open")) {
637 const iString *url = collect_String(newCStr_String(suffixPtr_Command(cmd, "url"))); 637 const iString *url = collectNewCStr_String(suffixPtr_Command(cmd, "url"));
638 iUrl parts; 638 iUrl parts;
639 init_Url(&parts, url); 639 init_Url(&parts, url);
640 if (equalCase_Rangecc(parts.scheme, "http") || 640 if (equalCase_Rangecc(parts.scheme, "http") || equalCase_Rangecc(parts.scheme, "https")) {
641 equalCase_Rangecc(parts.scheme, "https")) {
642 openInDefaultBrowser_App(url); 641 openInDefaultBrowser_App(url);
643 return iTrue; 642 return iTrue;
644 } 643 }
@@ -648,8 +647,9 @@ iBool handleCommand_App(const char *cmd) {
648 } 647 }
649 iHistory *history = history_DocumentWidget(doc); 648 iHistory *history = history_DocumentWidget(doc);
650 const iBool isHistory = argLabel_Command(cmd, "history") != 0; 649 const iBool isHistory = argLabel_Command(cmd, "history") != 0;
650 int redirectCount = argLabel_Command(cmd, "redirect");
651 if (!isHistory) { 651 if (!isHistory) {
652 if (argLabel_Command(cmd, "redirect")) { 652 if (redirectCount) {
653 replace_History(history, url); 653 replace_History(history, url);
654 } 654 }
655 else { 655 else {
@@ -658,6 +658,7 @@ iBool handleCommand_App(const char *cmd) {
658 } 658 }
659 visitUrl_Visited(d->visited, url); 659 visitUrl_Visited(d->visited, url);
660 setInitialScroll_DocumentWidget(doc, argfLabel_Command(cmd, "scroll")); 660 setInitialScroll_DocumentWidget(doc, argfLabel_Command(cmd, "scroll"));
661 setRedirectCount_DocumentWidget(doc, redirectCount);
661 setUrlFromCache_DocumentWidget(doc, url, isHistory); 662 setUrlFromCache_DocumentWidget(doc, url, isHistory);
662 } 663 }
663 else if (equal_Command(cmd, "document.request.cancelled")) { 664 else if (equal_Command(cmd, "document.request.cancelled")) {