aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-04-18 14:09:29 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-04-18 14:20:44 +0800
commitc0f10d3fe018990b68cfa47bd84693449100f449 (patch)
tree43d0a05dfa50126d915c7ea86482fc139d210855 /src
parent240c41e1af556cd17329d5c46d26a3ca91be2db8 (diff)
downloadrneovim-c0f10d3fe018990b68cfa47bd84693449100f449.tar.gz
rneovim-c0f10d3fe018990b68cfa47bd84693449100f449.tar.bz2
rneovim-c0f10d3fe018990b68cfa47bd84693449100f449.zip
vim-patch:9.0.0783: ":!" doesn't do anything but does update the previous command
Problem: ":!" doesn't do anything but does update the previous command. Solution: Do not have ":!" change the previous command. (Martin Tournoij, closes vim/vim#11372) https://github.com/vim/vim/commit/8107a2a8af80a53a61734b600539c5beb4782991 Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src')
-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;