Improve gettext support. Stylistic fixes and error handling fixes while
on it.
This commit is contained in:
parent
215c90cb82
commit
9c4b5c13e6
184 changed files with 1175 additions and 959 deletions
|
@ -340,7 +340,7 @@ grub_cmd_plan9 (grub_extcmd_context_t ctxt, int argc, char *argv[])
|
|||
}
|
||||
|
||||
if (argc == 0)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified");
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, N_("filename expected"));
|
||||
|
||||
grub_dl_ref (my_mod);
|
||||
|
||||
|
@ -384,7 +384,12 @@ grub_cmd_plan9 (grub_extcmd_context_t ctxt, int argc, char *argv[])
|
|||
goto fail;
|
||||
|
||||
if (grub_file_read (file, &hdr, sizeof (hdr)) != (grub_ssize_t) sizeof (hdr))
|
||||
goto fail;
|
||||
{
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"),
|
||||
argv[0]);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
if (grub_be_to_cpu32 (hdr.magic) != GRUB_PLAN9_MAGIC
|
||||
|| hdr.zero)
|
||||
|
@ -462,7 +467,12 @@ grub_cmd_plan9 (grub_extcmd_context_t ctxt, int argc, char *argv[])
|
|||
|
||||
if (grub_file_read (file, ptr, grub_be_to_cpu32 (hdr.text_size))
|
||||
!= (grub_ssize_t) grub_be_to_cpu32 (hdr.text_size))
|
||||
goto fail;
|
||||
{
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"),
|
||||
argv[0]);
|
||||
goto fail;
|
||||
}
|
||||
ptr += grub_be_to_cpu32 (hdr.text_size);
|
||||
padsize = ALIGN_UP (grub_be_to_cpu32 (hdr.text_size) + sizeof (hdr),
|
||||
GRUB_PLAN9_ALIGN) - grub_be_to_cpu32 (hdr.text_size)
|
||||
|
@ -473,7 +483,12 @@ grub_cmd_plan9 (grub_extcmd_context_t ctxt, int argc, char *argv[])
|
|||
|
||||
if (grub_file_read (file, ptr, grub_be_to_cpu32 (hdr.data_size))
|
||||
!= (grub_ssize_t) grub_be_to_cpu32 (hdr.data_size))
|
||||
goto fail;
|
||||
{
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_BAD_OS, N_("premature end of file %s"),
|
||||
argv[0]);
|
||||
goto fail;
|
||||
}
|
||||
ptr += grub_be_to_cpu32 (hdr.data_size);
|
||||
padsize = ALIGN_UP (grub_be_to_cpu32 (hdr.data_size), GRUB_PLAN9_ALIGN)
|
||||
- grub_be_to_cpu32 (hdr.data_size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue