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
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-10-29 13:40:47 +0300
committerCorinna Vinschen <corinna@vinschen.de>2014-10-29 13:40:47 +0300
commit5da7a22be0f2035da004c9f3a3dc228c575a526f (patch)
tree91b5cd479cf4d71114b76a15f6d4444acfdc0708 /winsup
parentd5b68452aa332f8241e7dbe493cdb0433188b15f (diff)
* cygheap.cc (init_cygheap::init_installation_root): Create content of
installation_dir as non-prefixed path, if possible.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/cygheap.cc16
2 files changed, 18 insertions, 3 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index ee1fff587..5e88b8046 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,10 @@
2014-10-29 Corinna Vinschen <corinna@vinschen.de>
+ * cygheap.cc (init_cygheap::init_installation_root): Create content of
+ installation_dir as non-prefixed path, if possible.
+
+2014-10-29 Corinna Vinschen <corinna@vinschen.de>
+
* common.din (__cxa_atexit): Define as cygwin__cxa_atexit.
* dcrt0.cc (cygwin__cxa_atexit): New function. Explain what we do.
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index 97090affc..fd851ac6d 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -130,7 +130,7 @@ init_cygheap::close_ctty ()
cygcheck can print the paths into which the Cygwin DLL has been
installed for debugging purposes.
- Last but not least, the new cygwin properties datastrcuture is checked
+ Last but not least, the new cygwin properties datastructure is checked
for the "disabled_key" value, which is used to determine whether the
installation key is actually added to all object names or not. This is
used as a last resort for debugging purposes, usually. However, there
@@ -140,6 +140,8 @@ init_cygheap::close_ctty ()
void
init_cygheap::init_installation_root ()
{
+ ptrdiff_t len = 0;
+
if (!GetModuleFileNameW (cygwin_hmodule, installation_root, PATH_MAX))
api_fatal ("Can't initialize Cygwin installation root dir.\n"
"GetModuleFileNameW(%p, %p, %u), %E",
@@ -147,6 +149,7 @@ init_cygheap::init_installation_root ()
PWCHAR p = installation_root;
if (wcsncasecmp (p, L"\\\\", 2)) /* Normal drive letter path */
{
+ len = 4;
memmove (p + 4, p, PATH_MAX - 4);
p = wcpncpy (p, L"\\\\?\\", 4);
}
@@ -155,6 +158,7 @@ init_cygheap::init_installation_root ()
bool unc = false;
if (wcsncmp (p + 2, L"?\\", 2)) /* No long path prefix, so UNC path. */
{
+ len = 6;
memmove (p + 6, p, PATH_MAX - 6);
p = wcpncpy (p, L"\\??\\UN", 6);
*p = L'C';
@@ -189,9 +193,15 @@ init_cygheap::init_installation_root ()
/* Copy result into installation_dir before stripping off "bin" dir and
revert to Win32 path. This path is added to the Windows environment
in buildenv. See there for a description. */
- installation_dir_len = wcpncpy (installation_dir, installation_root, PATH_MAX)
+ installation_dir_len = wcpncpy (installation_dir, installation_root + len,
+ PATH_MAX)
- installation_dir;
- installation_dir[1] = L'\\';
+ if (len == 4) /* Local path */
+ ;
+ else if (len == 6) /* UNC path */
+ installation_dir[0] = L'\\';
+ else /* Long, prefixed path */
+ installation_dir[1] = L'\\';
/* If w < p, the Cygwin DLL resides in the root dir of a drive or network
path. In that case, if we strip off yet another backslash, the path