This is the mail archive of the
cygwin-apps-cvs
mailing list for the cygwin-apps project.
[setup] branch master, updated. release_2.873-3-ga9a8e93
- From: corinna at sourceware dot org
- To: cygwin-apps-cvs at sourceware dot org
- Date: 1 Dec 2015 11:14:35 -0000
- Subject: [setup] branch master, updated. release_2.873-3-ga9a8e93
https://sourceware.org/git/gitweb.cgi?p=cygwin-setup.git;h=a9a8e93a21763260eeb0b14b0747af86c9056cc2
commit a9a8e93a21763260eeb0b14b0747af86c9056cc2
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Tue Dec 1 12:14:29 2015 +0100
Make sure Cygwin root is an absolute path
* mount.cc (read_mounts): Always convert root dir path from command line
to an absolute path.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
ChangeLog | 5 +++++
mount.cc | 14 ++++++++++----
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 7236582..c977b9f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2015-12-01 Corinna Vinschen <corinna@vinschen.de>
+
+ * mount.cc (read_mounts): Always convert root dir path from command line
+ to an absolute path.
+
2015-08-04 Jon Turney <jon.turney@dronecode.org.uk>
* dialog.cc (fatal): Use mbox rather than MessageBox.
diff --git a/mount.cc b/mount.cc
index 303c138..d4c869b 100644
--- a/mount.cc
+++ b/mount.cc
@@ -320,10 +320,16 @@ read_mounts (const std::string val)
if (val.size ())
{
- m->native = val;
- m->posix = "/";
- root_here = m;
- add_usr_mnts (++m);
+ /* Cygwin rootdir always < MAX_PATH. */
+ char rootdir[MAX_PATH + 1];
+
+ if (GetFullPathName (val.c_str (), MAX_PATH + 1, rootdir, NULL))
+ {
+ m->native = rootdir;
+ m->posix = "/";
+ root_here = m;
+ add_usr_mnts (++m);
+ }
}
else
{