2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
* kern/misc.c (grub_utf8_to_ucs4): Don't eat valid characters preceeded by non-valid ones. * kern/term.c (grub_putchar): Likewise.
This commit is contained in:
parent
f51a90d0cf
commit
b6c0d9c201
3 changed files with 15 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* kern/misc.c (grub_utf8_to_ucs4): Don't eat valid characters preceeded
|
||||||
|
by non-valid ones.
|
||||||
|
* kern/term.c (grub_putchar): Likewise.
|
||||||
|
|
||||||
2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
|
2010-02-06 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* partmap/sun.c (sun_partition_map_iterate): Restructure flow to fix
|
* partmap/sun.c (sun_partition_map_iterate): Restructure flow to fix
|
||||||
|
|
|
@ -971,6 +971,10 @@ grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize,
|
||||||
{
|
{
|
||||||
/* invalid */
|
/* invalid */
|
||||||
code = '?';
|
code = '?';
|
||||||
|
/* Character c may be valid, don't eat it. */
|
||||||
|
src--;
|
||||||
|
if (srcsize != (grub_size_t)-1)
|
||||||
|
srcsize++;
|
||||||
count = 0;
|
count = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -57,16 +57,17 @@ grub_putchar (int c)
|
||||||
{
|
{
|
||||||
static grub_size_t size = 0;
|
static grub_size_t size = 0;
|
||||||
static grub_uint8_t buf[6];
|
static grub_uint8_t buf[6];
|
||||||
|
grub_uint8_t *rest;
|
||||||
grub_uint32_t code;
|
grub_uint32_t code;
|
||||||
grub_size_t ret;
|
|
||||||
|
|
||||||
buf[size++] = c;
|
buf[size++] = c;
|
||||||
ret = grub_utf8_to_ucs4 (&code, 1, buf, size, 0);
|
|
||||||
|
|
||||||
if (ret != 0)
|
while (grub_utf8_to_ucs4 (&code, 1, buf, size, (const grub_uint8_t **) &rest)
|
||||||
|
!= 0)
|
||||||
{
|
{
|
||||||
struct grub_term_output *term;
|
struct grub_term_output *term;
|
||||||
size = 0;
|
size -= rest - buf;
|
||||||
|
grub_memmove (buf, rest, size);
|
||||||
FOR_ACTIVE_TERM_OUTPUTS(term)
|
FOR_ACTIVE_TERM_OUTPUTS(term)
|
||||||
grub_putcode (code, term);
|
grub_putcode (code, term);
|
||||||
if (code == '\n' && grub_newline_hook)
|
if (code == '\n' && grub_newline_hook)
|
||||||
|
|
Loading…
Reference in a new issue