Re: [RFC] Renaming environment variables.
- From
Sean <seanlkml@sympatico.ca>
- Date
- May 9, 2005, 21:04 UTC
- Message-ID
- <3677.10.10.10.24.1115672678.squirrel@linux1>
- In-Reply-To
- <7vhdhcxj0z.fsf_-_@assigned-by-dhcp.cox.net>
On Mon, May 9, 2005 4:05 pm, Junio C Hamano said:
Show 5 quoted lines
> H. Peter Anvin mentioned that using SHA1_whatever as an > environment variable name is not nice and we should instead use > names starting with "GIT_" prefix to avoid conflicts. > > Here is a patch, requesting for comments.
Junio,
Look quite good; you made short work of that!
However I don't understand your gitenv_bc, wouldn't the following suffice?
char *gitenv_bc(const char *e)
{
int i;
char *val = getenv(e);
if (val)
return val; for (i=0; i < sizeof(bc_name) / sizeof(bc_name[0]); ++i) {
if (!strcmp(e, bc_name[i].canonical)) {
if (val = getenv(bc_name[i].old))
warn_old_environment();
return val;
}
}
return NULL;
}Cheers, Sean