logo

badwolf

Minimalist and privacy-oriented WebKitGTK+ browser
commit: 0c8f21f4584dba758bb1e59b1946f5fbde4a2968
parent: c48c49ab9b60f74e496dfee94a3461637bc5970f
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Sat, 18 May 2019 17:15:59 +0200

badwolf.c: Document ensure_uri_scheme function behavior

Diffstat:

Mbadwolf.c11+++++++++++
1 file changed, 11 insertions(+), 0 deletions(-)

diff --git a/badwolf.c b/badwolf.c @@ -95,6 +95,17 @@ static void notebookCb_switch__page(GtkNotebook *notebook, GtkWidget *page, guint page_num, gpointer user_data); gint get_tab_position(GtkContainer *notebook, GtkWidget *child); +/* ensure_uri_scheme: tries to add a scheme on a pseudo-URL missing a scheme + * - gchar text: pseudo-URL missing a scheme + * - gboolean try_file: when TRUE check try first if it can be a file:// path + * + * When `text` isn't exploitable (ie. NULL), returns "about:blank", + * when the URL seems to be valid, return it, + * if try_file is TRUE, check if it can be file:// path, + * some other checks might be added. + * In the end use the fallback (`http://` for now, might get configuration), + * might get some safeguard. + */ gchar * ensure_uri_scheme(gchar *text, gboolean try_file) {