Date: Fri, 2 Sep 94 12:54:38 EDT From: peprbv AT cfa0 DOT harvard DOT edu (Bob Babcock) To: ddw2 AT sunbim DOT be Cc: djgpp AT sun DOT soe DOT clarkson DOT edu Subject: Re: Bug in getenv() ? Reply-To: babcock AT cfa DOT harvard DOT edu > watersm1> Using djgpp 1.11, getenv() behaves strangely when the environment > watersm1> variable contains spaces. eg > > watersm1> set TMP = C:/TMP > > watersm1> then getenv() returns C:/TMPMP > > This might still be in 1.12. I noticed that a call to a prg failed > because go32 could not get to c:/gcc/bin/emu3877. I had a blank after > the = in my SET GO32 command. If you do SET TMP = C:/TMP then getenv("TMP") should return NULL. getenv("TMP ") should return " C:/TMP". The blanks are significant to DOS in both the variable name and its value. Of course, one can argue about whether it _should_ work this way. Trailing blanks in the variable don't get trimmed either, so you might find yourself looking for "c:/gcc/bin/ emu3877".