Re: [PATCH] Use setenv(), fix warnings

From: Junio C Hamano <junkio@cox.net>
Date: 2006-02-27 05:06:41
Timo Hirvonen <tihirvon@gmail.com> writes:

>   - Use setenv() instead of putenv()
>   - Fix -Wundef -Wold-style-definition warnings
>   - Make pll_free() static

I think the last one makes sense, and I can see why some people
may prefer -Wundef but I am not sure about the first one.  Care
to defend why we should prefer setenv()?  IIRC, initially we did
not use setenv() anywhere because certain platforms only had
putenv().

> diff --git a/fsck-objects.c b/fsck-objects.c
> @@ -483,7 +483,7 @@ int main(int argc, char **argv)
>  	if (standalone && check_full)
>  		die("Only one of --standalone or --full can be used.");
>  	if (standalone)
> -		putenv("GIT_ALTERNATE_OBJECT_DIRECTORIES=");
> +		setenv("GIT_ALTERNATE_OBJECT_DIRECTORIES", "", 1);

For platforms with only putenv we did this; here, what we really
wanted to do was unsetenv.


-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Mon Feb 27 05:07:26 2006

This archive was generated by hypermail 2.1.8 : 2006-02-27 05:07:38 EST