Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3155)

Unified Diff: base/file_util_win.cc

Issue 285803002: Fix DeleteFile of an empty path on Windows XP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/file_util_win.cc
diff --git a/base/file_util_win.cc b/base/file_util_win.cc
index eb9c6dc23dcf3f3eff8177d6c5083f7a9318385d..adf6608f4e3f16e32238fb46c6b2ae2cbaa5fc04 100644
--- a/base/file_util_win.cc
+++ b/base/file_util_win.cc
@@ -51,6 +51,11 @@ bool DeleteFile(const FilePath& path, bool recursive) {
if (path.value().length() >= MAX_PATH)
return false;
+ // On XP SHFileOperation will return ERROR_ACCESS_DENIED instead of
+ // ERROR_FILE_NOT_FOUND, so just shortcut this here.
+ if (path.empty())
+ return true;
+
if (!recursive) {
// If not recursing, then first check to see if |path| is a directory.
// If it is, then remove it with RemoveDirectory.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698