-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Special case the posix locale in WildcardPattern #10186
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
|
|
@@ -142,7 +142,11 @@ StringComparison GetStringComparison() | |||
| { | ||||
| stringComparison = Options.HasFlag(WildcardOptions.CultureInvariant) | ||||
| ? StringComparison.InvariantCultureIgnoreCase | ||||
| : StringComparison.CurrentCultureIgnoreCase; | ||||
| : CultureInfo.CurrentCulture.Name.Equals("en-US-POSIX", StringComparison.OrdinalIgnoreCase) | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add a test case? We have one for.. hashtable.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. PowerShell/test/powershell/Language/Parser/LanguageAndParser.TestFollowup.Tests.ps1 Line 307 in 1ce2de4
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test added. Two things to be noted:
|
||||
| // The collation behavior of the POSIX locale (also known as the C locale) is case sensitive. | ||||
| // For this specific locale, we use 'OrdinalIgnoreCase'. | ||||
| ? StringComparison.OrdinalIgnoreCase | ||||
| : StringComparison.CurrentCultureIgnoreCase; | ||||
| } | ||||
| else | ||||
| { | ||||
|
|
||||
Uh oh!
There was an error while loading. Please reload this page.