1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

Merge pull request #2516 from jfinkels/tac-read-dir-error-message

tac: correct error message when reading from directory
This commit is contained in:
Sylvestre Ledru 2021-07-31 09:49:54 +02:00 committed by GitHub
commit fd02ef2dc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -97,7 +97,7 @@ fn tac(filenames: Vec<String>, before: bool, _: bool, separator: &str) -> i32 {
let path = Path::new(filename); let path = Path::new(filename);
if path.is_dir() || path.metadata().is_err() { if path.is_dir() || path.metadata().is_err() {
if path.is_dir() { if path.is_dir() {
show_error!("dir: read error: Invalid argument"); show_error!("{}: read error: Invalid argument", filename);
} else { } else {
show_error!( show_error!(
"failed to open '{}' for reading: No such file or directory", "failed to open '{}' for reading: No such file or directory",

View file

@ -66,7 +66,7 @@ fn test_invalid_input() {
.ucmd() .ucmd()
.arg("a") .arg("a")
.fails() .fails()
.stderr_contains("dir: read error: Invalid argument"); .stderr_contains("a: read error: Invalid argument");
} }
#[test] #[test]