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>2009-03-02 13:47:04 +0300
committerCorinna Vinschen <corinna@vinschen.de>2009-03-02 13:47:04 +0300
commit8262e64256c78033641dd1ce6b68452adc2b647f (patch)
tree8be736220aeafe5e7c5e03c99642c3629633475f /winsup/utils/mount.cc
parent753a03bf8e01cd738885a11922618ef6401a9f92 (diff)
* mount.cc (mount_entries): Handle a "/" cygdrive prefix correctly.
Add comments.
Diffstat (limited to 'winsup/utils/mount.cc')
-rw-r--r--winsup/utils/mount.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/winsup/utils/mount.cc b/winsup/utils/mount.cc
index 464240f75..fd2d6c539 100644
--- a/winsup/utils/mount.cc
+++ b/winsup/utils/mount.cc
@@ -386,9 +386,15 @@ mount_entries (void)
char opts[strlen (p->mnt_opts) + 1];
convert_spaces (dirname, p->mnt_dir);
+ // remove trailing slash
char *ls = strrchr (dirname, '/');
- if (ls && ls > dirname)
- *ls = '\0';
+ if (ls)
+ {
+ // last slash == leading slash? cygdrive prefix == "/"
+ if (ls == dirname)
+ ++ls;
+ *ls = '\0';
+ }
*stpncpy (opts, p->mnt_opts, noumount - p->mnt_opts) = '\0';
printf (format_cyg, dirname, opts);
break;