diff --git a/src/find/matchers/type_matcher.rs b/src/find/matchers/type_matcher.rs index a1af4889..e7687d27 100644 --- a/src/find/matchers/type_matcher.rs +++ b/src/find/matchers/type_matcher.rs @@ -107,7 +107,7 @@ fn type_creator(type_string: &str, mode: &str) -> Result, Box< if type_string.contains(',') { for part in type_string.split(',') { if part.is_empty() { - return Err(From::from(format!("find: Last file type in list argument to {mode} is missing, i.e., list is ending on: ','"))); + return Err(From::from(format!("Last file type in list argument to {mode} is missing, i.e., list is ending on: ','"))); } let file_type = parse(part, mode)?; if !file_types.insert(file_type) { diff --git a/tests/test_find.rs b/tests/test_find.rs index 0fab96dd..b9c73d5f 100644 --- a/tests/test_find.rs +++ b/tests/test_find.rs @@ -181,6 +181,8 @@ fn multiple_matcher_failure() { .args(&["-type", "f,", "-name", "abbb"]) .fails() .stderr_contains("list is ending on: ','") + // GNU prints a single "find: " prefix; the message must not double it. + .stderr_does_not_contain("find: find:") .no_stdout(); ucmd() @@ -212,6 +214,7 @@ fn multiple_matcher_failure() { .args(&["-xtype", "f,", "-name", "abbb"]) .fails() .stderr_contains("list is ending on: ','") + .stderr_does_not_contain("find: find:") .no_stdout(); ucmd()