X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Ffileio.c;h=64adf94338d09c4a36807a00ea88bc1d4c47c553;hb=2f66a7a3c164a478e7203fc61e3c765de99f1d47;hp=c9bc2ae75ce2fc3382dbc0625b7d02aa8417453f;hpb=8b2e8ef2dee7da2f0d4cea712b0fc55902c3cff7;p=chise%2Fxemacs-chise.git.1 diff --git a/src/fileio.c b/src/fileio.c index c9bc2ae..64adf94 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2307,6 +2307,11 @@ check_writable (const char *filename) filename = filename_buffer; #endif + // First check for a normal file with the old-style readonly bit + attributes = GetFileAttributes(filename); + if (FILE_ATTRIBUTE_READONLY == (attributes & (FILE_ATTRIBUTE_DIRECTORY|FILE_ATTRIBUTE_READONLY))) + return 0; + /* Win32 prototype lacks const. */ error = GetNamedSecurityInfo((LPTSTR)filename, SE_FILE_OBJECT, DACL_SECURITY_INFORMATION|GROUP_SECURITY_INFORMATION|OWNER_SECURITY_INFORMATION,