diff options
author | Christopher Faylor <me@cgf.cx> | 2005-12-05 22:30:03 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-12-05 22:30:03 +0000 |
commit | e5a0cf24156069135fcbcf6519280ae3eea6267c (patch) | |
tree | 6f843276d6493becef6434f7b7adf83be689fdf1 /winsup/cygwin/environ.cc | |
parent | b1da33a0b031088846a1fb6417f73c4a8cd35853 (diff) | |
download | cygnal-e5a0cf24156069135fcbcf6519280ae3eea6267c.tar.gz cygnal-e5a0cf24156069135fcbcf6519280ae3eea6267c.tar.bz2 cygnal-e5a0cf24156069135fcbcf6519280ae3eea6267c.zip |
* include/cygwin/stdlib.h: New file.
* environ.cc (unsetenv): Change to return -1 on input error.
* include/cygwin/version.h: Add more description to latest api bump.
Diffstat (limited to 'winsup/cygwin/environ.cc')
-rw-r--r-- | winsup/cygwin/environ.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index e7bd292c7..af950dd05 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -362,17 +362,25 @@ setenv (const char *name, const char *value, int overwrite) } /* unsetenv(name) -- Delete environment variable "name". */ -extern "C" void +extern "C" int unsetenv (const char *name) { register char **e; int offset; + myfault efault; + if (efault.faulted () || *name == '\0' || strchr (name, '=')) + { + set_errno (EINVAL); + return -1; + } while (my_findenv (name, &offset)) /* if set multiple times */ /* Move up the rest of the array */ for (e = cur_environ () + offset; ; e++) if (!(*e = *(e + 1))) break; + + return 0; } /* Turn environment variable part of a=b string into uppercase. */ |