GNOME Bugzilla – Bug 562137
Yelp fails to show a local HTML file
Last modified: 2009-03-01 21:45:51 UTC
this report has been filed here: https://bugs.edge.launchpad.net/yelp/+bug/294906 "In Ubuntu 8.04 (GNOME 2.22) Yelp worked fine with local files, like DeVeDe help: yelp file:///usr/share/doc/devede/html/main.html I upgraded to Ubuntu 8.10 (GNOME 2.24) and now Yelp shows an error: Can't read the file. The file is owned by root, but has worldwide read access, and can be read with less." Thanks,
*** Bug 554016 has been marked as a duplicate of this bug. ***
Created attachment 125225 [details] [review] Handle path to files as well as URIs Two issues prevent local HTML file viewing from working. This patch fixes the first one: local files are stripped of the file:// prefix in yelp_uri_resolve, but g_file_new_for_uri doesn’t support file paths as GnomeVFS used to.
Created attachment 125229 [details] [review] Do not loop indefinitely over EOF This patch fixes the second issue: g_input_stream_read_all still returns TRUE at EOF; you have to check the number of read bytes, otherwise it will loop endlessly.
Minor nitpick: Could you please change *uri to uri[0]? It just reads nicer. Other than that, this is great, thanks. If you have SVN access, please commit to trunk.
Committed (r3212), with the suggested modification.