git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org, Johannes Sixt <johannes.sixt@telecom.at>
Subject: [MinGW PATCH] spawnvppe_pipe: Don't overwrite argv[0]
Date: Sat, 27 Oct 2007 20:26:31 +0700	[thread overview]
Message-ID: <20071027132631.GA32149@laptop> (raw)

Because caller expects it so

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 spawn-pipe.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/spawn-pipe.c b/spawn-pipe.c
index c8f0452..3df7e22 100644
--- a/spawn-pipe.c
+++ b/spawn-pipe.c
@@ -123,6 +123,7 @@ int spawnvppe_pipe(const char *cmd, const char **argv, const char **env,
 		  int pin[], int pout[])
 {
 	const char *cmd_basename = strrchr(cmd, '/');
+	const char *argv0 = argv[0];
 	pid_t pid;
 
 #ifdef __MINGW32__
@@ -214,6 +215,8 @@ int spawnvppe_pipe(const char *cmd, const char **argv, const char **env,
 	}
 #endif
 
+	argv[0] = argv0;
+
 	return pid;
 }
 
-- 
1.5.3.rc4.3.gab089

                 reply	other threads:[~2007-10-27 13:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071027132631.GA32149@laptop \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=johannes.sixt@telecom.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).