diff options
author | Eric Blake <ebb9@byu.net> | 2009-12-10 12:18:31 -0700 |
---|---|---|
committer | Eric Blake <ebb9@byu.net> | 2009-12-11 13:57:28 -0700 |
commit | 91e21656de5ae1e87d23465ce46e738be45a7254 (patch) | |
tree | 26245d771735e0a0ae14408abcdce507cff8e7ee /tests | |
parent | a3255b1b9848874572e0df9d0609e263da50de4b (diff) | |
download | gnulib-91e21656de5ae1e87d23465ce46e738be45a7254.tar.gz |
setenv: relax requirement in light of POSIX ruling
Requiring that {un,}setenv gracefully reject NULL is just a waste
of processing power; POSIX agreed to this argument in
http://austingroupbugs.net/view.php?id=185
so we no longer worry whether a native implementation handles NULL.
* m4/setenv.m4 (gl_FUNC_SETENV_SEPARATE): Test handling of "" but
not NULL.
* tests/test-setenv.c (main): Relax test.
* tests/test-unsetenv.c (main): Likewise.
* doc/posix-functions/setenv.texi (setenv): Document this.
* doc/posix-functions/unsetenv.texi (unsetenv): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-setenv.c | 4 | ||||
-rw-r--r-- | tests/test-unsetenv.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/test-setenv.c b/tests/test-setenv.c index 61be8381bc..eb1fe3336f 100644 --- a/tests/test-setenv.c +++ b/tests/test-setenv.c @@ -52,9 +52,13 @@ main (void) errno = 0; ASSERT (setenv ("a=b", "", 0) == -1); ASSERT (errno == EINVAL); +#if 0 + /* glibc and gnulib's implementation guarantee this, but POSIX no + longer requires it: http://austingroupbugs.net/view.php?id=185 */ errno = 0; ASSERT (setenv (NULL, "", 0) == -1); ASSERT (errno == EINVAL); +#endif return 0; } diff --git a/tests/test-unsetenv.c b/tests/test-unsetenv.c index 11af82c991..2815cf3a39 100644 --- a/tests/test-unsetenv.c +++ b/tests/test-unsetenv.c @@ -57,9 +57,13 @@ main (void) errno = 0; ASSERT (unsetenv ("a=b") == -1); ASSERT (errno == EINVAL); +#if 0 + /* glibc and gnulib's implementation guarantee this, but POSIX no + longer requires it: http://austingroupbugs.net/view.php?id=185 */ errno = 0; ASSERT (unsetenv (NULL) == -1); ASSERT (errno == EINVAL); +#endif return 0; } |