Add unsetenv to libroken.

Fix telnet(d) to link with libroken.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@455 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Björn Groenvall
1996-05-01 16:23:49 +00:00
parent 12c36f4d0a
commit 2acd35f94f
6 changed files with 59 additions and 77 deletions

35
lib/roken/unsetenv.c Normal file
View File

@@ -0,0 +1,35 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdlib.h>
RCSID("$Id$");
extern char **environ;
/*
* unsetenv --
*/
void
unsetenv(const char *name)
{
int len;
const char *np;
char **p;
if (name == 0 || environ == 0)
return;
for (np = name; *np && *np != '='; np++)
/* nop */;
len = np - name;
for (p = environ; *p != 0; p++)
if (strncmp(*p, name, len) == 0 && (*p)[len] == '=')
break;
for (; *p != 0; p++)
*p = *(p + 1);
}