fold: don't putchar('\n') if last byte is '\n'
This commit is contained in:
parent
0d42b4f3d1
commit
db1dc984c3
3
fold.c
3
fold.c
@ -23,7 +23,8 @@ foldline(struct line *l) {
|
||||
len = ((sflag && spacesect) ? spacesect : i) - last;
|
||||
if (fwrite(l->data + last, 1, len, stdout) != len)
|
||||
eprintf("fwrite <stdout>:");
|
||||
putchar('\n');
|
||||
if (l->data[i] != '\n')
|
||||
putchar('\n');
|
||||
last = (sflag && spacesect) ? spacesect : i;
|
||||
col = 0;
|
||||
spacesect = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user