]> git.pld-linux.org Git - packages/vim.git/blob - 7.3.448
- up to 7.3.600
[packages/vim.git] / 7.3.448
1 To: vim_dev@googlegroups.com
2 Subject: Patch 7.3.448
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.448 (after 7.3.447)
11 Problem:    Win32: Still a problem with "!start /b".
12 Solution:   Escape only '|'. (Yasuhiro Matsumoto)
13 Files:      src/os_win32.c
14
15
16 *** ../vim-7.3.447/src/os_win32.c       2012-02-21 21:22:40.000000000 +0100
17 --- src/os_win32.c      2012-02-22 13:06:55.000000000 +0100
18 ***************
19 *** 3933,3939 ****
20       else
21       {
22         /* we use "command" or "cmd" to start the shell; slow but easy */
23 !       char_u *cmdbase = cmd;
24   
25         /* Skip a leading ", ( and "(. */
26         if (*cmdbase == '"' )
27 --- 3933,3941 ----
28       else
29       {
30         /* we use "command" or "cmd" to start the shell; slow but easy */
31 !       char_u  *newcmd = NULL;
32 !       char_u  *cmdbase = cmd;
33 !       long_u  cmdlen;
34   
35         /* Skip a leading ", ( and "(. */
36         if (*cmdbase == '"' )
37 ***************
38 *** 3971,3982 ****
39                 flags = CREATE_NO_WINDOW;
40                 si.dwFlags = STARTF_USESTDHANDLES;
41                 si.hStdInput = CreateFile("\\\\.\\NUL", // File name
42 !                   GENERIC_READ,                               // Access flags
43                     0,                                  // Share flags
44 !                   NULL,                                       // Security att.
45 !                   OPEN_EXISTING,                              // Open flags
46 !                   FILE_ATTRIBUTE_NORMAL,                      // File att.
47 !                   NULL);                                      // Temp file
48                 si.hStdOutput = si.hStdInput;
49                 si.hStdError = si.hStdInput;
50             }
51 --- 3973,3984 ----
52                 flags = CREATE_NO_WINDOW;
53                 si.dwFlags = STARTF_USESTDHANDLES;
54                 si.hStdInput = CreateFile("\\\\.\\NUL", // File name
55 !                   GENERIC_READ,                       // Access flags
56                     0,                                  // Share flags
57 !                   NULL,                               // Security att.
58 !                   OPEN_EXISTING,                      // Open flags
59 !                   FILE_ATTRIBUTE_NORMAL,              // File att.
60 !                   NULL);                              // Temp file
61                 si.hStdOutput = si.hStdInput;
62                 si.hStdError = si.hStdInput;
63             }
64 ***************
65 *** 3993,4004 ****
66                     *--p = NUL;
67             }
68   
69             /*
70 !            * Unescape characters in shellxescape. This is workaround for
71 !            * /b option. Only redirect character should be unescaped.
72              */
73 !           unescape_shellxquote(cmdbase,
74 !                       (flags & CREATE_NEW_CONSOLE) ? p_sxe : "<>");
75   
76             /*
77              * Now, start the command as a process, so that it doesn't
78 --- 3995,4030 ----
79                     *--p = NUL;
80             }
81   
82 +           newcmd = cmdbase;
83 +           unescape_shellxquote(cmdbase, p_sxe);
84
85             /*
86 !            * If creating new console, arguments are passed to the
87 !            * 'cmd.exe' as-is. If it's not, arguments are not treated
88 !            * correctly for current 'cmd.exe'. So unescape characters in
89 !            * shellxescape except '|' for avoiding to be treated as
90 !            * argument to them. Pass the arguments to sub-shell.
91              */
92 !           if (flags != CREATE_NEW_CONSOLE)
93 !           {
94 !               char_u  *subcmd;
95 !               char_u  *cmd_shell = default_shell();
96
97 !               subcmd = vim_strsave_escaped_ext(cmdbase, "|", '^', FALSE);
98 !               if (subcmd != NULL)
99 !               {
100 !                   /* make "cmd.exe /c arguments" */
101 !                   cmdlen = STRLEN(cmd_shell) + STRLEN(subcmd) + 5;
102 !                   vim_free(subcmd);
103
104 !                   newcmd = lalloc(cmdlen, TRUE);
105 !                   if (newcmd != NULL)
106 !                       vim_snprintf((char *)newcmd, cmdlen, "%s /c %s",
107 !                                                      default_shell, subcmd);
108 !                   else
109 !                       newcmd = cmdbase;
110 !               }
111 !           }
112   
113             /*
114              * Now, start the command as a process, so that it doesn't
115 ***************
116 *** 4006,4012 ****
117              * files if we exit before the spawned process
118              */
119             if (CreateProcess(NULL,             // Executable name
120 !                   cmdbase,                    // Command to execute
121                     NULL,                       // Process security attributes
122                     NULL,                       // Thread security attributes
123                     FALSE,                      // Inherit handles
124 --- 4032,4038 ----
125              * files if we exit before the spawned process
126              */
127             if (CreateProcess(NULL,             // Executable name
128 !                   newcmd,                     // Command to execute
129                     NULL,                       // Process security attributes
130                     NULL,                       // Thread security attributes
131                     FALSE,                      // Inherit handles
132 ***************
133 *** 4023,4028 ****
134 --- 4049,4058 ----
135                 EMSG(_("E371: Command not found"));
136   #endif
137             }
138
139 +           if (newcmd != cmdbase)
140 +               vim_free(newcmd);
141
142             if (si.hStdInput != NULL)
143             {
144                 /* Close the handle to \\.\NUL */
145 ***************
146 *** 4034,4041 ****
147         }
148         else
149         {
150 !           char_u *newcmd;
151 !           long_u cmdlen =  (
152   #ifdef FEAT_GUI_W32
153                 (allowPiping && !p_stmp ? 0 : STRLEN(vimrun_path)) +
154   #endif
155 --- 4064,4070 ----
156         }
157         else
158         {
159 !           cmdlen = (
160   #ifdef FEAT_GUI_W32
161                 (allowPiping && !p_stmp ? 0 : STRLEN(vimrun_path)) +
162   #endif
163 *** ../vim-7.3.447/src/version.c        2012-02-21 21:22:40.000000000 +0100
164 --- src/version.c       2012-02-22 13:02:15.000000000 +0100
165 ***************
166 *** 716,717 ****
167 --- 716,719 ----
168   {   /* Add new patch number below this line */
169 + /**/
170 +     448,
171   /**/
172
173 -- 
174 From "know your smileys":
175  ~#:-(  I just washed my hair, and I can't do nuthin' with it.
176
177  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
178 ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
179 \\\  an exciting new programming language -- http://www.Zimbu.org        ///
180  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
This page took 0.185494 seconds and 3 git commands to generate.