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