Commit f46544f6 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

tweaks: chuck two useless asserts, and elide a call to strncasecmp()

No related merge requests found
Showing with 3 additions and 10 deletions
+3 -10
......@@ -613,8 +613,6 @@ void parse_includes(char *ptr)
* and set bright to TRUE if that color is bright. */
short color_to_short(const char *colorname, bool *bright)
{
assert(colorname != NULL && bright != NULL);
if (strncasecmp(colorname, "bright", 6) == 0) {
*bright = TRUE;
colorname += 6;
......@@ -654,8 +652,6 @@ void parse_colors(char *ptr, int rex_flags)
bool bright = FALSE;
char *item;
assert(ptr != NULL);
if (!opensyntax) {
rcfile_error(
N_("A '%s' command requires a preceding 'syntax' command"),
......@@ -729,9 +725,6 @@ void parse_colors(char *ptr, int rex_flags)
newcolor->next = NULL;
#ifdef DEBUG
fprintf(stderr, "Adding an entry for fg %hd, bg %hd\n", fg, bg);
#endif
if (lastcolor == NULL)
live_syntax->color = newcolor;
else
......@@ -785,12 +778,12 @@ bool parse_color_names(char *combostr, short *fg, short *bg, bool *bright)
char *comma = strchr(combostr, ',');
if (comma != NULL) {
*comma = '\0';
if (strncasecmp(comma + 1, "bright", 6) == 0) {
*bg = color_to_short(comma + 1, bright);
if (*bright) {
rcfile_error(N_("A background color cannot be bright"));
return FALSE;
}
*bg = color_to_short(comma + 1, bright);
*comma = '\0';
} else
*bg = -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment