#6706 closed bug (fixed)
unsetenv("a") does not remove all settings of the environment variable "a"
Reported by: | scottmc | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | - General | Version: | R1/alpha2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
gnulib test suite fails test-unsetenv.c:
unsetenv("a") does not remove all settings of the environment variable "a" from the environment.
Attachments (1)
Change History (4)
by , 14 years ago
Attachment: | test-unsetenv.c added |
---|
comment:1 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 by , 14 years ago
Seems that our putenv() implementation is not POSIX compliant :
http://www.opengroup.org/onlinepubs/009695399/functions/putenv.html
"the string pointed to by string shall become part of the environment, so altering the string shall change the environment. "
We don't support that, as we always copy the string in src/system/libroot/posix/stdlib/env.cpp:update_variable().
comment:3 by , 14 years ago
Our env variable implementation is indeed not POSIX compatible, but that was actually by intention; the POSIX interface is just horrible (especially for things that use threading), and there were several apps that did not use it correctly in the first place. So unless you need to fix an actual problem (that causes application misbehaviour), I would leave the implementation as is.
Fixed in hrev38904.