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
|
@ -277,8 +277,9 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv,
|
|||
|
||||
if (! opt)
|
||||
{
|
||||
char tmp[3] = { '-', *curshort, 0 };
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"unknown argument `-%c'", *curshort);
|
||||
N_("unknown argument `%s'"), tmp);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -344,7 +345,7 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv,
|
|||
|
||||
if (! opt)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "unknown argument `%s'", arg);
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, N_("unknown argument `%s'"), arg);
|
||||
goto fail;
|
||||
}
|
||||
}
|
||||
|
@ -355,7 +356,7 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv,
|
|||
if (! option)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"missing mandatory option for `%s'", opt->longarg);
|
||||
N_("missing mandatory option for `%s'"), opt->longarg);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -377,7 +378,7 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv,
|
|||
if (tail == 0 || tail == option || *tail != '\0' || grub_errno)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"the argument `%s' requires an integer",
|
||||
N_("the argument `%s' requires an integer"),
|
||||
arg);
|
||||
|
||||
goto fail;
|
||||
|
@ -400,8 +401,8 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv,
|
|||
if (option)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||
"a value was assigned to the argument `%s' while it "
|
||||
"doesn't require an argument", arg);
|
||||
N_("a value was assigned to the argument `%s' while it "
|
||||
"doesn't require an argument"), arg);
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@
|
|||
#include <grub/mm.h>
|
||||
#include <grub/term.h>
|
||||
#include <grub/dl.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
#ifdef GRUB_UTIL
|
||||
#include <termios.h>
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include <grub/i386/relocator.h>
|
||||
#include <grub/relocator_private.h>
|
||||
#include <grub/cpu/relocator_private.h>
|
||||
#include <grub/i386/relocator_private.h>
|
||||
|
||||
extern grub_uint8_t grub_relocator_forward_start;
|
||||
extern grub_uint8_t grub_relocator_forward_end;
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
#define PSEUDO_REAL_DSEG 0x20
|
||||
|
||||
#include <grub/cpu/relocator_private.h>
|
||||
#include <grub/i386/relocator_private.h>
|
||||
|
||||
#include "relocator_common.S"
|
||||
|
||||
|
|
|
@ -801,7 +801,7 @@ grub_legacy_parse (const char *buf, char **entryname, char **suffix)
|
|||
len = grub_strlen (corig);
|
||||
if (!slash)
|
||||
{
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "bad color specification %s",
|
||||
grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid color specification `%s'",
|
||||
args[0]);
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -1209,14 +1209,14 @@ grub_relocator_alloc_chunk_addr (struct grub_relocator *rel,
|
|||
grub_phys_addr_t min_addr = 0, max_addr;
|
||||
|
||||
if (target > ~size)
|
||||
return grub_error (GRUB_ERR_OUT_OF_RANGE, "address is out of range");
|
||||
return grub_error (GRUB_ERR_BUG, "address is out of range");
|
||||
|
||||
adjust_limits (rel, &min_addr, &max_addr, target, target);
|
||||
|
||||
for (chunk = rel->chunks; chunk; chunk = chunk->next)
|
||||
if ((chunk->target <= target && target < chunk->target + chunk->size)
|
||||
|| (target <= chunk->target && chunk->target < target + size))
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "overlap detected");
|
||||
return grub_error (GRUB_ERR_BUG, "overlap detected");
|
||||
|
||||
chunk = grub_malloc (sizeof (struct grub_relocator_chunk));
|
||||
if (!chunk)
|
||||
|
@ -1256,7 +1256,7 @@ grub_relocator_alloc_chunk_addr (struct grub_relocator *rel,
|
|||
|
||||
grub_dprintf ("relocator", "not allocated\n");
|
||||
grub_free (chunk);
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of memory");
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));
|
||||
}
|
||||
while (0);
|
||||
|
||||
|
@ -1486,7 +1486,7 @@ grub_relocator_prepare_relocs (struct grub_relocator *rel, grub_addr_t addr,
|
|||
if (!malloc_in_range (rel, 0, ~(grub_addr_t)0 - rel->relocators_size + 1,
|
||||
grub_relocator_align,
|
||||
rel->relocators_size, &movers_chunk, 1, 1))
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of memory");
|
||||
return grub_error (GRUB_ERR_OUT_OF_MEMORY, N_("out of memory"));
|
||||
movers_chunk.srcv = rels = rels0
|
||||
= grub_map_memory (movers_chunk.src, movers_chunk.size);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue