mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
test: go into '[' mode when executable ends with [
This makes [ work even when installed with a custom prefix, e.g. as uu-[.
This commit is contained in:
@@ -31,7 +31,7 @@ pub fn uumain(mut args: impl uucore::Args) -> i32 {
|
||||
let mut args: Vec<_> = args.collect();
|
||||
|
||||
// If invoked via name '[', matching ']' must be in the last arg
|
||||
if binary_name == "[" {
|
||||
if binary_name.ends_with('[') {
|
||||
let last = args.pop();
|
||||
if last != Some(OsString::from("]")) {
|
||||
eprintln!("[: missing ']'");
|
||||
|
||||
Reference in New Issue
Block a user