1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-31 13:07:46 +00:00

fold: actually print out empty lines

This commit is contained in:
Arcterus 2014-11-22 13:18:14 -08:00
parent d50d4f54b9
commit d47a174954

View file

@ -139,6 +139,10 @@ fn fold_file<T: io::Reader>(file: BufferedReader<T>, bytes: bool, spaces: bool,
let mut len = line.char_len();
let newline = line.ends_with("\n");
if newline {
if len == 1 {
println!("");
continue;
}
line = line.slice_to(line.len() - 1);
len -= 1;
}