summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2016-09-01 14:29:08 +0200
committerwm4 <wm4@nowhere>2016-09-01 14:29:08 +0200
commit17dbb39dec1fcd3280f86e480a7191b6f78cbbcc (patch)
tree130f553c04d86f6fef8bafb959c61ddd393e11dd
parent6b4f560f3ccca0f7db345bd7a6ed65e9307b432d (diff)
downloadmpv-17dbb39dec1fcd3280f86e480a7191b6f78cbbcc.tar.bz2
mpv-17dbb39dec1fcd3280f86e480a7191b6f78cbbcc.tar.xz
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.)
-rw-r--r--options/m_config.c2
1 files changed, 1 insertions, 1 deletions
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);