Make few more points bidi-clean
This commit is contained in:
parent
ce04e79272
commit
81b0623a6c
2 changed files with 12 additions and 17 deletions
|
@ -1094,10 +1094,10 @@ complete (struct screen *screen, int continuous, int update)
|
||||||
else
|
else
|
||||||
grub_putcode (' ', screen->terms[i].term);
|
grub_putcode (' ', screen->terms[i].term);
|
||||||
|
|
||||||
while (*p && p < endp)
|
grub_print_ucs4 (p, ucs4 + ucs4len < endp ? ucs4 + ucs4len : endp,
|
||||||
grub_putcode (*p++, screen->terms[i].term);
|
0, 0, screen->terms[i].term);
|
||||||
|
|
||||||
if (*p)
|
if (ucs4 + ucs4len > endp)
|
||||||
grub_putcode (GRUB_TERM_DISP_RIGHT, screen->terms[i].term);
|
grub_putcode (GRUB_TERM_DISP_RIGHT, screen->terms[i].term);
|
||||||
grub_term_gotoxy (screen->terms[i].term, pos >> 8, pos & 0xFF);
|
grub_term_gotoxy (screen->terms[i].term, pos >> 8, pos & 0xFF);
|
||||||
}
|
}
|
||||||
|
|
|
@ -165,17 +165,12 @@ map_code (grub_uint32_t in, struct grub_term_output *term)
|
||||||
void
|
void
|
||||||
grub_puts_terminal (const char *str, struct grub_term_output *term)
|
grub_puts_terminal (const char *str, struct grub_term_output *term)
|
||||||
{
|
{
|
||||||
grub_uint32_t code;
|
grub_uint32_t *unicode_str, *unicode_last_position;
|
||||||
grub_ssize_t ret;
|
grub_utf8_to_ucs4_alloc (str, &unicode_str,
|
||||||
const grub_uint8_t *ptr = (const grub_uint8_t *) str;
|
&unicode_last_position);
|
||||||
const grub_uint8_t *end;
|
|
||||||
end = (const grub_uint8_t *) (str + grub_strlen (str));
|
|
||||||
|
|
||||||
while (*ptr)
|
grub_print_ucs4 (unicode_str, unicode_last_position, 0, 0, term);
|
||||||
{
|
grub_free (unicode_str);
|
||||||
ret = grub_utf8_to_ucs4 (&code, 1, ptr, end - ptr, &ptr);
|
|
||||||
grub_putcode (code, term);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
grub_uint16_t *
|
grub_uint16_t *
|
||||||
|
@ -574,13 +569,13 @@ void
|
||||||
grub_xputs_normal (const char *str)
|
grub_xputs_normal (const char *str)
|
||||||
{
|
{
|
||||||
grub_term_output_t term;
|
grub_term_output_t term;
|
||||||
|
grub_uint32_t *unicode_str, *unicode_last_position;
|
||||||
|
grub_utf8_to_ucs4_alloc (str, &unicode_str,
|
||||||
|
&unicode_last_position);
|
||||||
|
|
||||||
FOR_ACTIVE_TERM_OUTPUTS(term)
|
FOR_ACTIVE_TERM_OUTPUTS(term)
|
||||||
{
|
{
|
||||||
grub_uint32_t *unicode_str, *unicode_last_position;
|
|
||||||
grub_utf8_to_ucs4_alloc (str, &unicode_str,
|
|
||||||
&unicode_last_position);
|
|
||||||
grub_print_ucs4 (unicode_str, unicode_last_position, 0, 0, term);
|
grub_print_ucs4 (unicode_str, unicode_last_position, 0, 0, term);
|
||||||
grub_free (unicode_str);
|
|
||||||
}
|
}
|
||||||
|
grub_free (unicode_str);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue