944 |
return (char *) base; |
return (char *) base; |
945 |
} |
} |
946 |
#endif /* HAVE_BASENAME */ |
#endif /* HAVE_BASENAME */ |
947 |
|
|
948 |
|
#ifndef HAVE_UNSETENV |
949 |
|
#define __environ environ |
950 |
|
extern char **environ; |
951 |
|
|
952 |
|
void |
953 |
|
unsetenv (name) |
954 |
|
const char *name; |
955 |
|
{ |
956 |
|
const size_t len = strlen (name); |
957 |
|
char **ep; |
958 |
|
|
959 |
|
for (ep = __environ; *ep; ++ep) |
960 |
|
if (!strncmp (*ep, name, len) && (*ep)[len] == '=') |
961 |
|
{ |
962 |
|
/* Found it. Remove this pointer by moving later ones back. */ |
963 |
|
char **dp = ep; |
964 |
|
do |
965 |
|
dp[0] = dp[1]; |
966 |
|
while (*dp++); |
967 |
|
/* Continue the loop in case NAME appears again. */ |
968 |
|
} |
969 |
|
|
970 |
|
} |
971 |
|
#endif /* !HAVE_UNSETENV */ |