On 2020-06-20, Richard Ipsum <[email protected]> wrote:
> diff --git a/fold.c b/fold.c
> index 169064b..10a23cf 100644
> --- a/fold.c
> +++ b/fold.c
> @@ -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))

It seems like this hunk might belong better with patch 4/5? Or maybe
4/5 should use isspacerune, and change it to isblankrune here.

>                       spacesect = i + 1;

I think this should be `i + runelen` in case there is a multibyte blank.

>               if (!bflag && iscntrl(l->data[i])) {
>                       switch(l->data[i]) {

Reply via email to