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

[PATCH 2/2] help.c: use SHELL_PATH instead of hard-coded "/bin/sh"

From
Kyle J. McKay <mackyle@gmail.com>
Date
Mar 8, 2015, 05:08 UTC
Message-ID
<0ebc0373b21c75fa88adb5aefd098e9@74d39fa044aa309eaea14b9f57fe79c>
In-Reply-To
<38be9195b966a027cb050e5a1b47526@74d39fa044aa309eaea14b9f57fe79c>

If the user has set SHELL_PATH in the Makefile then we should respect that value and use it.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
---
 builtin/help.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/help.c b/builtin/help.c
index 6133fe49..2ae8a1e9 100644
--- a/builtin/help.c
+++ b/builtin/help.c
@@ -171,7 +171,7 @@ static void exec_man_cmd(const char *cmd, const char *page)
 {
 	struct strbuf shell_cmd = STRBUF_INIT;
 	strbuf_addf(&shell_cmd, "%s %s", cmd, page);
-	execl("/bin/sh", "sh", "-c", shell_cmd.buf, (char *)NULL);
+	execl(SHELL_PATH, SHELL_PATH, "-c", shell_cmd.buf, (char *)NULL);
 	warning(_("failed to exec '%s': %s"), cmd, strerror(errno));
 }
 
---
Previous: Kyle J. McKayNext: Junio C Hamano
Message 2 of 6 in “git-compat-util.h: move SHELL_PATH default into header”
  1. 1/2 git-compat-util.h: move SHELL_PATH default into headerKyle J. McKay, Mar 8, 2015
  2. 2/2 help.c: use SHELL_PATH instead of hard-coded "/bin/sh"Kyle J. McKay, Mar 8, 2015
  3. Junio C HamanoMar 8, 2015
  4. Kyle J. McKayMar 9, 2015
  5. Jeff KingMar 9, 2015
  6. Junio C HamanoMar 10, 2015

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.