From 34e3bf8d8e01e72d760dc11e600de40a6756f9cd Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 5 Nov 2024 12:59:58 +0200 Subject: Fix path_entry() not to fail for non-existent drives on Windows --- libbutl/filesystem.cxx | 10 ++++++---- 1 file 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 -- cgit v1.1