diff --git a/ChangeLog b/ChangeLog index de22f2c43b7d1b5a24536d72315a434703cec86f..69907de5329ecd75d4cb6f5c571b291695f15a49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -140,6 +140,8 @@ CVS code - parse_colors() - Properly parse a background color without a foreground color. (DLR) + - Properly generate an error if we get a color directive without + a regex string. (DLR) - search.c: do_gotoline() - Properly show an error message if we try to go to line 0, diff --git a/src/rcfile.c b/src/rcfile.c index 3e5bd78c8f079f820e66cb0af007c536d713ada9..8eddeb6ef9d8098d17de572ef64e8026a879ed3b 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -402,6 +402,12 @@ void parse_colors(char *ptr) return; } + if (*ptr == '\0') { + rcfile_error( + N_("Cannot add a color directive without a regex string")); + return; + } + /* Now for the fun part. Start adding regexes to individual strings * in the colorstrings array, woo! */ while (ptr != NULL && *ptr != '\0') {