cat: strip errno (#10885)

This commit is contained in:
oech3
2026-02-12 03:27:17 -08:00
committed by GitHub
parent 8d8e7f8879
commit 8e5966300b
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ use std::os::fd::AsFd;
use std::os::unix::fs::FileTypeExt;
use thiserror::Error;
use uucore::display::Quotable;
use uucore::error::UResult;
use uucore::error::{UResult, strip_errno};
use uucore::translate;
use uucore::{fast_inc::fast_inc_one, format_usage};
@@ -82,7 +82,7 @@ impl LineNumber {
#[derive(Error, Debug)]
enum CatError {
/// Wrapper around `io::Error`
#[error("{0}")]
#[error("{}", strip_errno(.0))]
Io(#[from] io::Error),
/// Wrapper around `nix::Error`
#[cfg(any(target_os = "linux", target_os = "android"))]
@@ -1,5 +1,5 @@
cat: test_directory3/test_directory4: Is a directory
cat: file_which_does_not_exist.txt: No such file or directory (os error 2)
cat: file_which_does_not_exist.txt: No such file or directory
cat: test_directory3/test_directory5: Is a directory
cat: test_directory3/../test_directory3/test_directory5: Is a directory
cat: test_directory3: Is a directory