mirror of
https://github.com/sharkdp/fd
synced 2024-11-02 15:11:27 +00:00
Do not include non-files when using --size
This commit is contained in:
parent
0bbc7f5219
commit
4172ed03f0
1 changed files with 14 additions and 8 deletions
|
@ -249,7 +249,8 @@ pub fn scan(path_vec: &[PathBuf], pattern: Arc<Regex>, config: Arc<FdOptions>) {
|
|||
}
|
||||
|
||||
// Filter out unwanted sizes if it is a file and we have been given size constraints.
|
||||
if config.size_constraints.len() > 0 && entry_path.is_file() {
|
||||
if config.size_constraints.len() > 0 {
|
||||
if entry_path.is_file() {
|
||||
if let Ok(metadata) = entry_path.metadata() {
|
||||
let file_size = metadata.len();
|
||||
if config
|
||||
|
@ -259,6 +260,11 @@ pub fn scan(path_vec: &[PathBuf], pattern: Arc<Regex>, config: Arc<FdOptions>) {
|
|||
{
|
||||
return ignore::WalkState::Continue;
|
||||
}
|
||||
} else {
|
||||
return ignore::WalkState::Continue;
|
||||
}
|
||||
} else {
|
||||
return ignore::WalkState::Continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue