From 9d13caa464ff02269798ca91f57e309cd5564436 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Wed, 24 Apr 2024 13:50:06 +0200 Subject: [PATCH] Report diagnostics from libconfig when parsing fails. --- src/parse.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parse.c b/src/parse.c index bfea3ec..93072d0 100644 --- a/src/parse.c +++ b/src/parse.c @@ -403,6 +403,8 @@ libmegapixels_load_file(libmegapixels_devconfig *config, const char *file) config_init(&cfg); if (!config_read_file(&cfg, file)) { fprintf(stderr, "Could not read %s\n", file); + fprintf(stderr, "%s:%d - %s\n", + config_error_file(&cfg), config_error_line(&cfg), config_error_text(&cfg)); config_destroy(&cfg); return 0; } @@ -571,4 +573,4 @@ libmegapixels_init(libmegapixels_devconfig **config) *config = calloc(1, sizeof(libmegapixels_devconfig)); init_log(0); return 1; -} \ No newline at end of file +}