mirror of
https://github.com/mpv-player/mpv
synced 2025-04-24 20:29:53 +00:00
options: commandline: don't set bogus playtree option params
The command line parsing code recorded the next commandline argument,
if any, as the parameter of any option recorded to playtree. Thus a
command line like "mplayer file -fs -aid 1" would record option "-fs"
with a bogus argument "-aid". Historically this triggered no visible
problems because such bogus arguments were silently ignored when
interpreting the options later. However after recent commit 507fa7e2c2
("options: indicate ambiguous option parameters explicitly")
parameters to flag options are no longer ignored, and the bogus values
now triggered parsing errors. Add a check to stop recording parameters
for old-style single-dash options if m_config_check_option() says the
option did not consume any arguments.
This commit is contained in:
parent
ec72cb7a73
commit
ce9ce9d0c3
@ -186,6 +186,8 @@ play_tree_t *m_config_parse_mp_command_line(m_config_t *config, int argc,
|
|||||||
r = m_config_check_option(config, opt, param, old_syntax);
|
r = m_config_check_option(config, opt, param, old_syntax);
|
||||||
if (r >= 0) {
|
if (r >= 0) {
|
||||||
play_tree_t *pt = last_entry ? last_entry : last_parent;
|
play_tree_t *pt = last_entry ? last_entry : last_parent;
|
||||||
|
if (r == 0)
|
||||||
|
param = bstr(NULL); // for old_syntax case
|
||||||
play_tree_set_param(pt, opt, param);
|
play_tree_set_param(pt, opt, param);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user