summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDon Scorgie <dscorgie@src.gnome.org>2006-05-23 11:49:44 +0000
committerDon Scorgie <dscorgie@src.gnome.org>2006-05-23 11:49:44 +0000
commit12417a7d368a0a3189ba405ad79094c5aed4cf0c (patch)
treebbe14fba9a4c89560d0d3b03b18ece95843002b8
parent04693ee4826e57e55b9e15c5af527efce05fc021 (diff)
downloadyelp-12417a7d368a0a3189ba405ad79094c5aed4cf0c.tar.gz
If an info file doesn't exist, default to showing the man page Fixes bug
* src/yelp-utils.c: If an info file doesn't exist, default to showing the man page Fixes bug #341627
-rw-r--r--ChangeLog3
-rw-r--r--src/yelp-utils.c20
2 files changed, 21 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 893256b0..a5f99ec8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,9 @@
2006-05-23 Don Scorgie <dscorgie@cvs.gnome.org>
* src/yelp-utils.c:
+ If an info file doesn't exist, default to showing the man page
+ Fixes bug #341627
+
* src/yelp-info-parser.c:
Fix loading of info pages from subdirectories (emacs).
(Stupid info page workaround #3)
diff --git a/src/yelp-utils.c b/src/yelp-utils.c
index 62943a3b..a84ea9d8 100644
--- a/src/yelp-utils.c
+++ b/src/yelp-utils.c
@@ -164,8 +164,14 @@ yelp_doc_info_new (const gchar *uri, gboolean trust_uri)
}
else if (g_str_has_prefix (full_uri, "info:")) {
doc_uri = convert_info_uri (full_uri);
- doc_type = YELP_DOC_TYPE_INFO;
- uri_type = YELP_URI_TYPE_INFO;
+ if (!g_str_has_prefix (doc_uri, "man:")) {
+ doc_type = YELP_DOC_TYPE_INFO;
+ uri_type = YELP_URI_TYPE_INFO;
+ } else {
+ doc_uri = convert_man_uri (doc_uri, trust_uri);
+ doc_type = YELP_DOC_TYPE_MAN;
+ uri_type = YELP_URI_TYPE_MAN;
+ }
}
else if (g_str_has_prefix (full_uri, "x-yelp-toc:")) {
doc_uri = g_strdup ("file://" DATADIR "/yelp/toc.xml");
@@ -1002,6 +1008,15 @@ convert_info_uri (gchar *uri)
}
}
+ /* If we got this far and doc_uri is still NULL, we resort to looking
+ * for a man page. Let above handle that. We just let it know that
+ * somethings gotta be done */
+ if (doc_uri == NULL) {
+ gchar *tmp;
+ tmp = strchr (uri, ':');
+ doc_uri = g_strconcat ("man",tmp,NULL);
+ }
+
done:
if (pspec)
g_pattern_spec_free (pspec);
@@ -1010,5 +1025,6 @@ convert_info_uri (gchar *uri)
g_free (subdir);
g_free (info_dot_info);
g_free (info_name);
+
return doc_uri;
}