From f53e4865da54b1f9fd13b575dd0f39054614fdb6 Mon Sep 17 00:00:00 2001 From: Cem Keylan Date: Wed, 29 Sep 2021 10:58:39 +0300 Subject: LARIZA_SEARCH_ENGINE: add optional environment variable --- browser.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'browser.c') diff --git a/browser.c b/browser.c index b47bdeb..3c58152 100644 --- a/browser.c +++ b/browser.c @@ -91,6 +91,7 @@ gboolean cooperative_alone = TRUE; gboolean cooperative_instances = TRUE; int cooperative_pipe_fp = 0; gchar *download_dir = "/var/tmp"; +gchar *search_engine = SEARCH_ENGINE; gboolean enable_console_to_stdout = FALSE; gchar *fifo_suffix = "main"; gdouble global_zoom = 1.0; @@ -670,7 +671,7 @@ ensure_uri_scheme(const gchar *t) } else { if (g_str_has_prefix(f, "!/")) - f = g_strdup_printf(SEARCH_ENGINE, t + 2); + f = g_strdup_printf(search_engine, t + 2); else f = g_strdup_printf("http://%s", t); } @@ -707,6 +708,10 @@ grab_environment_configuration(void) if (e != NULL) download_dir = g_strdup(e); + e = g_getenv(__NAME_UPPERCASE__"_SEARCH_ENGINE"); + if (e != NULL) + search_engine = g_strdup(e); + e = g_getenv(__NAME_UPPERCASE__"_ENABLE_CONSOLE_TO_STDOUT"); if (e != NULL) enable_console_to_stdout = TRUE; -- cgit v1.2.3