new upstream release (#680736)

- new upstream release (#680736)
- use hunspell as default spell-checker (#681000)
- fix for http://thread.gmane.org/gmane.editors.nano.devel/2911
This commit is contained in:
Kamil Dudka 2011-03-03 12:05:56 +01:00
parent e524e386d1
commit d4b92eee66
7 changed files with 171 additions and 39 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
nano-2.2.5.tar.gz
/nano-2.2.6.tar.gz
/nano-2.3.0.tar.gz

View File

@ -1,4 +1,4 @@
From 63c92c82a8de237f22648d4ffef64b9ad23eb2e3 Mon Sep 17 00:00:00 2001
From fc87b0a32c130a2b3ab37e614d4a1c6c8e5d70e7 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Thu, 19 Aug 2010 13:58:12 +0200
Subject: [PATCH 1/2] check stat's result and avoid calling stat on a NULL pointer
@ -8,7 +8,7 @@ Subject: [PATCH 1/2] check stat's result and avoid calling stat on a NULL pointe
1 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/src/files.c b/src/files.c
index c5b9d6a..656a684 100644
index f6efbf1..99cc1b8 100644
--- a/src/files.c
+++ b/src/files.c
@@ -103,6 +103,24 @@ void initialize_buffer_text(void)
@ -49,7 +49,7 @@ index c5b9d6a..656a684 100644
#endif
}
@@ -1511,8 +1525,8 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
@@ -1532,8 +1546,8 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
* specified it interactively), stat and save the value
* or else we will chase null pointers when we do
* modtime checks, preserve file times, etc. during backup */
@ -60,7 +60,7 @@ index c5b9d6a..656a684 100644
/* We backup only if the backup toggle is set, the file isn't
* temporary, and the file already exists. Furthermore, if we
@@ -1894,7 +1908,10 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
@@ -1924,7 +1938,10 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
if (openfile->current_stat == NULL)
openfile->current_stat =
(struct stat *)nmalloc(sizeof(struct stat));
@ -73,5 +73,5 @@ index c5b9d6a..656a684 100644
statusbar(P_("Wrote %lu line", "Wrote %lu lines",
--
1.7.3.2
1.7.4

View File

@ -1,4 +1,4 @@
From e014ef2cf988a232a702292c82cd577719d08d8c Mon Sep 17 00:00:00 2001
From 23510b930ea31f7de8005e2f0ff6cab7062b4e26 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Thu, 19 Aug 2010 15:23:06 +0200
Subject: [PATCH 2/2] use futimens() if available, instead of utime()
@ -7,11 +7,11 @@ Subject: [PATCH 2/2] use futimens() if available, instead of utime()
config.h.in | 3 +++
configure | 2 +-
configure.ac | 2 +-
src/files.c | 46 +++++++++++++++++++++++++++++++++++-----------
4 files changed, 40 insertions(+), 13 deletions(-)
src/files.c | 48 +++++++++++++++++++++++++++++++++++-------------
4 files changed, 40 insertions(+), 15 deletions(-)
diff --git a/config.h.in b/config.h.in
index 8fbe824..fb0e65d 100644
index 52e13f1..cb17b29 100644
--- a/config.h.in
+++ b/config.h.in
@@ -64,6 +64,9 @@
@ -25,7 +25,7 @@ index 8fbe824..fb0e65d 100644
#undef HAVE_GETDELIM
diff --git a/configure b/configure
index 238dbf9..f1ef55b 100755
index 02733c7..1805e53 100755
--- a/configure
+++ b/configure
@@ -7484,7 +7484,7 @@ fi
@ -38,7 +38,7 @@ index 238dbf9..f1ef55b 100755
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --git a/configure.ac b/configure.ac
index 6388c03..255ec5d 100644
index 66f8ee3..f4975d3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -415,7 +415,7 @@ fi])
@ -51,10 +51,10 @@ index 6388c03..255ec5d 100644
if test x$enable_utf8 != xno; then
AC_CHECK_FUNCS(iswalnum iswblank iswpunct iswspace nl_langinfo mblen mbstowcs mbtowc wctomb wcwidth)
diff --git a/src/files.c b/src/files.c
index 656a684..889c4a8 100644
index 99cc1b8..9a1bdcc 100644
--- a/src/files.c
+++ b/src/files.c
@@ -1434,6 +1434,29 @@ int copy_file(FILE *inn, FILE *out)
@@ -1455,6 +1455,29 @@ int copy_file(FILE *inn, FILE *out)
return retval;
}
@ -84,7 +84,7 @@ index 656a684..889c4a8 100644
/* Write a file out to disk. If f_open isn't NULL, we assume that it is
* a stream associated with the file, and we don't try to open it
* ourselves. If tmp is TRUE, we set the umask to disallow anyone else
@@ -1666,6 +1689,18 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
@@ -1694,6 +1717,18 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
fprintf(stderr, "Backing up %s to %s\n", realname, backupname);
#endif
@ -103,12 +103,14 @@ index 656a684..889c4a8 100644
/* Copy the file. */
copy_status = copy_file(f, backup_file);
@@ -1676,17 +1711,6 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
@@ -1704,19 +1739,6 @@ bool write_file(const char *name, FILE *f_open, bool tmp, append_type
goto cleanup_and_exit;
}
- /* And set its metadata. */
- if (utime(backupname, &filetime) == -1 && !ISSET(INSECURE_BACKUP)) {
- if (prompt_failed_backupwrite(backupname))
- goto skip_backup;
- statusbar(_("Error writing backup file %s: %s"), backupname,
- strerror(errno));
- /* If we can't write to the backup, DONT go on, since
@ -122,5 +124,5 @@ index 656a684..889c4a8 100644
}
--
1.7.3.2
1.7.4

View File

@ -0,0 +1,118 @@
From ea296ebe2f027e40457d116c40e687f1724fab90 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Thu, 3 Mar 2011 12:02:51 +0100
Subject: [PATCH] nano-2.3.0 likes to tell me it matched
From: Mike Frysinger <vapier <at> gentoo.org>
Newsgroups: gmane.editors.nano.devel
Date: 2011-03-03 09:44:20 GMT (1 hour and 16 minutes ago)
when i save the attached file, nano writes to stdout (not via ncurses)
the string "We matched!"
-mike
--
http://thread.gmane.org/gmane.editors.nano.devel/2911
---
src/color.c | 36 +++++++++++++++---------------------
1 files changed, 15 insertions(+), 21 deletions(-)
diff --git a/src/color.c b/src/color.c
index 269cd21..8dfcf23 100644
--- a/src/color.c
+++ b/src/color.c
@@ -31,6 +31,12 @@
#include <magic.h>
#endif
+#ifdef DEBUG
+# define debug_printf(...) fprintf(stderr, __VA_ARGS__)
+#else
+# define debug_printf(...)
+#endif
+
#ifdef ENABLE_COLOR
/* For each syntax list entry, go through the list of colors and assign
@@ -100,9 +106,7 @@ void color_init(void)
init_pair(tmpcolor->pairnum, foreground, background);
-#ifdef DEBUG
- fprintf(stderr, "init_pair(): fg = %hd, bg = %hd\n", tmpcolor->fg, tmpcolor->bg);
-#endif
+ debug_printf("init_pair(): fg = %hd, bg = %hd\n", tmpcolor->fg, tmpcolor->bg);
}
}
}
@@ -167,16 +171,14 @@ void color_update(void)
#endif /* DEBUG */
MAGIC_ERROR);
if (m == NULL || magic_load(m, NULL) < 0)
- fprintf(stderr, "something went wrong: %s [%s]\n", strerror(errno), openfile->filename);
+ debug_printf("something went wrong: %s [%s]\n", strerror(errno), openfile->filename);
else {
magicstring = magic_file(m,openfile->filename);
if (magicstring == NULL) {
magicerr = magic_error(m);
- fprintf(stderr, "something went wrong: %s [%s]\n", magicerr, openfile->filename);
+ debug_printf("something went wrong: %s [%s]\n", magicerr, openfile->filename);
}
-#ifdef DEBUG
- fprintf(stderr, "magic string returned: %s\n", magicstring);
-#endif /* DEBUG */
+ debug_printf("magic string returned: %s\n", magicstring);
}
}
#endif /* HAVE_LIBMAGIC */
@@ -227,9 +229,7 @@ void color_update(void)
#ifdef HAVE_LIBMAGIC
if (openfile->colorstrings == NULL) {
-#ifdef DEBUG
- fprintf(stderr, "No match using extension, trying libmagic...\n");
-#endif /* DEBUG */
+ debug_printf("No match using extension, trying libmagic...\n");
for (tmpsyntax = syntaxes; tmpsyntax != NULL;
tmpsyntax = tmpsyntax->next) {
@@ -239,12 +239,10 @@ void color_update(void)
e->ext = (regex_t *)nmalloc(sizeof(regex_t));
regcomp(e->ext, fixbounds(e->ext_regex), REG_EXTENDED);
}
-#ifdef DEBUG
- fprintf(stderr,"Matching regex \"%s\" against \"%s\"\n",e->ext_regex, magicstring);
-#endif /* DEBUG */
+ debug_printf("Matching regex \"%s\" against \"%s\"\n",e->ext_regex, magicstring);
if (magicstring && regexec(e->ext, magicstring, 0, NULL, 0) == 0) {
- fprintf(stderr,"We matched!\n");
+ debug_printf("We matched!\n");
openfile->syntax = tmpsyntax;
openfile->colorstrings = tmpsyntax->color;
break;
@@ -259,9 +257,7 @@ void color_update(void)
/* If we haven't matched anything yet, try the headers */
if (openfile->colorstrings == NULL) {
-#ifdef DEBUG
- fprintf(stderr, "No match for file extensions, looking at headers...\n");
-#endif
+ debug_printf("No match for file extensions, looking at headers...\n");
for (tmpsyntax = syntaxes; tmpsyntax != NULL;
tmpsyntax = tmpsyntax->next) {
@@ -278,9 +274,7 @@ void color_update(void)
/* Set colorstrings if we matched the extension
* regex. */
-#ifdef DEBUG
- fprintf(stderr, "Comparing header regex \"%s\" to fileage \"%s\"...\n", e->ext_regex, openfile->fileage->data);
-#endif
+ debug_printf("Comparing header regex \"%s\" to fileage \"%s\"...\n", e->ext_regex, openfile->fileage->data);
if (regexec(e->ext, openfile->fileage->data, 0, NULL, 0) == 0) {
openfile->syntax = tmpsyntax;
openfile->colorstrings = tmpsyntax->color;
--
1.7.4

View File

@ -1,7 +1,6 @@
po/Makefile.in.in | 1 +
src/nano.c | 2 +-
src/winio.c | 1 -
3 files changed, 2 insertions(+), 2 deletions(-)
2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/po/Makefile.in.in b/po/Makefile.in.in
index ada8bb4..f7b2a95 100644
@ -16,10 +15,10 @@ index ada8bb4..f7b2a95 100644
localedir = $(datadir)/locale
gettextsrcdir = $(datadir)/gettext/po
diff --git a/src/nano.c b/src/nano.c
index 59e2a9d..1d1d40c 100644
index 269ab29..5b605bf 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -1907,7 +1907,7 @@ precalc_cleanup:
@@ -1925,7 +1925,7 @@ precalc_cleanup:
* TRUE. */
void do_output(char *output, size_t output_len, bool allow_cntrls)
{
@ -28,15 +27,16 @@ index 59e2a9d..1d1d40c 100644
char *char_buf = charalloc(mb_cur_max());
int char_buf_len;
diff --git a/src/winio.c b/src/winio.c
index 1aef2a9..9fde5a2 100644
--- a/src/winio.c
+++ b/src/winio.c
@@ -3125,7 +3125,6 @@ void edit_redraw(filestruct *old_current, size_t pww_save)
old_current->lineno, openfile->edittop->lineno);
#endif
filestruct *old_edittop = openfile->edittop;
- ssize_t nlines;
#ifndef NANO_TINY
/* If the mark is on, update all the lines between old_current
diff --git a/src/search.c b/src/search.c
index ca93098..3451600 100644
--- a/src/search.c
+++ b/src/search.c
@@ -138,7 +138,7 @@ int search_init(bool replacing, bool use_answer)
int i = 0;
char *buf;
sc *s;
- void (*func)(void);
+ void (*func)(void) = (void (*)(void))0;
bool meta_key = FALSE, func_key = FALSE;
static char *backupstring = NULL;
/* The search string we'll be using. */

View File

@ -1,13 +1,13 @@
Summary: A small text editor
Name: nano
Version: 2.2.6
Release: 3%{?dist}
Version: 2.3.0
Release: 1%{?dist}
License: GPLv3+
Group: Applications/Editors
URL: http://www.nano-editor.org
Source: http://www.nano-editor.org/dist/v2.2/%{name}-%{version}.tar.gz
Source: http://www.nano-editor.org/dist/v2.3/%{name}-%{version}.tar.gz
Source2: nanorc
Patch0: nano-2.2.3-warnings.patch
Patch0: nano-2.3.0-warnings.patch
# http://lists.gnu.org/archive/html/nano-devel/2010-08/msg00004.html
Patch1: 0001-check-stat-s-result-and-avoid-calling-stat-on-a-NULL.patch
@ -15,6 +15,9 @@ Patch1: 0001-check-stat-s-result-and-avoid-calling-stat-on-a-NULL.patch
# http://lists.gnu.org/archive/html/nano-devel/2010-08/msg00005.html
Patch2: 0002-use-futimens-if-available-instead-of-utime.patch
# http://thread.gmane.org/gmane.editors.nano.devel/2911
Patch3: nano-2.3.0-color-debug.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: autoconf
BuildRequires: gettext-devel
@ -32,6 +35,7 @@ GNU nano is a small and friendly text editor.
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
for f in doc/man/fr/{nano.1,nanorc.5,rnano.1} ; do
iconv -f iso-8859-1 -t utf-8 -o $f.tmp $f && mv $f.tmp $f
@ -56,8 +60,10 @@ ln -s ../../bin/nano ${RPM_BUILD_ROOT}%{_bindir}/nano
ln -s ../../bin/rnano ${RPM_BUILD_ROOT}%{_bindir}/rnano
cp %{SOURCE2} ./nanorc
# disable line wrapping by default
sed 's/# set nowrap/set nowrap/' doc/nanorc.sample >> ./nanorc
# disable line wrapping by default and set hunspell as the default spell-checker
sed -e 's/# set nowrap/set nowrap/' \
-e 's/^#.*set speller.*$/set speller "hunspell"/' \
doc/nanorc.sample >> ./nanorc
mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}
install -m 644 ./nanorc $RPM_BUILD_ROOT%{_sysconfdir}/nanorc
@ -94,6 +100,11 @@ rm -rf %{buildroot}
%{_datadir}/nano
%changelog
* Thu Mar 03 2011 Kamil Dudka <kdudka@redhat.com> - 2.3.0-1
- new upstream release (#680736)
- use hunspell as default spell-checker (#681000)
- fix for http://thread.gmane.org/gmane.editors.nano.devel/2911
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.2.6-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

View File

@ -1 +1 @@
03233ae480689a008eb98feb1b599807 nano-2.2.6.tar.gz
88bc88e8ae5dad7a85bc84e09df64475 nano-2.3.0.tar.gz