summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/exec/exec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/exec/exec.c b/src/plugins/exec/exec.c
index b337d6f45..00a8d127e 100644
--- a/src/plugins/exec/exec.c
+++ b/src/plugins/exec/exec.c
@@ -135,10 +135,11 @@ exec_add ()
new_exec_cmd->prev_cmd = last_exec_cmd;
new_exec_cmd->next_cmd = NULL;
- if (!exec_cmds)
- exec_cmds = new_exec_cmd;
- else
+ if (exec_cmds)
last_exec_cmd->next_cmd = new_exec_cmd;
+ else
+ exec_cmds = new_exec_cmd;
+
last_exec_cmd = new_exec_cmd;
new_exec_cmd->number = number;