]> git.eshelyaron.com Git - emacs.git/commitdiff
(w32_get_long_filename): Handle root dirs correctly.
authorGeoff Voelker <voelker@cs.washington.edu>
Thu, 10 Dec 1998 05:43:07 +0000 (05:43 +0000)
committerGeoff Voelker <voelker@cs.washington.edu>
Thu, 10 Dec 1998 05:43:07 +0000 (05:43 +0000)
src/w32.c

index 46d95057edbe78ef545e86187c163fa4097cae3e..d50cff56793ee1a2493c2fc9e729b2716587611a 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -503,9 +503,10 @@ w32_get_long_filename (char * name, char * buf, int size)
   len = parse_root (full, &p);
   memcpy (o, full, len);
   o += len;
+  *o = '\0';
   size -= len;
 
-  do
+  while (p != NULL && *p)
     {
       q = p;
       p = strchr (q, '\\');
@@ -528,7 +529,6 @@ w32_get_long_filename (char * name, char * buf, int size)
       else
        return FALSE;
     }
-  while (p != NULL && *p);
 
   return TRUE;
 }