diff options
-rw-r--r-- | src/web-view.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/web-view.c b/src/web-view.c index 8acb939..c6ff0ad 100644 --- a/src/web-view.c +++ b/src/web-view.c @@ -965,10 +965,16 @@ save_mhtml(MqWebView *web_view, GFile *file) static gchar * get_clean_title(MqWebView *web_view) { - gchar *title; + const gchar *title; - title = g_strdup(webkit_web_view_get_title(WEBKIT_WEB_VIEW(web_view))); - return g_strdelimit(title, + title = webkit_web_view_get_title(WEBKIT_WEB_VIEW(web_view)); + if (!title || title[0] == '\0') { + title = web_view->uri; + } + if (!title || title[0] == '\0') { + title = "page"; + } + return g_strdelimit(g_strdup(title), #ifdef G_OS_WIN32 "/\\:*\"?<>|", #else |