Commit 44491acf authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

in color_to_int(), assert that colorname isn't NULL, since that case is

now handled elsewhere; also clarify an error message in parse_colors()


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@2623 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 5 additions and 8 deletions
+5 -8
...@@ -140,6 +140,9 @@ CVS code - ...@@ -140,6 +140,9 @@ CVS code -
- Disable extended output processing as well as extended input - Disable extended output processing as well as extended input
processing, and rename to disable_extended_io(). (DLR) processing, and rename to disable_extended_io(). (DLR)
- rcfile.c: - rcfile.c:
color_to_int()
- Since colorname's being NULL is handled elsewhere now, assert
that it isn't NULL at the beginning of the function. (DLR)
parse_colors() parse_colors()
- Properly parse a background color without a foreground color. - Properly parse a background color without a foreground color.
(DLR) (DLR)
......
...@@ -188,12 +188,7 @@ int color_to_int(const char *colorname, bool *bright) ...@@ -188,12 +188,7 @@ int color_to_int(const char *colorname, bool *bright)
{ {
int mcolor = -1; int mcolor = -1;
if (colorname == NULL) { assert(colorname != NULL && bright != NULL);
rcfile_error(N_("Missing color name"));
return -1;
}
assert(bright != NULL);
if (strncasecmp(colorname, "bright", 6) == 0) { if (strncasecmp(colorname, "bright", 6) == 0) {
*bright = TRUE; *bright = TRUE;
...@@ -403,8 +398,7 @@ void parse_colors(char *ptr) ...@@ -403,8 +398,7 @@ void parse_colors(char *ptr)
} }
if (*ptr == '\0') { if (*ptr == '\0') {
rcfile_error( rcfile_error(N_("Missing regex string"));
N_("Cannot add a color directive without a regex string"));
return; return;
} }
......
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