Fix a bug in fs::recursive_directory_iterator()
The 4th element of directory_iterator() controls if it should advance to the first non special directory entry (not . nor ..). If m_iter advances itself and m_iter->path() is a directory then the next call to recursive_directory_iterator.increment() will not step down into this directory.pull/1116/head
parent
6f666280fd
commit
a2a67c59e8
|
@ -367,7 +367,8 @@ recursive_directory_iterator::recursive_directory_iterator(const path& p, direct
|
||||||
if (m_dirs == nullptr)
|
if (m_dirs == nullptr)
|
||||||
m_dirs = std::shared_ptr<DirStack>(new DirStack);
|
m_dirs = std::shared_ptr<DirStack>(new DirStack);
|
||||||
|
|
||||||
m_iter = directory_iterator(p, options, ec);
|
m_iter = directory_iterator(p, options, ec, false);
|
||||||
|
__increment(ec); // advance to the first element
|
||||||
|
|
||||||
if (m_iter == end(m_iter))
|
if (m_iter == end(m_iter))
|
||||||
reset();
|
reset();
|
||||||
|
|
Loading…
Reference in New Issue