1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
10 Patch 7.3.446 (after 7.3.445)
11 Problem: Win32: External commands with special characters don't work.
12 Solution: Add the 'shellxescape' option.
13 Files: src/misc2.c, src/option.c, src/option.h, runtime/doc/options.txt
16 *** ../vim-7.3.445/src/misc2.c 2012-02-19 18:19:24.000000000 +0100
17 --- src/misc2.c 2012-02-20 22:05:22.000000000 +0100
20 retval = mch_call_shell(cmd, opt);
23 ! ncmd = alloc((unsigned)(STRLEN(cmd) + STRLEN(p_sxq) * 2 + 1));
28 /* When 'shellxquote' is ( append ).
29 * When 'shellxquote' is "( append )". */
30 STRCAT(ncmd, STRCMP(p_sxq, "(") == 0 ? (char_u *)")"
32 retval = mch_call_shell(cmd, opt);
37 ! if (*p_sxe != NUL && STRCMP(p_sxq, "(") == 0)
39 ! ecmd = vim_strsave_escaped_ext(cmd, p_sxe, '^', FALSE);
43 ! ncmd = alloc((unsigned)(STRLEN(ecmd) + STRLEN(p_sxq) * 2 + 1));
48 /* When 'shellxquote' is ( append ).
49 * When 'shellxquote' is "( append )". */
50 STRCAT(ncmd, STRCMP(p_sxq, "(") == 0 ? (char_u *)")"
62 *** ../vim-7.3.445/src/option.c 2012-02-19 18:19:24.000000000 +0100
63 --- src/option.c 2012-02-20 22:01:07.000000000 +0100
69 (char_u *)0L} SCRIPTID_INIT},
70 + {"shellxescape", "sxe", P_STRING|P_VI_DEF|P_SECURE,
71 + (char_u *)&p_sxe, PV_NONE,
73 + #if defined(MSDOS) || defined(WIN16) || defined(WIN3264)
74 + (char_u *)"\"&|<>()@^",
78 + (char_u *)0L} SCRIPTID_INIT},
79 {"shiftround", "sr", P_BOOL|P_VI_DEF|P_VIM,
80 (char_u *)&p_sr, PV_NONE,
81 {(char_u *)FALSE, (char_u *)0L} SCRIPTID_INIT},
82 *** ../vim-7.3.445/src/option.h 2011-10-20 21:09:25.000000000 +0200
83 --- src/option.h 2012-02-20 21:45:31.000000000 +0100
88 EXTERN char_u *p_shq; /* 'shellquote' */
89 EXTERN char_u *p_sxq; /* 'shellxquote' */
90 + EXTERN char_u *p_sxe; /* 'shellxescape' */
91 EXTERN char_u *p_srr; /* 'shellredir' */
93 EXTERN long p_st; /* 'shelltype' */
94 *** ../vim-7.3.445/runtime/doc/options.txt 2012-02-12 23:23:25.000000000 +0100
95 --- runtime/doc/options.txt 2012-02-20 22:09:19.000000000 +0100
99 *'shellxquote'* *'sxq'*
100 'shellxquote' 'sxq' string (default: "";
101 ! for Win32, when 'shell' is cmd.exe or
102 ! contains "sh" somewhere: "\""
103 for Unix, when using system(): "\"")
108 *'shellxquote'* *'sxq'*
109 'shellxquote' 'sxq' string (default: "";
110 ! for Win32, when 'shell' is cmd.exe: "("
111 ! for Win32, when 'shell' contains "sh"
113 for Unix, when using system(): "\"")
119 the "!" and ":!" commands. Includes the redirection. See
120 'shellquote' to exclude the redirection. It's probably not useful
122 + When the value is '(' then ')' is appended. When the value is '"('
123 + then ')"' is appended.
124 + When the value is '(' then also see 'shellxescape'.
125 This is an empty string by default on most systems, but is known to be
126 useful for on Win32 version, either for cmd.exe which automatically
127 strips off the first and last quote on a command, or 3rd-party shells
131 This option cannot be set from a |modeline| or in the |sandbox|, for
134 + *'shellxescape'* *'sxe'*
135 + 'shellxescape' 'sxe' string (default: "";
136 + for MS-DOS and MS-Windows: "\"&|<>()@^")
139 + When 'shellxquote' is set to "(" then the characters listed in this
140 + option will be escaped with a '^' character. This makes it possible
141 + to execute most external commands with cmd.exe.
144 *'shiftround'* *'sr'* *'noshiftround'* *'nosr'*
145 'shiftround' 'sr' boolean (default off)
147 *** ../vim-7.3.445/src/version.c 2012-02-19 18:19:24.000000000 +0100
148 --- src/version.c 2012-02-20 22:12:32.000000000 +0100
152 { /* Add new patch number below this line */
158 hundred-and-one symptoms of being an internet addict:
159 86. E-mail Deficiency Depression (EDD) forces you to e-mail yourself.
161 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
162 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
163 \\\ an exciting new programming language -- http://www.Zimbu.org ///
164 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///