Skip to content
Merged
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
7 changes: 4 additions & 3 deletions src/bin/coreutils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@ fn main() {
});

// binary name ends with util name?
let is_coreutils = binary_as_util.ends_with("utils");
let matched_util = utils
.keys()
.filter(|&&u| binary_as_util.ends_with(u) && !binary_as_util.ends_with("coreutils"))
.max_by_key(|u| u.len()); //Prefer stty more than tty. coreutils is not ls
.filter(|&&u| binary_as_util.ends_with(u) && !is_coreutils)
.max_by_key(|u| u.len()); //Prefer stty more than tty. *utils is not ls

let util_name = if let Some(&util) = matched_util {
Some(OsString::from(util))
} else if binary_as_util.ends_with("utils") || binary_as_util.ends_with("box") {
} else if is_coreutils || binary_as_util.ends_with("box") {
// todo: Remove support of "*box" from binary
uucore::set_utility_is_second_arg();
args.next()
Expand Down
Loading