tweaks: rename a variable, to be more general

master
Benno Schulenberg 2017-01-17 12:33:46 +01:00
parent a8c1dc1402
commit de36e1c120
1 changed files with 11 additions and 11 deletions

View File

@ -648,7 +648,7 @@ void parse_colors(char *ptr, int rex_flags)
{
short fg, bg;
bool bright = FALSE;
char *fgstr;
char *item;
assert(ptr != NULL);
@ -664,9 +664,9 @@ void parse_colors(char *ptr, int rex_flags)
return;
}
fgstr = ptr;
item = ptr;
ptr = parse_next_word(ptr);
if (!parse_color_names(fgstr, &fg, &bg, &bright))
if (!parse_color_names(item, &fg, &bg, &bright))
return;
if (*ptr == '\0') {
@ -696,16 +696,16 @@ void parse_colors(char *ptr, int rex_flags)
continue;
}
fgstr = ++ptr;
item = ++ptr;
ptr = parse_next_regex(ptr);
if (ptr == NULL)
break;
if (*fgstr == '\0') {
if (*item == '\0') {
rcfile_error(N_("Empty regex string"));
goodstart = FALSE;
} else
goodstart = nregcomp(fgstr, rex_flags);
goodstart = nregcomp(item, rex_flags);
/* If the starting regex is valid, initialize a new color struct,
* and hook it in at the tail of the linked list. */
@ -717,7 +717,7 @@ void parse_colors(char *ptr, int rex_flags)
newcolor->bright = bright;
newcolor->rex_flags = rex_flags;
newcolor->start_regex = mallocstrcpy(NULL, fgstr);
newcolor->start_regex = mallocstrcpy(NULL, item);
newcolor->start = NULL;
newcolor->end_regex = NULL;
@ -750,12 +750,12 @@ void parse_colors(char *ptr, int rex_flags)
continue;
}
fgstr = ++ptr;
item = ++ptr;
ptr = parse_next_regex(ptr);
if (ptr == NULL)
break;
if (*fgstr == '\0') {
if (*item == '\0') {
rcfile_error(N_("Empty regex string"));
continue;
}
@ -766,8 +766,8 @@ void parse_colors(char *ptr, int rex_flags)
continue;
/* If it's valid, save the ending regex string. */
if (nregcomp(fgstr, rex_flags))
newcolor->end_regex = mallocstrcpy(NULL, fgstr);
if (nregcomp(item, rex_flags))
newcolor->end_regex = mallocstrcpy(NULL, item);
/* Lame way to skip another static counter. */
newcolor->id = live_syntax->nmultis;