diff options
author | Andrew Gallant <jamslam@gmail.com> | 2016-10-10 19:11:10 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-10 19:11:10 -0400 |
commit | c9d0ca8257d7ccb3d65b607f4b3969198bce1e40 (patch) | |
tree | 01a724dad6c8c5848e1abd8bfa15417c84888df5 /src | |
parent | 45fe4aab9699a9395a46e96a2b796042d8d85f26 (diff) | |
parent | 1c964372ad7cfb70116101480638e39a0d07d762 (diff) |
Merge pull request #157 from CannedYerins/follow-explicit-args
Always follow symlinks on explicit file arguments
Diffstat (limited to 'src')
-rw-r--r-- | src/args.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/args.rs b/src/args.rs index 6cca1256..365749d8 100644 --- a/src/args.rs +++ b/src/args.rs @@ -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); } |