OSDN Git Service

* mount.cc (mount_info::get_mounts_here): Don't subtract 2 from
authorcorinna <corinna>
Fri, 15 Aug 2008 12:33:26 +0000 (12:33 +0000)
committercorinna <corinna>
Fri, 15 Aug 2008 12:33:26 +0000 (12:33 +0000)
Length if it's 0 anyway.

winsup/cygwin/ChangeLog
winsup/cygwin/mount.cc

index 5fa71b4..f8c4be1 100644 (file)
@@ -1,5 +1,10 @@
 2008-08-15  Corinna Vinschen  <corinna@vinschen.de>
 
+       * mount.cc (mount_info::get_mounts_here): Don't subtract 2 from
+       Length if it's 0 anyway.
+
+2008-08-15  Corinna Vinschen  <corinna@vinschen.de>
+
        * mount.cc (mount_info::create_root_entry): Create default cygdrive
        prefix with MOUNT_NOPOSIX flag.
 
index 3636386..03b6ff8 100644 (file)
@@ -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;
 }