mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-20 05:33:47 -04:00
conf: improve configuration file parsing
* Strip whitespaces from keys and values * Detect (and ignore) comments * Detect syntax errors (no value specified etc) * Error out on syntax errors and invalid keys
This commit is contained in:
parent
c11cc2be57
commit
de575ac58e
3 changed files with 66 additions and 16 deletions
4
main.c
4
main.c
|
|
@ -273,7 +273,9 @@ main(int argc, char *const *argv)
|
|||
{
|
||||
int ret = EXIT_FAILURE;
|
||||
|
||||
struct config conf = config_load();
|
||||
struct config conf = {NULL};
|
||||
if (!config_load(&conf))
|
||||
return ret;
|
||||
|
||||
static const struct option longopts[] = {
|
||||
{"font", required_argument, 0, 'f'},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue