---
fold.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fold.c b/fold.c
index c7f6ae8..6c7b9e7 100644
--- a/fold.c
+++ b/fold.c
@@ -28,14 +28,16 @@ foldline(struct line *l, const char *fname) {
eprintf("fwrite <stdout>:");
if (l->data[i] != '\n')
putchar('\n');
- last = (sflag && spacesect) ? spacesect : i;
+ if (sflag && spacesect)
+ i = spacesect;
+ last = i;
col = 0;
spacesect = 0;
}
runelen = charntorune(&r, l->data + i, l->len - i);
if (!runelen || r == Runeerror)
eprintf("charntorune: %s: invalid utf\n", fname);
- if (sflag && isspacerune(r))
+ if (sflag && isblankrune(r))
spacesect = i + runelen;
if (!bflag && iscntrl(l->data[i])) {
switch(l->data[i]) {
--
2.28.0- [hackers] [sbase][PATCH v2 0/5] fold fixes Richard Ipsum
- [hackers] [sbase][PATCH 1/5] fold: fix tabstop column ... Richard Ipsum
- [hackers] [sbase][PATCH 5/5] fold: fix handling of -s Richard Ipsum
- [hackers] [sbase][PATCH 3/5] fold: don't putchar('\n')... Richard Ipsum
- [hackers] [sbase][PATCH 4/5] fold: fix handling of mul... Richard Ipsum
- [hackers] [sbase][PATCH 2/5] fold: fix handling of \b,... Richard Ipsum
- Re: [hackers] [sbase][PATCH v2 0/5] fold fixes Michael Forney
