Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/DefaultFileSystem.cpp

Issue 10518027: Don`t use stat() on Windows, use a Unicode-safe Windows function instead (Closed)
Patch Set: Addressed review comments Created May 17, 2013, 10:44 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/AdblockPlus/FileSystem.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/DefaultFileSystem.cpp
===================================================================
--- a/src/DefaultFileSystem.cpp
+++ b/src/DefaultFileSystem.cpp
@@ -92,18 +92,22 @@ void DefaultFileSystem::Remove(const std
FileSystem::StatResult DefaultFileSystem::Stat(const std::string& path) const
{
FileSystem::StatResult result;
#ifdef WIN32
WIN32_FILE_ATTRIBUTE_DATA data;
if (!GetFileAttributesExW(NormalizePath(path).c_str(), GetFileExInfoStandard, &data))
{
DWORD err = GetLastError();
- if (err == ERROR_FILE_NOT_FOUND || ERROR_PATH_NOT_FOUND || ERROR_INVALID_DRIVE)
+ if (err == ERROR_FILE_NOT_FOUND ||
+ err == ERROR_PATH_NOT_FOUND ||
+ err == ERROR_INVALID_DRIVE)
+ {
return result;
+ }
throw RuntimeErrorWithErrno("Unable to stat " + path);
}
result.exists = true;
if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
{
result.isFile = false;
result.isDirectory = true;
« no previous file with comments | « include/AdblockPlus/FileSystem.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld