Skip to content

minorbug(cp): io error messages vague when using -g#13110

Open
Devel08 wants to merge 4 commits into
uutils:mainfrom
Devel08:fix-issue-13097
Open

minorbug(cp): io error messages vague when using -g#13110
Devel08 wants to merge 4 commits into
uutils:mainfrom
Devel08:fix-issue-13097

Conversation

@Devel08

@Devel08 Devel08 commented Jun 27, 2026

Copy link
Copy Markdown
Contributor

this PR closes #13097

@github-actions

github-actions Bot commented Jun 27, 2026

Copy link
Copy Markdown

GNU testsuite comparison:

Skipping an intermittent issue tests/cut/bounded-memory (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/tail/symlink (passes in this run but fails in the 'main' branch)

Comment thread src/uu/cp/src/cp.rs
Comment on lines 838 to 854
if let CpError::NotAllFilesCopied = error {
// Error::NotAllFilesCopied is non-fatal, but the error
// code should still be EXIT_ERR as does GNU cp
} else {
// Else we caught a fatal bubbled-up error, log it to stderr
show_error!("{error}");

if let CpError::IoErr(error) = error {
if error.kind() == io::ErrorKind::NotFound {
show_error!(
"{}",
translate!("cp-error-cannot-stat", "source" => format!("'{}'",sources[0].display()))
);
}
} else {
show_error!("{error}");
}
}

@cakebaker cakebaker Jun 28, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would use a match instead of the if let/else chain.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

minorbug(cp): io error messages vague when using -g

2 participants