diff options
author | Don Scorgie <dscorgie@src.gnome.org> | 2006-05-23 11:49:44 +0000 |
---|---|---|
committer | Don Scorgie <dscorgie@src.gnome.org> | 2006-05-23 11:49:44 +0000 |
commit | 12417a7d368a0a3189ba405ad79094c5aed4cf0c (patch) | |
tree | bbe14fba9a4c89560d0d3b03b18ece95843002b8 | |
parent | 04693ee4826e57e55b9e15c5af527efce05fc021 (diff) | |
download | yelp-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-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/yelp-utils.c | 20 |
2 files changed, 21 insertions, 2 deletions
@@ -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; } |