aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ck.c5
-rw-r--r--src/confparser.c3
-rw-r--r--src/confparser.h1
3 files changed, 6 insertions, 3 deletions
diff --git a/src/ck.c b/src/ck.c
index e0f8a94..6e4248e 100644
--- a/src/ck.c
+++ b/src/ck.c
@@ -37,9 +37,12 @@
ERRLOG(main);
int main(int argc, const char **argv) {
- initialize_errlog(argc, argv);
UserOpt opt;
Conf conf;
+
+ initialize_errlog(argc, argv);
+ initialize_conf(&conf);
+
/* get user opt */
if (parse_action(argc, argv, &opt)) {
goto error;
diff --git a/src/confparser.c b/src/confparser.c
index 3a7c357..f6ea3a0 100644
--- a/src/confparser.c
+++ b/src/confparser.c
@@ -16,7 +16,7 @@ ERRLOG(configfile);
const char * const CONFIG_NAME = "/ckrc";
-void conf_values_initialize(Conf *c) {
+void initialize_conf(Conf *c) {
#define X(var, str, name) \
c->var = NULL;
CONFIG_VARIABLES_TABLE
@@ -55,7 +55,6 @@ void make_config_name(char * ret, const char *confPath) {
int config_file_parse(Conf *conf, UserOpt *opt) {
LOG("Using '%s' for ck configuration directory", opt->confDir);
- conf_values_initialize(conf);
FILE *confPtr;
char confName[STR_L];
char line[STR_L];
diff --git a/src/confparser.h b/src/confparser.h
index f4c52c3..d7af842 100644
--- a/src/confparser.h
+++ b/src/confparser.h
@@ -42,5 +42,6 @@ struct ConfigValues {
extern int config_file_parse(Conf *conf, UserOpt *opt);
extern void make_config_name(char * ret, const char *confPath);
+extern void initialize_conf(Conf *conf);
extern void free_conf(Conf *conf);
#endif // CONFPARSER_H