Skip to content

Commit

Permalink
[#2] remove_all now counts directories too
Browse files Browse the repository at this point in the history
  • Loading branch information
gulrak committed Sep 23, 2018
1 parent 217fb2b commit 4fbc6e1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion filesystem.h
Original file line number Diff line number Diff line change
Expand Up @@ -3628,7 +3628,7 @@ inline uintmax_t remove_all(const path& p, std::error_code& ec) noexcept
if (ec) {
return static_cast<uintmax_t>(-1);
}
return count;
return ++count;
}

inline void rename(const path& from, const path& to)
Expand Down
2 changes: 1 addition & 1 deletion test/filesystem_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1983,7 +1983,7 @@ TEST_CASE("30.10.15.31 remove_all", "[filesystem][operations][fs.op.remove_all]"
fs::create_directories("dir1/dir1b");
generateFile("dir1/dir1a/f1");
generateFile("dir1/dir1b/f2");
CHECK(fs::remove_all("dir1") == 2);
CHECK(fs::remove_all("dir1") == 5);
CHECK(fs::directory_iterator(t.path()) == fs::directory_iterator());
}

Expand Down

0 comments on commit 4fbc6e1

Please sign in to comment.