mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
use default config file on parsing errors
This commit is contained in:
parent
64658bcf93
commit
3bd36a4749
1 changed files with 6 additions and 1 deletions
7
config.c
7
config.c
|
@ -729,12 +729,17 @@ config_parse(const char *confpatharg)
|
|||
if(ret == CFG_FILE_ERROR)
|
||||
{
|
||||
perror("awesome: parsing configuration file failed");
|
||||
cfg_parse_buf(cfg, AWESOME_DEFAULT_CONFIG);
|
||||
if(!(defconfig = fopen(confpath, "w")))
|
||||
perror("awesome: unable to create default configuration file");
|
||||
}
|
||||
else if(ret == CFG_PARSE_ERROR)
|
||||
cfg_error(cfg, "awesome: parsing configuration file %s failed.\n", confpath);
|
||||
if(ret != CFG_SUCCESS) {
|
||||
fprintf(stderr, "Using default compile-time configuration\n");
|
||||
cfg_free(cfg);
|
||||
cfg = cfg_init(opts, CFGF_NONE);
|
||||
cfg_parse_buf(cfg, AWESOME_DEFAULT_CONFIG);
|
||||
}
|
||||
|
||||
/* get the right screen section */
|
||||
for(screen = 0; screen < get_screen_count(); screen++)
|
||||
|
|
Loading…
Reference in a new issue