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:
authorCorinna Vinschen <corinna@vinschen.de>2012-02-08 21:45:43 +0400
committerCorinna Vinschen <corinna@vinschen.de>2012-02-08 21:45:43 +0400
commita7a03a3920777a685564a2b285f3bdce808b53b6 (patch)
tree8540f9a3dbf877a3cad928b0b15328049f968bb9 /winsup/cygwin/uinfo.cc
parent8f4ea5f005c7fe645048e5de3ed11d2744d89028 (diff)
* uinfo.cc (cygheap_user::env_userprofile): Convert native
userprofile path returned from get_registry_hive_path to Win32 path.
Diffstat (limited to 'winsup/cygwin/uinfo.cc')
-rw-r--r--winsup/cygwin/uinfo.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc
index ee90e52d3..eddfcec2b 100644
--- a/winsup/cygwin/uinfo.cc
+++ b/winsup/cygwin/uinfo.cc
@@ -440,7 +440,15 @@ cygheap_user::env_userprofile (const char *name, size_t namelen)
cfree_and_set (puserprof, almost_null);
if (get_registry_hive_path (get_windows_id (win_id), userprofile_env_buf))
- sys_wcstombs_alloc (&puserprof, HEAP_STR, userprofile_env_buf);
+ {
+ PWCHAR up = userprofile_env_buf + 4;
+ if (!wcsncasecmp (up, L"UNC\\", 4))
+ {
+ up += 2;
+ *up = L'\\';
+ }
+ sys_wcstombs_alloc (&puserprof, HEAP_STR, up);
+ }
return puserprof;
}