mirror of
https://github.com/mpv-player/mpv
synced 2025-03-31 07:51:55 +00:00
options: fix "--"
Handling this was accidentally forgotten when command line parsing was refactored. The added recursive call should be a tail recursion with all reasonable compilers, and it shouldn't be possible to provoke a stack overflow.
This commit is contained in:
parent
1ba5a8f283
commit
b28c6d0ba5
@ -70,6 +70,11 @@ static int split_opt_silent(struct parse_state *p)
|
||||
if (p->no_more_opts || !bstr_startswith0(p->arg, "-") || p->arg.len == 1)
|
||||
return 0;
|
||||
|
||||
if (bstrcmp0(p->arg, "--") == 0) {
|
||||
p->no_more_opts = true;
|
||||
return split_opt_silent(p);
|
||||
}
|
||||
|
||||
bool old_syntax = !bstr_startswith0(p->arg, "--");
|
||||
if (old_syntax) {
|
||||
p->arg = bstr_cut(p->arg, 1);
|
||||
|
Loading…
Reference in New Issue
Block a user