Page MenuHomeFreeBSD

cp: Avoid prepending ./ in file-to-file case.
ClosedPublic

Authored by des on Wed, May 14, 8:10 PM.
Tags
None
Referenced Files
F118745699: D50357.diff
Sun, Jun 1, 11:56 AM
F118689106: D50357.id155504.diff
Sat, May 31, 8:18 PM
Unknown Object (File)
Sat, May 31, 12:26 PM
Unknown Object (File)
Thu, May 29, 1:18 PM
Unknown Object (File)
Wed, May 28, 7:16 PM
Unknown Object (File)
Tue, May 27, 10:42 AM
Unknown Object (File)
Fri, May 23, 5:15 AM
Unknown Object (File)
Fri, May 16, 6:24 PM
Subscribers

Details

Summary
  • Make to.base large enough to hold a trailing separator.
  • Remove the separator from warning and error messages.
  • In the FILE_TO_FILE case, leave to.base empty.
  • In the FILE_TO_DIR and DIR_TO_DNE cases, append a separator to to.base once we've (optionally created and) opened it.
  • Thus, in the file-to-file case, we print an empty string followed by to.path, while in all other cases, to.base already contains the necessary separator.

This fixes failures in tests that used cp and expected a specific
error message and were surprised to see "./" pop up.

Fixes: 82fc0d09e862
Sponsored by: Klara, Inc.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable