From 10aa19f7b748385fa08f99a0766dac837ee9522a Mon Sep 17 00:00:00 2001 From: "Haelwenn (lanodan) Monnier" Date: Sun, 15 Dec 2019 19:17:31 +0100 Subject: badwolf_ensure_uri_scheme(): Fix const discarding --- badwolf.c | 6 +++--- badwolf.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/badwolf.c b/badwolf.c index 289e218..bf42eb2 100644 --- a/badwolf.c +++ b/badwolf.c @@ -62,8 +62,8 @@ static void closeCb_clicked(GtkButton *close, gpointer user_data); static void notebookCb_switch__page(GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer user_data); -gchar * -badwolf_ensure_uri_scheme(gchar *text, gboolean try_file) +const gchar * +badwolf_ensure_uri_scheme(const gchar *text, gboolean try_file) { SoupURI *uri = soup_uri_new(text); @@ -535,7 +535,7 @@ SearchEntryCb_stop__search(GtkSearchEntry *search, gpointer user_data) } struct Client * -new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web_view) +new_browser(struct Window *window, const gchar *target_url, WebKitWebView *related_web_view) { struct Client *browser = malloc(sizeof(struct Client)); target_url = badwolf_ensure_uri_scheme(target_url, (related_web_view == NULL)); diff --git a/badwolf.h b/badwolf.h index 4c9fa65..971ffa3 100644 --- a/badwolf.h +++ b/badwolf.h @@ -41,11 +41,11 @@ struct Client * In the end use the fallback (`http://` for now, might get configuration), * might get some safeguard. */ -gchar *badwolf_ensure_uri_scheme(gchar *text, gboolean try_file); +const gchar *badwolf_ensure_uri_scheme(const gchar *text, gboolean try_file); GtkWidget *badwolf_new_tab_box(const gchar *title, struct Client *browser); void webView_tab_label_change(struct Client *browser, const gchar *title); struct Client * -new_browser(struct Window *window, gchar *target_url, WebKitWebView *related_web_view); +new_browser(struct Window *window, const gchar *target_url, WebKitWebView *related_web_view); int badwolf_new_tab(GtkNotebook *notebook, struct Client *browser); gint badwolf_get_tab_position(GtkContainer *notebook, GtkWidget *child); #endif /* BADWOLF_H_INCLUDED */ -- cgit v1.3.1-23-gd82d