aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index a1b43113a6..cc8c4aeca8 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -1012,6 +1012,12 @@ void do_bang(int addr_count, exarg_T *eap, bool forceit, bool do_in, bool do_out
}
} while (trailarg != NULL);
+ // Don't do anything if there is no command as there isn't really anything
+ // useful in running "sh -c ''". Avoids changing "prevcmd".
+ if (strlen(newcmd) == 0) {
+ return;
+ }
+
xfree(prevcmd);
prevcmd = newcmd;