mountlist: tweak previous commit
authorEric Blake <eblake@redhat.com>
Wed, 29 Dec 2010 22:53:15 +0000 (15:53 -0700)
committerEric Blake <eblake@redhat.com>
Wed, 29 Dec 2010 22:53:39 +0000 (15:53 -0700)
* lib/mountlist.c (me_remote): Guarantee trailing backslash.
Reported by Paul Eggert.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
lib/mountlist.c

index f9aff45..2e12c65 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2010-12-29  Eric Blake  <eblake@redhat.com>
 
+       mountlist: tweak previous commit
+       * lib/mountlist.c (me_remote): Guarantee trailing backslash.
+       Reported by Paul Eggert.
+
        mountlist: fix local drive detection on cygwin
        * lib/mountlist.c (ME_REMOTE) [__CYGWIN__]: Provide implementation
        that works for cygwin.
index 126f43d..96e2b26 100644 (file)
@@ -166,7 +166,8 @@ me_remote (char const *fs_name, char const *fs_type _GL_UNUSED)
 {
   if (fs_name[0] && fs_name[1] == ':')
     {
-      char const drive[3] = { fs_name[0], ':', '\0' };
+      char drive[4];
+      sprintf (drive, "%c:\\", fs_name[0]);
       switch (GetDriveType (drive))
         {
         case DRIVE_REMOVABLE: