diff options
Diffstat (limited to 'm_option.c')
-rw-r--r-- | m_option.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/m_option.c b/m_option.c index 2f8daa42de..1fef1fd86e 100644 --- a/m_option.c +++ b/m_option.c @@ -91,23 +91,15 @@ static int parse_flag(const m_option_t *opt, struct bstr name, struct bstr param, void *dst) { if (param.len) { - char * const enable[] = { "yes", "on", "ja", "si", "igen", "y", "j", - "i", "tak", "ja", "true", "1" }; - for (int i = 0; i < sizeof(enable) / sizeof(enable[0]); i++) { - if (!bstrcasecmp0(param, enable[i])) { - if (dst) - VAL(dst) = opt->max; - return 1; - } + if (!bstrcasecmp0(param, "yes")) { + if (dst) + VAL(dst) = opt->max; + return 1; } - char * const disable[] = { "no", "off", "nein", "nicht", "nem", "n", - "nie", "nej", "false", "0" }; - for (int i = 0; i < sizeof(disable) / sizeof(disable[0]); i++) { - if (!bstrcasecmp0(param, disable[i])) { - if (dst) - VAL(dst) = opt->min; - return 1; - } + if (!bstrcasecmp0(param, "no")) { + if (dst) + VAL(dst) = opt->min; + return 1; } mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Invalid parameter for %.*s flag: %.*s\n", |