|
Last change
on this file since 18 was 18, checked in by bird, 23 years ago |
|
Initial revision
|
-
Property cvs2svn:cvs-rev
set to
1.1
-
Property svn:eol-style
set to
native
-
Property svn:executable
set to
*
|
|
File size:
391 bytes
|
| Line | |
|---|
| 1 | /* getenv.c (emx+gcc) -- Copyright (c) 1990-1995 by Eberhard Mattes */
|
|---|
| 2 |
|
|---|
| 3 | #include <stdlib.h>
|
|---|
| 4 | #include <string.h>
|
|---|
| 5 |
|
|---|
| 6 | char *getenv (const char *name)
|
|---|
| 7 | {
|
|---|
| 8 | int len;
|
|---|
| 9 | char **p;
|
|---|
| 10 |
|
|---|
| 11 | if (name == NULL || _environ == NULL)
|
|---|
| 12 | return NULL;
|
|---|
| 13 | len = strlen (name);
|
|---|
| 14 | for (p = _environ; *p != NULL; ++p)
|
|---|
| 15 | if (strncmp (*p, name, len) == 0 && (*p)[len] == '=')
|
|---|
| 16 | return *p + len + 1;
|
|---|
| 17 | return NULL;
|
|---|
| 18 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.