Bug 16337 – Posix get empty environment value returns null

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-07-30T01:52:00Z
Last change time
2016-07-31T11:14:21Z
Keywords
pull
Assigned to
nobody
Creator
schveiguy

Comments

Comment #0 by schveiguy — 2016-07-30T01:52:10Z
If one saves an environment variable that is a blank string, and then retrieves that value, the returned value is the null string. While this normally would be fine (null is a valid blank string), the get function uses null as a sentinel to signify that the environment variable isn't present. This means one cannot distinguish between getting an environment variable that is blank, and one that is missing. PR: https://github.com/dlang/phobos/pull/4627