commit 6e3b9ac0587243460c1f8a19d3fcc4402f98808d
parent 41c561c5cf4584b9852324e7d64c630e6d596d39
Author: David Lawrence Ramsey <pooka109@gmail.com>
Date: Mon, 10 Dec 2018 14:25:15 -0600
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.
Diffstat:
2 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/src/nano.c b/src/nano.c
@@ -2481,6 +2481,8 @@ int main(int argc, char **argv)
quoteerr = charalloc(size);
regerror(quoterc, "ereg, quoteerr, size);
+
+ die(_("Bad quoting regex \"%s\": %s\n"), quotestr, quoteerr);
}
#endif /* ENABLE_JUSTIFY */
diff --git a/src/text.c b/src/text.c
@@ -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)