Skip to content

Commit

Permalink
Use case-insensitive comparison for detecting rye.exe (#1286)
Browse files Browse the repository at this point in the history
## Summary

This check can be subtly incorrect on case-insensitive filesystems
(e.g., NTFS). Seems easiest to just make the whole comparison
case-insensitive.

Closes #1284.
  • Loading branch information
charliermarsh committed Jul 27, 2024
1 parent 1ce72f2 commit 05f1c49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rye/src/cli/shim.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn detect_shim(args: &[OsString]) -> Option<String> {

// rye is itself placed in the shims folder, so it must not
// detect itself.
if shim_name == "rye" || shim_name == "rye.exe" {
if shim_name.eq_ignore_ascii_case("rye") || shim_name.eq_ignore_ascii_case("rye.exe") {
return None;
}

Expand Down

0 comments on commit 05f1c49

Please sign in to comment.