mirror of
https://github.com/reactos/reactos.git
synced 2025-07-24 16:33:49 +00:00
Hopefully create a branch and not destroy the svn repository.
svn path=/branches/reactos-yarotows/; revision=45219
This commit is contained in:
parent
c88ec84439
commit
6afbc8f483
19442 changed files with 0 additions and 1060695 deletions
48
lib/sdk/crt/stdlib/getenv.c
Normal file
48
lib/sdk/crt/stdlib/getenv.c
Normal file
|
@ -0,0 +1,48 @@
|
|||
/*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
* FILE: lib/crt/??????
|
||||
* PURPOSE: Unknown
|
||||
* PROGRAMER: Unknown
|
||||
* UPDATE HISTORY:
|
||||
* 25/11/05: Added license header
|
||||
*/
|
||||
|
||||
#include <precomp.h>
|
||||
//#undef environ
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
char *getenv(const char *name)
|
||||
{
|
||||
char **environ;
|
||||
unsigned int length = strlen(name);
|
||||
|
||||
for (environ = *__p__environ(); *environ; environ++)
|
||||
{
|
||||
char *str = *environ;
|
||||
char *pos = strchr(str,'=');
|
||||
if (pos && ((unsigned int)(pos - str) == length) && !_strnicmp(str, name, length))
|
||||
return pos + 1;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/*
|
||||
* @implemented
|
||||
*/
|
||||
wchar_t *_wgetenv(const wchar_t *name)
|
||||
{
|
||||
wchar_t **environ;
|
||||
unsigned int length = wcslen(name);
|
||||
|
||||
for (environ = *__p__wenviron(); *environ; environ++)
|
||||
{
|
||||
wchar_t *str = *environ;
|
||||
wchar_t *pos = wcschr(str, L'=');
|
||||
if (pos && ((unsigned int)(pos - str) == length) && !_wcsnicmp(str, name, length))
|
||||
return pos + 1;
|
||||
}
|
||||
return NULL;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue