diff options
author | Peter Hofmann <scm@uninformativ.de> | 2014-06-22 13:41:21 +0200 |
---|---|---|
committer | Peter Hofmann <scm@uninformativ.de> | 2014-06-22 14:17:09 +0200 |
commit | 491d711dbcbccfbe973ca08b84df2c649d2f3155 (patch) | |
tree | 8f09d3c6d81ae483e07070944e5bfdfec338ef3f | |
parent | f5b82c773f19a674572b85377d06eff97caabeb4 (diff) | |
download | lariza-491d711dbcbccfbe973ca08b84df2c649d2f3155.tar.gz |
No URLs specified? Open about:blank!
-rw-r--r-- | browser.c | 19 |
1 files changed, 11 insertions, 8 deletions
@@ -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); |