Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PaDarochek committed Mar 10, 2024
1 parent f1c99b8 commit 6a706c8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions casr/src/bin/casr-cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -824,6 +824,7 @@ fn print_summary(dir: &Path, unique_crash_line: bool) {
.map(|res| res.unwrap().path())
.any(|e| e.extension().is_some() && e.extension().unwrap() == "casrep")
{
// Try to canonocalize directory path to avoid paths with empty file_name.
if let Ok(canon_dir) = dir.canonicalize() {
clusters.push((canon_dir.to_path_buf(), 0));
} else {
Expand All @@ -833,6 +834,8 @@ fn print_summary(dir: &Path, unique_crash_line: bool) {

for (clpath, _) in clusters {
let cluster = clpath.as_path();
// file_name may be empty if path ends with '.', '..', or '/'.
// Take the whole path as filename then.
let filename = if let Some(cl_filename) = cluster.file_name() {
cl_filename.to_str().unwrap()
} else {
Expand Down

0 comments on commit 6a706c8

Please sign in to comment.