Skip to content

bug(find): do not warn when appending / to -name in the start or the end #783

Description

@HackingRepo

Hi, findutils mainteners

we confirmed uu find do not emit zero single warning

relunsec@relunsec:~/software/findutils/target/debug$ ./find -name /a.txt
relunsec@relunsec:~/software/findutils/target/debug$ /bin/find -name /a.txt
/bin/find: warning:-name’ matches against basenames only, but the given pattern contains a directory separator (‘/’), thus the expression will evaluate to false all the time.  Did you mean ‘-wholename’?

while the gnu find those

the samething with

relunsec@relunsec:~/software/findutils/target/debug$ ./find -wholename a.txt/
relunsec@relunsec:~/software/findutils/target/debug$ /bin/find -wholename a.txt/
/bin/find: warning: -wholename a.txt/ will not match anything because it ends with /.
relunsec@relunsec:~/software/findutils/target/debug$ 

the samething with

relunsec@relunsec:~/software/findutils/target/debug$ /bin/find -path ./
/bin/find: warning: -path ./ will not match anything because it ends with /.

not just name

relunsec@relunsec:~/software/findutils/target/debug$ ./find -path ./
relunsec@relunsec:~/software/findutils/target/debug$ 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions