1
0
forked from aniani/vim

updated for version 7.3.445

Problem:    Can't properly escape commands for cmd.exe.
Solution:   Default 'shellxquote' to '('.  Append ')' to make '(command)'.
            No need to use "/s" for 'shellcmdflag'.
This commit is contained in:
Bram Moolenaar
2012-02-19 18:19:30 +01:00
parent 5dc6252d33
commit 034b115568
4 changed files with 39 additions and 23 deletions

View File

@@ -3933,27 +3933,22 @@ set_init_3()
* my path/to/echo" "my args to echo
* when executed.
*
* To avoid this, use the /s argument in addition to /c to force the
* stripping behavior, and also set shellxquote to automatically
* surround the entire command in quotes (which get stripped as
* noted).
* To avoid this, set shellxquote to surround the command in
* parenthesis. This appears to make most commands work, without
* breaking commands that worked previously, such as
* '"path with spaces/cmd" "a&b"'.
*/
/* Set shellxquote default to add the quotes to be stripped. */
idx3 = findoption((char_u *)"sxq");
if (idx3 >= 0 && !(options[idx3].flags & P_WAS_SET))
{
p_sxq = (char_u *)"\"";
p_sxq = (char_u *)"(";
options[idx3].def_val[VI_DEFAULT] = p_sxq;
}
/* Set shellcmdflag default to always strip the quotes, note the order
* between /s and /c is important or cmd.exe will treat the /s as part
* of the command to be executed. */
idx3 = findoption((char_u *)"shcf");
if (idx3 >= 0 && !(options[idx3].flags & P_WAS_SET))
{
p_shcf = (char_u *)"/s /c";
p_shcf = (char_u *)"/c";
options[idx3].def_val[VI_DEFAULT] = p_shcf;
}
}