mirror of
https://github.com/reactos/reactos.git
synced 2025-08-06 05:22:56 +00:00
[SHELL/EXPERIMENTS]
* Create a branch for some evul shell experiments. svn path=/branches/shell-experiments/; revision=61927
This commit is contained in:
parent
d09f611410
commit
527f2f9057
20177 changed files with 0 additions and 1312061 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 **env;
|
||||
size_t length = strlen(name);
|
||||
|
||||
for (env = *__p__environ(); *env; env++)
|
||||
{
|
||||
char *str = *env;
|
||||
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 **env;
|
||||
size_t length = wcslen(name);
|
||||
|
||||
for (env = *__p__wenviron(); *env; env++)
|
||||
{
|
||||
wchar_t *str = *env;
|
||||
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