Skip to content

Fix stability of compare_strings_ascii - #823

Merged
Leonard Hecker (lhecker) merged 1 commit into
mainfrom
dev/lhecker/ascii-sort
Apr 27, 2026
Merged

Leonard Hecker (lhecker) merged 1 commit into
mainfrom
dev/lhecker/ascii-sort

Conversation

@lhecker

Copy link
Copy Markdown
Member

Closes #822

Comment thread crates/edit/src/icu.rs
// case-insensitive equal, because then we use that as a fallback.
while let Some((&a, &b)) = iter.next() {
if a != b {
let mut order = a.cmp(&b);

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The default value for order must always be la.cmp(&lb) (high weight: case-insensitive). Only if it's Equal must it fall back to a.cmp(&b) (low weight: case-sensitive).

@lhecker
Leonard Hecker (lhecker) enabled auto-merge (squash) April 27, 2026 19:27
auto-merge was automatically disabled April 27, 2026 19:27

Pull request was closed

@lhecker
Leonard Hecker (lhecker) enabled auto-merge (squash) April 27, 2026 19:28
@lhecker
Leonard Hecker (lhecker) merged commit 2bb7c10 into main Apr 27, 2026
10 checks passed
@lhecker
Leonard Hecker (lhecker) deleted the dev/lhecker/ascii-sort branch April 27, 2026 19:31
@DHowett

Copy link
Copy Markdown
Member

Leonard Hecker (@lhecker) how on earth did this fix a crash in the file picker

@lhecker

Copy link
Copy Markdown
Member Author

Dustin L. Howett (@DHowett) Rust detects non-deterministic sorters at runtime. This bug caused vmlinuz2 < w32process.ps1 < Willkommen, but also vmlinuz2 > Willkommen, which is impossible.

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.

Edit crashes in the file picker

2 participants