Re: getenv
- Posted by Jeremy Cowgar <jeremy at c??gar.com> May 30, 2008
- 691 views
Kenneth Rhodes wrote: > > > Your kidding, right? {} and " " are empty values. Muck arround with Windows > to your hearts content, thats what its there for. > Hm, I do not follow. {} is empty, " " is a space, it's not empty. Fact is that this C program: void main() { printf("...%s...\n", getenv("HELLO")); } acts differently on Windows and Linux. That's the root cause that makes Euphoria act differently also. C:\> c_test.exe ...NULL... C:\> SET HELLO=A C:\> c_test.exe ...A... C:\> SET HELLO= C:\> c_test.exe ...NULL... $ c_test ...NULL... $ export HELLO=A $ c_test ...A... $ export HELLO= $ c_test ...... Notice the last.... It does not return null, it returns "", an empty value. In windows it will return NULL, therefore, in Windows you have no idea if a env var is actually empty or non-existent. -- Jeremy Cowgar http://jeremy.cowgar.com