Skip to content

Commit 97d7fa8

Browse files
authored
Merge pull request #135 from phprus/issue-132
Fix for issue #132
2 parents 7bc5c17 + 1f3943b commit 97d7fa8

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

.github/workflows/build_cmake.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,17 +91,17 @@ jobs:
9191
cc: clang
9292
cxx: clang++
9393

94-
- name: "Ubuntu 16.04 Clang 6.0"
95-
os: ubuntu-16.04
94+
- name: "Ubuntu 18.04 Clang 6.0"
95+
os: ubuntu-18.04
9696
build_type: Release
9797
packages: ninja-build clang-6.0
9898
generator: Ninja
9999
compatibility: "cxx_std_11;cxx_std_17"
100100
cc: clang-6.0
101101
cxx: clang++-6.0
102102

103-
- name: "Ubuntu 16.04 Clang 5.0"
104-
os: ubuntu-16.04
103+
- name: "Ubuntu 18.04 Clang 5.0"
104+
os: ubuntu-18.04
105105
build_type: Release
106106
packages: ninja-build clang-5.0
107107
generator: Ninja

include/ghc/filesystem.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4740,7 +4740,7 @@ GHC_INLINE uintmax_t remove_all(const path& p, std::error_code& ec) noexcept
47404740
return static_cast<uintmax_t>(-1);
47414741
}
47424742
std::error_code tec;
4743-
auto fs = status(p, tec);
4743+
auto fs = symlink_status(p, tec);
47444744
if (exists(fs) && is_directory(fs)) {
47454745
for (auto iter = directory_iterator(p, ec); iter != directory_iterator(); iter.increment(ec)) {
47464746
if (ec && !detail::is_not_found_error(ec)) {

test/filesystem_test.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2607,6 +2607,10 @@ TEST_CASE("fs.op.remove_all - remove_all", "[filesystem][operations][fs.op.remov
26072607
CHECK_NOTHROW(fs::remove_all("dir1/non-existing", ec));
26082608
CHECK(!ec);
26092609
CHECK(fs::remove_all("dir1/non-existing", ec) == 0);
2610+
if (is_symlink_creation_supported()) {
2611+
fs::create_directory_symlink("dir1", "dir1link");
2612+
CHECK(fs::remove_all("dir1link") == 1);
2613+
}
26102614
CHECK(fs::remove_all("dir1") == 5);
26112615
CHECK(fs::directory_iterator(t.path()) == fs::directory_iterator());
26122616
}

0 commit comments

Comments
 (0)