mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-01 05:27:45 +00:00
fold: actually print out empty lines
This commit is contained in:
parent
d50d4f54b9
commit
d47a174954
1 changed files with 4 additions and 0 deletions
|
@ -139,6 +139,10 @@ fn fold_file<T: io::Reader>(file: BufferedReader<T>, bytes: bool, spaces: bool,
|
||||||
let mut len = line.char_len();
|
let mut len = line.char_len();
|
||||||
let newline = line.ends_with("\n");
|
let newline = line.ends_with("\n");
|
||||||
if newline {
|
if newline {
|
||||||
|
if len == 1 {
|
||||||
|
println!("");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
line = line.slice_to(line.len() - 1);
|
line = line.slice_to(line.len() - 1);
|
||||||
len -= 1;
|
len -= 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue