mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-22 07:12:39 +00:00
2008-05-16 Christian Franke <franke@computer.org>
* commands/cat.c (grub_cmd_cat): Remove non-ESC keys from keyboard queue to ensure that break with ESC will always work. * commands/sleep.c (grub_interruptible_millisleep): Likewise. Remove ESC from keyboard queue.
This commit is contained in:
1 parent
eedf167fef
commit
b7c6bed50e
3 files changed
+15
-7
No files matched your search
@@ -1,3 +1,10 @@
|
|||||||
|
2008-05-16 Christian Franke <franke@computer.org>
|
||||||
|
|
||||||
|
* commands/cat.c (grub_cmd_cat): Remove non-ESC keys from keyboard queue
|
||||||
|
to ensure that break with ESC will always work.
|
||||||
|
* commands/sleep.c (grub_interruptible_millisleep): Likewise.
|
||||||
|
Remove ESC from keyboard queue.
|
||||||
|
|
||||||
2008-05-16 Christian Franke <franke@computer.org>
|
2008-05-16 Christian Franke <franke@computer.org>
|
||||||
|
|
||||||
* util/biosdisk.c: [__CYGWIN__] Add includes.
|
* util/biosdisk.c: [__CYGWIN__] Add includes.
|
||||||
|
|||||||
+6
-6
@@ -34,6 +34,7 @@ grub_cmd_cat (struct grub_arg_list *state __attribute__ ((unused)),
|
|||||||
grub_file_t file;
|
grub_file_t file;
|
||||||
char buf[GRUB_DISK_SECTOR_SIZE];
|
char buf[GRUB_DISK_SECTOR_SIZE];
|
||||||
grub_ssize_t size;
|
grub_ssize_t size;
|
||||||
|
int key = 0;
|
||||||
|
|
||||||
if (argc != 1)
|
if (argc != 1)
|
||||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
|
return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required");
|
||||||
@@ -42,7 +43,8 @@ grub_cmd_cat (struct grub_arg_list *state __attribute__ ((unused)),
|
|||||||
if (! file)
|
if (! file)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
while ((size = grub_file_read (file, buf, sizeof (buf))) > 0)
|
while ((size = grub_file_read (file, buf, sizeof (buf))) > 0
|
||||||
|
&& key != GRUB_TERM_ESC)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
@@ -60,11 +62,9 @@ grub_cmd_cat (struct grub_arg_list *state __attribute__ ((unused)),
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GRUB_TERM_ASCII_CHAR (grub_checkkey ()) == GRUB_TERM_ESC)
|
while (grub_checkkey () >= 0 &&
|
||||||
{
|
(key = GRUB_TERM_ASCII_CHAR (grub_getkey ())) != GRUB_TERM_ESC)
|
||||||
grub_getkey ();
|
;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
grub_putchar ('\n');
|
grub_putchar ('\n');
|
||||||
|
|||||||
+2
-1
@@ -52,7 +52,8 @@ grub_interruptible_millisleep (grub_uint32_t ms)
|
|||||||
end_at = grub_get_rtc () + grub_div_roundup (ms * GRUB_TICKS_PER_SECOND, 1000);
|
end_at = grub_get_rtc () + grub_div_roundup (ms * GRUB_TICKS_PER_SECOND, 1000);
|
||||||
|
|
||||||
while (grub_get_rtc () < end_at)
|
while (grub_get_rtc () < end_at)
|
||||||
if (GRUB_TERM_ASCII_CHAR (grub_checkkey ()) == GRUB_TERM_ESC)
|
if (grub_checkkey () >= 0 &&
|
||||||
|
GRUB_TERM_ASCII_CHAR (grub_getkey ()) == GRUB_TERM_ESC)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Reference in new issue
Block a user