Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/uinfo.cc')
-rw-r--r--winsup/cygwin/uinfo.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index 25c868ce4..46d4b15a6 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -454,19 +454,16 @@ cygheap_user::env_systemroot (const char *name, size_t namelen)
{
if (!psystemroot)
{
- int size = GetWindowsDirectory (NULL, 0);
+ int size = GetSystemWindowsDirectoryW (NULL, 0);
if (size > 0)
{
- psystemroot = (char *) cmalloc_abort (HEAP_STR, ++size);
- size = GetWindowsDirectory (psystemroot, size);
- if (size <= 0)
- {
- cfree (psystemroot);
- psystemroot = NULL;
- }
+ WCHAR wsystemroot[size];
+ size = GetSystemWindowsDirectoryW (wsystemroot, size);
+ if (size > 0)
+ sys_wcstombs_alloc (&psystemroot, HEAP_STR, wsystemroot);
}
if (size <= 0)
- debug_printf ("GetWindowsDirectory(), %E");
+ debug_printf ("GetSystemWindowsDirectoryW(), %E");
}
return psystemroot;
}