aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-11-05 12:59:58 +0200
committerKaren Arutyunov <karen@codesynthesis.com>2024-11-05 12:59:58 +0200
commit34e3bf8d8e01e72d760dc11e600de40a6756f9cd (patch)
tree206a39315cd0458900ba659b9b3335ccc47719e3
parentd061c88ae81eb5e1354526f07f9f8d90d0732656 (diff)
Fix path_entry() not to fail for non-existent drives on Windows
-rw-r--r--libbutl/filesystem.cxx10
1 files changed, 6 insertions, 4 deletions
diff --git a/libbutl/filesystem.cxx b/libbutl/filesystem.cxx
index 3153e77..7c43aa0 100644
--- a/libbutl/filesystem.cxx
+++ b/libbutl/filesystem.cxx
@@ -272,11 +272,13 @@ namespace butl
//
// 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.
+ // ERROR_NOT_READY or ERROR_INVALID_PARAMETER error code rather
+ // than ERROR_INVALID_DRIVE for paths on non-existent drives. Thus,
+ // we treat the ERROR_NOT_READY and ERROR_INVALID_PARAMETER error
+ // codes in the same way as ERROR_INVALID_DRIVE here.
//
- ec == ERROR_NOT_READY;
+ ec == ERROR_NOT_READY ||
+ ec == ERROR_INVALID_PARAMETER;
}
static inline bool