NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/53803: Miss port to src/lib/libedit from OpenBSD



>Number:         53803
>Category:       lib
>Synopsis:       Miss port to src/lib/libedit from OpenBSD
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 20 07:00:00 +0000 2018
>Originator:     ASOU Masato
>Release:        8.0-current
>Organization:
SOUM Corporation
>Environment:
$ uname -a
NetBSD asou-nbsd80-1 8.0 NetBSD 8.0 (GENERIC) #1: Thu Dec 20 02:44:31 UTC 2018  asou@asou-nbsd80-1:/usr/src/sys/arch/amd64/compile/GENERIC amd64

>Description:
http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/refresh.c.diff?r1=1.54&r2=1.55&only_with_tag=MAIN

I saw above URL and I found miss port as below:

 		} else {
 			el->el_cursor.v++;
 			el->el_refresh.r_oldcv++;
+			lastline = el->el_display[++el->el_refresh.r_oldcv];

The valiable el->el_refresh.r_oldcv was incremented two times.

>How-To-Repeat:

>Fix:
Delete unnecessary increment as below.

 		} else {
 			el->el_cursor.v++;
- 			el->el_refresh.r_oldcv++;
+			lastline = el->el_display[++el->el_refresh.r_oldcv];

See also diff of OpenBSD:
http://cvsweb.openbsd.org/cgi-bin/cvsweb/src/lib/libedit/refresh.c.diff?r1=1.21&r2=1.22
The below diff was extracted from above URL.

@@ -1083,7 +1083,7 @@
 			el->el_display[i - 1] = lastline;
 		} else {
 			el->el_cursor.v++;
-			lastline = el->el_display[el->el_refresh.r_oldcv++];
+			lastline = el->el_display[++el->el_refresh.r_oldcv];
 		}
 		re__copy_and_pad(lastline, L"", el->el_terminal.t_size.h);



Home | Main Index | Thread Index | Old Index