* dir.cc (rmdir): Correct the manner in checking the target directory.
+2000-05-25 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
+
+ * dir.cc (rmdir): Correct the manner in checking the target directory.
+
Wed May 24 21:59:00 2000 Corinna Vinschen <corinna@vinschen.de>
* dir.cc (writable_directory): Comment out previous code,
/* Under Windows 9X or on a samba share, ERROR_ACCESS_DENIED is
returned if you try to remove a file. On 9X the same error is
returned if you try to remove a non-empty directory. */
- if (GetFileAttributes (real_dir.get_win32()) != FILE_ATTRIBUTE_DIRECTORY)
+ int attr = GetFileAttributes (real_dir.get_win32());
+ if (attr != -1 && !(attr & FILE_ATTRIBUTE_DIRECTORY))
set_errno (ENOTDIR);
else if (os_being_run != winNT)
set_errno (ENOTEMPTY);