summaryrefslogtreecommitdiffstats
path: root/m_config.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2012-08-04 12:07:35 +0200
committerwm4 <wm4@nowhere>2012-08-04 19:59:56 +0200
commitf7e9c15c7babadc23bd6deeb340925e6eb2a6776 (patch)
treef1be7f6e632c949a1695498cf2ba5af889558aa1 /m_config.c
parent70c455a59610242fc982e257c375f43c880ff0f7 (diff)
downloadmpv-f7e9c15c7babadc23bd6deeb340925e6eb2a6776.tar.bz2
mpv-f7e9c15c7babadc23bd6deeb340925e6eb2a6776.tar.xz
m_config: always reject setting global options in per-file mode
Now the command line parser sets the m_config object into file local mode, so that m_config can check for this condition. Makes trying to set global options from a profile fail. Note: global options can be considered read-only by m_config, so maybe there should be an additional check for this. Reusing the file- local check is more practical for now, though.
Diffstat (limited to 'm_config.c')
-rw-r--r--m_config.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/m_config.c b/m_config.c
index f2f621d0fa..b1c732fb71 100644
--- a/m_config.c
+++ b/m_config.c
@@ -413,6 +413,12 @@ static int m_config_parse_option(struct m_config *config, void *optstruct,
BSTR_P(name));
return M_OPT_INVALID;
}
+ if (config->file_local_mode && (co->opt->flags & M_OPT_GLOBAL)) {
+ mp_tmsg(MSGT_CFGPARSER, MSGL_ERR,
+ "The %.*s option is global and can't be set per-file.\n",
+ BSTR_P(name));
+ return M_OPT_INVALID;
+ }
// During command line preparse set only pre-parse options
// Otherwise only set pre-parse option if they were not already set.
if (((config->mode == M_COMMAND_LINE_PRE_PARSE) &&