summaryrefslogtreecommitdiff
path: root/run-command.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-07-30 14:21:09 -0700
committerJunio C Hamano <gitster@pobox.com>2014-07-30 14:21:09 -0700
commit385e171a5b56dabbe33dbef6f88e8f934a6cacda (patch)
treee09faa621121db48522e940556fa7a169f66e730 /run-command.c
parent4b0c0e35dd2ebdab3fed1c6649f74787f7e46327 (diff)
parentbaea068d677fae92d7903e984cf93bbd5195a000 (diff)
downloadgit-385e171a5b56dabbe33dbef6f88e8f934a6cacda.tar.gz
Merge branch 'sk/mingw-uni-fix-more'
Most of these are battle-tested in msysgit and are needed to complete what has been merged to 'master' already. * sk/mingw-uni-fix-more: Win32: enable color output in Windows cmd.exe Win32: patch Windows environment on startup Win32: keep the environment sorted Win32: use low-level memory allocation during initialization Win32: reduce environment array reallocations Win32: don't copy the environment twice when spawning child processes Win32: factor out environment block creation Win32: unify environment function names Win32: unify environment case-sensitivity Win32: fix environment memory leaks Win32: Unicode environment (incoming) Win32: Unicode environment (outgoing) Revert "Windows: teach getenv to do a case-sensitive search" tests: do not pass iso8859-1 encoded parameter
Diffstat (limited to 'run-command.c')
-rw-r--r--run-command.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/run-command.c b/run-command.c
index 576dfeaa3f..35a3ebf07b 100644
--- a/run-command.c
+++ b/run-command.c
@@ -454,7 +454,6 @@ fail_pipe:
{
int fhin = 0, fhout = 1, fherr = 2;
const char **sargv = cmd->argv;
- char **env = environ;
if (cmd->no_stdin)
fhin = open("/dev/null", O_RDWR);
@@ -479,24 +478,19 @@ fail_pipe:
else if (cmd->out > 1)
fhout = dup(cmd->out);
- if (cmd->env)
- env = make_augmented_environ(cmd->env);
-
if (cmd->git_cmd)
cmd->argv = prepare_git_cmd(cmd->argv);
else if (cmd->use_shell)
cmd->argv = prepare_shell_cmd(cmd->argv);
- cmd->pid = mingw_spawnvpe(cmd->argv[0], cmd->argv, env, cmd->dir,
- fhin, fhout, fherr);
+ cmd->pid = mingw_spawnvpe(cmd->argv[0], cmd->argv, (char**) cmd->env,
+ cmd->dir, fhin, fhout, fherr);
failed_errno = errno;
if (cmd->pid < 0 && (!cmd->silent_exec_failure || errno != ENOENT))
error("cannot spawn %s: %s", cmd->argv[0], strerror(errno));
if (cmd->clean_on_exit && cmd->pid >= 0)
mark_child_for_cleanup(cmd->pid);
- if (cmd->env)
- free_environ(env);
if (cmd->git_cmd)
free(cmd->argv);