summaryrefslogtreecommitdiff
path: root/libiberty/pexecute.c
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>1997-10-14 15:10:45 -0400
committerJason Merrill <jason@gcc.gnu.org>1997-10-14 15:10:45 -0400
commit19ddc834bc1ebc4e7cb7aa053cb815b3c6cc1115 (patch)
treeb6cfbdffaad259ea4ff8c43d7e1e9abb33446d1f /libiberty/pexecute.c
parente66d884e7b29d16a098c881bc8b577f2b39d3ca6 (diff)
downloadgcc-19ddc834bc1ebc4e7cb7aa053cb815b3c6cc1115.tar.gz
cplus-dem.c (demangle_signature): Don't look for return types on constructors.
Tue Oct 14 12:01:00 1997 Mark Mitchell <mmitchell@usa.net> * cplus-dem.c (demangle_signature): Don't look for return types on constructors. Handle member template constructors. and update from devo. From-SVN: r15901
Diffstat (limited to 'libiberty/pexecute.c')
-rw-r--r--libiberty/pexecute.c55
1 files changed, 52 insertions, 3 deletions
diff --git a/libiberty/pexecute.c b/libiberty/pexecute.c
index ab5f392780c..b8594eb0954 100644
--- a/libiberty/pexecute.c
+++ b/libiberty/pexecute.c
@@ -23,11 +23,14 @@ Boston, MA 02111-1307, USA. */
/* This file lives in at least two places: libiberty and gcc.
Don't change one without the other. */
+#ifdef IN_GCC
+#include "config.h"
+#endif
+
#include <stdio.h>
#include <errno.h>
#ifdef IN_GCC
-#include "config.h"
#include "gansidecl.h"
/* ??? Need to find a suitable header file. */
#define PEXECUTE_FIRST 1
@@ -223,6 +226,51 @@ pwait (pid, status, flags)
extern int _spawnv ();
extern int _spawnvp ();
+#ifdef __CYGWIN32__
+
+#define fix_argv(argvec) (argvec)
+
+#else
+
+/* 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;
+{
+ 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;
+}
+
+#endif /* ! defined (__CYGWIN32__) */
+
int
pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
const char *program;
@@ -236,7 +284,8 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
if ((flags & PEXECUTE_ONE) != PEXECUTE_ONE)
abort ();
- pid = (flags & PEXECUTE_SEARCH ? _spawnvp : _spawnv) (_P_NOWAIT, program, argv);
+ pid = (flags & PEXECUTE_SEARCH ? _spawnvp : _spawnv)
+ (_P_NOWAIT, program, fix_argv(argv));
if (pid == -1)
{
*errmsg_fmt = install_error_msg;
@@ -254,7 +303,7 @@ pwait (pid, status, flags)
{
/* ??? Here's an opportunity to canonicalize the values in STATUS.
Needed? */
- return cwait (status, pid, WAIT_CHILD);
+ return _cwait (status, pid, WAIT_CHILD);
}
#endif /* _WIN32 */