From 3fe70b9d6c9ce78eece2c6dd8d7ead682278833b Mon Sep 17 00:00:00 2001 From: ketmar Date: Thu, 7 Aug 2014 08:54:19 +0300 Subject: [PATCH] respect https prefix --- src/imagelink.c | 2 +- src/link.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/imagelink.c b/src/imagelink.c index 1ae75b4..b054869 100644 --- a/src/imagelink.c +++ b/src/imagelink.c @@ -97,7 +97,7 @@ static void make_dialog (ImageDlg *idlg, GtkWindow *win) { static gboolean is_image_link (const char *str) { if (!str) return FALSE; - return (g_str_has_prefix(str, "http://") || g_str_has_prefix(str, "ftp://")); + return (g_str_has_prefix(str, "http://") || g_str_has_prefix(str, "https://") || g_str_has_prefix(str, "ftp://")); } diff --git a/src/link.c b/src/link.c index 1833d30..9f47526 100644 --- a/src/link.c +++ b/src/link.c @@ -135,6 +135,7 @@ has_url(char *buf) { if (!buf || buf[0] == 0) return FALSE; /* just test a few of the obvious ones... */ if (g_str_has_prefix(buf, "http://") || + g_str_has_prefix(buf, "https://") || g_str_has_prefix(buf, "ftp://") || g_str_has_suffix(buf, ".com") || g_str_has_suffix(buf, ".net") || @@ -162,6 +163,7 @@ prepopulate_fields(LinkDialog *ld, char *bufsel) { if (url) { char *niceurl; if (g_str_has_prefix(url, "http://") || + g_str_has_prefix(url, "https://") || g_str_has_prefix(url, "ftp://")) { niceurl = url; } else { -- 2.11.4.GIT