apple / swift-foundation

The Foundation project
Apache License 2.0
2.29k stars 135 forks source link

FoundationEssentials: correct directory enumeration on Windows #629

Closed compnerd closed 1 month ago

compnerd commented 1 month ago

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.

compnerd commented 1 month ago

@swift-ci please test

compnerd commented 1 month ago

@swift-ci please test