diff options
author | Christopher Faylor <me@cgf.cx> | 2004-05-28 19:50:07 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2004-05-28 19:50:07 +0000 |
commit | e3778517d9c6409c9c917db83ccac20de1800a29 (patch) | |
tree | 407e958798d6f156ff0762350734b7b92cf032d8 /winsup/cygwin/dir.cc | |
parent | dccc3e5d2c6059410c12feb9e5d26f3176334011 (diff) | |
download | cygnal-e3778517d9c6409c9c917db83ccac20de1800a29.tar.gz cygnal-e3778517d9c6409c9c917db83ccac20de1800a29.tar.bz2 cygnal-e3778517d9c6409c9c917db83ccac20de1800a29.zip |
* path.cc (chdir): Always use the normalized_path as posix_cwd, except if it
starts with a drive.
Also perform whitespace cleanup.
Diffstat (limited to 'winsup/cygwin/dir.cc')
-rw-r--r-- | winsup/cygwin/dir.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/winsup/cygwin/dir.cc b/winsup/cygwin/dir.cc index d0a650434..e74498fb0 100644 --- a/winsup/cygwin/dir.cc +++ b/winsup/cygwin/dir.cc @@ -292,7 +292,7 @@ rmdir (const char *dir) (DWORD) real_dir & ~FILE_ATTRIBUTE_READONLY); for (bool is_cwd = false; ; is_cwd = true) - { + { DWORD err; int rc = RemoveDirectory (real_dir); DWORD att = GetFileAttributes (real_dir); @@ -304,8 +304,8 @@ rmdir (const char *dir) /* RemoveDirectory on a samba drive doesn't return an error if the directory can't be removed because it's not empty. Checking for existence afterwards keeps us informed about success. */ - if (att == INVALID_FILE_ATTRIBUTES) - { + if (att == INVALID_FILE_ATTRIBUTES) + { res = 0; break; } @@ -327,19 +327,19 @@ rmdir (const char *dir) SetCurrentDirectory. */ if (strcasematch (real_dir, cygheap->cwd.win32) - && !strcasematch ("c:\\", cygheap->cwd.win32) + && !strcasematch ("c:\\", cygheap->cwd.win32) && !is_cwd && SetCurrentDirectory ("c:\\")) continue; - - /* On 9X ERROR_ACCESS_DENIED is returned + + /* On 9X ERROR_ACCESS_DENIED is returned if you try to remove a non-empty directory. */ if (err == ERROR_ACCESS_DENIED && wincap.access_denied_on_delete ()) err = ERROR_DIR_NOT_EMPTY; - + __seterrno_from_win_error (err); - + /* Directory still exists, restore its characteristics. */ if (real_dir.has_attribute (FILE_ATTRIBUTE_READONLY)) SetFileAttributes (real_dir, real_dir); |