mirror of
https://github.com/leahneukirchen/cwm.git
synced 2023-08-10 21:13:12 +03:00
Move conf_init/clear into main - no behaviour change; from Tiago Cunha.
This commit is contained in:
parent
0608610cc7
commit
51b3fbee52
5
calmwm.c
5
calmwm.c
@ -108,8 +108,11 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
conf_init(&Conf);
|
||||
if (conf_path && (parse_config(conf_path, &Conf) == -1))
|
||||
if (conf_path && (parse_config(conf_path, &Conf) == -1)) {
|
||||
warnx("config file %s has errors, not loading", conf_path);
|
||||
conf_clear(&Conf);
|
||||
conf_init(&Conf);
|
||||
}
|
||||
free(conf_path);
|
||||
|
||||
x_init(display_name);
|
||||
|
7
parse.y
7
parse.y
@ -545,7 +545,7 @@ popfile(void)
|
||||
int
|
||||
parse_config(const char *filename, struct conf *xconf)
|
||||
{
|
||||
int errors = 0;
|
||||
int errors = 0;
|
||||
|
||||
conf = xconf;
|
||||
|
||||
@ -558,10 +558,5 @@ parse_config(const char *filename, struct conf *xconf)
|
||||
errors = file->errors;
|
||||
popfile();
|
||||
|
||||
if (errors) {
|
||||
conf_clear(conf);
|
||||
conf_init(conf);
|
||||
}
|
||||
|
||||
return (errors ? -1 : 0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user