1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

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 <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
This commit is contained in:
Martin Schwenke 2018-08-20 13:43:38 +10:00 committed by Amitay Isaacs
parent a9758f413d
commit 21de59ab7f

View File

@ -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;
}