Mercurial > emacs
comparison src/w32.c @ 97488:caf9103a3856
(stat): Only root directory passed to GetDriveType.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Fri, 15 Aug 2008 13:52:30 +0000 |
parents | 2c195017488c |
children | bb6b5c0fc1ba |
comparison
equal
deleted
inserted
replaced
97487:999b2122b66c | 97488:caf9103a3856 |
---|---|
2877 inode values without hacks in the main Emacs code. */ | 2877 inode values without hacks in the main Emacs code. */ |
2878 int | 2878 int |
2879 stat (const char * path, struct stat * buf) | 2879 stat (const char * path, struct stat * buf) |
2880 { | 2880 { |
2881 char *name, *r; | 2881 char *name, *r; |
2882 char drive_root[4]; | |
2883 UINT devtype; | |
2882 WIN32_FIND_DATA wfd; | 2884 WIN32_FIND_DATA wfd; |
2883 HANDLE fh; | 2885 HANDLE fh; |
2884 unsigned __int64 fake_inode; | 2886 unsigned __int64 fake_inode; |
2885 int permission; | 2887 int permission; |
2886 int len; | 2888 int len; |
2981 } | 2983 } |
2982 FindClose (fh); | 2984 FindClose (fh); |
2983 } | 2985 } |
2984 } | 2986 } |
2985 | 2987 |
2988 /* GetDriveType needs the root directory of NAME's drive. */ | |
2989 if (!(strlen (name) >= 2 && IS_DEVICE_SEP (name[1]))) | |
2990 devtype = GetDriveType (NULL); /* use root of current diectory */ | |
2991 else | |
2992 { | |
2993 strncpy (drive_root, name, 3); | |
2994 drive_root[3] = '\0'; | |
2995 devtype = GetDriveType (drive_root); | |
2996 } | |
2997 | |
2986 if (!(NILP (Vw32_get_true_file_attributes) | 2998 if (!(NILP (Vw32_get_true_file_attributes) |
2987 || (EQ (Vw32_get_true_file_attributes, Qlocal) && | 2999 || (EQ (Vw32_get_true_file_attributes, Qlocal) |
2988 GetDriveType (name) != DRIVE_FIXED)) | 3000 && devtype != DRIVE_FIXED && devtype != DRIVE_RAMDISK)) |
2989 /* No access rights required to get info. */ | 3001 /* No access rights required to get info. */ |
2990 && (fh = CreateFile (name, 0, 0, NULL, OPEN_EXISTING, | 3002 && (fh = CreateFile (name, 0, 0, NULL, OPEN_EXISTING, |
2991 FILE_FLAG_BACKUP_SEMANTICS, NULL)) | 3003 FILE_FLAG_BACKUP_SEMANTICS, NULL)) |
2992 != INVALID_HANDLE_VALUE) | 3004 != INVALID_HANDLE_VALUE) |
2993 { | 3005 { |