diff options
author | Fredrik Medley <fredrik.medley@autoliv.com> | 2017-12-19 13:49:07 (GMT) |
---|---|---|
committer | Fredrik Medley <fredrik.medley@autoliv.com> | 2017-12-19 13:55:08 (GMT) |
commit | 6c864097ef11da366fb4070e6ab9f34d6a293766 (patch) | |
tree | 9bff85fbbb84b0d4c79cb67cbbb09a3cebfc4112 /src/disk_interface.cc | |
parent | ed11516a03583602fbaae2748f3d428542096136 (diff) | |
download | Ninja-6c864097ef11da366fb4070e6ab9f34d6a293766.zip Ninja-6c864097ef11da366fb4070e6ab9f34d6a293766.tar.gz Ninja-6c864097ef11da366fb4070e6ab9f34d6a293766.tar.bz2 |
Fix stat when subdirectory is a file
Make sure that stat on Windows, both with and without cache, returns
"missing file" when running stat on notadir/foo where notadir is a
file.
Diffstat (limited to 'src/disk_interface.cc')
-rw-r--r-- | src/disk_interface.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/disk_interface.cc b/src/disk_interface.cc index aba6ab2..0a5991d 100644 --- a/src/disk_interface.cc +++ b/src/disk_interface.cc @@ -105,7 +105,8 @@ bool StatAllFilesInDir(const string& dir, map<string, TimeStamp>* stamps, if (find_handle == INVALID_HANDLE_VALUE) { DWORD win_err = GetLastError(); - if (win_err == ERROR_FILE_NOT_FOUND || win_err == ERROR_PATH_NOT_FOUND) + if (win_err == ERROR_FILE_NOT_FOUND || win_err == ERROR_PATH_NOT_FOUND || + win_err == ERROR_DIRECTORY) // File and not a directory return true; *err = "FindFirstFileExA(" + dir + "): " + GetLastErrorString(); return false; |