]> git.armaanb.net Git - chorizo.git/commitdiff
No URLs specified? Open about:blank!
authorPeter Hofmann <scm@uninformativ.de>
Sun, 22 Jun 2014 11:41:21 +0000 (13:41 +0200)
committerPeter Hofmann <scm@uninformativ.de>
Sun, 22 Jun 2014 12:17:09 +0000 (14:17 +0200)
browser.c

index b79e29d070f2c982c6fb0d2be8cdc03cd83a1bff..14b02bc7ca5d2849a5f5bd812c9be8c5a0ae47cd 100644 (file)
--- a/browser.c
+++ b/browser.c
@@ -76,7 +76,7 @@ static gchar *download_dir = "/tmp";
 static gint downloads_indicated = 0;
 static Window embed = 0;
 static gchar *fifo_suffix = "main";
-static gchar *first_uri = NULL;
+static gchar *first_uri = "about:blank";
 static gdouble global_zoom = 1.0;
 static GHashTable *keywords = NULL;
 static gboolean language_is_set = FALSE;
@@ -925,7 +925,7 @@ tabbed_launch(void)
 void
 usage(void)
 {
-       fprintf(stderr, "Usage: "__NAME__" [OPTION]... <URI>...\n");
+       fprintf(stderr, "Usage: "__NAME__" [OPTION]... [URI]...\n");
        exit(EXIT_FAILURE);
 }
 
@@ -961,9 +961,6 @@ main(int argc, char **argv)
                }
        }
 
-       if (optind >= argc)
-               usage();
-
        adblock_load();
        keywords_load();
        cooperation_setup();
@@ -972,9 +969,15 @@ main(int argc, char **argv)
        if (tabbed_automagic && !(cooperative_instances && !cooperative_alone))
                embed = tabbed_launch();
 
-       first_uri = g_strdup(argv[optind]);
-       for (i = optind; i < argc; i++)
-               client_new(argv[i]);
+       if (optind >= argc)
+               client_new(first_uri);
+       else
+       {
+               first_uri = g_strdup(argv[optind]);
+               for (i = optind; i < argc; i++)
+                       client_new(argv[i]);
+       }
+
        if (!cooperative_instances || cooperative_alone)
                gtk_main();
        exit(EXIT_SUCCESS);