Module Name:    src
Committed By:   christos
Date:           Sat Jun 29 21:35:09 UTC 2019

Modified Files:
        src/lib/libedit: terminal.c

Log Message:
PR/54329: Raphael Ross: According to https://www.gnu.org/software/termutils/\
manual/termcap-1.3/html_chapter/termcap_4.html#SEC23 the cursor move multiple
escapes have undefined results when moving out of the screen. Stop using DO
to move down multiple lines and use a loop of newlines instead.


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/lib/libedit/terminal.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libedit/terminal.c
diff -u src/lib/libedit/terminal.c:1.36 src/lib/libedit/terminal.c:1.37
--- src/lib/libedit/terminal.c:1.36	Fri Apr 12 13:30:49 2019
+++ src/lib/libedit/terminal.c	Sat Jun 29 17:35:09 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: terminal.c,v 1.36 2019/04/12 17:30:49 christos Exp $	*/
+/*	$NetBSD: terminal.c,v 1.37 2019/06/29 21:35:09 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)term.c	8.2 (Berkeley) 4/30/95";
 #else
-__RCSID("$NetBSD: terminal.c,v 1.36 2019/04/12 17:30:49 christos Exp $");
+__RCSID("$NetBSD: terminal.c,v 1.37 2019/06/29 21:35:09 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -509,15 +509,10 @@ terminal_move_to_line(EditLine *el, int 
 		return;
 	}
 	if ((del = where - el->el_cursor.v) > 0) {
-		if ((del > 1) && GoodStr(T_DO)) {
-			terminal_tputs(el, tgoto(Str(T_DO), del, del), del);
-			del = 0;
-		} else {
-			for (; del > 0; del--)
-				terminal__putc(el, '\n');
-			/* because the \n will become \r\n */
-			el->el_cursor.h = 0;
-		}
+		for (; del > 0; del--)
+			terminal__putc(el, '\n');
+		/* because the \n will become \r\n */
+		el->el_cursor.h = 0;
 	} else {		/* del < 0 */
 		if (GoodStr(T_UP) && (-del > 1 || !GoodStr(T_up)))
 			terminal_tputs(el, tgoto(Str(T_UP), -del, -del), -del);

Reply via email to