Re: getenv
- Posted by Jim Brown <jbrown105 at li?ux?uddhist.net> May 31, 2008
- 812 views
CChris wrote:
>
> Or, faster:
> }}}
<eucode>
> en = getenv("FOO")
> if compare(en,"")=1 then
> -- empty
> end if
> </eucode>
{{{
>
> CChris
>
Also wrong. It fails to catch the (more portable) getenv() = -1 case.
You want (compare(en,"") or compare(en,-1)), or possibly find(en, {"",-1}) (I'm
not sure which would be faster.)
Unless you meant this:
> en = getenv("FOO")
> if compare(en,"")=1 then
> en = -1
> end if

