Skip to content

cp: normalize paths before checking for duplicate sources #6824

@matrixhead

Description

@matrixhead

The cp command generally does not allow duplicate source files.
for example

touch a; mkdir d;
cp a a d/ 

This produces:

cp: warning: source file 'a' specified more than once

Additionally, when providing paths like this:

cp ./a a d/ 

GNU cp correctly identifies these two paths as pointing to the same file, while our implementation currently attempts to copy both paths, resulting in:

cp: will not overwrite just-created 'd/a' with 'a'

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