merge with mainline

This commit is contained in:
BVK Chaitanya 2010-12-19 09:17:22 +05:30
commit fcf983f8c7
7 changed files with 80 additions and 22 deletions

View file

@ -261,24 +261,16 @@ grub_mofile_open (const char *filename)
return fd_mo;
}
/* Returning grub_file_t would be more natural, but grub_mofile_open assigns
to fd_mo anyway ... */
static void
grub_gettext_init_ext (const char *lang)
grub_mofile_open_lang (const char *locale_dir, const char *locale)
{
char *mo_file;
char *locale_dir;
locale_dir = grub_env_get ("locale_dir");
if (locale_dir == NULL)
{
grub_dprintf ("gettext", "locale_dir variable is not set up.\n");
return;
}
fd_mo = NULL;
/* mo_file e.g.: /boot/grub/locale/ca.mo */
mo_file = grub_xasprintf ("%s/%s.mo", locale_dir, lang);
mo_file = grub_xasprintf ("%s/%s.mo", locale_dir, locale);
if (!mo_file)
return;
@ -295,6 +287,38 @@ grub_gettext_init_ext (const char *lang)
return;
fd_mo = grub_mofile_open (mo_file);
}
}
static void
grub_gettext_init_ext (const char *locale)
{
char *locale_dir;
locale_dir = grub_env_get ("locale_dir");
if (locale_dir == NULL)
{
grub_dprintf ("gettext", "locale_dir variable is not set up.\n");
return;
}
fd_mo = NULL;
grub_mofile_open_lang (locale_dir, locale);
/* ll_CC didn't work, so try ll. */
if (fd_mo == NULL)
{
char *lang = grub_strdup (locale);
char *underscore = grub_strchr (lang, '_');
if (underscore)
{
*underscore = '\0';
grub_mofile_open_lang (locale_dir, lang);
}
grub_free (lang);
}
if (fd_mo)
{

View file

@ -141,7 +141,7 @@ grub_multiboot_load (grub_file_t file)
}
if (header->bss_end_addr)
grub_memset ((grub_uint32_t *) source + load_size, 0,
grub_memset ((grub_uint8_t *) source + load_size, 0,
header->bss_end_addr - header->load_addr - load_size);
grub_multiboot_payload_eip = header->entry_addr;
@ -441,7 +441,7 @@ grub_multiboot_make_mbi (grub_uint32_t *target)
if (err)
return err;
ptrorig = get_virtual_current_address (ch);
ptrdest = (grub_addr_t) get_virtual_current_address (ch);
ptrdest = get_physical_target_address (ch);
*target = ptrdest;

View file

@ -91,16 +91,16 @@ print_more (void)
grub_term_restore_pos (pos);
grub_free (pos);
/* Scroll one lines or an entire page, depending on the key. */
/* Scroll one line or an entire page, depending on the key. */
if (key == '\r' || key =='\n')
grub_normal_reset_more ();
else
{
static struct term_state *state;
for (state = term_states; state; state = state->next)
state->num_lines -= 2;
state->num_lines--;
}
else
grub_normal_reset_more ();
}
void