aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-02-03 15:55:47 -0800
committerH. Peter Anvin <hpa@zytor.com>2010-02-03 15:56:44 -0800
commit8276fe64e083725e406d48c596e4a43cb5927daa (patch)
tree058e6b526903c37b842c8aae2ac1f77cdd2e3170 /com32
parentbd5b09dc502c8c1022a50fada50cb8e2298365ac (diff)
downloadsyslinux.git-8276fe64e083725e406d48c596e4a43cb5927daa.tar.gz
syslinux.git-8276fe64e083725e406d48c596e4a43cb5927daa.tar.xz
syslinux.git-8276fe64e083725e406d48c596e4a43cb5927daa.zip
menu: when running hidden, clear the screen before final boot
Clear away the countdown message before actually running the final boot. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'com32')
-rw-r--r--com32/menu/menumain.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index cbeb9a18..9516f72f 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -1,7 +1,7 @@
/* ----------------------------------------------------------------------- *
*
* Copyright 2004-2008 H. Peter Anvin - All Rights Reserved
- * Copyright 2009 Intel Corporation; author: H. Peter Anvin
+ * Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -616,8 +616,9 @@ static inline int shift_is_held(void)
static void print_timeout_message(int tol, int row, const char *msg)
{
+ static int last_msg_len = 0;
char buf[256];
- int nc = 0, nnc;
+ int nc = 0, nnc, padc;
const char *tp = msg;
char tc;
char *tq = buf;
@@ -686,9 +687,17 @@ static void print_timeout_message(int tol, int row, const char *msg)
}
*tq = '\0';
- /* Let's hope 4 spaces on each side is enough... */
- printf("\033[%d;%dH\2#14 %s ", row,
- HSHIFT + 1 + ((WIDTH - nc - 8) >> 1), buf);
+ if (nc >= last_msg_len) {
+ padc = 0;
+ } else {
+ padc = (last_msg_len - nc + 1) >> 1;
+ }
+
+ printf("\033[%d;%dH\2#14%*s%s%*s", row,
+ HSHIFT + 1 + ((WIDTH - nc) >> 1) - padc,
+ padc, "", buf, padc, "");
+
+ last_msg_len = nc;
}
/* Set the background screen, etc. */
@@ -724,6 +733,9 @@ static const char *do_hidden_menu(void)
}
}
+ /* Clear the message from the screen */
+ print_timeout_message(0, HIDDEN_ROW, "");
+
if (cm->ontimeout)
return cm->ontimeout;
else