aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-09-09 16:29:14 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2024-09-09 16:29:14 +0300
commite0385d5e3fd8bdd160ff959c0950a8f351d39a7b (patch)
tree19c79451fe21eab4d4ce9b68d12ceebc62f85453
parent85fbf3f0284268073fdfe1ed6d9dbfe54dc4d4bb (diff)
Fix path_entry() not to fail for non-existent drives on WindowsHEADmaster
-rw-r--r--libbutl/filesystem.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/libbutl/filesystem.cxx b/libbutl/filesystem.cxx
index 28a0de8..3153e77 100644
--- a/libbutl/filesystem.cxx
+++ b/libbutl/filesystem.cxx
@@ -268,7 +268,15 @@ namespace butl
ec == ERROR_INVALID_NAME ||
ec == ERROR_INVALID_DRIVE ||
ec == ERROR_BAD_PATHNAME ||
- ec == ERROR_BAD_NETPATH;
+ ec == ERROR_BAD_NETPATH ||
+ //
+ // Note that for reasons unknown, filesystem entry stat functions
+ // (GetFileAttributesExA(), etc) may end up with the
+ // ERROR_NOT_READY error code rather than ERROR_INVALID_DRIVE for
+ // paths on non-existent drives. Thus, we treat the ERROR_NOT_READY
+ // error code in the same way as ERROR_INVALID_DRIVE here.
+ //
+ ec == ERROR_NOT_READY;
}
static inline bool