* mount.cc (mount_entries): Handle a "/" cygdrive prefix correctly.

Add comments.
This commit is contained in:
Corinna Vinschen 2009-03-02 10:47:04 +00:00
parent 753a03bf8e
commit 8262e64256
2 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2009-03-02 Corinna Vinschen <corinna@vinschen.de>
* mount.cc (mount_entries): Handle a "/" cygdrive prefix correctly.
Add comments.
2009-02-23 Sjors Gielen <mailinglist@dazjorz.com>
* Makefile.in: Add DESTDIR functionality.

View File

@ -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;