diff --git a/src/uu/ln/src/ln.rs b/src/uu/ln/src/ln.rs index dcaad9099f2..283778c54c5 100644 --- a/src/uu/ln/src/ln.rs +++ b/src/uu/ln/src/ln.rs @@ -302,6 +302,7 @@ fn link_files_in_dir(files: &[PathBuf], target_dir: &Path, settings: &Settings) show_error!("Could not update {}: {}", target_dir.quote(), e); }; } + #[cfg(windows)] if target_dir.is_dir() { // Not sure why but on Windows, the symlink can be // considered as a dir diff --git a/tests/by-util/test_ln.rs b/tests/by-util/test_ln.rs index b8089f401ec..5d74884165d 100644 --- a/tests/by-util/test_ln.rs +++ b/tests/by-util/test_ln.rs @@ -549,7 +549,11 @@ fn test_symlink_no_deref_dir() { scene.ucmd().args(&["-sn", dir1, link]).fails(); // Try with the no-deref - scene.ucmd().args(&["-sfn", dir1, link]).succeeds(); + scene + .ucmd() + .args(&["-sfn", dir1, link]) + .succeeds() + .no_stderr(); assert!(at.dir_exists(dir1)); assert!(at.dir_exists(dir2)); assert!(at.is_symlink(link));