Mercurial > repos > blastem
comparison config.c @ 1540:e94cff9cb625 nuklear_ui
Make sure config directory exists before trying to save config file
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Sun, 25 Mar 2018 12:00:29 -0700 |
parents | 637fbc3b5063 |
children | 650178d81d33 |
comparison
equal
deleted
inserted
replaced
1539:5b1157eb189d | 1540:e94cff9cb625 |
---|---|
248 { | 248 { |
249 char const *confdir = get_config_dir(); | 249 char const *confdir = get_config_dir(); |
250 if (!confdir) { | 250 if (!confdir) { |
251 fatal_error("Failed to locate config file directory\n"); | 251 fatal_error("Failed to locate config file directory\n"); |
252 } | 252 } |
253 ensure_dir_exists(confdir); | |
253 char *confpath = path_append(confdir, "blastem.cfg"); | 254 char *confpath = path_append(confdir, "blastem.cfg"); |
254 if (!serialize_config_file(config, confpath)) { | 255 if (!serialize_config_file(config, confpath)) { |
255 fatal_error("Failed to write config to %s\n", confpath); | 256 fatal_error("Failed to write config to %s\n", confpath); |
256 } | 257 } |
257 free(confpath); | 258 free(confpath); |