From: H. Peter Anvin Date: Mon, 05 Dec 2005 18:39:51 GMT Subject: Re: [PATCH] Add compat/setenv.c, use in git.c. Message-ID: <43948977.7060405@zytor.com> In-Reply-To: <14404.1133806037@lotus.CS.Berkeley.EDU> Jason Riedy wrote: > And Junio C Hamano writes: > - putenv(3) says > - The string pointed to by string becomes part of the environment, > - so altering the string changes the environment. > > Good catch, thanks. The Solaris man page first says the > string space is "no longer used", but at the very end warns > against using an automatic variable. Chalk one up for lousy > docs. > > (And sizeof(char) is just habit; 99% of my mallocs aren't of > char... Sorry.) > Personally I consider it a serious bug in the C language that sizeof(char) == 1 by definition. It basically prohibits a whole lot of useful machine models. -hpa