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.448 (after 7.3.447)
11 Problem: Win32: Still a problem with "!start /b".
12 Solution: Escape only '|'. (Yasuhiro Matsumoto)
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
22 /* we use "command" or "cmd" to start the shell; slow but easy */
23 ! char_u *cmdbase = cmd;
25 /* Skip a leading ", ( and "(. */
30 /* we use "command" or "cmd" to start the shell; slow but easy */
31 ! char_u *newcmd = NULL;
32 ! char_u *cmdbase = cmd;
35 /* Skip a leading ", ( and "(. */
39 flags = CREATE_NO_WINDOW;
40 si.dwFlags = STARTF_USESTDHANDLES;
41 si.hStdInput = CreateFile("\\\\.\\NUL", // File name
42 ! GENERIC_READ, // Access flags
44 ! NULL, // Security att.
45 ! OPEN_EXISTING, // Open flags
46 ! FILE_ATTRIBUTE_NORMAL, // File att.
48 si.hStdOutput = si.hStdInput;
49 si.hStdError = si.hStdInput;
52 flags = CREATE_NO_WINDOW;
53 si.dwFlags = STARTF_USESTDHANDLES;
54 si.hStdInput = CreateFile("\\\\.\\NUL", // File name
55 ! GENERIC_READ, // Access flags
57 ! NULL, // Security att.
58 ! OPEN_EXISTING, // Open flags
59 ! FILE_ATTRIBUTE_NORMAL, // File att.
61 si.hStdOutput = si.hStdInput;
62 si.hStdError = si.hStdInput;
70 ! * Unescape characters in shellxescape. This is workaround for
71 ! * /b option. Only redirect character should be unescaped.
73 ! unescape_shellxquote(cmdbase,
74 ! (flags & CREATE_NEW_CONSOLE) ? p_sxe : "<>");
77 * Now, start the command as a process, so that it doesn't
83 + unescape_shellxquote(cmdbase, p_sxe);
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.
92 ! if (flags != CREATE_NEW_CONSOLE)
95 ! char_u *cmd_shell = default_shell();
97 ! subcmd = vim_strsave_escaped_ext(cmdbase, "|", '^', FALSE);
100 ! /* make "cmd.exe /c arguments" */
101 ! cmdlen = STRLEN(cmd_shell) + STRLEN(subcmd) + 5;
104 ! newcmd = lalloc(cmdlen, TRUE);
105 ! if (newcmd != NULL)
106 ! vim_snprintf((char *)newcmd, cmdlen, "%s /c %s",
107 ! default_shell, subcmd);
114 * Now, start the command as a process, so that it doesn't
117 * files if we exit before the spawned process
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
125 * files if we exit before the spawned process
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
135 EMSG(_("E371: Command not found"));
139 + if (newcmd != cmdbase)
142 if (si.hStdInput != NULL)
144 /* Close the handle to \\.\NUL */
153 (allowPiping && !p_stmp ? 0 : STRLEN(vimrun_path)) +
161 (allowPiping && !p_stmp ? 0 : STRLEN(vimrun_path)) +
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
168 { /* Add new patch number below this line */
174 From "know your smileys":
175 ~#:-( I just washed my hair, and I can't do nuthin' with it.
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 ///