diff --git a/filesystem.h b/filesystem.h index 2d5dbc9..6ce1c80 100644 --- a/filesystem.h +++ b/filesystem.h @@ -3628,7 +3628,7 @@ inline uintmax_t remove_all(const path& p, std::error_code& ec) noexcept if (ec) { return static_cast(-1); } - return count; + return ++count; } inline void rename(const path& from, const path& to) diff --git a/test/filesystem_test.cpp b/test/filesystem_test.cpp index 47765e0..f895de0 100644 --- a/test/filesystem_test.cpp +++ b/test/filesystem_test.cpp @@ -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()); }