Module Name:    src
Committed By:   martin
Date:           Tue May 22 17:43:21 UTC 2018

Modified Files:
        src/sys/arch/i386/stand/efiboot [netbsd-8]: eficons.c

Log Message:
Pull up following revision(s) (requested by jakllsch in ticket #831):

        sys/arch/i386/stand/efiboot/eficons.c: revision 1.6

During awaitkey(), move the cursor back to the beginning of the
countdown with '\b' only after waiting.

Some UEFI implementations have a destructive/erasing backspace,
and will not show the countdown if we move the cursor back before the
wait.

My ThinkPad T430 w/ Lenovo's UEFI exhibited this whiteout-backspace,
while my Gigabyte Brix GB-BXBT-2807 did not.

Should fix PR #53292.


To generate a diff of this commit:
cvs rdiff -u -r1.4.2.1 -r1.4.2.2 src/sys/arch/i386/stand/efiboot/eficons.c

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

Modified files:

Index: src/sys/arch/i386/stand/efiboot/eficons.c
diff -u src/sys/arch/i386/stand/efiboot/eficons.c:1.4.2.1 src/sys/arch/i386/stand/efiboot/eficons.c:1.4.2.2
--- src/sys/arch/i386/stand/efiboot/eficons.c:1.4.2.1	Mon Apr  2 08:50:33 2018
+++ src/sys/arch/i386/stand/efiboot/eficons.c	Tue May 22 17:43:21 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: eficons.c,v 1.4.2.1 2018/04/02 08:50:33 martin Exp $	*/
+/*	$NetBSD: eficons.c,v 1.4.2.2 2018/05/22 17:43:21 martin Exp $	*/
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka <[email protected]>
@@ -328,10 +328,10 @@ awaitkey(int timeout, int tell)
 	char c = 0;
 
 	for (;;) {
-		if (tell && timeout) {
-			char numbuf[32];
-			int len;
+		char numbuf[32];
+		int len;
 
+		if (tell && timeout) {
 			len = snprintf(numbuf, sizeof(numbuf), "%d seconds. ",
 			    timeout);
 			if (len > 0 && len < sizeof(numbuf)) {
@@ -340,7 +340,6 @@ awaitkey(int timeout, int tell)
 				printf("%s", numbuf);
 				while (*p)
 					*p++ = '\b';
-				printf("%s", numbuf);
 			}
 		}
 		if (iskey(1)) {
@@ -355,6 +354,8 @@ awaitkey(int timeout, int tell)
 			internal_waitforinputevent(10000000);
 		else
 			break;
+		if (tell)
+			printf("%s", numbuf);
 	}
 
 out:

Reply via email to