diff options
author | Eric Andersen <andersen@codepoet.org> | 2002-08-07 13:04:32 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2002-08-07 13:04:32 +0000 |
commit | 560dd2f77a152c0fd7639ba7ac81cd698c84e65a (patch) | |
tree | 73caf7b4efbd9e6c18c97a07f50f05cc78b26251 /libc/stdlib | |
parent | 8cea9a34c6c3552ad8be8a7d682fb051f99c6aa4 (diff) |
Rewrite getenv
Diffstat (limited to 'libc/stdlib')
-rw-r--r-- | libc/stdlib/getenv.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/libc/stdlib/getenv.c b/libc/stdlib/getenv.c deleted file mode 100644 index 588f696ee..000000000 --- a/libc/stdlib/getenv.c +++ /dev/null @@ -1,25 +0,0 @@ -/* Copyright (C) 1995,1996 Robert de Bath <rdebath@cix.compulink.co.uk> - * This file is part of the Linux-8086 C library and is distributed - * under the GNU Library General Public License. - */ -#include <string.h> -#include <stdlib.h> -#include <unistd.h> -#include <malloc.h> - -char *getenv(const char *var) -{ - char **p; - int len; - - len = strlen(var); - - if (!__environ) - return NULL; - - for (p = __environ; *p; p++) { - if (memcmp(var, *p, len) == 0 && (*p)[len] == '=') - return *p + len + 1; - } - return NULL; -} |