From 624b4d15577daf68976cf3674699a948da969ea8 Mon Sep 17 00:00:00 2001 From: Martin Schwenke Date: Mon, 20 Aug 2018 13:43:38 +1000 Subject: ctdb-common: Allow boolean configuration values to have yes/no values This make the new configuration style more consistent with the old one. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589 Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs (cherry picked from commit 21de59ab7fe53240380b9a9a5b32d5af32d34237) --- ctdb/common/conf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ctdb/common/conf.c b/ctdb/common/conf.c index 74af7f8a048..669ac23a74b 100644 --- a/ctdb/common/conf.c +++ b/ctdb/common/conf.c @@ -122,12 +122,12 @@ static int string_to_integer(const char *str, int *int_val) static int string_to_boolean(const char *str, bool *bool_val) { - if (strcasecmp(str, "true") == 0) { + if (strcasecmp(str, "true") == 0 || strcasecmp(str, "yes") == 0) { *bool_val = true; return 0; } - if (strcasecmp(str, "false") == 0) { + if (strcasecmp(str, "false") == 0 || strcasecmp(str, "no") == 0) { *bool_val = false; return 0; } -- cgit v1.2.1