mirror of
git://git.suckless.org/sbase
synced 2024-12-24 16:02:54 +00:00
fold: fix empty lines
This commit is contained in:
parent
6be3e82218
commit
10049d33a5
6
fold.c
6
fold.c
@ -62,9 +62,9 @@ void
|
||||
foldline(const char *str, long width)
|
||||
{
|
||||
bool space;
|
||||
long col, i, j, n;
|
||||
long col, j, i = 0, n = 0;
|
||||
|
||||
for(i = n = 0; str[i] && str[i] != '\n'; i = n) {
|
||||
do {
|
||||
space = false;
|
||||
for(j = i, col = 0; str[j] && col <= width; j++) {
|
||||
if(!UTF8_POINT(str[j]) && !bflag)
|
||||
@ -95,5 +95,5 @@ foldline(const char *str, long width)
|
||||
eprintf("<stdout>: write error:");
|
||||
if(str[n])
|
||||
putchar('\n');
|
||||
}
|
||||
} while(str[i = n] && str[i] != '\n');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user