Skip to content

Commit 24399d5

Browse files
committed
minor changes
1 parent 651fc7c commit 24399d5

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/uu/cp/src/cp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ fn construct_dest_path(
13321332
Ok(match target_type {
13331333
TargetType::Directory => {
13341334
let root = if options.parents {
1335-
if source_path.has_root() {
1335+
if source_path.has_root() && cfg!(unix) {
13361336
Path::new("/")
13371337
} else {
13381338
Path::new("")

tests/by-util/test_cp.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5576,6 +5576,7 @@ fn test_preserve_attrs_overriding_2() {
55765576

55775577
/// Test the behavior of preserving permissions when copying through a symlink
55785578
#[test]
5579+
#[cfg(unix)]
55795580
fn test_cp_symlink_permissions() {
55805581
let scene = TestScenario::new(util_name!());
55815582
let at = &scene.fixtures;
@@ -5597,6 +5598,7 @@ fn test_cp_symlink_permissions() {
55975598

55985599
/// Test the behavior of preserving permissions of parents when copying through a symlink
55995600
#[test]
5601+
#[cfg(unix)]
56005602
fn test_cp_parents_symlink_permissions_file() {
56015603
let scene = TestScenario::new(util_name!());
56025604
let at = &scene.fixtures;
@@ -5620,6 +5622,7 @@ fn test_cp_parents_symlink_permissions_file() {
56205622
/// Test the behavior of preserving permissions of parents when copying through
56215623
/// a symlink when source is a dir.
56225624
#[test]
5625+
#[cfg(unix)]
56235626
fn test_cp_parents_symlink_permissions_dir() {
56245627
let scene = TestScenario::new(util_name!());
56255628
let at = &scene.fixtures;
@@ -5640,6 +5643,7 @@ fn test_cp_parents_symlink_permissions_dir() {
56405643
}
56415644

56425645
/// Test the behavior of copying a file to a destination with parents using absolute paths.
5646+
#[cfg(unix)]
56435647
#[test]
56445648
fn test_cp_parents_absolute_path() {
56455649
let scene = TestScenario::new(util_name!());

0 commit comments

Comments
 (0)