summaryrefslogtreecommitdiffstats
path: root/core/m_config.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/m_config.c')
-rw-r--r--core/m_config.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/core/m_config.c b/core/m_config.c
index b6c15d3d9a..3781a92b90 100644
--- a/core/m_config.c
+++ b/core/m_config.c
@@ -258,6 +258,22 @@ void m_config_leave_file_local(struct m_config *config)
}
}
+void m_config_mark_file_local(struct m_config *config, const char *opt)
+{
+ struct m_config_option *co = m_config_get_co(config, bstr0(opt));
+ if (co) {
+ ensure_backup(config, co);
+ } else {
+ mp_tmsg(MSGT_CFGPARSER, MSGL_ERR, "Option %s not found.\n", opt);
+ }
+}
+
+void m_config_mark_all_file_local(struct m_config *config)
+{
+ for (struct m_config_option *co = config->opts; co; co = co->next)
+ ensure_backup(config, co);
+}
+
// Given an option --opt, add --no-opt (if applicable).
static void add_negation_option(struct m_config *config,
struct m_config_option *parent,
@@ -569,10 +585,7 @@ int m_config_option_requires_param(struct m_config *config, bstr name)
if (opt) {
if (bstr_endswith0(name, "-clr"))
return 0;
- if (((opt->flags & M_OPT_OPTIONAL_PARAM) ||
- (opt->type->flags & M_OPT_TYPE_OPTIONAL_PARAM)))
- return 0;
- return 1;
+ return m_option_required_params(opt);
}
return M_OPT_UNKNOWN;
}