comparison src/ex_cmds.c @ 31020:b0596e8ee3c0 v9.0.0845

patch 9.0.0845: shell command with just space gives strange error Commit: https://github.com/vim/vim/commit/4e7590ec00483077daaa567aa2220bc8df912f3c Author: shane.xb.qian <shane.qian@foxmail.com> Date: Tue Nov 8 21:40:04 2022 +0000 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)
author Bram Moolenaar <Bram@vim.org>
date Tue, 08 Nov 2022 22:45:04 +0100
parents 6d6545c99597
children 30ea99dff3be
comparison
equal deleted inserted replaced
31019:3cee244c9363 31020:b0596e8ee3c0
897 autowrite_all(); 897 autowrite_all();
898 msg_scroll = scroll_save; 898 msg_scroll = scroll_save;
899 } 899 }
900 900
901 /* 901 /*
902 * Try to find an embedded bang, like in :!<cmd> ! [args] 902 * Try to find an embedded bang, like in ":!<cmd> ! [args]"
903 * (:!! is indicated by the 'forceit' variable) 903 * ":!!" is indicated by the 'forceit' variable.
904 */ 904 */
905 ins_prevcmd = forceit; 905 ins_prevcmd = forceit;
906 trailarg = arg; 906
907 // Skip leading white space to avoid a strange error with some shells.
908 trailarg = skipwhite(arg);
907 do 909 do
908 { 910 {
909 len = (int)STRLEN(trailarg) + 1; 911 len = (int)STRLEN(trailarg) + 1;
910 if (newcmd != NULL) 912 if (newcmd != NULL)
911 len += (int)STRLEN(newcmd); 913 len += (int)STRLEN(newcmd);