Skip to content

FoundationEssentials: correct directory enumeration on Windows #629

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2024

Conversation

compnerd
Copy link
Member

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
Copy link
Member Author

@swift-ci please test

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
Copy link
Member Author

@swift-ci please test

@compnerd compnerd merged commit f657181 into swiftlang:main May 22, 2024
2 checks passed
@compnerd compnerd deleted the enumerator branch May 22, 2024 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants