From c6b3c5e1e868f86e32b47e3c41d09b795b60bb0c Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Fri, 1 Apr 2016 14:01:41 +0200 Subject: separate cfg files for fbi/fbpdf --- fbiconfig.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'fbiconfig.c') diff --git a/fbiconfig.c b/fbiconfig.c index 565a21b..6c2a4bc 100644 --- a/fbiconfig.c +++ b/fbiconfig.c @@ -259,7 +259,7 @@ struct cfg_cmdline fbpdf_cfg[] = { static char *fbi_config = NULL; -static void init_config(void) +static void init_config(const char *name) { char *home; @@ -267,13 +267,13 @@ static void init_config(void) if (NULL == home) return; - fbi_config = malloc(strlen(home) + 16); - sprintf(fbi_config,"%s/.fbirc", home); + fbi_config = malloc(strlen(home) + strlen(name) + 2); + sprintf(fbi_config,"%s/%s", home, name); } -void fbi_read_config(void) +void fbi_read_config(const char *name) { - init_config(); + init_config(name); if (fbi_config) cfg_parse_file("config", fbi_config); } -- cgit