mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2026-01-17 10:41:03 +00:00
Merge pull request #2007 from drocco007/fold-preserve-blank-lines
fold: preserve blank lines
This commit is contained in:
commit
4934af0c3d
2 changed files with 31 additions and 2 deletions
|
|
@ -100,7 +100,10 @@ fn fold(filenames: Vec<String>, bytes: bool, spaces: bool, width: usize) {
|
|||
fn fold_file<T: Read>(file: BufReader<T>, bytes: bool, spaces: bool, width: usize) {
|
||||
for line_result in file.lines() {
|
||||
let mut line = safe_unwrap!(line_result);
|
||||
if bytes {
|
||||
|
||||
if line.is_empty() {
|
||||
println!();
|
||||
} else if bytes {
|
||||
let len = line.len();
|
||||
let mut i = 0;
|
||||
while i < len {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue