diff options
author | Don Scorgie <dscorgie@src.gnome.org> | 2006-05-29 19:06:50 +0000 |
---|---|---|
committer | Don Scorgie <dscorgie@src.gnome.org> | 2006-05-29 19:06:50 +0000 |
commit | bce83f2e5bfa578cff2147e8ecf7e9023b58ff7f (patch) | |
tree | 8af031e2259d3258ff4ec5116558da9aa7194b8a | |
parent | b5c42044a6ad717e4f262d9e73413d3be2912adc (diff) | |
download | yelp-bce83f2e5bfa578cff2147e8ecf7e9023b58ff7f.tar.gz |
Fix loading of info pages from subdirs in some cases
* src/yelp-utils.c:
Fix loading of info pages from subdirs in some cases
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | src/yelp-utils.c | 14 |
2 files changed, 12 insertions, 5 deletions
@@ -1,5 +1,8 @@ 2006-05-29 Don Scorgie <dscorgie@cvs.gnome.org> + * src/yelp-utils.c: + Fix loading of info pages from subdirs in some cases + * src/gtkentryaction.c: Free text after use diff --git a/src/yelp-utils.c b/src/yelp-utils.c index a84ea9d8..37410735 100644 --- a/src/yelp-utils.c +++ b/src/yelp-utils.c @@ -903,6 +903,7 @@ convert_info_uri (gchar *uri) gchar *info_name = NULL; gchar *info_dot_info = NULL; gchar **infopaths = NULL; + gboolean need_subdir = FALSE; gint i; @@ -958,6 +959,7 @@ convert_info_uri (gchar *uri) g_free (info_name); info_name = g_strdup (real_name); g_free (real_name); + need_subdir = TRUE; } @@ -976,18 +978,20 @@ convert_info_uri (gchar *uri) dir = g_dir_open (infopath[i], 0, NULL); if (dir) { while ((filename = g_dir_read_name (dir))) { - if (subdir && g_str_equal (filename, subdir)) { + if (need_subdir && g_str_equal (filename, subdir)) { gchar *dirname = NULL; g_dir_close (dir); dirname = g_strconcat (infopath[i], "/", subdir, NULL); dir = g_dir_open (dirname, 0, NULL); g_free (dirname); filename = g_dir_read_name (dir); + need_subdir = FALSE; } - else if (g_str_equal (info_dot_info, filename) || - g_pattern_match_string (pspec, filename) || - g_pattern_match_string (pspec1, filename) || - g_str_equal (info_name, filename)) { + else if (!need_subdir && + (g_str_equal (info_dot_info, filename) || + g_pattern_match_string (pspec, filename) || + g_pattern_match_string (pspec1, filename) || + g_str_equal (info_name, filename))) { if (subdir) { doc_uri = g_strconcat ("file://", infopath[i], "/", subdir, "/", |