Skip to content

Conversation

@compnerd
Copy link
Member

The C-String to Swift-String conversion would corrupt the path on Windows, where the path separator would get dropped. This would result in the inability to use the driver due to the failure to load the standard library as the SDK would not be consulted.

Directly convert the raw buffer to a Data for the foreign representation. Note that this also makes the code clearer as we explicitly see the copying as opposed to the use of the deprecated String(bytesNoCopy:length:encoding:freeWhenDone:) function.

Thanks to @artemcm for the help with this!

The C-String to Swift-String conversion would corrupt the path on
Windows, where the path separator would get dropped.  This would result
in the inability to use the driver due to the failure to load the
standard library as the SDK would not be consulted.

Directly convert the raw buffer to a `Data` for the foreign
representation.  Note that this also makes the code clearer as we
explicitly see the copying as opposed to the use of the deprecated
`String(bytesNoCopy:length:encoding:freeWhenDone:)` function.

Thanks to @artemcm for the help with this!
@compnerd compnerd requested a review from artemcm January 27, 2023 23:52
@compnerd
Copy link
Member Author

@swift-ci please test

compnerd added a commit to compnerd/apple-swift that referenced this pull request Jan 27, 2023
Copy link
Contributor

@artemcm artemcm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @compnerd !

@compnerd compnerd merged commit d8b266c into swiftlang:main Jan 28, 2023
@compnerd compnerd deleted the slasher branch January 28, 2023 16:42
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