aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1995-09-12 18:30:06 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1995-09-12 18:30:06 -0400
commitaa76a77e6ca2bc0056b236c80f65e44c2eedd96f (patch)
treeb3d891e16bdca33f2eb4dc118052844cb7a08f1f /gcc
parentcf601f01c1192813a04d883e60f99215237adcdf (diff)
downloadgcc-aa76a77e6ca2bc0056b236c80f65e44c2eedd96f.zip
gcc-aa76a77e6ca2bc0056b236c80f65e44c2eedd96f.tar.gz
gcc-aa76a77e6ca2bc0056b236c80f65e44c2eedd96f.tar.bz2
Remove fix_argv kludge.
From-SVN: r10340
Diffstat (limited to 'gcc')
-rw-r--r--gcc/gcc.c60
1 files changed, 14 insertions, 46 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c
index db0b6d6..7622771 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -41,6 +41,8 @@ compilation is specified by a string called a "spec". */
#include <sys/file.h> /* May get R_OK, etc. on some systems. */
#else
#include <process.h>
+int __spawnv ();
+int __spawnvp ();
#endif
#include "config.h"
@@ -2112,54 +2114,20 @@ pexecute (search_flag, program, argv, not_last)
#endif /* not __MSDOS__ and not OS2 and not _WIN32 */
-#if defined(OS2) || defined(_WIN32)
+#if defined(OS2)
-#ifdef _WIN32
-
-/* This is a kludge to get around the Microsoft C spawn functions' propensity
- to remove the outermost set of double quotes from all arguments. */
-
-const char * const
-fix_argv (argvec)
- char **argvec;
+static int
+pexecute (search_flag, program, argv, not_last)
+ int search_flag;
+ char *program;
+ char *argv[];
+ int not_last;
{
- int i;
-
- for (i = 1; argvec[i] != 0; i++)
- {
- int len, j;
- char *temp, *newtemp;
-
- temp = argvec[i];
- len = strlen (temp);
- for (j = 0; j < len; j++)
- {
- if (temp[j] == '"')
- {
- newtemp = xmalloc (len + 2);
- strncpy (newtemp, temp, j);
- newtemp [j] = '\\';
- strncpy (&newtemp [j+1], &temp [j], len-j);
- newtemp [len+1] = 0;
- temp = newtemp;
- len++;
- j++;
- }
- }
-
- argvec[i] = temp;
- }
-
- return (const char* const*) argvec;
+ return (search_flag ? spawnv : spawnvp) (1, program, argv);
}
+#endif /* OS2 */
-#define FIX_ARGV(a) fix_argv(a)
-
-#else
-
-#define FIX_ARGV(a) a
-
-#endif
+#if defined(_WIN32)
static int
pexecute (search_flag, program, argv, not_last)
@@ -2168,9 +2136,9 @@ pexecute (search_flag, program, argv, not_last)
char *argv[];
int not_last;
{
- return (search_flag ? spawnv : spawnvp) (1, program, FIX_ARGV (argv));
+ return (search_flag ? __spawnv : __spawnvp) (1, program, argv);
}
-#endif /* OS2 or _WIN32 */
+#endif /* _WIN32 */
/* Execute the command specified by the arguments on the current line of spec.