Skip to content

Commit 8e59663

Browse files
authored
cat: strip errno (#10885)
1 parent 8d8e7f8 commit 8e59663

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/uu/cat/src/cat.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use std::os::fd::AsFd;
1919
use std::os::unix::fs::FileTypeExt;
2020
use thiserror::Error;
2121
use uucore::display::Quotable;
22-
use uucore::error::UResult;
22+
use uucore::error::{UResult, strip_errno};
2323
use uucore::translate;
2424
use uucore::{fast_inc::fast_inc_one, format_usage};
2525

@@ -82,7 +82,7 @@ impl LineNumber {
8282
#[derive(Error, Debug)]
8383
enum CatError {
8484
/// Wrapper around `io::Error`
85-
#[error("{0}")]
85+
#[error("{}", strip_errno(.0))]
8686
Io(#[from] io::Error),
8787
/// Wrapper around `nix::Error`
8888
#[cfg(any(target_os = "linux", target_os = "android"))]
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
cat: test_directory3/test_directory4: Is a directory
2-
cat: file_which_does_not_exist.txt: No such file or directory (os error 2)
2+
cat: file_which_does_not_exist.txt: No such file or directory
33
cat: test_directory3/test_directory5: Is a directory
44
cat: test_directory3/../test_directory3/test_directory5: Is a directory
55
cat: test_directory3: Is a directory

0 commit comments

Comments
 (0)