emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/w32.c,v [EMACS_22_BASE]


From: Eli Zaretskii
Subject: [Emacs-diffs] Changes to emacs/src/w32.c,v [EMACS_22_BASE]
Date: Sat, 30 Aug 2008 10:54:06 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Branch:         EMACS_22_BASE
Changes by:     Eli Zaretskii <eliz>    08/08/30 10:54:06

Index: w32.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/w32.c,v
retrieving revision 1.111.2.11
retrieving revision 1.111.2.12
diff -u -b -r1.111.2.11 -r1.111.2.12
--- w32.c       10 May 2008 07:56:42 -0000      1.111.2.11
+++ w32.c       30 Aug 2008 10:54:06 -0000      1.111.2.12
@@ -2390,6 +2390,8 @@
 stat (const char * path, struct stat * buf)
 {
   char *name, *r;
+  char drive_root[4];
+  UINT devtype;
   WIN32_FIND_DATA wfd;
   HANDLE fh;
   DWORD fake_inode;
@@ -2491,9 +2493,19 @@
        }
     }
 
+  /* GetDriveType needs the root directory of NAME's drive.  */
+  if (!(strlen (name) >= 2 && IS_DEVICE_SEP (name[1])))
+    devtype = GetDriveType (NULL); /* use root of current diectory */
+  else
+    {
+      strncpy (drive_root, name, 3);
+      drive_root[3] = '\0';
+      devtype = GetDriveType (drive_root);
+    }
+
   if (!(NILP (Vw32_get_true_file_attributes)
        || (EQ (Vw32_get_true_file_attributes, Qlocal) &&
-           GetDriveType (name) != DRIVE_FIXED))
+           devtype != DRIVE_FIXED && devtype != DRIVE_RAMDISK))
       /* No access rights required to get info.  */
       && (fh = CreateFile (name, 0, 0, NULL, OPEN_EXISTING,
                           FILE_FLAG_BACKUP_SEMANTICS, NULL))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]