diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 5fa71b4cb..f8c4be131 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2008-08-15 Corinna Vinschen + + * mount.cc (mount_info::get_mounts_here): Don't subtract 2 from + Length if it's 0 anyway. + 2008-08-15 Corinna Vinschen * mount.cc (mount_info::create_root_entry): Create default cygdrive diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc index 36363868d..03b6ff80c 100644 --- a/winsup/cygwin/mount.cc +++ b/winsup/cygwin/mount.cc @@ -355,7 +355,8 @@ mount_info::get_mounts_here (const char *parent_dir, int parent_dir_len, last_slash + 1); } RtlCreateUnicodeStringFromAsciiz (cygd, cygdrive + 1); - cygd->Length -= 2; // Strip trailing slash + if (cygd->Length) + cygd->Length -= 2; // Strip trailing slash return n_mounts; }