From b48b550697acfd0a6f36d74054be1694af604467 Mon Sep 17 00:00:00 2001 From: schneider <schneider@blinkenlichts.net> Date: Fri, 3 Apr 2020 19:30:48 +0200 Subject: [PATCH] change(config): Ignore case when reading a boolean --- epicardium/modules/config.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/epicardium/modules/config.c b/epicardium/modules/config.c index 0f2f2e74..922dae65 100644 --- a/epicardium/modules/config.c +++ b/epicardium/modules/config.c @@ -7,6 +7,7 @@ #include <stdbool.h> #include <ctype.h> #include <string.h> +#include <strings.h> #include <stdlib.h> #include <unistd.h> #include <stddef.h> @@ -358,10 +359,10 @@ int epic_config_get_boolean(const char *key, bool *value) char buf[MAX_LINE_LENGTH]; epic_config_get_string(key, buf, MAX_LINE_LENGTH); - if (!strcmp(buf, "true")) { + if (!strcasecmp(buf, "true")) { *value = true; return 0; - } else if (!strcmp(buf, "false")) { + } else if (!strcasecmp(buf, "false")) { *value = false; return 0; } -- GitLab