diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-10-17 18:00:23 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-10-17 18:00:23 +0100 |
commit | 8107a2a8af80a53a61734b600539c5beb4782991 (patch) | |
tree | 90fd78458a77d1c04ec964419dae7b5889d2f8d0 /src/ex_cmds.c | |
parent | 4bf67ec52e938a3edaa4f452adab42a57505f940 (diff) |
patch 9.0.0783: ":!" doesn't do anything but does update the previous commandv9.0.0783
Problem: ":!" doesn't do anything but does update the previous command.
Solution: Do not have ":!" change the previous command. (Martin Tournoij,
closes #11372)
Diffstat (limited to 'src/ex_cmds.c')
-rw-r--r-- | src/ex_cmds.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 7f41c7915a..f5271ea426 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -957,6 +957,11 @@ do_bang( } } 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; + vim_free(prevcmd); prevcmd = newcmd; |