diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2016-04-01 14:01:41 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2016-04-01 14:01:41 +0200 |
commit | c6b3c5e1e868f86e32b47e3c41d09b795b60bb0c (patch) | |
tree | bb77ff443e7ba03203d6e1e3df9ffa3104cfbef4 | |
parent | 483b8019a23f46b60c444d07c74968c7aa057f65 (diff) | |
download | fbida-c6b3c5e1e868f86e32b47e3c41d09b795b60bb0c.tar.gz |
separate cfg files for fbi/fbpdf
-rw-r--r-- | fbi.c | 2 | ||||
-rw-r--r-- | fbiconfig.c | 10 | ||||
-rw-r--r-- | fbiconfig.h | 2 | ||||
-rw-r--r-- | fbpdf.c | 2 |
4 files changed, 8 insertions, 8 deletions
@@ -1342,7 +1342,7 @@ int main(int argc, char *argv[]) #ifdef HAVE_LIBLIRC lirc = lirc_fbi_init(); #endif - fbi_read_config(); + fbi_read_config(".fbirc"); cfg_parse_cmdline(&argc,argv,fbi_cmd); cfg_parse_cmdline(&argc,argv,fbi_cfg); 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); } diff --git a/fbiconfig.h b/fbiconfig.h index 2e3a0a1..e98a246 100644 --- a/fbiconfig.h +++ b/fbiconfig.h @@ -74,6 +74,6 @@ extern struct cfg_cmdline fbi_cmd[]; extern struct cfg_cmdline fbi_cfg[]; extern struct cfg_cmdline fbpdf_cmd[]; extern struct cfg_cmdline fbpdf_cfg[]; -void fbi_read_config(void); +void fbi_read_config(const char *name); void fbi_write_config(void); @@ -255,7 +255,7 @@ int main(int argc, char *argv[]) setlocale(LC_ALL,""); - fbi_read_config(); + fbi_read_config(".fbpdf.rc"); cfg_parse_cmdline(&argc,argv,fbpdf_cmd); cfg_parse_cmdline(&argc,argv,fbpdf_cfg); |