diff --git a/src/uu/ln/src/ln.rs b/src/uu/ln/src/ln.rs index 3b8ff0d70..0fc72da49 100644 --- a/src/uu/ln/src/ln.rs +++ b/src/uu/ln/src/ln.rs @@ -301,6 +301,7 @@ fn link_files_in_dir(files: &[PathBuf], target_dir: &Path, settings: &Settings) show_error!("Could not update {}: {e}", target_dir.quote()); }; } + #[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 9ef25ef08..998595035 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));