summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Scorgie <dscorgie@src.gnome.org>2007-08-07 18:37:33 +0000
committerDon Scorgie <dscorgie@src.gnome.org>2007-08-07 18:37:33 +0000
commit11d7398fb480532f035fc215151b9fff9853f844 (patch)
tree61226efb7f4f9acd2e53f9907cc6aa73bbdefdff
parent1653989e7a1f536aefd7a192405d21ffeadb590d (diff)
downloadyelp-11d7398fb480532f035fc215151b9fff9853f844.tar.gz
Resolve a full path within a ghelp uri correctly (bug #464295)
* src/yelp-utils.c: Resolve a full path within a ghelp uri correctly (bug #464295) svn path=/trunk/; revision=2874
-rw-r--r--ChangeLog4
-rw-r--r--src/yelp-utils.c9
2 files changed, 13 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2088c117..f0645c09 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2007-08-07 Don Scorgie <dscorgie@svn.gnome.org>
+ * src/yelp-utils.c:
+ Resolve a full path within a ghelp uri
+ correctly (bug #464295)
+
* src/yelp-gecko-services.cpp:
* src/yelp-debug.c:
reduce relocations by removing unnecessarily
diff --git a/src/yelp-utils.c b/src/yelp-utils.c
index 59a0fad4..3a0436aa 100644
--- a/src/yelp-utils.c
+++ b/src/yelp-utils.c
@@ -82,6 +82,15 @@ resolve_process_ghelp (char *uri, gchar **result)
else if (g_str_equal (mime, "application/xhtml+xml"))
type = YELP_RRN_TYPE_XHTML;
+ } else {
+ gint file_cut = 6;
+ /* If a full file path after ghelp:, see if the file
+ * exists and return type if it does
+ */
+ while (uri[file_cut] == '/' && uri[file_cut+1] == '/')
+ file_cut++;
+ type = resolve_full_file (&uri[file_cut]);
+ *result = g_strdup (&uri[file_cut]);
}
return type;