Skip to content

Commit

Permalink
fix: Fix handling invalid(?) unicode in filenames.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
wxsBSD committed Jul 24, 2024
1 parent 14f42ba commit 5a7da73
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/src/commands/scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 5a7da73

Please sign in to comment.