Skip to content

Commit

Permalink
test: go into '[' mode when executable ends with [
Browse files Browse the repository at this point in the history
This makes [ work even when installed with a custom prefix, e.g. as uu-[.
  • Loading branch information
miDeb committed Jun 28, 2021
1 parent 97d1489 commit cd83aed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/uu/test/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 ']'");
Expand Down

0 comments on commit cd83aed

Please sign in to comment.