diff options
author | Thomas Adam <thomas@xteddy.org> | 2020-04-13 10:30:00 +0100 |
---|---|---|
committer | Thomas Adam <thomas@xteddy.org> | 2020-04-13 10:30:00 +0100 |
commit | b117c3b81217a11946ac784cfbe2ef1f3725b207 (patch) | |
tree | 196cc4a27cb75def4466d418cb91dd3fcfdfbf5b /cmd-if-shell.c | |
parent | 52e3d960e7ebe2006509d48c427ffd8f25a0cf52 (diff) | |
parent | c20eb0c0ae3347c768894a6355adfd7ebae6f2f3 (diff) | |
download | rtmux-b117c3b81217a11946ac784cfbe2ef1f3725b207.tar.gz rtmux-b117c3b81217a11946ac784cfbe2ef1f3725b207.tar.bz2 rtmux-b117c3b81217a11946ac784cfbe2ef1f3725b207.zip |
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-if-shell.c')
-rw-r--r-- | cmd-if-shell.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/cmd-if-shell.c b/cmd-if-shell.c index b008241d..a678cf40 100644 --- a/cmd-if-shell.c +++ b/cmd-if-shell.c @@ -62,10 +62,11 @@ struct cmd_if_shell_data { static enum cmd_retval cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item) { - struct args *args = self->args; + struct args *args = cmd_get_args(self); struct mouse_event *m = &item->shared->mouse; struct cmd_if_shell_data *cdata; char *shellcmd, *cmd; + const char *file; struct cmdq_item *new_item; struct cmd_find_state *fs = &item->target; struct client *c = cmd_find_client(item, NULL, 1); @@ -88,9 +89,7 @@ cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item) return (CMD_RETURN_NORMAL); memset(&pi, 0, sizeof pi); - if (self->file != NULL) - pi.file = self->file; - pi.line = self->line; + cmd_get_source(self, &pi.file, &pi.line); pi.item = item; pi.c = c; cmd_find_copy_state(&pi.fs, fs); @@ -134,10 +133,9 @@ cmd_if_shell_exec(struct cmd *self, struct cmdq_item *item) cdata->item = NULL; memset(&cdata->input, 0, sizeof cdata->input); - if (self->file != NULL) - cdata->input.file = xstrdup(self->file); - cdata->input.line = self->line; - cdata->input.item = cdata->item; + cmd_get_source(self, &file, &cdata->input.line); + if (file != NULL) + cdata->input.file = xstrdup(file); cdata->input.c = c; if (cdata->input.c != NULL) cdata->input.c->references++; |