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 #11372)
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 7f41c79..f5271ea 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -957,6 +957,11 @@
}
} 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;