diff options
author | wm4 <wm4@nowhere> | 2014-02-23 17:43:38 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2014-02-23 17:43:38 +0100 |
commit | f5c781b0d5755cb503a0531a159cd3664b32c620 (patch) | |
tree | f5716f73d3afef35536355ef159f135985a1cda2 /player | |
parent | b184c7d1e7e665730b5f1397661da02a6db1afc5 (diff) | |
download | mpv-f5c781b0d5755cb503a0531a159cd3664b32c620.tar.bz2 mpv-f5c781b0d5755cb503a0531a159cd3664b32c620.tar.xz |
command: remove special casing for strings in input commands
Until now, strings were the only allowed dynamically allocated argument
type in input commands. Extend it so that it works for any type. (The
string expansion in command.c is of course still string specific.)
Diffstat (limited to 'player')
-rw-r--r-- | player/command.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/player/command.c b/player/command.c index d27c3f4418..2a40132a70 100644 --- a/player/command.c +++ b/player/command.c @@ -2710,11 +2710,11 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) if (cmd->flags & MP_EXPAND_PROPERTIES) { for (int n = 0; n < cmd->nargs; n++) { if (cmd->args[n].type->type == CONF_TYPE_STRING) { - cmd->args[n].v.s = - mp_property_expand_string(mpctx, cmd->args[n].v.s); - if (!cmd->args[n].v.s) + char *s = mp_property_expand_string(mpctx, cmd->args[n].v.s); + if (!s) return; - talloc_steal(cmd, cmd->args[n].v.s); + talloc_free(cmd->args[n].v.s); + cmd->args[n].v.s = s; } } } |