forked from clap-rs/clap
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
avoid relying on as_bytes() in OsStr::starts_with() on Windows
Previously, starts_with() would panic on Windows if the OsStr contained any invalid Unicode. Because this method is in the critical path for parsing command line arguments, this meant that Clap up to v2.33.0 on Windows would panic on non-Unicode filenames, even when the application tried to use OsString specifically to account for this case. As a workaround, this commit adds a custom implementation of OsStr::starts_with() for Windows that doesn't rely on as_bytes(). Fixes clap-rs#1905.
- Loading branch information
1 parent
3f1a9b7
commit eb27b4a
Showing
1 changed file
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters