From 62e3f75de1ed889b3acb45cad2c64e2d9fb34f80 Mon Sep 17 00:00:00 2001 From: oech3 <79379754+oech3@users.noreply.github.com> Date: Fri, 6 Feb 2026 02:34:11 +0900 Subject: [PATCH] comm /etc/pacman.conf /dev/null 2>/dev/full does not abort --- src/uu/comm/src/comm.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/uu/comm/src/comm.rs b/src/uu/comm/src/comm.rs index c72bbcc8a2e..42ec1c0ec12 100644 --- a/src/uu/comm/src/comm.rs +++ b/src/uu/comm/src/comm.rs @@ -8,7 +8,7 @@ use std::cmp::Ordering; use std::ffi::OsString; use std::fs::{File, metadata}; -use std::io::{self, BufRead, BufReader, BufWriter, Read, StdinLock, Write, stdin}; +use std::io::{self, BufRead, BufReader, BufWriter, Read, StdinLock, Write, stderr, stdin}; use std::path::Path; use uucore::display::Quotable; use uucore::error::{FromIo, UResult, USimpleError}; @@ -114,7 +114,8 @@ impl OrderChecker { let is_ordered = *current_line >= *self.last_line; if !is_ordered && !self.has_error { - eprintln!( + let _ = writeln!( + stderr(), "{}", translate!("comm-error-file-not-sorted", "file_num" => self.file_num.as_str()) ); @@ -314,7 +315,7 @@ fn comm( if should_check_order && (checker1.has_error || checker2.has_error) { // Print the input error message once at the end if input_error { - eprintln!("{}", translate!("comm-error-input-not-sorted")); + let _ = writeln!(stderr(), "{}", translate!("comm-error-input-not-sorted")); } Err(USimpleError::new(1, "")) } else {