Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 22 Jun 2022 16:01:54 +0200
From:      Hans Petter Selasky <hps@selasky.org>
To:        Ivan Quitschal <tezeka@hotmail.com>, "freebsd-current@freebsd.org" <freebsd-current@freebsd.org>
Subject:   Re: RES: vt newcons mouse paste issue FIXED
Message-ID:  <41ef5c38-515f-739a-cb47-7cab0e609526@selasky.org>
In-Reply-To: <CP6P284MB1900CC7B7F6343DAB1D1E5BCCBB29@CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM>
References:  <CP6P284MB1900CA1ED5B5BADE054ECB34CBB29@CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM> <f6c1ee1c-bdd9-c8d6-1385-145022e6765d@selasky.org> <CP6P284MB1900CC7B7F6343DAB1D1E5BCCBB29@CP6P284MB1900.BRAP284.PROD.OUTLOOK.COM>

next in thread | previous in thread | raw e-mail | index | archive | help
On 6/22/22 15:36, Ivan Quitschal wrote:
> Hi Hans
> 

Hi Ivan,

I think you should upload the diff at:

https://reviews.freebsd.org/differential/

Make the diff like this:

diff -u -C 999999 sys/dev/vt/vt_buf.c.orig sys/dev/vt/vt_buf.c > a.diff


I see two issues:

1) Pointer arithmetics is not so good!

>                 }
> +               end = buf + i - 1;
> +               while (end > buf && isspace((unsigned char)*end))
> +               {
> +                       *end = '\0';
> +                       end--;
> +               }
> +

I think this would be better and avoid the ">" with pointers!

for (end = buf + i; end-- != buf; ) {
    if (isspace((unsigned char)*end) == false)
	break;
    *end = '\0';
}

Can you explain this:

> -                       buf[i++] = '\r';
> +                       buf[i] = '\r';
>                         buf[i++] = '\n';

'\r' character is now overwritten by '\n' character.

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?41ef5c38-515f-739a-cb47-7cab0e609526>