XEmacs 21.4.21.
[chise/xemacs-chise.git.1] / src / fileio.c
index c9bc2ae..64adf94 100644 (file)
@@ -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,