1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-06-25 14:22:54 +02:00

Merge pull request #157 from CannedYerins/follow-explicit-args

Always follow symlinks on explicit file arguments
This commit is contained in:
Andrew Gallant
2016-10-10 19:11:10 -04:00
committed by GitHub
2 changed files with 22 additions and 1 deletions

View File

@ -708,7 +708,9 @@ impl Args {
/// Create a new recursive directory iterator at the path given.
pub fn walker(&self, path: &Path) -> Result<walk::Iter> {
let mut wd = WalkDir::new(path).follow_links(self.follow);
// Always follow symlinks for explicitly specified files.
let mut wd = WalkDir::new(path).follow_links(self.follow
|| path.is_file());
if let Some(maxdepth) = self.maxdepth {
wd = wd.max_depth(maxdepth);
}