Skip to content

Conversation

@3405691582
Copy link
Member

strsep modifies its first argument, which means that if we don't make a copy, any PATH processing that may occur after _CFProcessPath executes breaks because strsep will effectively change PATH to be only the first list item. For example, swiftpm's tool finding fails because it searches PATH, and if the tool in question doesn't reside in the first PATH item, things break.

This only occurs on BSD and only when the program name, i.e., argv[0], is not an absolute path.

(As a heads up: this should be picked onto release branches.)

strsep modifies its first argument, which means that if we don't make a
copy, any PATH processing that may occur after _CFProcessPath executes
breaks because strsep will effectively change PATH to be only the first
list item. For example, swiftpm's tool finding fails because it searches
PATH, and if the tool in question doesn't reside in the first PATH item,
things break.

This only occurs on BSD and only when the program name, i.e., argv[0], is
not an absolute path.
@3405691582 3405691582 requested a review from parkera November 23, 2025 00:25
@3405691582
Copy link
Member Author

@swift-ci please test.

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.

1 participant