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

Re: [PATCH] Use SHELL_PATH from build system in run_command.c:prepare_shell_cmd

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Mar 31, 2012, 03:48 UTC
Message-ID
<20120331034802.GB2475@burratino>
In-Reply-To
<1333157601-6458-1-git-send-email-bwalton@artsci.utoronto.ca>
Ben Walton wrote:
> During the testing of the 1.7.10 rc series on Solaris for OpenCSW, it
> was discovered that t7006-pager was failing
[...]
Show 19 quoted lines
> --- a/run-command.c
> +++ b/run-command.c
> @@ -4,6 +4,10 @@
>  #include "sigchain.h"
>  #include "argv-array.h"
>  
> +#ifndef SHELL_PATH
> +# define SHELL_PATH "/bin/sh"
> +#endif
> +
>  struct child_to_clean {
>  	pid_t pid;
>  	struct child_to_clean *next;
> @@ -90,7 +94,7 @@ static const char **prepare_shell_cmd(const char **argv)
>  		die("BUG: shell command is empty");
>  
>  	if (strcspn(argv[0], "|&;<>()$`\\\"' \t\n*?[#~=%") != strlen(argv[0])) {
> -		nargv[nargc++] = "sh";
> +		nargv[nargc++] = SHELL_PATH;
The underlying problem is an old one.  Thanks for fixing it.
For what it's worth,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
[...]
> Essentially, the shell is a
> special case of tool that should not rely on SANE_TOOL_PATH and must
> be called explicitly.
It is probably annoying to hear me say this, but:

The above doesn't tell me _why_ it is a special case and that on Solaris users have been burned by "sh" being the original Bourne shell or a temperamental version of ksh so SHELL_PATH usually points to bash or ksh93 instead.

I trust the reader enough to fill in the blank, though, so I think the patch is ok as is.

Previous: Ben WaltonNext: Junio C Hamano
Message 2 of 16 in “Use SHELL_PATH from build system in run_command.c:prepare_shell_cmd”
  1. Use SHELL_PATH from build system in run_command.c:prepare_shell_cmdBen Walton, Mar 31, 2012
  2. Jonathan NiederMar 31, 2012
  3. Junio C HamanoMar 31, 2012
  4. Jonathan NiederMar 31, 2012
  5. Junio C HamanoMar 31, 2012
  6. Junio C HamanoMar 31, 2012
  7. Do not use SHELL_PATH from build system in prepare_shell_cmd on WindowsJohannes Sixt, Apr 17, 2012
  8. Ben WaltonApr 17, 2012
  9. Johannes SixtApr 17, 2012
  10. Ben WaltonApr 17, 2012
  11. Jeff KingApr 17, 2012
  12. Johannes SixtApr 18, 2012
  13. Jeff KingApr 18, 2012
  14. Junio C HamanoApr 18, 2012
  15. Johannes SixtApr 19, 2012
  16. Junio C HamanoApr 19, 2012

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.