Reducing the indentation by short-circuiting a loop.
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5727 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
3cb80ff7ea
commit
fa82824a59
|
@ -3,6 +3,7 @@
|
|||
just once, in a single place. And unnest two 'if's.
|
||||
* 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.
|
||||
|
||||
2016-03-11 Benno Schulenberg <bensberg@justemail.net>
|
||||
* src/browser.c (do_browser): Fix compilation when configured with
|
||||
|
|
12
src/rcfile.c
12
src/rcfile.c
|
@ -718,16 +718,17 @@ void parse_colors(char *ptr, bool icase)
|
|||
} else
|
||||
cancelled = TRUE;
|
||||
|
||||
if (expectend) {
|
||||
if (!expectend)
|
||||
continue;
|
||||
|
||||
if (ptr == NULL || strncasecmp(ptr, "end=", 4) != 0) {
|
||||
rcfile_error(
|
||||
N_("\"start=\" requires a corresponding \"end=\""));
|
||||
rcfile_error(N_("\"start=\" requires a corresponding \"end=\""));
|
||||
return;
|
||||
}
|
||||
|
||||
ptr += 4;
|
||||
if (*ptr != '"') {
|
||||
rcfile_error(
|
||||
N_("Regex strings must begin and end with a \" character"));
|
||||
rcfile_error(N_("Regex strings must begin and end with a \" character"));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -749,7 +750,6 @@ void parse_colors(char *ptr, bool icase)
|
|||
newcolor->id = live_syntax->nmultis;
|
||||
live_syntax->nmultis++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Parse the color name, or pair of color names, in combostr. */
|
||||
|
|
Loading…
Reference in New Issue