Skip to content

Commit

Permalink
Fix empty filename case
Browse files Browse the repository at this point in the history
  • Loading branch information
PaDarochek committed Mar 6, 2024
1 parent c2ce4c8 commit 27521c4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions casr/src/bin/casr-cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -824,12 +824,16 @@ fn print_summary(dir: &Path, unique_crash_line: bool) {
.map(|res| res.unwrap().path())
.any(|e| e.extension().is_some() && e.extension().unwrap() == "casrep")
{
clusters.push((dir.to_path_buf(), 0));
clusters.push((dir.canonicalize().unwrap().to_path_buf(), 0));
}

for (clpath, _) in clusters {
let cluster = clpath.as_path();
let filename = cluster.file_name().unwrap().to_str().unwrap();
let filename = if let Some(cl_filename) = cluster.file_name() {
cl_filename.to_str().unwrap()
} else {
cluster.to_str().unwrap()

Check warning on line 835 in casr/src/bin/casr-cli.rs

View check run for this annotation

Codecov / codecov/patch

casr/src/bin/casr-cli.rs#L835

Added line #L835 was not covered by tests
};

// Ubsan indicator for minimize logging
let mut ubsan = true;
Expand Down

0 comments on commit 27521c4

Please sign in to comment.