From 5a7da73a6de1f6505bcc183880cc60b99a352380 Mon Sep 17 00:00:00 2001 From: Wesley Shields Date: Wed, 24 Jul 2024 16:45:10 -0400 Subject: [PATCH] fix: Fix handling invalid(?) unicode in filenames. When running yr scan against some random files I have laying around I noticed a crash. I think it is because there is invalid (at least I think it is, I'm so bad at understanding unicode) unicode in the filename of one of the files contained in 84523ddad722e205e2d52eedfb682026928b63f919a7bf1ce6f1ad4180d0f507 (available on VT). This changes it so the string is using the debug formatter which handles the invalid utf-8 better? This seems to work fine on my machine. --- cli/src/commands/scan.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cli/src/commands/scan.rs b/cli/src/commands/scan.rs index 3eb654e43..18dff336f 100644 --- a/cli/src/commands/scan.rs +++ b/cli/src/commands/scan.rs @@ -566,7 +566,7 @@ impl Component for ScanState { for (file, start_time) in self.files_in_progress.lock().unwrap().iter() { - let path = file.display().to_string(); + let path = format!("{:?}", file.display().to_string()); // The length of the elapsed is 7 characters. let spaces = " " .repeat(dimensions.width.saturating_sub(path.len() + 7));