aboutsummaryrefslogtreecommitdiffhomepage
path: root/input
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2014-02-19 15:39:59 +0100
committerGravatar wm4 <wm4@nowhere>2014-02-19 15:39:59 +0100
commit8b57e4bc1290fd1d6eba7a379e7fa04fc602c945 (patch)
tree1d35fb9329b76ce4e3a48e742309ce4785b315d3 /input
parent5d7cf6e508760ad0e8b2e94e21a60fd21b729c6d (diff)
input: minor simplification for --input-test
Diffstat (limited to 'input')
-rw-r--r--input/input.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/input/input.c b/input/input.c
index a578f8cb1f..41eb794a0e 100644
--- a/input/input.c
+++ b/input/input.c
@@ -311,8 +311,7 @@ static void append_bind_info(struct input_ctx *ictx, char **pmsg,
static mp_cmd_t *handle_test(struct input_ctx *ictx, int n, int *keys)
{
char *key_buf = mp_input_get_key_combo_name(keys, n);
- // "$>" to disable property substitution when invoking "show_text"
- char *msg = talloc_asprintf(NULL, "$>Key %s is bound to:\n", key_buf);
+ char *msg = talloc_asprintf(NULL, "Key %s is bound to:\n", key_buf);
talloc_free(key_buf);
int count = 0;
@@ -333,9 +332,9 @@ static mp_cmd_t *handle_test(struct input_ctx *ictx, int n, int *keys)
msg = talloc_asprintf_append(msg, "(nothing)");
MP_VERBOSE(ictx, "%s\n", msg);
-
- mp_cmd_t *res = mp_input_parse_cmd(ictx, bstr0("show_text \"\""), "");
- res->args[0].v.s = talloc_steal(res, msg);
+ const char *args[] = {"show_text", msg, NULL};
+ mp_cmd_t *res = mp_input_parse_cmd_strv(ictx->log, MP_ON_OSD_MSG, args, "");
+ talloc_free(msg);
return res;
}