src/common/parse-bool.c: support on/off boolean values

This commit is contained in:
redtide 2023-09-13 01:06:29 +02:00 committed by Johan Malm
parent bd6efe4849
commit 143714f1c9
2 changed files with 10 additions and 0 deletions

View file

@ -13,10 +13,14 @@ parse_bool(const char *str, int default_value)
return true;
} else if (!strcasecmp(str, "true")) {
return true;
} else if (!strcasecmp(str, "on")) {
return true;
} else if (!strcasecmp(str, "no")) {
return false;
} else if (!strcasecmp(str, "false")) {
return false;
} else if (!strcasecmp(str, "off")) {
return false;
}
error_not_a_boolean:
wlr_log(WLR_ERROR, "(%s) is not a boolean value", str);