aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
authorPierre-Alexandre Meyer <pierre@mouraf.org>2009-09-03 14:31:27 -0700
committerPierre-Alexandre Meyer <pierre@mouraf.org>2009-09-03 14:31:27 -0700
commit5b6c056cabc11a0d20356a1f977b09f2e92a496d (patch)
tree6c0b2e19028c8123c6349720f00ad3d213b0f18e /com32
parent6e64433a5db40467759ca858d8f998d52d921b5f (diff)
downloadsyslinux-5b6c056cabc11a0d20356a1f977b09f2e92a496d.tar.gz
syslinux-5b6c056cabc11a0d20356a1f977b09f2e92a496d.tar.xz
syslinux-5b6c056cabc11a0d20356a1f977b09f2e92a496d.zip
hdt: remove call to legacy getnumcols (menu)
Use getscreensize instead. Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
Diffstat (limited to 'com32')
-rw-r--r--com32/hdt/hdt-menu.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/com32/hdt/hdt-menu.c b/com32/hdt/hdt-menu.c
index e3521dcb..55031d67 100644
--- a/com32/hdt/hdt-menu.c
+++ b/com32/hdt/hdt-menu.c
@@ -27,6 +27,7 @@
*/
#include "hdt-menu.h"
+#include <unistd.h>
int start_menu_mode(struct s_hardware *hardware, char *version_string)
{
@@ -86,7 +87,7 @@ TIMEOUTCODE ontimeout()
/* Keyboard handler for the menu system */
void keys_handler(t_menuitem * mi, unsigned int scancode)
{
- char nc;
+ int nr, nc;
if ((scancode >> 8) == F1) { // If scancode of F1
runhelpsystem(mi->helpid);
@@ -97,7 +98,11 @@ void keys_handler(t_menuitem * mi, unsigned int scancode)
*/
if (((scancode & 0xFF) == 0x09) && (mi->action == OPT_RUN)) {
//(isallowed(username,"editcmd") || isallowed(username,"root"))) {
- nc = getnumcols();
+ if (getscreensize(1, &nr, &nc)) {
+ /* Unknown screen size? */
+ nc = 80;
+ nr = 24;
+ }
/* User typed TAB and has permissions to edit command line */
gotoxy(EDITPROMPT, 1);
csprint("Command line:", 0x07);