Repository navigation
fix: Windows shortcut ico lookup and case-insensitive system directory guard - #304
Merged
Merged
Conversation
Shortcut icon lookups scanned ImageFormat::ALL, which excludes Ico, so prepared Windows shortcut icons were never found, listed or removed. Scan ICO for shortcut icons only; other artwork kinds are unchanged. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DGbCKVdcUfJfjZ93bYY9p3
The SystemRoot guard compared paths component by component with the raw environment value, so C:\WINDOWS and C:\Windows did not match. Compare normalized Windows path strings instead. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DGbCKVdcUfJfjZ93bYY9p3
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed?
Two small Windows fixes from the review, one commit each:
.icoicons never found:existing_pathsscannedImageFormat::ALL, which has noIco, sopath(ShortcutIcon)always returnedNoneand.icofiles were orphaned. NewArtworkKind::formats()ingame_artwork.rs:ShortcutIconalso scans ICO;IconandBannerkeepALL(the constant is unchanged becausemodding/mod_icons.rsuses it too).%SystemRoot%guard was case-sensitive:is_system_directorynow usesis_within_windows_directory, which normalizes case and separators, trims trailing separators and requires a separator boundary (C:\WindowsAppsdoes not matchC:\Windows). Also covers the caller ingame_library.rs. The helper is compiled for tests so it runs on Linux CI.Validation
cargo test game_uninstall10 passed,cargo test game_artwork16 passed; clippy and fmt clean.shortcut_ico_is_found_by_path,system_directory_match.cfg(windows)path itself is not compiled on Linux).Generated by Claude Code