summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib/getenv.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2007-05-01 16:02:44 +0000
committerache <ache@FreeBSD.org>2007-05-01 16:02:44 +0000
commit6ccaf050cc62bc9d81ac3acb71ce640739caa0f7 (patch)
treee3e0b3658b8df3a905b3117d8535bb15f42c9e80 /lib/libc/stdlib/getenv.c
parent61e9800ad7707590037d6868c703475f36cf7058 (diff)
downloadFreeBSD-src-6ccaf050cc62bc9d81ac3acb71ce640739caa0f7.zip
FreeBSD-src-6ccaf050cc62bc9d81ac3acb71ce640739caa0f7.tar.gz
Back out all POSIXified *env() changes.
Not because I admit they are technically wrong and not because of bug reports (I receive nothing). But because I surprisingly meets so strong opposition and resistance so lost any desire to continue that. Anyone who interested in POSIX can dig out what changes and how through cvs diffs.
Diffstat (limited to 'lib/libc/stdlib/getenv.c')
-rw-r--r--lib/libc/stdlib/getenv.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libc/stdlib/getenv.c b/lib/libc/stdlib/getenv.c
index 9ff18d8..306b6a1 100644
--- a/lib/libc/stdlib/getenv.c
+++ b/lib/libc/stdlib/getenv.c
@@ -43,7 +43,7 @@ inline char *__findenv(const char *, int *);
* __findenv --
* Returns pointer to value associated with name, if any, else NULL.
* Sets offset to be the offset of the name/value combination in the
- * environmental array, for use by putenv(3), setenv(3) and unsetenv(3).
+ * environmental array, for use by setenv(3) and unsetenv(3).
* Explicitly removes '=' in argument name.
*
* This routine *should* be a static; don't use it.
@@ -58,7 +58,7 @@ __findenv(name, offset)
const char *np;
char **p, *cp;
- if (environ == NULL)
+ if (name == NULL || environ == NULL)
return (NULL);
for (np = name; *np && *np != '='; ++np)
continue;
@@ -85,8 +85,5 @@ getenv(name)
{
int offset;
- if (name == NULL || !*name || strchr(name, '=') != NULL)
- return (NULL);
-
return (__findenv(name, &offset));
}
OpenPOWER on IntegriCloud