Skip to content

A fast file manager for Windows and macOS that never freezes: tabs, dual panes, archives as folders, Quick Look-style previews. A File Explorer and Finder alternative written in Rust.

A file type registered under a non-ASCII name no longer ends the app when opened (1019)

gelenmedyaae3ba134493e
diff --git a/crates/rf-win/src/neighbours.rs b/crates/rf-win/src/neighbours.rs
index e20eb337..d018d734 100644
--- a/crates/rf-win/src/neighbours.rs
+++ b/crates/rf-win/src/neighbours.rs
@@ -45,8 +45,12 @@ pub fn walks_its_neighbours(aumid: &str) -> bool {
}
/// `AppX43hnxtbyyps62jhe9sqpdzxn1790zetc` is a packaged app's file type; `jpegfile` or `IrfanView.jpg` are not. Pure.
+///
+/// Compared as bytes: a ProgID is any text a program registered, and one that begins with letters longer than a byte (issue 1019:
+/// a Chinese program's, "…立…") cut at the fourth byte fell inside a letter, and opening such a file ended rustyfiles.
pub fn is_packaged_progid(progid: &str) -> bool {
- progid.len() > 4 && progid[..4].eq_ignore_ascii_case("appx")
+ let b = progid.as_bytes();
+ b.len() > 4 && b[..4].eq_ignore_ascii_case(b"appx")
}
/// The Windows property a folder's sort column is (for the order the app walks the files in). The columns Windows has no property
@@ -166,6 +170,10 @@ mod tests {
assert!(!is_packaged_progid("IrfanView.jpg"));
assert!(!is_packaged_progid("AppX"));
assert!(!is_packaged_progid(""));
+ // (issue 1019: these ended the program, cut inside a letter)
+ assert!(!is_packaged_progid("嘉立创EDA.eprj2"));
+ assert!(!is_packaged_progid("a立创"));
+ assert!(!is_packaged_progid("立"));
assert!(walks_its_neighbours("Microsoft.Windows.Photos_8wekyb3d8bbwe!App"));
assert!(walks_its_neighbours("Microsoft.ZuneMusic_8wekyb3d8bbwe!Microsoft.ZuneMusic"));
assert!(!walks_its_neighbours("57469Pictureflect.PictureflectPhotoViewer_xxxx!App"), "another app opens through the shell");