git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[MinGW PATCH] spawnvppe_pipe: Don't overwrite argv[0]

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Oct 27, 2007, 13:26 UTC
Message-ID
<20071027132631.GA32149@laptop>
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
Message 1 of 1 in “spawnvppe_pipe: Don't overwrite argv[0]”
  1. spawnvppe_pipe: Don't overwrite argv[0]Nguyễn Thái Ngọc Duy, Oct 27, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.