summaryrefslogtreecommitdiffstats
path: root/options/parse_configfile.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-05 23:50:17 +0200
committerwm4 <wm4@nowhere>2014-05-05 23:55:47 +0200
commit7c01dee153fe8b7dabbc4ff8f206097f4191b48f (patch)
tree05f1b8ae1c33fd44b0fd2fcf69e3ba7b0292d994 /options/parse_configfile.c
parent20b5fecdf14736b739db5c53c740484cedb2fbf5 (diff)
downloadmpv-7c01dee153fe8b7dabbc4ff8f206097f4191b48f.tar.bz2
mpv-7c01dee153fe8b7dabbc4ff8f206097f4191b48f.tar.xz
options: let unknown option case be handled by final option parser
If an option is completely missing, let m_config_parse_option() handle this case, instead of erroring out early. Needed for the following commit.
Diffstat (limited to 'options/parse_configfile.c')
-rw-r--r--options/parse_configfile.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/options/parse_configfile.c b/options/parse_configfile.c
index 5418082d03..a4ba67fd7e 100644
--- a/options/parse_configfile.c
+++ b/options/parse_configfile.c
@@ -228,13 +228,12 @@ int m_config_parse_config_file(m_config_t *config, const char *conffile,
goto nextline;
}
- tmp = m_config_option_requires_param(config, bopt);
- if (tmp > 0 && !param_set)
- tmp = M_OPT_MISSING_PARAM;
- if (tmp < 0) {
+ bool need_param = m_config_option_requires_param(config, bopt) > 0;
+ if (need_param && !param_set) {
PRINT_LINENUM;
MP_ERR(config, "error parsing option %.*s=%.*s: %s\n",
- BSTR_P(bopt), BSTR_P(bparam), m_option_strerror(tmp));
+ BSTR_P(bopt), BSTR_P(bparam),
+ m_option_strerror(M_OPT_MISSING_PARAM));
continue;
}