setterm: disallow "default" for --ulcolor/--hbcolor

Passing "default" to --ulcolor or --hbcolor worked, but it set the color to
bright red. This was not a documented syntax, so let's forbid it.

Signed-off-by: Jakub Wilk <jwilk@jwilk.net>
This commit is contained in:
Jakub Wilk 2019-03-07 21:42:09 +01:00
parent 64a87be1a4
commit c1b4cf105d
1 changed files with 1 additions and 1 deletions

View File

@ -231,7 +231,7 @@ static int parse_ulhb_color(char **av, int *oi)
color = parse_color(color_name);
if (color < 0)
color = strtos32_or_err(color_name, _("argument error"));
if (!is_valid_color(color))
if (!is_valid_color(color) || color == DEFAULT)
errx(EXIT_FAILURE, "%s: %s", _("argument error"), color_name);
if (bright && (color == BLACK || color == GREY))
errx(EXIT_FAILURE, _("argument error: bright %s is not supported"), color_name);