* 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:
Corinna Vinschen
2004-10-07 21:28:57 +00:00
parent 9286b55306
commit 60cb120f3e
4 changed files with 47 additions and 11 deletions

View File

@@ -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)
{