* cygheap.h (class cygheap_user): Add psystemroot member and
env_systemroot method. * environ.cc (struct spenv): Add add_always member. (spenvs): Accomodate new add_always member. Add cygheap_user::env_systemroot method to SYSTEMROOT entry. (build_env): Check add_always member when adding missing environment variables from spenvs. * uinfo.cc (cygheap_user::env_systemroot): New method.
This commit is contained in:
@@ -449,6 +449,28 @@ cygheap_user::env_name (const char *name, size_t namelen)
|
||||
return pwinname;
|
||||
}
|
||||
|
||||
const char *
|
||||
cygheap_user::env_systemroot (const char *name, size_t namelen)
|
||||
{
|
||||
if (!psystemroot)
|
||||
{
|
||||
int size = GetWindowsDirectory (NULL, 0);
|
||||
if (size > 0)
|
||||
{
|
||||
psystemroot = (char *) cmalloc (HEAP_STR, ++size);
|
||||
size = GetWindowsDirectory (psystemroot, size);
|
||||
if (size <= 0)
|
||||
{
|
||||
cfree (psystemroot);
|
||||
psystemroot = NULL;
|
||||
}
|
||||
}
|
||||
if (size <= 0)
|
||||
debug_printf ("GetWindowsDirectory(), %E");
|
||||
}
|
||||
return psystemroot;
|
||||
}
|
||||
|
||||
char *
|
||||
pwdgrp::next_str (char c)
|
||||
{
|
||||
|
Reference in New Issue
Block a user