Skip to content

Commit

Permalink
refs #104, fixed noexcept inconsistency
Browse files Browse the repository at this point in the history
  • Loading branch information
gulrak committed Feb 22, 2021
1 parent 8a19af1 commit 5c02ca3
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions include/ghc/filesystem.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5730,22 +5730,26 @@ GHC_INLINE recursive_directory_iterator& recursive_directory_iterator::operator+

GHC_INLINE recursive_directory_iterator& recursive_directory_iterator::increment(std::error_code& ec) noexcept
{
if (recursion_pending() && (*this)->is_directory() && (!(*this)->is_symlink() || (options() & directory_options::follow_directory_symlink) != directory_options::none)) {
_impl->_dir_iter_stack.push(directory_iterator((*this)->path(), _impl->_options, ec));
}
else {
_impl->_dir_iter_stack.top().increment(ec);
}
if (!ec) {
while (depth() && _impl->_dir_iter_stack.top() == directory_iterator()) {
_impl->_dir_iter_stack.pop();
bool isDir = (*this)->is_directory(ec);
bool isSymLink = !ec && (*this)->is_symlink(ec);
if(!ec) {
if (recursion_pending() && (*this)->is_directory() && (!(*this)->is_symlink() || (options() & directory_options::follow_directory_symlink) != directory_options::none)) {
_impl->_dir_iter_stack.push(directory_iterator((*this)->path(), _impl->_options, ec));
}
else {
_impl->_dir_iter_stack.top().increment(ec);
}
if (!ec) {
while (depth() && _impl->_dir_iter_stack.top() == directory_iterator()) {
_impl->_dir_iter_stack.pop();
_impl->_dir_iter_stack.top().increment(ec);
}
}
else if (!_impl->_dir_iter_stack.empty()) {
_impl->_dir_iter_stack.pop();
}
_impl->_recursion_pending = true;
}
else if (!_impl->_dir_iter_stack.empty()) {
_impl->_dir_iter_stack.pop();
}
_impl->_recursion_pending = true;
return *this;
}

Expand Down

0 comments on commit 5c02ca3

Please sign in to comment.