diff options
author | wm4 <wm4@nowhere> | 2012-09-02 20:30:16 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-09-18 21:07:29 +0200 |
commit | b28c6d0ba5693949a6b64cad446276e8886e3f3b (patch) | |
tree | 2ec8c9a6d216712a2a3282ef53364040070c8182 /parser-mpcmd.c | |
parent | 1ba5a8f283e3894158f12f025035903e13d0f8ae (diff) | |
download | mpv-b28c6d0ba5693949a6b64cad446276e8886e3f3b.tar.bz2 mpv-b28c6d0ba5693949a6b64cad446276e8886e3f3b.tar.xz |
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.
Diffstat (limited to 'parser-mpcmd.c')
-rw-r--r-- | parser-mpcmd.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/parser-mpcmd.c b/parser-mpcmd.c index 41cad67467..d87e820e0f 100644 --- a/parser-mpcmd.c +++ b/parser-mpcmd.c @@ -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); |