* 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.
This commit is contained in:
Christopher Faylor
2005-12-05 22:30:03 +00:00
parent b1da33a0b0
commit e5a0cf2415
4 changed files with 78 additions and 2 deletions

View File

@ -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. */