openbsd-ports/x11/gnome/devhelp/patches/patch-src_dh-assistant-view_c

38 lines
1.4 KiB
Plaintext

$OpenBSD: patch-src_dh-assistant-view_c,v 1.1 2009/03/19 14:36:53 ajacoutot Exp $
From upstream SVN rev 1265:
Use file: URIs instead of local paths, fixes use with more recent webkit
versions.
--- src/dh-assistant-view.c.orig Fri Nov 28 16:56:04 2008
+++ src/dh-assistant-view.c Thu Mar 19 15:28:11 2009
@@ -169,6 +169,7 @@ assistant_view_set_link (DhAssistantView *view,
gsize length;
gchar *key;
gsize key_length;
+ gsize offset = 0;
const gchar *start;
const gchar *end;
@@ -203,7 +204,10 @@ assistant_view_set_link (DhAssistantView *view,
return;
}
- file = g_mapped_file_new (filename, FALSE, NULL);
+ if (g_str_has_prefix (filename, "file://"))
+ offset = 7;
+
+ file = g_mapped_file_new (filename + offset, FALSE, NULL);
if (!file) {
g_free (filename);
return;
@@ -326,7 +330,7 @@ assistant_view_set_link (DhAssistantView *view,
* anchor links are handled internally in webkit.
*/
tmp = g_path_get_dirname (filename);
- base = g_strconcat ("file://", tmp, "/fake", NULL);
+ base = g_strconcat (tmp, "/fake", NULL);
g_free (tmp);
webkit_web_view_load_html_string (