Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/uu/kill/src/kill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pub enum Mode {

#[uucore::main]
pub fn uumain(args: impl uucore::Args) -> UResult<()> {
let mut args = args.collect_ignore();
let mut args = args.collect_lossy();
let obs_signal = handle_obsolete(&mut args);

let matches = uucore::clap_localization::handle_clap_result(uu_app(), args)?;
Expand Down
14 changes: 13 additions & 1 deletion tests/by-util/test_kill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
// spell-checker:ignore IAMNOTASIGNAL RTMAX RTMIN SIGRTMAX
// spell-checker:ignore IAMNOTASIGNAL RTMAX RTMIN SIGRTMAX FFFD
use regex::Regex;
use std::os::unix::process::ExitStatusExt;
use std::process::{Child, Command};
Expand Down Expand Up @@ -539,3 +539,15 @@ fn test_kill_realtime_signal() {
.succeeds();
assert_eq!(target.wait_for_signal(), Some(libc::SIGRTMIN()));
}

#[test]
fn test_kill_invalid_utf8() {
let arg = uucore::os_str_from_bytes(b"\xFFa\xFF")
.expect("Only unix platforms can test non-unicode names");

new_ucmd!()
.arg("-l")
.arg(&arg)
.fails()
.stderr_contains("'\u{FFFD}a\u{FFFD}': invalid signal");
}
Loading