Zhenbo Li litimetal@gmail.com writes:
@@ -353,8 +353,13 @@ static BOOL SHELL_DeleteDirectoryW(HWND hwnd, LPCWSTR pszDir, BOOL bShowUI) HANDLE hFind; WIN32_FIND_DATAW wfd; WCHAR szTemp[MAX_PATH];
DWORD attrib;
/* Make sure the directory exists before eventually prompting the user */
attrib = GetFileAttributesW(pszDir);
if (attrib == INVALID_FILE_ATTRIBUTES || !(attrib & FILE_ATTRIBUTE_DIRECTORY))
return FALSE;
It would be better to avoid a redundant file lookup, particularly since it's only to set last error (which BTW you are not setting at all in the non-directory case).