refs #122, fix for dead symlink iteration error

This commit is contained in:
Steffen Schuemann 2021-05-22 07:14:47 +02:00
parent 7e009bcf6f
commit 873a55addf
2 changed files with 7 additions and 2 deletions

View File

@ -551,6 +551,8 @@ to the expected behavior.
### v1.5.5 (WIP)
* Fix for [#122](https://github.com/gulrak/filesystem/issues/122), incrementing
the `recursive_directory_iterator` will not try to enter dead symlinks.
* Fix for [#119](https://github.com/gulrak/filesystem/issues/119), added missing
support for char16_t and char32_t and on C++20 char8_t literals.
* Pull request [#118](https://github.com/gulrak/filesystem/pull/118), when

View File

@ -5802,8 +5802,11 @@ GHC_INLINE recursive_directory_iterator& recursive_directory_iterator::operator+
GHC_INLINE recursive_directory_iterator& recursive_directory_iterator::increment(std::error_code& ec) noexcept
{
bool isDir = (*this)->is_directory(ec);
bool isSymLink = !ec && (*this)->is_symlink(ec);
bool isSymLink = (*this)->is_symlink(ec);
bool isDir = !ec && (*this)->is_directory(ec);
if(isSymLink && detail::is_not_found_error(ec)) {
ec.clear();
}
if(!ec) {
if (recursion_pending() && isDir && (!isSymLink || (options() & directory_options::follow_directory_symlink) != directory_options::none)) {
_impl->_dir_iter_stack.push(directory_iterator((*this)->path(), _impl->_options, ec));