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.
This commit is contained in:
wm4 2013-10-14 23:41:26 +02:00
parent c7dee24c8c
commit cf02e515d4
1 changed files with 3 additions and 0 deletions

View File

@ -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;