diff options
author | Mike Frysinger <vapier@gentoo.org> | 2008-10-05 20:13:51 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2008-10-05 20:13:51 +0000 |
commit | 37819e16ae684a91389dc70bd7a0e3e19fdc1bdc (patch) | |
tree | 78605764433422074d4156bde4d5dd8232ce76c3 /app-editors | |
parent | broken (diff) | |
download | gentoo-2-37819e16ae684a91389dc70bd7a0e3e19fdc1bdc.tar.gz gentoo-2-37819e16ae684a91389dc70bd7a0e3e19fdc1bdc.tar.bz2 gentoo-2-37819e16ae684a91389dc70bd7a0e3e19fdc1bdc.zip |
Add fix from upstream for segv when cutting & pasting between files.
(Portage version: 2.2_rc8/cvs/Linux 2.6.26.2 x86_64)
Diffstat (limited to 'app-editors')
-rw-r--r-- | app-editors/nano/ChangeLog | 8 | ||||
-rw-r--r-- | app-editors/nano/files/nano-2.1.6-cut-paste-segv.patch | 70 | ||||
-rw-r--r-- | app-editors/nano/nano-2.1.6-r1.ebuild | 84 |
3 files changed, 161 insertions, 1 deletions
diff --git a/app-editors/nano/ChangeLog b/app-editors/nano/ChangeLog index 2ec467b4ee77..33023e8653b6 100644 --- a/app-editors/nano/ChangeLog +++ b/app-editors/nano/ChangeLog @@ -1,6 +1,12 @@ # ChangeLog for app-editors/nano # Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-editors/nano/ChangeLog,v 1.206 2008/10/05 17:52:09 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-editors/nano/ChangeLog,v 1.207 2008/10/05 20:13:50 vapier Exp $ + +*nano-2.1.6-r1 (05 Oct 2008) + + 05 Oct 2008; Mike Frysinger <vapier@gentoo.org> + +files/nano-2.1.6-cut-paste-segv.patch, +nano-2.1.6-r1.ebuild: + Add fix from upstream for segv when cutting & pasting between files. *nano-2.1.6 (05 Oct 2008) diff --git a/app-editors/nano/files/nano-2.1.6-cut-paste-segv.patch b/app-editors/nano/files/nano-2.1.6-cut-paste-segv.patch new file mode 100644 index 000000000000..aab3643bb9a2 --- /dev/null +++ b/app-editors/nano/files/nano-2.1.6-cut-paste-segv.patch @@ -0,0 +1,70 @@ +https://savannah.gnu.org/bugs/?24447 + +commit af3b86f16fc3e3f07a1d067528ecd84dd72a58d2 +Author: astyanax <astyanax@35c25a1d-7b9e-4130-9fde-d3aeb78583b8> +Date: Sat Oct 4 11:10:11 2008 +0000 + + 2008-10-04 Chris Allegretta <chrisa@asty.org> + * cut.c (Add_undo): Save last cut undo information so it can be used for next uncut, fixes + Savannah bug 24183. + + + + git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4338 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 + +diff --git a/ChangeLog b/ChangeLog +index 98e9253..5f0f132 100644 +--- a/ChangeLog ++++ b/ChangeLog +@@ -1,3 +1,7 @@ ++2008-10-04 Chris Allegretta <chrisa@asty.org> ++ * cut.c (Add_undo): Save last cut undo information so it can be used for next uncut, fixes ++ Savannah bug 24183. ++ + GNU nano 2.1.6 - 2008.10.03 + 2008-10-03 Pascal Gentil <pascal.gentil@univ-rennes1.fr> + * fortran.nanorc: Sample python syntax highlighting file +diff --git a/src/text.c b/src/text.c +index 407b7ec..97e1f19 100644 +--- a/src/text.c ++++ b/src/text.c +@@ -822,6 +822,7 @@ void add_undo(undo_type current_action) + undo *u, *cutu; + char *data; + openfilestruct *fs = openfile; ++ static undo *last_cutu = NULL; /* Last thing we cut to set up the undo for uncut */ + + /* Ugh, if we were called while cutting not-to-end, non-marked and on the same lineno, + we need to abort here */ +@@ -896,22 +897,22 @@ void add_undo(undo_type current_action) + u->mark_begin_x = openfile->mark_begin_x; + } + u->to_end = (current_action == CUTTOEND); ++ last_cutu = u; + break; + case UNCUT: +- for (cutu = u; cutu != NULL && cutu->type != CUT; cutu = cutu->next) +- ; +- if (cutu->type == CUT) { +- u->cutbuffer = cutu->cutbuffer; +- u->cutbottom = cutu->cutbottom; +- if (!cutu->mark_set) +- u->linescut = cutu->linescut; ++ if (!last_cutu) ++ statusbar(_("Internal error: can't setup uncut. Please save your work.")); ++ else if (last_cutu->type == CUT) { ++ u->cutbuffer = last_cutu->cutbuffer; ++ u->cutbottom = last_cutu->cutbottom; ++ if (!last_cutu->mark_set) ++ u->linescut = last_cutu->linescut; + else { + filestruct *c; + for (c = u->cutbuffer; c != NULL; c = c->next) + u->linescut++; + } +- } else +- statusbar(_("Internal error: can't setup uncut. Please save your work.")); ++ } + break; + case OTHER: + statusbar(_("Internal error: unknown type. Please save your work.")); diff --git a/app-editors/nano/nano-2.1.6-r1.ebuild b/app-editors/nano/nano-2.1.6-r1.ebuild new file mode 100644 index 000000000000..193f42b43752 --- /dev/null +++ b/app-editors/nano/nano-2.1.6-r1.ebuild @@ -0,0 +1,84 @@ +# Copyright 1999-2008 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-editors/nano/nano-2.1.6-r1.ebuild,v 1.1 2008/10/05 20:13:50 vapier Exp $ + +inherit eutils +if [[ ${PV} == "9999" ]] ; then + ECVS_SERVER="savannah.gnu.org:/cvsroot/nano" + ECVS_MODULE="nano" + ECVS_AUTH="pserver" + ECVS_USER="anonymous" + inherit cvs +else + MY_P=${PN}-${PV/_} + SRC_URI="http://www.nano-editor.org/dist/v${PV:0:3}/${MY_P}.tar.gz" +fi + +DESCRIPTION="GNU GPL'd Pico clone with more functionality" +HOMEPAGE="http://www.nano-editor.org/" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" +IUSE="debug justify minimal ncurses nls slang spell unicode" + +DEPEND=">=sys-libs/ncurses-5.2 + nls? ( sys-devel/gettext ) + !ncurses? ( slang? ( sys-libs/slang ) )" + +src_unpack() { + unpack ${A} + cd "${S}" + epatch "${FILESDIR}"/${P}-cut-paste-segv.patch + if [[ ! -e configure ]] ; then + ./autogen.sh || die "autogen failed" + fi +} + +src_compile() { + local myconf="" + use ncurses \ + && myconf="--without-slang" \ + || myconf="${myconf} $(use_with slang)" + + econf \ + --bindir=/bin \ + $(use_enable !minimal color) \ + $(use_enable !minimal multibuffer) \ + $(use_enable !minimal nanorc) \ + --disable-wrapping-as-root \ + $(use_enable spell speller) \ + $(use_enable justify) \ + $(use_enable debug) \ + $(use_enable nls) \ + $(use_enable unicode utf8) \ + $(use_enable minimal tiny) \ + ${myconf} \ + || die "configure failed" + emake || die +} + +src_install() { + emake DESTDIR="${D}" install || die + + dodoc ChangeLog README doc/nanorc.sample AUTHORS BUGS NEWS TODO + dohtml *.html + insinto /etc + newins doc/nanorc.sample nanorc + + dodir /usr/bin + dosym /bin/nano /usr/bin/nano + + insinto /usr/share/nano + local f + for f in "${FILESDIR}"/*.nanorc ; do + [[ -e ${D}/usr/share/nano/${f##*/} ]] && continue + doins "${f}" || die + echo "# include \"/usr/share/nano/${f##*/}\"" >> "${D}"/etc/nanorc + done +} + +pkg_postinst() { + elog "More helpful info about nano, visit the GDP page:" + elog "http://www.gentoo.org/doc/en/nano-basics-guide.xml" +} |