1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Remove unnecessary trailing space when using the comma format (-m)

unnecessary trailing space was being added. because we were padding for alignment,
which is not required with -m

fixes #3608

Signed-off-by: anastygnome <noreplygitemail@protonmail.com>
This commit is contained in:
anastygnome 2022-06-11 08:41:08 +02:00
parent b242e6592c
commit 8693eaa3b9
No known key found for this signature in database
GPG key ID: 5EFFB4485F9B4317

View file

@ -1874,7 +1874,12 @@ fn display_additional_leading_info(
} else {
"?".to_owned()
};
write!(result, "{} ", pad_left(&s, padding.block_size)).unwrap();
// extra space is insert to align the sizes, as needed for all formats, except for the comma format.
if config.format == Format::Commas {
write!(result, "{} ", s).unwrap();
} else {
write!(result, "{} ", pad_left(&s, padding.block_size)).unwrap();
};
}
Ok(result)
}