* grub-core/term/terminfo.c (grub_terminfo_getkey): Fix incorrect queue

handling.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2012-04-26 18:55:39 +02:00
parent 4a3594c9b1
commit 0f42c8898f
2 changed files with 15 additions and 4 deletions

View file

@ -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

View file

@ -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;