[hackers] [sbase][PATCH 5/5] fold: fix handling of -s

From: Richard Ipsum <richardipsum_AT_vx21.xyz>
Date: Sat, 20 Jun 2020 11:41:33 +0100

---
 fold.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fold.c b/fold.c
index 169064b..10a23cf 100644
--- a/fold.c
+++ b/fold.c
_AT_@ -29,12 +29,14 @@ foldline(struct line *l) {
 				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 = chartorune(&r, l->data + i);
-		if (sflag && isspace(l->data[i]))
+		if (sflag && isblankrune(r))
 			spacesect = i + 1;
 		if (!bflag && iscntrl(l->data[i])) {
 			switch(l->data[i]) {
-- 
2.26.2
Received on Sat Jun 20 2020 - 12:41:33 CEST

This archive was generated by hypermail 2.3.0 : Sat Jun 20 2020 - 12:48:32 CEST