Re: getenv

new topic     » goto parent     » topic index » view thread      » older message » newer message

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

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu