summaryrefslogtreecommitdiffstats
path: root/mpvcore
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-14 23:41:26 +0200
committerwm4 <wm4@nowhere>2013-10-14 23:41:26 +0200
commitcf02e515d4176dd89f8552d6451059b993a6fb17 (patch)
tree0c00260744c034ebf9f6a73b44af58e9905a113f /mpvcore
parentc7dee24c8cf07193b6780eb06af2fb7270204b3e (diff)
downloadmpv-cf02e515d4176dd89f8552d6451059b993a6fb17.tar.bz2
mpv-cf02e515d4176dd89f8552d6451059b993a6fb17.tar.xz
parser-cfg: allow putting options with leading "--"
Now you can pretend the config file is quite literally command line values dumped into a file, e.g. --option1=value --option2=value ... although the underlying mechanisms are quite different.
Diffstat (limited to 'mpvcore')
-rw-r--r--mpvcore/parser-cfg.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mpvcore/parser-cfg.c b/mpvcore/parser-cfg.c
index 7f1f954c85..3395a67432 100644
--- a/mpvcore/parser-cfg.c
+++ b/mpvcore/parser-cfg.c
@@ -228,6 +228,9 @@ int m_config_parse_config_file(m_config_t *config, const char *conffile,
bstr bopt = bstr0(opt);
bstr bparam = bstr0(param);
+ if (bopt.len >= 3)
+ bstr_eatstart0(&bopt, "--");
+
if (profile && bstr_equals0(bopt, "profile-desc")) {
m_profile_set_desc(profile, bparam);
goto nextline;