diff options
author | wm4 <wm4@nowhere> | 2013-04-23 14:21:08 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-04-23 14:21:08 +0200 |
commit | 50ce2bd6c86ea44aef6bf64fdc0af605e45e6612 (patch) | |
tree | 127ef75b35b342e3afdaa483480547e2578586f3 | |
parent | 355b980a723c8a5a578f85d82e81b79b3ddb7129 (diff) | |
download | mpv-50ce2bd6c86ea44aef6bf64fdc0af605e45e6612.tar.bz2 mpv-50ce2bd6c86ea44aef6bf64fdc0af605e45e6612.tar.xz |
m_option: fix positional sub-option skipping
Empty sub-option parameters mean the sub-option should be skipped,
e.g. -vf gradfun=:10 sets the second option (by position) to 10. This
was broken in commit 04f1e2d.
-rw-r--r-- | core/m_option.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/m_option.c b/core/m_option.c index cbae2fb349..a0b4808e2e 100644 --- a/core/m_option.c +++ b/core/m_option.c @@ -1772,7 +1772,7 @@ static int get_obj_param(bstr opt_name, bstr obj_name, const m_struct_t *desc, // positional fields if (val.len == 0) { // Empty field, count it and go on (*nold)++; - return 1; + return 0; } if ((*nold) >= oldmax) { mp_msg(MSGT_CFGPARSER, MSGL_ERR, "Option %.*s: %.*s has only %d params, so you can't give more than %d unnamed params.\n", @@ -1823,7 +1823,7 @@ static int get_obj_params(struct bstr opt_name, struct bstr name, if (r < 0) goto exit; - if (ret) { + if (r > 0 && ret) { MP_TARRAY_APPEND(NULL, args, num_args, bstrto0(NULL, fname)); MP_TARRAY_APPEND(NULL, args, num_args, bstrto0(NULL, fval)); } |