Skip to content

Commit

Permalink
Skip symlinks when collecting symtypes to avoid recursion issues
Browse files Browse the repository at this point in the history
  • Loading branch information
petrpavlu committed Oct 11, 2024
1 parent c7cf077 commit a67e122
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/sym/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,21 @@ impl SymCorpus {
err,
)
})?;

let entry_path = entry.path();
if entry_path.is_dir() {

let md = fs::symlink_metadata(&entry_path).map_err(|err| {
crate::Error::new_io(
&format!("Failed to query path '{}'", entry_path.display()),
err,
)
})?;

if md.is_symlink() {
continue;
}

if md.is_dir() {
Self::collect_symfiles(&entry_path, symfiles)?;
continue;
}
Expand Down

0 comments on commit a67e122

Please sign in to comment.