Re: [PATCH] Add ability to specify environment extension to run_command
- From
Alex Riesen <raa.lkml@gmail.com>
- Date
- May 22, 2007, 21:47 UTC
- Message-ID
- <20070522214754.GD30871@steel.home>
- In-Reply-To
- <7v7ir1dbl9.fsf@assigned-by-dhcp.cox.net>
Junio C Hamano, Tue, May 22, 2007 01:02:42 +0200:
Show 6 quoted lines
> > > > So here it is. On top of the previos patch regarding chdir before > > exec. Junio, if needed, I can resend that first patch about chdir. > > Both of them in a row would be good, so yes, resend is > appreciated.
Will be resent.
Show 16 quoted lines
> > @@ -76,6 +76,10 @@ int start_command(struct child_process *cmd)
> > if (cmd->dir && chdir(cmd->dir))
> > die("exec %s: cd to %s failed (%s)", cmd->argv[0],
> > cmd->dir, strerror(errno));
> > + if (cmd->env) {
> > + for (; *cmd->env; cmd->env++)
> > + putenv((char*)*cmd->env);
> > + }
> > if (cmd->git_cmd) {
> > execv_git_cmd(cmd->argv);
> > } else {
>
> I had a feeling that some callers needed to be able to unsetenv
> some. How would this patch help them, or are they outside of
> the scope?
> Others already discussed the issue. Just to be sure, I reimplemented that comfortable putenv with unsetenv: if an environment entry ends with a "=" it will be unset.