Renaming a variable.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5728 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2016-03-12 10:21:02 +00:00
parent fa82824a59
commit f72e16502e
2 changed files with 16 additions and 17 deletions

View File

@ -4,6 +4,7 @@
* src/rcfile.c (parse_one_include, parse_includes): New names for
these functions, to be more distinguishable.
* src/rcfile.c (parse_colors): Reduce the indentation.
* src/rcfile.c (parse_colors): Rename a variable.
2016-03-11 Benno Schulenberg <bensberg@justemail.net>
* src/browser.c (do_browser): Fix compilation when configured with

View File

@ -658,10 +658,10 @@ void parse_colors(char *ptr, bool icase)
while (ptr != NULL && *ptr != '\0') {
colortype *newcolor;
/* The container for a color plus its regexes. */
bool cancelled = FALSE;
/* The start expression was bad. */
bool goodstart;
/* Whether the start expression was valid. */
bool expectend = FALSE;
/* Do we expect an end= line? */
/* Whether to expect an end= line. */
if (strncasecmp(ptr, "start=", 6) == 0) {
ptr += 6;
@ -680,9 +680,11 @@ void parse_colors(char *ptr, bool icase)
if (ptr == NULL)
break;
/* Save the starting regex string if it's valid, and set up the
* color information. */
if (nregcomp(fgstr, icase ? REG_ICASE : 0)) {
goodstart = nregcomp(fgstr, icase ? REG_ICASE : 0);
/* If the starting regex is valid, initialize a new color struct,
* and hook it in at the tail of the linked list. */
if (goodstart) {
newcolor = (colortype *)nmalloc(sizeof(colortype));
newcolor->fg = fg;
@ -698,15 +700,12 @@ void parse_colors(char *ptr, bool icase)
newcolor->next = NULL;
if (endcolor == NULL) {
#ifdef DEBUG
fprintf(stderr, "Adding an entry for fg %hd, bg %hd\n", fg, bg);
#endif
if (endcolor == NULL)
live_syntax->color = newcolor;
#ifdef DEBUG
fprintf(stderr, "Starting a new colorstring for fg %hd, bg %hd\n", fg, bg);
#endif
} else {
#ifdef DEBUG
fprintf(stderr, "Adding new entry for fg %hd, bg %hd\n", fg, bg);
#endif
else {
/* Need to recompute endcolor now so we can extend
* colors to syntaxes. */
for (endcolor = live_syntax->color; endcolor->next != NULL;)
@ -715,8 +714,7 @@ void parse_colors(char *ptr, bool icase)
}
endcolor = newcolor;
} else
cancelled = TRUE;
}
if (!expectend)
continue;
@ -739,7 +737,7 @@ void parse_colors(char *ptr, bool icase)
/* If the start regex was invalid, skip past the end regex
* to stay in sync. */
if (cancelled)
if (!goodstart)
continue;
/* If it's valid, save the ending regex string. */