Skip to content

recursive cp fails on files with trailing backslashes #8739

@simpoir

Description

@simpoir

Although uncommon and probably unwise, linux filenames can end in slash.
uutils-coreutils appears to wrongfull intrepret those as directories and fails copying.

repro:

# cp -V
cp (uutils coreutils) 0.2.2
# mkdir a
# touch a/foo\\
# cp -r a b
cp: 'b/foo\' is not a directory
# ls -la b
total 1
drwxr-xr-x 2 root root 2 Sep 24 23:07 .
drwx------ 6 root root 9 Sep 24 23:07 ..

expected:

# gnucp -r a gnu_b
# ls -la gnu_b/
total 1
drwxr-xr-x 2 root root 3 Sep 24 23:07  .
drwx------ 6 root root 9 Sep 24 23:07  ..
-rw-r--r-- 1 root root 0 Sep 24 23:07 'foo\'

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions