summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-05-13 19:26:25 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-05-13 19:26:25 +0000
commitd39b8363ef73ed0c9646410b5cf91263b213003f (patch)
tree72eaf0499049d5e78ebaefd58de06efc9e34dc78
parentb933f62111cb088c9d5c8f9289cd6ebbdd409010 (diff)
downloadirssi-d39b8363ef73ed0c9646410b5cf91263b213003f.zip
/SET help_path now supports multiple paths separated with ':' - patch by c0ffee
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2792 dbcabf3a-b0e7-0310-adc4-f8d773084564
-rw-r--r--src/fe-common/core/fe-help.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/fe-common/core/fe-help.c b/src/fe-common/core/fe-help.c
index c087771b..84a76352 100644
--- a/src/fe-common/core/fe-help.c
+++ b/src/fe-common/core/fe-help.c
@@ -117,16 +117,27 @@ static void help_category(GSList *cmdlist, int items)
static int show_help_file(const char *file)
{
const char *helppath;
- char tmpbuf[1024], *str, *path;
+ char tmpbuf[1024], *str, *path, **paths, **tmp;
LINEBUF_REC *buffer = NULL;
int f, ret, recvlen;
helppath = settings_get_str("help_path");
- /* helpdir/command or helpdir/category/command */
- path = g_strdup_printf("%s/%s", helppath, file);
- f = open(path, O_RDONLY);
- g_free(path);
+ paths = g_strsplit(helppath, ":", -1);
+
+ f = -1;
+ for (tmp = paths; *tmp != NULL; tmp++) {
+ /* helpdir/command or helpdir/category/command */
+ path = g_strdup_printf("%s/%s", *tmp, file);
+ f = open(path, O_RDONLY);
+ g_free(path);
+
+ if (f != -1)
+ break;
+
+ }
+
+ g_strfreev(paths);
if (f == -1)
return FALSE;