From 17dbb39dec1fcd3280f86e480a7191b6f78cbbcc Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 1 Sep 2016 14:29:08 +0200 Subject: [PATCH] m_config: fix "no-" option handling with sub-options E.g. --vf=scale=no-arnd didn't work, because it didn't recognize no-arnd as flag option. The top-level command line parser is not affected by this, because it uses the result of m_config_option_requires_param() differently and assumes unknown parameters do not necessarily require a parameter. (The suboption parser can't do this.) --- options/m_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/options/m_config.c b/options/m_config.c index e5600228da..352965ea47 100644 --- a/options/m_config.c +++ b/options/m_config.c @@ -729,7 +729,7 @@ int m_config_option_requires_param(struct m_config *config, bstr name) { struct m_config_option *co = m_config_get_co(config, name); if (!co) - return M_OPT_UNKNOWN; + return m_config_find_negation_opt(config, &name) ? 0 : M_OPT_UNKNOWN; if (bstr_endswith0(name, "-clr")) return 0; return m_option_required_params(co->opt);