]> git.ipfire.org Git - ipfire-3.x.git/blob - vim/patches/vim-7.3.446.patch0
59a2b254c587f7cb8fe42c4c76cd42bd7ecdf9d1
[ipfire-3.x.git] / vim / patches / vim-7.3.446.patch0
1 To: vim_dev@googlegroups.com
2 Subject: Patch 7.3.446
3 Fcc: outbox
4 From: Bram Moolenaar <Bram@moolenaar.net>
5 Mime-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8 ------------
9
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
14
15
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
18 ***************
19 *** 3225,3235 ****
20 retval = mch_call_shell(cmd, opt);
21 else
22 {
23 ! ncmd = alloc((unsigned)(STRLEN(cmd) + STRLEN(p_sxq) * 2 + 1));
24 if (ncmd != NULL)
25 {
26 STRCPY(ncmd, p_sxq);
27 ! STRCAT(ncmd, cmd);
28 /* When 'shellxquote' is ( append ).
29 * When 'shellxquote' is "( append )". */
30 STRCAT(ncmd, STRCMP(p_sxq, "(") == 0 ? (char_u *)")"
31 --- 3225,3243 ----
32 retval = mch_call_shell(cmd, opt);
33 else
34 {
35 ! char_u *ecmd = cmd;
36 !
37 ! if (*p_sxe != NUL && STRCMP(p_sxq, "(") == 0)
38 ! {
39 ! ecmd = vim_strsave_escaped_ext(cmd, p_sxe, '^', FALSE);
40 ! if (ecmd == NULL)
41 ! ecmd = cmd;
42 ! }
43 ! ncmd = alloc((unsigned)(STRLEN(ecmd) + STRLEN(p_sxq) * 2 + 1));
44 if (ncmd != NULL)
45 {
46 STRCPY(ncmd, p_sxq);
47 ! STRCAT(ncmd, ecmd);
48 /* When 'shellxquote' is ( append ).
49 * When 'shellxquote' is "( append )". */
50 STRCAT(ncmd, STRCMP(p_sxq, "(") == 0 ? (char_u *)")"
51 ***************
52 *** 3240,3245 ****
53 --- 3248,3255 ----
54 }
55 else
56 retval = -1;
57 + if (ecmd != cmd)
58 + vim_free(ecmd);
59 }
60 #ifdef FEAT_GUI
61 --hold_gui_events;
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
64 ***************
65 *** 2273,2278 ****
66 --- 2273,2287 ----
67 (char_u *)"",
68 #endif
69 (char_u *)0L} SCRIPTID_INIT},
70 + {"shellxescape", "sxe", P_STRING|P_VI_DEF|P_SECURE,
71 + (char_u *)&p_sxe, PV_NONE,
72 + {
73 + #if defined(MSDOS) || defined(WIN16) || defined(WIN3264)
74 + (char_u *)"\"&|<>()@^",
75 + #else
76 + (char_u *)"",
77 + #endif
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
84 ***************
85 *** 712,717 ****
86 --- 712,718 ----
87 #endif
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' */
92 #ifdef AMIGA
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
96 ***************
97 *** 6023,6030 ****
98
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(): "\"")
104 global
105 {not in Vi}
106 --- 6042,6050 ----
107
108 *'shellxquote'* *'sxq'*
109 'shellxquote' 'sxq' string (default: "";
110 ! for Win32, when 'shell' is cmd.exe: "("
111 ! for Win32, when 'shell' contains "sh"
112 ! somewhere: "\""
113 for Unix, when using system(): "\"")
114 global
115 {not in Vi}
116 ***************
117 *** 6032,6037 ****
118 --- 6052,6060 ----
119 the "!" and ":!" commands. Includes the redirection. See
120 'shellquote' to exclude the redirection. It's probably not useful
121 to set both options.
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
128 ***************
129 *** 6041,6046 ****
130 --- 6064,6079 ----
131 This option cannot be set from a |modeline| or in the |sandbox|, for
132 security reasons.
133
134 + *'shellxescape'* *'sxe'*
135 + 'shellxescape' 'sxe' string (default: "";
136 + for MS-DOS and MS-Windows: "\"&|<>()@^")
137 + global
138 + {not in Vi}
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.
142 +
143 +
144 *'shiftround'* *'sr'* *'noshiftround'* *'nosr'*
145 'shiftround' 'sr' boolean (default off)
146 global
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
149 ***************
150 *** 716,717 ****
151 --- 716,719 ----
152 { /* Add new patch number below this line */
153 + /**/
154 + 446,
155 /**/
156
157 --
158 hundred-and-one symptoms of being an internet addict:
159 86. E-mail Deficiency Depression (EDD) forces you to e-mail yourself.
160
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 ///