mirror of
https://github.com/irssi/irssi.git
synced 2026-08-20 17:12:51 +02:00
/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
This commit is contained in:
parent
b933f62111
commit
d39b8363ef
1 changed files with 16 additions and 5 deletions
|
|
@ -117,16 +117,27 @@ static void help_category(GSList *cmdlist, int items)
|
||||||
static int show_help_file(const char *file)
|
static int show_help_file(const char *file)
|
||||||
{
|
{
|
||||||
const char *helppath;
|
const char *helppath;
|
||||||
char tmpbuf[1024], *str, *path;
|
char tmpbuf[1024], *str, *path, **paths, **tmp;
|
||||||
LINEBUF_REC *buffer = NULL;
|
LINEBUF_REC *buffer = NULL;
|
||||||
int f, ret, recvlen;
|
int f, ret, recvlen;
|
||||||
|
|
||||||
helppath = settings_get_str("help_path");
|
helppath = settings_get_str("help_path");
|
||||||
|
|
||||||
/* helpdir/command or helpdir/category/command */
|
paths = g_strsplit(helppath, ":", -1);
|
||||||
path = g_strdup_printf("%s/%s", helppath, file);
|
|
||||||
f = open(path, O_RDONLY);
|
f = -1;
|
||||||
g_free(path);
|
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)
|
if (f == -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue