grub-devel
[Top][All Lists]
Advanced

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

grub-emu console-read causing issues with the read command


From: Seth Goldberg
Subject: grub-emu console-read causing issues with the read command
Date: Fri, 13 Jan 2012 12:43:32 -0800 (PST)
User-agent: Alpine 2.00 (GSO 1167 2008-08-23)

Hi,

When using the read command under grub-emu, the resulting value read (present in the environment variable) includes a time-dependent number of 0xff characters + the input that the user made. I tracked it down to grub_ncurses_getkey(), which times out after 100ms and causes grub_ncurses_getkey to return -1 instead of GRUB_TERM_NO_KEY, which causes grub_getkey() to return -1 instead of blocking until it has real input.

My suggestion would be to change grub_ncurses_getkey to return GRUB_TERM_NO_KEY in the ERR case:

static int
grub_ncurses_getkey (struct grub_term_input *term __attribute__ ((unused)))
{
  int c;

  wtimeout (stdscr, 100);
  c = getch ();

  switch (c)
    {
    case ERR:
<      return -1;
     return GRUB_TERM_NO_KEY;

 --S




reply via email to

[Prev in Thread] Current Thread [Next in Thread]