* 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:
@ -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. */
|
||||
|
Reference in New Issue
Block a user