mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-21 06:49:35 +00:00
* grub-core/video/colors.c (grub_video_parse_color): Fix error message.
Remove assignment in if while on it.
This commit is contained in:
1 parent
571e140e26
commit
432069398f
2 files changed
+18
-7
No files matched your search
@@ -1,3 +1,8 @@
|
|||||||
|
2012-02-09 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
|
* grub-core/video/colors.c (grub_video_parse_color): Fix error message.
|
||||||
|
Remove assignment in if while on it.
|
||||||
|
|
||||||
2012-02-09 Vladimir Serbinenko <phcoder@gmail.com>
|
2012-02-09 Vladimir Serbinenko <phcoder@gmail.com>
|
||||||
|
|
||||||
* util/grub-mkstandalone.in: Fix modules directory.
|
* util/grub-mkstandalone.in: Fix modules directory.
|
||||||
|
|||||||
@@ -245,11 +245,14 @@ grub_err_t
|
|||||||
grub_video_parse_color (const char *s, grub_video_rgba_color_t *color)
|
grub_video_parse_color (const char *s, grub_video_rgba_color_t *color)
|
||||||
{
|
{
|
||||||
grub_video_rgba_color_t c;
|
grub_video_rgba_color_t c;
|
||||||
|
const char *s0;
|
||||||
|
|
||||||
/* Skip whitespace. */
|
/* Skip whitespace. */
|
||||||
while (*s && grub_isspace (*s))
|
while (*s && grub_isspace (*s))
|
||||||
s++;
|
s++;
|
||||||
|
|
||||||
|
s0 = s;
|
||||||
|
|
||||||
if (*s == '#')
|
if (*s == '#')
|
||||||
{
|
{
|
||||||
/* HTML-style. Number if hex digits:
|
/* HTML-style. Number if hex digits:
|
||||||
@@ -289,23 +292,26 @@ grub_video_parse_color (const char *s, grub_video_rgba_color_t *color)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||||
"invalid HTML-type color string `%s'", s);
|
N_("invalid color specification `%s'"), s0);
|
||||||
}
|
}
|
||||||
else if (grub_isdigit (*s))
|
else if (grub_isdigit (*s))
|
||||||
{
|
{
|
||||||
/* Comma separated decimal values. */
|
/* Comma separated decimal values. */
|
||||||
c.red = grub_strtoul (s, 0, 0);
|
c.red = grub_strtoul (s, 0, 0);
|
||||||
if ((s = grub_strchr (s, ',')) == 0)
|
s = grub_strchr (s, ',');
|
||||||
|
if (!s)
|
||||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||||
"missing 1st comma separator in color `%s'", s);
|
N_("invalid color specification `%s'"), s0);
|
||||||
s++;
|
s++;
|
||||||
c.green = grub_strtoul (s, 0, 0);
|
c.green = grub_strtoul (s, 0, 0);
|
||||||
if ((s = grub_strchr (s, ',')) == 0)
|
s = grub_strchr (s, ',');
|
||||||
|
if (!s)
|
||||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||||
"missing 2nd comma separator in color `%s'", s);
|
N_("invalid color specification `%s'"), s0);
|
||||||
s++;
|
s++;
|
||||||
c.blue = grub_strtoul (s, 0, 0);
|
c.blue = grub_strtoul (s, 0, 0);
|
||||||
if ((s = grub_strchr (s, ',')) == 0)
|
s = grub_strchr (s, ',');
|
||||||
|
if (!s)
|
||||||
c.alpha = 255;
|
c.alpha = 255;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -317,7 +323,7 @@ grub_video_parse_color (const char *s, grub_video_rgba_color_t *color)
|
|||||||
{
|
{
|
||||||
if (! grub_video_get_named_color (s, &c))
|
if (! grub_video_get_named_color (s, &c))
|
||||||
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
return grub_error (GRUB_ERR_BAD_ARGUMENT,
|
||||||
"invalid named color `%s'", s);
|
N_("invalid color specification `%s'"), s0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (grub_errno == GRUB_ERR_NONE)
|
if (grub_errno == GRUB_ERR_NONE)
|
||||||
|
|||||||
Reference in new issue
Block a user