[arch-commits] Commit in nano/repos (3 files)

Andreas Radke andyrtr at archlinux.org
Mon Apr 1 19:12:15 UTC 2019


    Date: Monday, April 1, 2019 @ 19:12:14
  Author: andyrtr
Revision: 349548

archrelease: copy trunk to testing-x86_64

Added:
  nano/repos/testing-x86_64/
  nano/repos/testing-x86_64/0001-files-initialize-a-variable-before-referencing-it.patch
    (from rev 349547, nano/trunk/0001-files-initialize-a-variable-before-referencing-it.patch)
  nano/repos/testing-x86_64/PKGBUILD
    (from rev 349547, nano/trunk/PKGBUILD)

--------------------------------------------------------------+
 0001-files-initialize-a-variable-before-referencing-it.patch |   39 ++++++++
 PKGBUILD                                                     |   45 ++++++++++
 2 files changed, 84 insertions(+)

Copied: nano/repos/testing-x86_64/0001-files-initialize-a-variable-before-referencing-it.patch (from rev 349547, nano/trunk/0001-files-initialize-a-variable-before-referencing-it.patch)
===================================================================
--- testing-x86_64/0001-files-initialize-a-variable-before-referencing-it.patch	                        (rev 0)
+++ testing-x86_64/0001-files-initialize-a-variable-before-referencing-it.patch	2019-04-01 19:12:14 UTC (rev 349548)
@@ -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
+

Copied: nano/repos/testing-x86_64/PKGBUILD (from rev 349547, nano/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD	                        (rev 0)
+++ testing-x86_64/PKGBUILD	2019-04-01 19:12:14 UTC (rev 349548)
@@ -0,0 +1,45 @@
+# Maintainer: Andreas Radke <andyrtr at archlinux.org>
+# Contributor: Judd <judd at archlinux.org>
+
+pkgname=nano
+pkgver=4.0
+pkgrel=2
+pkgdesc="Pico editor clone with enhancements"
+arch=('x86_64')
+license=('GPL')
+url="https://www.nano-editor.org"
+groups=('base')
+depends=('ncurses' 'file' 'sh')
+backup=('etc/nanorc')
+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'
+            '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 \
+    --sysconfdir=/etc \
+    --enable-color \
+    --enable-nanorc \
+    --enable-multibuffer
+  make
+}
+
+package() {
+  cd ${pkgname}-${pkgver}
+  make DESTDIR=${pkgdir} install
+  install -DTm644 ${srcdir}/${pkgname}-${pkgver}/doc/sample.nanorc ${pkgdir}/etc/nanorc
+}


More information about the arch-commits mailing list