From cd83aed89c0e1108212cd83373b634bad9f615c2 Mon Sep 17 00:00:00 2001 From: Michael Debertol Date: Tue, 29 Jun 2021 00:13:04 +0200 Subject: [PATCH] test: go into '[' mode when executable ends with [ This makes [ work even when installed with a custom prefix, e.g. as uu-[. --- src/uu/test/src/test.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/uu/test/src/test.rs b/src/uu/test/src/test.rs index dba840d3c..df5f1fd3e 100644 --- a/src/uu/test/src/test.rs +++ b/src/uu/test/src/test.rs @@ -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 ']'");