浏览代码

Rewrite getenv

Eric Andersen 23 年之前
父节点
当前提交
560dd2f77a
共有 1 个文件被更改,包括 0 次插入25 次删除
  1. 0 25
      libc/stdlib/getenv.c

+ 0 - 25
libc/stdlib/getenv.c

@@ -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;
-}