1 /* vi:set ts=8 sts=4 sw=4:
3 * VIM - Vi IMproved by Bram Moolenaar
4 * this file by Vince Negri
6 * Do ":help uganda" in Vim to read copying and usage conditions.
7 * Do ":help credits" in Vim to see a list of people who contributed.
8 * See README.txt for an overview of the Vim source code.
12 * vimrun.c - Tiny Win32 program to safely run an external command in a
14 * This program is required to avoid that typing CTRL-C in the DOS
15 * console kills Vim. Now it only kills vimrun.
34 # ifndef WIN32_LEAN_AND_MEAN
35 # define WIN32_LEAN_AND_MEAN
40 # ifndef WIN32_LEAN_AND_MEAN
41 # define WIN32_LEAN_AND_MEAN
44 # define _getch getchar
62 # if defined(__MINGW32__) || defined(__CYGWIN__)
63 p
= (const char *)GetCommandLine();
69 * Skip the executable name, which might be in "".
75 else if (!inquote
&& *p
== ' ')
84 * "-s" argument: don't wait for a key hit.
86 if (p
[0] == '-' && p
[1] == 's' && p
[2] == ' ')
94 /* Print the command, including quotes and redirection. */
103 perror("vimrun system(): ");
104 else if (retval
!= 0)
105 printf("shell returned %d\n", retval
);
109 puts("Hit any key to close this window...");