summaryrefslogtreecommitdiffstats
path: root/input/cmd_list.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2018-01-10 01:20:58 +0100
committerKevin Mitchell <kevmitch@gmail.com>2018-01-10 20:36:27 -0800
commit2d345c59d637ec12fbc39d97e1999c335dffcdd2 (patch)
treeec8281b2e0ccec14739827e28153f73b22fd26ed /input/cmd_list.h
parente3bee23fe4e0dc15ea2564b684572572f2393a15 (diff)
downloadmpv-2d345c59d637ec12fbc39d97e1999c335dffcdd2.tar.bz2
mpv-2d345c59d637ec12fbc39d97e1999c335dffcdd2.tar.xz
input: make command argument list a dynamic array
Replace the static array with dynamic memory allocation. This also requires some code to honor mp_cmd.nargs more strictly. Generally allocates more stuff. Fixes #5375 (although we could also just raise the static limit).
Diffstat (limited to 'input/cmd_list.h')
-rw-r--r--input/cmd_list.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/input/cmd_list.h b/input/cmd_list.h
index 6590158c31..4d03626bee 100644
--- a/input/cmd_list.h
+++ b/input/cmd_list.h
@@ -21,14 +21,14 @@
#include <stdbool.h>
#include "options/m_option.h"
-#define MP_CMD_MAX_ARGS 10
+#define MP_CMD_DEF_MAX_ARGS 9
#define MP_CMD_OPT_ARG 0x1000
struct mp_cmd_def {
int id; // one of MP_CMD_...
const char *name; // user-visible name (as used in input.conf)
- const struct m_option args[MP_CMD_MAX_ARGS];
+ const struct m_option args[MP_CMD_DEF_MAX_ARGS];
bool allow_auto_repeat; // react to repeated key events
bool on_updown; // always emit it on both up and down key events
bool vararg; // last argument can be given 0 to multiple times