From 1e65313ceb6bc5bf1574ae93335ec62a94d9ed7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sat, 27 Oct 2007 20:26:31 +0700 Subject: [PATCH] spawnvppe_pipe: Don't overwrite argv[0] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Because caller expects it so Signed-off-by: Nguyễn Thái Ngọc Duy --- spawn-pipe.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/spawn-pipe.c b/spawn-pipe.c index c8f0452823..3df7e22ed9 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; }