summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosselin Mouette <jmouette@src.gnome.org>2008-12-23 21:20:48 +0000
committerJosselin Mouette <jmouette@src.gnome.org>2008-12-23 21:20:48 +0000
commitb04c4a6de9e5e7c98c5a3717c5c9e4a8f0f0f08a (patch)
tree99eecda2f90810ac56f1ac502d5de0359c32783c
parent3500f1bcf2d0feba3e87a7efb558e4b0052c9b06 (diff)
downloadyelp-b04c4a6de9e5e7c98c5a3717c5c9e4a8f0f0f08a.tar.gz
- Load local files with g_file_new_for_path. - Do not loop endlessly over
* src/yelp-window.c: (window_do_load_html): - Load local files with g_file_new_for_path. - Do not loop endlessly over the end of file while reading it. Fixes bug #562137 - fails to load local HTML files svn path=/trunk/; revision=3212
-rw-r--r--ChangeLog8
-rw-r--r--src/yelp-window.c7
2 files changed, 13 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 52a60782..8dc27a2d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-12-23 Josselin Mouette <joss@malsain.org>
+
+ * src/yelp-window.c: (window_do_load_html):
+ - Load local files with g_file_new_for_path.
+ - Do not loop endlessly over the end of file while
+ reading it.
+ Fixes bug #562137 - fails to load local HTML files
+
== 2.24.0 ==
2008-09-22 Don Scorgie <dscorgie@svn.gnome.org>
diff --git a/src/yelp-window.c b/src/yelp-window.c
index 01c0f8c3..8f5c4056 100644
--- a/src/yelp-window.c
+++ b/src/yelp-window.c
@@ -1631,7 +1631,10 @@ window_do_load_html (YelpWindow *window,
window_setup_window (window, type, uri, frag_id, uri, priv->base_uri, need_history);
- file = g_file_new_for_uri (uri);
+ if (uri[0] == '/')
+ file = g_file_new_for_path (uri);
+ else
+ file = g_file_new_for_uri (uri);
stream = g_file_read (file, NULL, NULL);
if (stream == NULL) {
@@ -1667,7 +1670,7 @@ window_do_load_html (YelpWindow *window,
}
while ((g_input_stream_read_all
- ((GInputStream *)stream, buffer, BUFFER_SIZE, &n, NULL, NULL))) {
+ ((GInputStream *)stream, buffer, BUFFER_SIZE, &n, NULL, NULL)) && n) {
gchar *tmp;
tmp = g_utf8_strup (buffer, n);
if (strstr (tmp, "<FRAMESET")) {