Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,14 +395,26 @@ namespace
}
else
itr = fs::directory_iterator(p);
for (; itr != end_dir_itr; ++itr)
while (itr != end_dir_itr)
{
fs::file_type tmp_type = query_file_type(itr->path(), ec);
if (ec != 0 && *ec)
return count;
count += remove_all_aux(itr->path(), tmp_type, ec);
if (ec != 0 && *ec)
return count;

// Don't let ++itr throw when reporting errors via ec.
if (ec != 0)
{
itr.increment(*ec);
if (*ec)
return count;
}
else
{
++itr;
}
}
}
remove_file_or_directory(p, type, ec);
Expand Down Expand Up @@ -2394,7 +2406,7 @@ namespace detail
&& (filename.size()== 1
|| (filename[1] == dot
&& filename.size()== 2)))
{ it.increment(*ec); }
{ ec ? it.increment(*ec) : ++it; }
}
}

Expand Down