From 4e7590ec00483077daaa567aa2220bc8df912f3c Mon Sep 17 00:00:00 2001 From: "shane.xb.qian" Date: Tue, 8 Nov 2022 21:40:04 +0000 Subject: 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) --- src/ex_cmds.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/ex_cmds.c') diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 7bb7aa0380..3cf07e4825 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -899,11 +899,13 @@ do_bang( } /* - * Try to find an embedded bang, like in :! ! [args] - * (:!! is indicated by the 'forceit' variable) + * Try to find an embedded bang, like in ":! ! [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; -- cgit v1.2.3