Skip to content

Commit

Permalink
refs #122, fix for dead symlink iteration error
Browse files Browse the repository at this point in the history
  • Loading branch information
gulrak committed May 22, 2021
1 parent 7e009bc commit 873a55a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions include/ghc/filesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 873a55a

Please sign in to comment.