aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2008-08-30 10:55:45 +0000
committerEli Zaretskii2008-08-30 10:55:45 +0000
commit70d7ae36dd2b57b5023dca4cfc48a3d5533ab82c (patch)
treeb64acf41136c5dca06662ad0664646ba9635eaf5 /src
parent4c7f3f68187a31d355666cd3757e7715f75c18f3 (diff)
downloademacs-70d7ae36dd2b57b5023dca4cfc48a3d5533ab82c.tar.gz
emacs-70d7ae36dd2b57b5023dca4cfc48a3d5533ab82c.zip
(stat): Only root directory passed to GetDriveType. Allow RAM disk as well
as local fixed disk when w32-get-true-file-attributes is set to `local'.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog6
-rw-r--r--src/w32.c14
2 files changed, 19 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 9282748191a..4a16ff32b11 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,9 @@
12008-08-30 Eli Zaretskii <eliz@gnu.org>
2
3 * w32.c (stat): Only root directory passed to GetDriveType. Allow
4 RAM disk as well as local fixed disk when
5 w32-get-true-file-attributes is set to `local'.
6
12008-08-30 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 72008-08-30 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2 8
3 * macterm.c [USE_CG_DRAWING] (mac_draw_cg_image): 9 * macterm.c [USE_CG_DRAWING] (mac_draw_cg_image):
diff --git a/src/w32.c b/src/w32.c
index aa6c21e4402..3c2fae73a4b 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -2390,6 +2390,8 @@ int
2390stat (const char * path, struct stat * buf) 2390stat (const char * path, struct stat * buf)
2391{ 2391{
2392 char *name, *r; 2392 char *name, *r;
2393 char drive_root[4];
2394 UINT devtype;
2393 WIN32_FIND_DATA wfd; 2395 WIN32_FIND_DATA wfd;
2394 HANDLE fh; 2396 HANDLE fh;
2395 DWORD fake_inode; 2397 DWORD fake_inode;
@@ -2491,9 +2493,19 @@ stat (const char * path, struct stat * buf)
2491 } 2493 }
2492 } 2494 }
2493 2495
2496 /* GetDriveType needs the root directory of NAME's drive. */
2497 if (!(strlen (name) >= 2 && IS_DEVICE_SEP (name[1])))
2498 devtype = GetDriveType (NULL); /* use root of current diectory */
2499 else
2500 {
2501 strncpy (drive_root, name, 3);
2502 drive_root[3] = '\0';
2503 devtype = GetDriveType (drive_root);
2504 }
2505
2494 if (!(NILP (Vw32_get_true_file_attributes) 2506 if (!(NILP (Vw32_get_true_file_attributes)
2495 || (EQ (Vw32_get_true_file_attributes, Qlocal) && 2507 || (EQ (Vw32_get_true_file_attributes, Qlocal) &&
2496 GetDriveType (name) != DRIVE_FIXED)) 2508 devtype != DRIVE_FIXED && devtype != DRIVE_RAMDISK))
2497 /* No access rights required to get info. */ 2509 /* No access rights required to get info. */
2498 && (fh = CreateFile (name, 0, 0, NULL, OPEN_EXISTING, 2510 && (fh = CreateFile (name, 0, 0, NULL, OPEN_EXISTING,
2499 FILE_FLAG_BACKUP_SEMANTICS, NULL)) 2511 FILE_FLAG_BACKUP_SEMANTICS, NULL))