From 81dee25438a4fc40e69f610e760d7a2aab117de6 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Fri, 28 Feb 2020 18:26:09 +0100 Subject: [PATCH] Add additional check for symlink --- src/walk.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/walk.rs b/src/walk.rs index be389ca..ff399b7 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -312,7 +312,12 @@ fn spawn_senders( path, err: inner_err, }) => match inner_err.as_ref() { - ignore::Error::Io(io_error) if io_error.kind() == io::ErrorKind::NotFound => { + ignore::Error::Io(io_error) + if io_error.kind() == io::ErrorKind::NotFound + && path + .symlink_metadata() + .map_or(false, |m| m.file_type().is_symlink()) => + { DirEntry::BrokenSymlink(path.to_owned()) } _ => {