diff src/misc2.c @ 3357:397e7e49bb0b v7.3.445

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'.
author Bram Moolenaar <bram@vim.org>
date Sun, 19 Feb 2012 18:19:30 +0100
parents c75a8d2404bd
children 20ca2e05ae20
line wrap: on
line diff
--- a/src/misc2.c
+++ b/src/misc2.c
@@ -3230,7 +3230,11 @@ call_shell(cmd, opt)
 	    {
 		STRCPY(ncmd, p_sxq);
 		STRCAT(ncmd, cmd);
-		STRCAT(ncmd, p_sxq);
+		/* When 'shellxquote' is ( append ).
+		 * When 'shellxquote' is "( append )". */
+		STRCAT(ncmd, STRCMP(p_sxq, "(") == 0 ? (char_u *)")"
+			   : STRCMP(p_sxq, "\"(") == 0 ? (char_u *)")\""
+			   : p_sxq);
 		retval = mch_call_shell(ncmd, opt);
 		vim_free(ncmd);
 	    }