From Martin Maechler <maechler@stat.math.ethz.ch>  Wed Sep 29 14:57:09 1999
From: Martin Maechler <maechler@stat.math.ethz.ch> (Martin Maechler)
Date: Wed, 29 Sep 1999 15:57:09 +0200
Subject: getenv() can't differentiate  "defined but empty" and "undefined"
Message-ID: <199909291357.PAA15567@sophie.ethz.ch>

getenv(<varname>)  currently returns  ""
if the <varname> is undefined.

However, if <varname> is defined but empty,
getenv(<varname>) still only returns "".

I think this is quite unfortunate  
but consistent with the prototype.

---
I'd propose to change the current behavior.
Something which should be pretty back compatible would 
for the first case (undefined environment variable)
to return "" with an attribute "defined" set to FALSE
i.e.  return(structure("", defined = FALSE))

Does anyone see a problem with this approach ?

Martin Maechler <maechler@stat.math.ethz.ch>	http://stat.ethz.ch/~maechler/
Seminar fuer Statistik, ETH-Zentrum  LEO D10	Leonhardstr. 27
ETH (Federal Inst. Technology)	8092 Zurich	SWITZERLAND
phone: x-41-1-632-3408		fax: ...-1228			<><
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


getenv() can't differentiate "defined but empty" and "undefined"
Martin Maechler