summaryrefslogtreecommitdiffstats
path: root/cmd-if-shell.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2019-05-25 18:41:51 +0100
committerThomas Adam <thomas@xteddy.org>2019-05-25 18:41:51 +0100
commit463bd8abb9248c31214c951221c3cf96dbffb56e (patch)
treeea7bd85988b7dedd4bb24c72743e3b473f3c8fa7 /cmd-if-shell.c
parenta69211aff5968f2bf71f0471cc67124dbd4597dd (diff)
parenta65a6d62d19136e20ce6e6ec72d676a334dcc914 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-if-shell.c')
-rw-r--r--cmd-if-shell.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/cmd-if-shell.c b/cmd-if-shell.c
index 40e2b1c3..84f66657 100644
--- a/cmd-if-shell.c
+++ b/cmd-if-shell.c
@@ -159,7 +159,7 @@ cmd_if_shell_callback(struct job *job)
struct cmd_if_shell_data *cdata = job_get_data(job);
struct client *c = cdata->client;
struct mouse_event *m = &cdata->mouse;
- struct cmdq_item *new_item;
+ struct cmdq_item *new_item = NULL;
char *cmd;
int status;
struct cmd_parse_result *pr;
@@ -175,10 +175,10 @@ cmd_if_shell_callback(struct job *job)
pr = cmd_parse_from_string(cmd, &cdata->input);
switch (pr->status) {
case CMD_PARSE_EMPTY:
- new_item = NULL;
break;
case CMD_PARSE_ERROR:
- new_item = cmdq_get_error(pr->error);
+ if (cdata->item != NULL)
+ cmdq_error(cdata->item, "%s", pr->error);
free(pr->error);
break;
case CMD_PARSE_SUCCESS: