lib/setenv.c


Log

Author Commit Date CI Message
Eric Blake e37c1207 2010-04-16T14:21:29 setenv: allow compilation with C++ * lib/setenv.c (__add_to_environ): Add a cast. Also, drop use of register keyword. Signed-off-by: Eric Blake <eblake@redhat.com>
Jim Meyering b2e2010c 2010-01-01T10:31:12 update nearly all FSF copyright year lists to include 2010 Use the same procedure as for 2009, outlined in http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/20081
Bruno Haible 69482508 2009-12-11T01:15:28 New module 'arg-nonnull'. Declare which arguments expect non-NULL values.
Bruno Haible 441aa304 2009-12-10T20:28:30 Use spaces for indentation, not tabs.
Eric Blake 8dffeb6f 2009-11-14T22:13:10 setenv, unsetenv: work around various bugs POSIX requires setenv(NULL,"",0), setenv("a=b","",0), unsetenv(NULL), and unsetenv("a=b") to fail with EINVAL, but many BSD implementations lack validation. The gnulib replacement for void unsetenv did not do validation, and the replacement for setenv was out of sync with glibc. Also, some BSD implementations of setenv("a","==",1) eat the leading '='. See also some recent Austin Group interpretations on environ: http://austingroupbugs.net/view.php?id=167 http://austingroupbugs.net/view.php?id=185 * lib/setenv.c (setenv) [!HAVE_SETENV]: Resync from glibc. (setenv) [HAVE_SETENV]: Work around bugs. * lib/unsetenv.c (unsetenv) [HAVE_UNSETENV]: Work around bugs. * m4/setenv.m4 (gl_FUNC_SETENV_SEPARATE, gl_FUNC_UNSETENV): Check for bugs. (gl_FUNC_SETENV): Write in terms of gl_FUNC_SETENV_SEPARATE. * m4/environ.m4 (gl_ENVIRON): Avoid expand-before-require. * m4/stdlib_h.m4 (gl_STDLIB_H_DEFAULTS): Update defaults. * modules/stdlib (Makefile.am): Update substitutions. * lib/stdlib.in.h (setenv, unsetenv): Update prototypes. * doc/posix-functions/setenv.texi (setenv): Document the bugs. * doc/posix-functions/unsetenv.texi (unsetenv): Likewise. * modules/setenv-tests: New test. * modules/unsetenv-tests: Likewise. * tests/test-setenv.c: New file. * tests/test-unsetenv.c: Likewise. Signed-off-by: Eric Blake <ebb9@byu.net>
Bruno Haible 22eb7728 2008-02-24T16:40:15 New module 'environ'.
Bruno Haible 81e61b22 2007-12-26T16:20:10 Split setenv module into setenv and unsetenv. Get rid of setenv.h.
Bruno Haible 57fdfd3f 2007-10-07T19:14:58 Change copyright notice from GPLv2+ to GPLv3+.
Bruno Haible 90988ede 2007-06-09T11:11:14 Update after allocsa -> malloca renaming.
Bruno Haible 44381706 2007-03-03T19:42:31 Make it possible to compile setenv.c separately, unconditionally.
Paul Eggert 0632e115 2006-09-13T22:38:14 * _fpending.c: Include <config.h> unconditionally, since we no longer worry about uses that don't define HAVE_CONFIG_H. * acl.c, alloca.c, argmatch.c, atexit.c, backupfile.c: * basename.c, c-stack.c, c-strtod.c, calloc.c, canon-host.c: * canonicalize.c, chdir-long.c, chdir-safer.c, chown.c: * cloexec.c, close-stream.c, closeout.c, creat-safer.c: * cycle-check.c, diacrit.c, dirchownmod.c, dirfd.c, dirname.c: * dup-safer.c, dup2.c, error.c, euidaccess.c, exclude.c: * exitfail.c, fchmodat.c, fchown-stub.c, fd-safer.c: * file-type.c, fileblocks.c, filemode.c, filenamecat.c: * fnmatch.c, fopen-safer.c, fprintftime.c, free.c, fsusage.c: * ftruncate.c, fts-cycle.c, fts.c, full-write.c, gai_strerror.c: * getcwd.c, getdate.y, getdomainname.c, getgroups.c: * gethostname.c, gethrxtime.c, getloadavg.c, getlogin_r.c: * getndelim2.c, getnline.c, getopt.c, getopt1.c, getpass.c: * gettime.c, gettimeofday.c, getugroups.c, getusershell.c: * glob.c, group-member.c, hard-locale.c, hash-pjw.c, hash.c: * human.c, idcache.c, inet_ntop.c, inet_pton.c, inttostr.c: * isdir.c, lchown.c, linebuffer.c, long-options.c, lstat.c: * malloc.c, md5.c, memcasecmp.c, memchr.c, memcmp.c, memcoll.c: * memcpy.c, memmove.c, memrchr.c, mkancesdirs.c, mkdir-p.c: * mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c, modechange.c: * mountlist.c, nanosleep.c, obstack.c, open-safer.c: * openat-die.c, openat.c, pagealign_alloc.c, physmem.c: * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c: * quotearg.c, raise.c, readtokens.c, readtokens0.c, readutmp.c: * realloc.c, regex.c, rename.c, rmdir.c, rpmatch.c, safe-read.c: * same.c, save-cwd.c, savedir.c, setenv.c, settime.c, sha1.c: * sig2str.c, snprintf.c, strdup.c, strerror.c, strftime.c: * stripslash.c, strndup.c, strnlen.c, strpbrk.c, strtod.c: * strtoimax.c, strtol.c, strverscmp.c, tempname.c, time_r.c: * timegm.c, tmpfile-safer.c, unlinkdir.c, userspec.c, utime.c: * utimecmp.c, utimens.c, version-etc-fsf.c, version-etc.c: * xalloc-die.c, xgetcwd.c, xgethostname.c, xmalloc.c: * xmemcoll.c, xnanosleep.c, xreadlink.c, xstrtod.c: * xstrtoimax.c, xstrtol.c, xstrtoumax.c, yesno.c: Likewise.
Bruno Haible caf80066 2006-07-29T14:38:53 setenv.c comes from gettext / libiconv again.
Karl Berry 183b57c6 2006-03-22T22:08:04 sync from coreutils
Jim Meyering 31589505 2006-02-27T06:37:59 undo last change -- this file is sync'd from gettext
Jim Meyering da326536 2006-02-24T10:09:59 Normalize inclusion of `config.h'.
Paul Eggert 267a39ba 2005-05-14T06:03:57 *** empty log message ***
Karl Berry 2a3f7e67 2005-03-02T14:56:43 sync (copyright years)
Paul Eggert a62be9f4 2004-08-07T00:09:38 Merge from coreutils.
Bruno Haible cca613ab 2004-01-20T17:05:34 Use allocsa instead of alloca.
Paul Eggert fa9635f2 2003-09-12T18:24:51 Remove K&R cruft.
Bruno Haible 7dd7a67c 2003-09-10T14:16:32 Assume ANSI C <string.h>, <stdlib.h>.
Paul Eggert 757bd39e 2003-07-14T22:44:04 Update gettext source files from gettext automatically, using srclist-update.
Bruno Haible 48dbf2c1 2003-01-10T21:06:49 Make it possibly to simply write: #include <alloca.h>.
Bruno Haible 336175d0 2002-12-11T20:31:00 setenv and unsetenv.
Jim Meyering d349992d 2000-07-09T07:22:43 update copyright date
Jim Meyering 783c1624 1996-07-15T03:56:06 indent cpp-directives
Jim Meyering aa9ba4a2 1996-04-01T04:29:28 (unsetenv): unprotoize.
Jim Meyering 692c4b6e 1996-03-31T23:30:43 .