From: Martin Schwenke Date: Mon, 20 Aug 2018 03:43:38 +0000 (+1000) Subject: ctdb-common: Allow boolean configuration values to have yes/no values X-Git-Tag: tdb-1.3.17~2024 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=21de59ab7fe53240380b9a9a5b32d5af32d34237;p=thirdparty%2Fsamba.git 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 --- 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; }