summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Hallendal <micke@codefactory.se>2002-03-23 17:06:59 +0000
committerMikael Hallendal <hallski@src.gnome.org>2002-03-23 17:06:59 +0000
commiteb7832038b933c96782763670b804202580042ee (patch)
tree3e8824b0d750501811020237a06611c4751f6109
parent6461cfcfa7d09b34c1aac45b61d0ed7b2784957d (diff)
downloadyelp-eb7832038b933c96782763670b804202580042ee.tar.gz
- Fixed #75218 - Read INFOPATH to locate path to info files.
2002-03-23 Mikael Hallendal <micke@codefactory.se> * src/yelp-info.c (yelp_info_init): - Fixed #75218 - Read INFOPATH to locate path to info files.
-rw-r--r--ChangeLog4
-rw-r--r--src/yelp-info.c45
2 files changed, 34 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index 9fadac57..0e6e3e79 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2002-03-23 Mikael Hallendal <micke@codefactory.se>
+ * src/yelp-info.c (yelp_info_init):
+ - Fixed #75218
+ - Read INFOPATH to locate path to info files.
+
* src/yelp-util.c:
(yelp_util_extract_docpath_from_uri): reverted this to it's
initial behaviour.
diff --git a/src/yelp-info.c b/src/yelp-info.c
index 57c72c0d..9a68e202 100644
--- a/src/yelp-info.c
+++ b/src/yelp-info.c
@@ -98,25 +98,40 @@ yelp_info_read_info_dir (const char *basedir, GSList **info_list)
gboolean
yelp_info_init (GNode *tree, GList **index)
{
- GNode *root;
- struct stat stat_dir1;
- struct stat stat_dir2;
- GSList *info_list = NULL;
- GSList *node;
- YelpSection *section;
- YelpSection *index_section;
- gchar *index_name;
- gchar *index_uri;
+ GNode *root;
+ struct stat stat_dir1;
+ struct stat stat_dir2;
+ GSList *info_list = NULL;
+ GSList *node;
+ YelpSection *section;
+ YelpSection *index_section;
+ gchar *index_name;
+ gchar *index_uri;
+ gchar **infopathes;
+ gchar *infopath;
+ gint i;
- stat ("/usr/info", &stat_dir1);
- stat ("/usr/share/info", &stat_dir2);
+ infopath = g_strdup (g_getenv ("INFOPATH"));
- yelp_info_read_info_dir ("/usr/info", &info_list);
+ if (infopath) {
+ g_strstrip (infopath);
+ infopathes = g_strsplit (infopath, ":", -1);
+ g_free (infopath);
+
+ for (i = 0; infopathes[i]; i++) {
+ yelp_info_read_info_dir (infopathes[i], &info_list);
+ }
+ } else {
+ stat ("/usr/info", &stat_dir1);
+ stat ("/usr/share/info", &stat_dir2);
+
+ yelp_info_read_info_dir ("/usr/info", &info_list);
- if (stat_dir1.st_ino != stat_dir2.st_ino) {
- yelp_info_read_info_dir ("/usr/share/info", &info_list);
+ if (stat_dir1.st_ino != stat_dir2.st_ino) {
+ yelp_info_read_info_dir ("/usr/share/info", &info_list);
+ }
}
-
+
if (g_slist_length (info_list) <= 0) {
return FALSE;
}