]> code.delx.au - gnu-emacs/blobdiff - src/w32proc.c
(ftfont_spec_pattern): Don't create a charset of the
[gnu-emacs] / src / w32proc.c
index 33981445c7ca3cceef46c737155525500d959fcd..ed405cce9fff2c8ba05e5fb07531913f347b3262 100644 (file)
@@ -1799,9 +1799,14 @@ All path elements in FILENAME are converted to their long names.  */)
      Lisp_Object filename;
 {
   char longname[ MAX_PATH ];
+  int drive_only = 0;
 
   CHECK_STRING (filename);
 
+  if (SBYTES (filename) == 2
+      && *(SDATA (filename) + 1) == ':')
+    drive_only = 1;
+
   /* first expand it.  */
   filename = Fexpand_file_name (filename, Qnil);
 
@@ -1810,6 +1815,12 @@ All path elements in FILENAME are converted to their long names.  */)
 
   CORRECT_DIR_SEPS (longname);
 
+  /* If we were passed only a drive, make sure that a slash is not appended
+     for consistency with directories.  Allow for drive mapping via SUBST
+     in case expand-file-name is ever changed to expand those.  */
+  if (drive_only && longname[1] == ':' && longname[2] == '/' && !longname[3])
+    longname[2] = '\0';
+
   return build_string (longname);
 }