options: exit on a bad quoting regex, instead of crashing later

The paragraph-jumping functions used the regex unverified...

This fixes https://savannah.gnu.org/bugs/?55169.
master
David Lawrence Ramsey 2018-12-10 14:25:15 -06:00 committed by Benno Schulenberg
parent 41c561c5cf
commit 6e3b9ac058
2 changed files with 2 additions and 5 deletions

View File

@ -2481,6 +2481,8 @@ int main(int argc, char **argv)
quoteerr = charalloc(size);
regerror(quoterc, &quotereg, quoteerr, size);
die(_("Bad quoting regex \"%s\": %s\n"), quotestr, quoteerr);
}
#endif /* ENABLE_JUSTIFY */

View File

@ -2208,11 +2208,6 @@ void do_justify(bool full_justify)
size_t was_current_x = openfile->current_x;
#endif
if (quoterc != 0) {
statusline(ALERT, _("Bad quoting regex %s: %s"), quotestr, quoteerr);
return;
}
/* When justifying the entire buffer, start at the top. Otherwise, when
* in a paragraph but not at its beginning, move back to its first line. */
if (full_justify)