From 481dc203af9559d9a180db1630909a492c80ff22 Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Tue, 13 Oct 2009 11:37:22 +0000 Subject: [PATCH] - disable line wrapping by default (#528359) --- nano-2.0.9-warnings.patch | 64 +++++++++++++++++++++++++++++++++++++++ nano.spec | 30 ++++++++++-------- nanorc | 7 +++++ 3 files changed, 89 insertions(+), 12 deletions(-) create mode 100644 nanorc diff --git a/nano-2.0.9-warnings.patch b/nano-2.0.9-warnings.patch index 085a9a5..327fc64 100644 --- a/nano-2.0.9-warnings.patch +++ b/nano-2.0.9-warnings.patch @@ -175,3 +175,67 @@ diff -rup nano-2.0.9.orig/src/files.c nano-2.0.9/src/files.c /* Free d_here, since we're done using it. */ free(d_here); +diff -rup nano-2.0.9.orig/src/chars.c nano-2.0.9/src/chars.c +--- nano-2.0.9.orig/src/chars.c 2009-09-21 21:23:45.682379298 +0200 ++++ nano-2.0.9/src/chars.c 2009-09-21 21:28:50.143093880 +0200 +@@ -81,14 +81,12 @@ bool is_byte(int c) + + static void mbtowc_reset(void) + { +- int rv = mbtowc(NULL, NULL, 0); +- (void) rv; ++ IGNORE_CALL_RESULT(mbtowc(NULL, NULL, 0)); + } + + static void wctomb_reset(void) + { +- int rv = wctomb(NULL, 0); +- (void) rv; ++ IGNORE_CALL_RESULT(wctomb(NULL, 0)); + } + + /* This function is equivalent to isalnum() for multibyte characters. */ +@@ -400,8 +398,7 @@ int parse_mbchar(const char *buf, char * + /* If buf contains an invalid multibyte character, only + * interpret buf's first byte. */ + if (buf_mb_len < 0) { +- int rv = mblen(NULL, 0); +- (void) rv; ++ IGNORE_CALL_RESULT(mblen(NULL, 0)); + buf_mb_len = 1; + } else if (buf_mb_len == 0) + buf_mb_len++; +diff -rup nano-2.0.9.orig/src/files.c nano-2.0.9/src/files.c +--- nano-2.0.9.orig/src/files.c 2009-09-21 21:23:45.683422811 +0200 ++++ nano-2.0.9/src/files.c 2009-09-21 21:29:11.684110349 +0200 +@@ -1057,7 +1057,6 @@ char *get_full_path(const char *origpath + free(d_there); + d_there = NULL; + } else { +- int rv; + free(d_there); + + /* Get the full path. */ +@@ -1083,8 +1082,7 @@ char *get_full_path(const char *origpath + /* Finally, go back to the path specified in d_here, + * where we were before. We don't check for a chdir() + * error, since we can do nothing if we get one. */ +- rv = chdir(d_here); +- (void) rv; ++ IGNORE_CALL_RESULT(chdir(d_here)); + + /* Free d_here, since we're done using it. */ + free(d_here); +diff -rup nano-2.0.9.orig/src/nano.h nano-2.0.9/src/nano.h +--- nano-2.0.9.orig/src/nano.h 2008-04-02 05:49:33.000000000 +0200 ++++ nano-2.0.9/src/nano.h 2009-09-21 21:27:50.795110162 +0200 +@@ -44,6 +44,9 @@ + #include + #endif + ++/* Suppress warnings for __attribute__((warn_unused_result)) */ ++#define IGNORE_CALL_RESULT(call) do { if (call) {} } while(0) ++ + /* Macros for flags. */ + #define SET(bit) flags |= bit + #define UNSET(bit) flags &= ~bit diff --git a/nano.spec b/nano.spec index 946ec01..39f1857 100644 --- a/nano.spec +++ b/nano.spec @@ -1,15 +1,16 @@ -Summary: A small text editor -Name: nano -Version: 2.0.9 -Release: 3%{?dist} -License: GPLv2+ -Group: Applications/Editors -URL: http://www.nano-editor.org -Source: http://www.nano-editor.org/dist/v1.3/%{name}-%{version}.tar.gz -Patch1: nano-2.0.9-warnings.patch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: ncurses-devel, autoconf, gettext-devel, groff -Requires(post): /sbin/install-info +Summary: A small text editor +Name: nano +Version: 2.0.9 +Release: 4%{?dist} +License: GPLv2+ +Group: Applications/Editors +URL: http://www.nano-editor.org +Source: http://www.nano-editor.org/dist/v1.3/%{name}-%{version}.tar.gz +Source2: nanorc +Patch1: nano-2.0.9-warnings.patch +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: ncurses-devel, autoconf, gettext-devel, groff +Requires(post): /sbin/install-info Requires(preun): /sbin/install-info %description @@ -62,12 +63,17 @@ rm -rf %{buildroot} %doc doc/faq.html /bin/* %{_bindir}/* +%config(noreplace) %{_sysconfdir}/nanorc %{_mandir}/man*/* %lang(fr) %{_mandir}/fr/man*/* %{_infodir}/nano.info* %{_datadir}/nano %changelog +* Tue Oct 13 2009 Kamil Dudka - 2.0.9-4 +- ship a system-wide configuration file along with the nano package +- disable line wrapping by default (#528359) + * Mon Sep 21 2009 Kamil Dudka - 2.0.9-3 - suppress warnings for __attribute__((warn_unused_result)) (#523951) diff --git a/nanorc b/nanorc new file mode 100644 index 0000000..fcf65a4 --- /dev/null +++ b/nanorc @@ -0,0 +1,7 @@ +# This is a system-wide configuration file for the nano editor. Each user can +# save his own configuration to ~/.nanorc +# +# See the nanorc(5) man page for details. + +# disable line wrapping by default +set nowrap