* grub-core/term/terminfo.c (grub_terminfo_getkey): Fix incorrect queue
handling.
This commit is contained in:
parent
4a3594c9b1
commit
0f42c8898f
2 changed files with 15 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-04-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/term/terminfo.c (grub_terminfo_getkey): Fix incorrect queue
|
||||
handling.
|
||||
|
||||
2012-04-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/disk/diskfilter.c (read_segment): Fix the case when disknr
|
||||
|
|
|
@ -549,9 +549,12 @@ grub_terminfo_getkey (struct grub_term_input *termi)
|
|||
= (struct grub_terminfo_input_state *) (termi->data);
|
||||
if (data->npending)
|
||||
{
|
||||
int ret;
|
||||
data->npending--;
|
||||
grub_memmove (data->input_buf, data->input_buf + 1, data->npending);
|
||||
return data->input_buf[0];
|
||||
ret = data->input_buf[0];
|
||||
grub_memmove (data->input_buf, data->input_buf + 1, data->npending
|
||||
* sizeof (data->input_buf[0]));
|
||||
return ret;
|
||||
}
|
||||
|
||||
grub_terminfo_readkey (termi, data->input_buf,
|
||||
|
@ -559,9 +562,12 @@ grub_terminfo_getkey (struct grub_term_input *termi)
|
|||
|
||||
if (data->npending)
|
||||
{
|
||||
int ret;
|
||||
data->npending--;
|
||||
grub_memmove (data->input_buf, data->input_buf + 1, data->npending);
|
||||
return data->input_buf[0];
|
||||
ret = data->input_buf[0];
|
||||
grub_memmove (data->input_buf, data->input_buf + 1, data->npending
|
||||
* sizeof (data->input_buf[0]));
|
||||
return ret;
|
||||
}
|
||||
|
||||
return GRUB_TERM_NO_KEY;
|
||||
|
|
Loading…
Reference in a new issue