On 2020-06-20, Richard Ipsum <[email protected]> wrote:
> diff --git a/fold.c b/fold.c
> index 9c3c919..a54594b 100644
> --- a/fold.c
> +++ b/fold.c
> @@ -19,7 +19,7 @@ foldline(struct line *l) {
>       for (i = 0, last = 0, col = 0, spacesect = 0; i < l->len; i++) {
>               if (!UTF8_POINT(l->data[i]) && !bflag)
>                       continue;
> -             if (col >= width) {
> +             if (col >= width && (l->data[i] != '\b' || bflag)) {

I think '\r' might also need special handling here.

>                       len = ((sflag && spacesect) ? spacesect : i) - last;
>                       if (fwrite(l->data + last, 1, len, stdout) != len)
>                               eprintf("fwrite <stdout>:");

Reply via email to