summaryrefslogtreecommitdiff
path: root/m4
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2009-12-10 12:18:31 -0700
committerEric Blake <ebb9@byu.net>2009-12-11 13:57:28 -0700
commit91e21656de5ae1e87d23465ce46e738be45a7254 (patch)
tree26245d771735e0a0ae14408abcdce507cff8e7ee /m4
parenta3255b1b9848874572e0df9d0609e263da50de4b (diff)
downloadgnulib-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 'm4')
-rw-r--r--m4/setenv.m44
1 files changed, 2 insertions, 2 deletions
diff --git a/m4/setenv.m4 b/m4/setenv.m4
index a5df034aa6..29e6866742 100644
--- a/m4/setenv.m4
+++ b/m4/setenv.m4
@@ -1,4 +1,4 @@
-# setenv.m4 serial 13
+# setenv.m4 serial 14
dnl Copyright (C) 2001-2004, 2006-2009 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -26,7 +26,7 @@ AC_DEFUN([gl_FUNC_SETENV_SEPARATE],
#include <stdlib.h>
#include <errno.h>
]], [[
- if (setenv (NULL, "", 0) != -1) return 1;
+ if (setenv ("", "", 0) != -1) return 1;
if (errno != EINVAL) return 2;
if (setenv ("a", "=", 1) != 0) return 3;
if (strcmp (getenv ("a"), "=") != 0) return 4;