Cygwin: cygheap: convert installation paths to UNICODE_STRINGS

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2018-12-25 01:06:34 +01:00
parent a7f392686b
commit 866901441b
5 changed files with 30 additions and 25 deletions

View File

@@ -1282,10 +1282,11 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
during execve. */
if (!saw_PATH)
{
new_tl += cygheap->installation_dir_len + 5;
new_tl += cygheap->installation_dir.Length / sizeof (WCHAR) + 5;
if (new_tl > tl)
tl = raise_envblock (new_tl, envblock, s);
s = wcpcpy (wcpcpy (s, L"PATH="), cygheap->installation_dir) + 1;
s = wcpcpy (wcpcpy (s, L"PATH="),
cygheap->installation_dir.Buffer) + 1;
}
*s = L'\0'; /* Two null bytes at the end */
assert ((s - envblock) <= tl); /* Detect if we somehow ran over end