We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3ffb925 commit 9c5444fCopy full SHA for 9c5444f
1 file changed
src/uu/tty/src/tty.rs
@@ -63,11 +63,11 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
63
let stdin = std::io::stdin();
64
let stdin_handle = stdin.as_handle();
65
if stdin_handle.is_terminal() {
66
- if let Some(name) = file_name(stdin_handle) {
67
- writeln!(stdout, "{name}")
68
- } else {
69
- writeln!(stdout, r"\\.\CON")
70
- }
+ writeln!(
+ stdout,
+ "{}",
+ file_name(stdin_handle).as_deref().unwrap_or(r"\\.\CON")
+ )
71
} else {
72
set_exit_code(1);
73
writeln!(stdout, "{}", translate!("tty-not-a-tty"))
0 commit comments