mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
join: add support for -t '\0'
This commit is contained in:
@@ -503,6 +503,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
settings.separator = match value.len() {
|
||||
0 => Sep::Line,
|
||||
1 => Sep::Char(value[0]),
|
||||
2 if value[0] == b'\\' && value[1] == b'0' => Sep::Char(0),
|
||||
_ => {
|
||||
return Err(USimpleError::new(
|
||||
1,
|
||||
|
||||
@@ -346,3 +346,14 @@ fn non_unicode() {
|
||||
.succeeds()
|
||||
.stdout_only_fixture("non-unicode.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn null_field_separators() {
|
||||
new_ucmd!()
|
||||
.arg("-t")
|
||||
.arg("\\0")
|
||||
.arg("non-unicode_1.bin")
|
||||
.arg("non-unicode_2.bin")
|
||||
.succeeds()
|
||||
.stdout_only_fixture("null-sep.expected");
|
||||
}
|
||||
|
||||
BIN
Binary file not shown.
Reference in New Issue
Block a user