app-editors/nano: Revbump to fix justify keystroke crash
authorLars Wendler <polynomial-c@gentoo.org>
Fri, 27 Mar 2020 08:22:34 +0000 (09:22 +0100)
committerLars Wendler <polynomial-c@gentoo.org>
Fri, 27 Mar 2020 08:22:44 +0000 (09:22 +0100)
Package-Manager: Portage-2.3.96, Repoman-2.3.22
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
app-editors/nano/files/nano-4.8-justify_keystroke_crash_fix.patch [new file with mode: 0644]
app-editors/nano/nano-4.6-r1.ebuild [moved from app-editors/nano/nano-4.6.ebuild with 96% similarity]

diff --git a/app-editors/nano/files/nano-4.8-justify_keystroke_crash_fix.patch b/app-editors/nano/files/nano-4.8-justify_keystroke_crash_fix.patch
new file mode 100644 (file)
index 0000000..e18425a
--- /dev/null
@@ -0,0 +1,34 @@
+From 2d05ce37c60a157760f386badc387e2d53b2fa75 Mon Sep 17 00:00:00 2001
+From: Benno Schulenberg <bensberg@telfort.nl>
+Date: Thu, 5 Mar 2020 16:57:16 +0100
+Subject: [PATCH] justify: do not crash when the user attempts to justify an
+ empty region
+
+This fixes https://savannah.gnu.org/bugs/?57959.
+
+Bug existed since version 4.0, since the justifying
+of a marked region was introduced.
+---
+ src/text.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/text.c b/src/text.c
+index 957938f4..4fe7eb96 100644
+--- a/src/text.c
++++ b/src/text.c
+@@ -1930,6 +1930,12 @@ void do_justify(bool full_justify)
+               get_region((const linestruct **)&first_par_line, &top_x,
+                                       (const linestruct **)&last_par_line, &bot_x, &right_side_up);
++              /* When the marked region is empty, do nothing. */
++              if (first_par_line == last_par_line && top_x == bot_x) {
++                      statusline(NOTICE, _("Nothing changed"));
++                      return;
++              }
++
+               /* Save the starting point of the marked region. */
+               was_top_lineno = first_par_line->lineno;
+               was_top_x = top_x;
+-- 
+2.25.2
+
similarity index 96%
rename from app-editors/nano/nano-4.6.ebuild
rename to app-editors/nano/nano-4.6-r1.ebuild
index 18a962cba39484a585142c957f26f4f2d14d1e9a..0f93288e883f2562eed62ae7bbddd6fbf9b17631 100644 (file)
@@ -32,6 +32,7 @@ BDEPEND="
        nls? ( sys-devel/gettext )
        virtual/pkgconfig
 "
+PATCHES=( "${FILESDIR}/${PN}-4.8-justify_keystroke_crash_fix.patch" )
 src_prepare() {
        default
        if [[ ${PV} == "9999" ]] ; then