From f824d0d46ba4da6cb71a1a108ee1f3b9c62136ee Mon Sep 17 00:00:00 2001 From: Steffen Schuemann Date: Sat, 24 Oct 2020 12:03:58 +0200 Subject: [PATCH] refs #77, fix skip_permission_denied inconsistency --- include/ghc/filesystem.hpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/ghc/filesystem.hpp b/include/ghc/filesystem.hpp index 06a0cbe..7ddf233 100644 --- a/include/ghc/filesystem.hpp +++ b/include/ghc/filesystem.hpp @@ -5328,12 +5328,10 @@ class directory_iterator::impl { if (!path.empty()) { _dir = ::opendir(path.native().c_str()); - } - if (!path.empty()) { if (!_dir) { auto error = errno; _base = filesystem::path(); - if (error != EACCES || (options & directory_options::skip_permission_denied) == directory_options::none) { + if ((error != EACCES && error != EPERM) || (options & directory_options::skip_permission_denied) == directory_options::none) { _ec = detail::make_system_error(); } }