mirror of
https://github.com/neovim/neovim.git
synced 2025-10-03 16:36:30 +00:00
vim-patch:9.0.0815
9c50eeb401
Co-authored-by: Martin Tournoij <martin@arp242.net>
This commit is contained in:
@@ -988,6 +988,8 @@ void do_bang(int addr_count, exarg_T *eap, bool forceit, bool do_in, bool do_out
|
||||
}
|
||||
if (ins_prevcmd) {
|
||||
STRCAT(t, prevcmd);
|
||||
} else {
|
||||
xfree(t);
|
||||
}
|
||||
p = t + strlen(t);
|
||||
STRCAT(t, trailarg);
|
||||
@@ -1012,16 +1014,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) {
|
||||
xfree(newcmd);
|
||||
return;
|
||||
// Don't clear "prevcmd" if there is no command to run.
|
||||
if (strlen(newcmd) > 0) {
|
||||
xfree(prevcmd);
|
||||
prevcmd = newcmd;
|
||||
}
|
||||
|
||||
xfree(prevcmd);
|
||||
prevcmd = newcmd;
|
||||
|
||||
if (bangredo) { // put cmd in redo buffer for ! command
|
||||
// If % or # appears in the command, it must have been escaped.
|
||||
// Reescape them, so that redoing them does not substitute them by the
|
||||
|
Reference in New Issue
Block a user