diff options
Diffstat (limited to 'common/util.c')
-rw-r--r-- | common/util.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/common/util.c b/common/util.c index 9df5b5596f..e1b523de97 100644 --- a/common/util.c +++ b/common/util.c @@ -142,17 +142,22 @@ int strtoi(const char *nptr, char **endptr, int base) int parse_bool(const char *s, int *dest) { + /* off, disable, false, no */ if (!strcasecmp(s, "off") || !strncasecmp(s, "dis", 3) || tolower(*s) == 'f' || tolower(*s) == 'n') { *dest = 0; return 1; - } else if (!strcasecmp(s, "on") || !strncasecmp(s, "ena", 3) || + } + + /* on, enable, true, yes */ + if (!strcasecmp(s, "on") || !strncasecmp(s, "ena", 3) || tolower(*s) == 't' || tolower(*s) == 'y') { *dest = 1; return 1; - } else { - return 0; } + + /* dunno */ + return 0; } int memcmp(const void *s1, const void *s2, size_t len) |