summaryrefslogtreecommitdiffstats
path: root/winsup/utils/strace.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/utils/strace.cc')
-rw-r--r--winsup/utils/strace.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc
index 745da9d2c..0334eb71e 100644
--- a/winsup/utils/strace.cc
+++ b/winsup/utils/strace.cc
@@ -326,12 +326,22 @@ create_child (char **argv)
make_command_line (one_line, argv);
SetConsoleCtrlHandler (NULL, 0);
+ const char *cygwin_env = getenv ("CYGWIN");
+ const char *space;
+ if (cygwin_env)
+ space = " ";
+ else
+ space = cygwin_env = "";
+ char *newenv = (char *) malloc (sizeof ("CYGWIN=noglob") + strlen (space) + strlen (cygwin_env));
+ sprintf (newenv, "CYGWIN=noglob%s%s", space, cygwin_env);
+ _putenv (newenv);
ret = CreateProcess (0, one_line.buf, /* command line */
NULL, /* Security */
NULL, /* thread */
TRUE, /* inherit handles */
flags, /* start flags */
- NULL, NULL, /* current directory */
+ NULL, /* default environment */
+ NULL, /* current directory */
&si, &pi);
if (!ret)
error (0, "error creating process %s, (error %d)", *argv,