When enumerating a directory on Windows, we would fail to increment the iterator as we would increment after the return. Insert a defer'ed increment on the iterator to allow us to track the state properly. Because the iteration was may have completed on the previous run, we need to track an additional bit of state as bValid which provides us an indication if iteration has completed.
When enumerating a directory on Windows, we would fail to increment the iterator as we would increment after the return. Insert a
defer
'ed increment on the iterator to allow us to track the state properly. Because the iteration was may have completed on the previous run, we need to track an additional bit of state asbValid
which provides us an indication if iteration has completed.