Merge pull request #135 from phprus/issue-132

Fix for issue #132
This commit is contained in:
gulrak 2021-10-01 07:42:52 +02:00 committed by GitHub
commit 97d7fa8d10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 5 deletions

View File

@ -91,8 +91,8 @@ jobs:
cc: clang cc: clang
cxx: clang++ cxx: clang++
- name: "Ubuntu 16.04 Clang 6.0" - name: "Ubuntu 18.04 Clang 6.0"
os: ubuntu-16.04 os: ubuntu-18.04
build_type: Release build_type: Release
packages: ninja-build clang-6.0 packages: ninja-build clang-6.0
generator: Ninja generator: Ninja
@ -100,8 +100,8 @@ jobs:
cc: clang-6.0 cc: clang-6.0
cxx: clang++-6.0 cxx: clang++-6.0
- name: "Ubuntu 16.04 Clang 5.0" - name: "Ubuntu 18.04 Clang 5.0"
os: ubuntu-16.04 os: ubuntu-18.04
build_type: Release build_type: Release
packages: ninja-build clang-5.0 packages: ninja-build clang-5.0
generator: Ninja generator: Ninja

View File

@ -4740,7 +4740,7 @@ GHC_INLINE uintmax_t remove_all(const path& p, std::error_code& ec) noexcept
return static_cast<uintmax_t>(-1); return static_cast<uintmax_t>(-1);
} }
std::error_code tec; std::error_code tec;
auto fs = status(p, tec); auto fs = symlink_status(p, tec);
if (exists(fs) && is_directory(fs)) { if (exists(fs) && is_directory(fs)) {
for (auto iter = directory_iterator(p, ec); iter != directory_iterator(); iter.increment(ec)) { for (auto iter = directory_iterator(p, ec); iter != directory_iterator(); iter.increment(ec)) {
if (ec && !detail::is_not_found_error(ec)) { if (ec && !detail::is_not_found_error(ec)) {

View File

@ -2607,6 +2607,10 @@ TEST_CASE("fs.op.remove_all - remove_all", "[filesystem][operations][fs.op.remov
CHECK_NOTHROW(fs::remove_all("dir1/non-existing", ec)); CHECK_NOTHROW(fs::remove_all("dir1/non-existing", ec));
CHECK(!ec); CHECK(!ec);
CHECK(fs::remove_all("dir1/non-existing", ec) == 0); CHECK(fs::remove_all("dir1/non-existing", ec) == 0);
if (is_symlink_creation_supported()) {
fs::create_directory_symlink("dir1", "dir1link");
CHECK(fs::remove_all("dir1link") == 1);
}
CHECK(fs::remove_all("dir1") == 5); CHECK(fs::remove_all("dir1") == 5);
CHECK(fs::directory_iterator(t.path()) == fs::directory_iterator()); CHECK(fs::directory_iterator(t.path()) == fs::directory_iterator());
} }