Skip to content

Commit 949a5b0

Browse files
authored
Merge pull request #105 from kyoheiu/master
fixes #104 fixes nushell/nushell#3977
2 parents 408e579 + b40bfcd commit 949a5b0

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

src/lib.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,11 @@ fn fill_todo(
855855
} else {
856856
path.join(&s)
857857
};
858-
if (special && is_dir) || (!special && fs::metadata(&next_path).is_ok()) {
858+
if (special && is_dir)
859+
|| (!special
860+
&& (fs::metadata(&next_path).is_ok()
861+
|| fs::symlink_metadata(&next_path).is_ok()))
862+
{
859863
add(todo, next_path);
860864
}
861865
}
@@ -1097,15 +1101,13 @@ mod test {
10971101
// check windows absolute paths with host/device components
10981102
let root_with_device = current_dir()
10991103
.ok()
1100-
.and_then(|p| {
1101-
match p.components().next().unwrap() {
1102-
Component::Prefix(prefix_component) => {
1103-
let path = Path::new(prefix_component.as_os_str());
1104-
path.join("*");
1105-
Some(path.to_path_buf())
1106-
}
1107-
_ => panic!("no prefix in this path"),
1104+
.and_then(|p| match p.components().next().unwrap() {
1105+
Component::Prefix(prefix_component) => {
1106+
let path = Path::new(prefix_component.as_os_str());
1107+
path.join("*");
1108+
Some(path.to_path_buf())
11081109
}
1110+
_ => panic!("no prefix in this path"),
11091111
})
11101112
.unwrap();
11111113
// FIXME (#9639): This needs to handle non-utf8 paths

0 commit comments

Comments
 (0)