[arch-commits] Commit in nano/trunk (2 files)
Andreas Radke
andyrtr at archlinux.org
Mon Apr 1 19:12:03 UTC 2019
Date: Monday, April 1, 2019 @ 19:12:02
Author: andyrtr
Revision: 349547
upgpkg: nano 4.0-2
apply upstream fix for possible non-working ^S keystroke
Added:
nano/trunk/0001-files-initialize-a-variable-before-referencing-it.patch
Modified:
nano/trunk/PKGBUILD
--------------------------------------------------------------+
0001-files-initialize-a-variable-before-referencing-it.patch | 39 ++++++++++
PKGBUILD | 15 +++
2 files changed, 51 insertions(+), 3 deletions(-)
Added: 0001-files-initialize-a-variable-before-referencing-it.patch
===================================================================
--- 0001-files-initialize-a-variable-before-referencing-it.patch (rev 0)
+++ 0001-files-initialize-a-variable-before-referencing-it.patch 2019-04-01 19:12:02 UTC (rev 349547)
@@ -0,0 +1,39 @@
+From 7ad232d71470cd8c4dc63aeb02f11c9e8df9ecdb Mon Sep 17 00:00:00 2001
+From: Devin Hussey <address at hidden>
+Date: Thu, 28 Mar 2019 17:28:47 -0400
+Subject: [PATCH] files: initialize a variable before referencing it
+
+The lack of initialization caused a nasty bug on some targets (such as
+ARMv7) which would make it so that ^S would just say "Cancelled".
+
+While x86 (both 64 and 32 bits) seems to initialize 'response' to zero or
+a positive number, ARM does not, and there is usually a negative value in
+its place, which triggers the 'if (response < 0)' check and, as a result,
+the code says "Cancelled".
+
+This fixes https://savannah.gnu.org/bugs/?56023.
+Reported-by: Devin Hussey <address at hidden>
+
+Bug existed since version 4.0, commit 0f9d60a3.
+
+Signed-off-by: Devin Hussey <address at hidden>
+---
+ src/files.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/files.c b/src/files.c
+index 84e3f684..fd54c168 100644
+--- a/src/files.c
++++ b/src/files.c
+@@ -2101,7 +2101,7 @@ int do_writeout(bool exiting, bool withprompt)
+
+ while (TRUE) {
+ const char *msg;
+- int response, choice;
++ int response = 0, choice = 0;
+ functionptrtype func;
+ #ifndef NANO_TINY
+ const char *formatstr, *backupstr;
+--
+2.20.1
+
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2019-04-01 18:59:25 UTC (rev 349546)
+++ PKGBUILD 2019-04-01 19:12:02 UTC (rev 349547)
@@ -3,7 +3,7 @@
pkgname=nano
pkgver=4.0
-pkgrel=1
+pkgrel=2
pkgdesc="Pico editor clone with enhancements"
arch=('x86_64')
license=('GPL')
@@ -11,14 +11,23 @@
groups=('base')
depends=('ncurses' 'file' 'sh')
backup=('etc/nanorc')
-source=(https://www.nano-editor.org/dist/v4/${pkgname}-${pkgver}.tar.xz{,.asc})
+source=(https://www.nano-editor.org/dist/v4/${pkgname}-${pkgver}.tar.xz{,.asc}
+ 0001-files-initialize-a-variable-before-referencing-it.patch)
sha256sums=('1e2fcfea35784624a7d86785768b772d58bb3995d1aec9176a27a113b1e9bac3'
- 'SKIP')
+ 'SKIP'
+ 'f1dce36d1932d925ae3491ab19d3032263fe7c675d0f9d69f30adece6441da96')
validpgpkeys=('8DA6FE7BFA7A418AB3CB2354BCB356DF91009FA7' # "Chris Allegretta <chrisa at asty.org>"
'A7F6A64A67DA09EF92782DD79DF4862AF1175C5B' # "Benno Schulenberg <bensberg at justemail.net>"
'BFD009061E535052AD0DF2150D28D4D2A0ACE884' # "Benno Schulenberg <bensberg at telfort.nl>"
)
+prepare() {
+ cd ${pkgname}-${pkgver}
+ # correct a possible non-working ^S keystroke on some systems
+ # http://lists.gnu.org/archive/html/nano-devel/2019-04/msg00000.html
+ patch -Np1 -i ../0001-files-initialize-a-variable-before-referencing-it.patch
+}
+
build() {
cd ${pkgname}-${pkgver}
./configure --prefix=/usr \
More information about the arch-commits
mailing list