patch 9.0.0845: shell command with just space gives strange error
Problem: Shell command with just space gives strange error.
Solution: Skip white space at start of the argument. (Christian Brabandt,
Shane-XB-Qian, closes #11515, closes #11495)
diff --git a/src/ex_cmds.c b/src/ex_cmds.c
index 7bb7aa0..3cf07e4 100644
--- a/src/ex_cmds.c
+++ b/src/ex_cmds.c
@@ -899,11 +899,13 @@
}
/*
- * Try to find an embedded bang, like in :!<cmd> ! [args]
- * (:!! is indicated by the 'forceit' variable)
+ * Try to find an embedded bang, like in ":!<cmd> ! [args]"
+ * ":!!" is indicated by the 'forceit' variable.
*/
ins_prevcmd = forceit;
- trailarg = arg;
+
+ // Skip leading white space to avoid a strange error with some shells.
+ trailarg = skipwhite(arg);
do
{
len = (int)STRLEN(trailarg) + 1;