After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 562137 - Yelp fails to show a local HTML file
Yelp fails to show a local HTML file
Status: RESOLVED FIXED
Product: yelp
Classification: Applications
Component: General
2.24.x
Other Linux
: Normal normal
: ---
Assigned To: Yelp maintainers
Yelp maintainers
: 554016 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2008-11-24 15:49 UTC by Pedro Villavicencio
Modified: 2009-03-01 21:45 UTC
See Also:
GNOME target: ---
GNOME version: 2.23/2.24


Attachments
Handle path to files as well as URIs (630 bytes, patch)
2008-12-23 20:40 UTC, Josselin Mouette
needs-work Details | Review
Do not loop indefinitely over EOF (591 bytes, patch)
2008-12-23 20:43 UTC, Josselin Mouette
accepted-commit_now Details | Review

Description Pedro Villavicencio 2008-11-24 15:49:49 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,
Comment 1 Pedro Villavicencio 2008-12-09 00:34:10 UTC
*** Bug 554016 has been marked as a duplicate of this bug. ***
Comment 2 Josselin Mouette 2008-12-23 20:40:57 UTC
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.
Comment 3 Josselin Mouette 2008-12-23 20:43:03 UTC
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.
Comment 4 Shaun McCance 2008-12-23 20:54:47 UTC
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.
Comment 5 Josselin Mouette 2008-12-23 21:21:47 UTC
Committed (r3212), with the suggested modification.