mirror of
https://github.com/reactos/reactos.git
synced 2025-06-27 04:19:43 +00:00
Create a branch for cmake bringup.
svn path=/branches/cmake-bringup/; revision=48236
This commit is contained in:
parent
a28e798006
commit
c424146e2c
20602 changed files with 0 additions and 1140137 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