Skip to content

Commit

Permalink
Avoid canonicalize() in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kyoheiu committed Jan 27, 2024
1 parent 722121c commit 04b8426
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1788,7 +1788,12 @@ fn read_item(entry: fs::DirEntry) -> ItemInfo {
if filetype == FileType::Symlink {
if let Ok(sym_meta) = fs::metadata(&path) {
if sym_meta.is_dir() {
fs::canonicalize(path.clone()).ok()
if cfg!(not(windows)) {
// Avoid error on Windows
path.canonicalize().ok()
} else {
Some(path.clone())
}
} else {
None
}
Expand Down

0 comments on commit 04b8426

Please sign in to comment.