summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2018-03-21 22:00:30 +0000
committerSergei Trofimovich <slyfox@gentoo.org>2018-03-21 22:01:04 +0000
commit3e60f60f4d9cc68dcb998101dc5862ea10258675 (patch)
tree168fbb46344d56199304703dea9427179321ea9b
parentdev-util/kdevelop: Fix patch name (diff)
downloadgentoo-3e60f60f4d9cc68dcb998101dc5862ea10258675.tar.gz
gentoo-3e60f60f4d9cc68dcb998101dc5862ea10258675.tar.bz2
gentoo-3e60f60f4d9cc68dcb998101dc5862ea10258675.zip
app-editors/hteditor: pull format-string fixes, bug #521018
Pulled upstream fix as is: https://github.com/sebastianbiallas/ht/commit/5839355d67ff822593190473a41512ca19e4280a Reported-by: Agostino Sarubbo Closes: https://bugs.gentoo.org/521018 Package-Manager: Portage-2.3.24, Repoman-2.3.6
-rw-r--r--app-editors/hteditor/files/hteditor-2.1.0-format-security.patch57
-rw-r--r--app-editors/hteditor/hteditor-2.1.0-r1.ebuild60
2 files changed, 117 insertions, 0 deletions
diff --git a/app-editors/hteditor/files/hteditor-2.1.0-format-security.patch b/app-editors/hteditor/files/hteditor-2.1.0-format-security.patch
new file mode 100644
index 00000000000..408d1b9b1be
--- /dev/null
+++ b/app-editors/hteditor/files/hteditor-2.1.0-format-security.patch
@@ -0,0 +1,57 @@
+https://bugs.gentoo.org/521018
+
+From 5839355d67ff822593190473a41512ca19e4280a Mon Sep 17 00:00:00 2001
+From: Anton Gladky <gladk@debian.org>
+Date: Wed, 18 Feb 2015 21:20:39 +0100
+Subject: [PATCH] Fix "format not a string" compilation failure
+
+Compilation with the flag -Werror=format-security fails with
+the message:
+
+error: format not a string literal and no format arguments
+
+This patch solves the issue.
+---
+ asm/x86dis.cc | 6 +++---
+ htpal.cc | 2 +-
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/asm/x86dis.cc b/asm/x86dis.cc
+index 0830d9c..bb9028f 100644
+--- a/asm/x86dis.cc
++++ b/asm/x86dis.cc
+@@ -1218,15 +1218,15 @@ void x86dis::str_op(char *opstr, int *opstrlen, x86dis_insn *insn, x86_insn_op *
+ default: {assert(0);}
+ }
+ if (!insn->rexprefix) {
+- sprintf(opstr, x86_regs[j][op->reg]);
++ sprintf(opstr, "%s", x86_regs[j][op->reg]);
+ } else {
+- sprintf(opstr, x86_64regs[j][op->reg]);
++ sprintf(opstr, "%s", x86_64regs[j][op->reg]);
+ }
+ break;
+ }
+ case X86_OPTYPE_SEG:
+ if (x86_segs[op->seg]) {
+- sprintf(opstr, x86_segs[op->seg]);
++ sprintf(opstr, "%s", x86_segs[op->seg]);
+ }
+ break;
+ case X86_OPTYPE_CRX:
+diff --git a/htpal.cc b/htpal.cc
+index 03dea18..3d5f51e 100644
+--- a/htpal.cc
++++ b/htpal.cc
+@@ -307,7 +307,7 @@ void palette_entry::strvalue(char *buf32bytes)
+ text = "normal";
+ }
+ p = tag_make_color(p, 32, VCP(fg, bg));
+- p += sprintf(p, text);
++ p += sprintf(p, "%s", text);
+ p = tag_make_default_color(p, 32);
+ *p = 0;
+ }
+--
+2.16.2
+
diff --git a/app-editors/hteditor/hteditor-2.1.0-r1.ebuild b/app-editors/hteditor/hteditor-2.1.0-r1.ebuild
new file mode 100644
index 00000000000..a1d577aacaf
--- /dev/null
+++ b/app-editors/hteditor/hteditor-2.1.0-r1.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit autotools toolchain-funcs
+
+MY_P=${P/editor}
+
+DESCRIPTION="A file viewer, editor and analyzer for text, binary, and executable files"
+HOMEPAGE="http://hte.sourceforge.net/ https://github.com/sebastianbiallas/ht/"
+SRC_URI="mirror://sourceforge/hte/${MY_P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~amd64-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~sparc-solaris ~x86-solaris"
+IUSE="X"
+
+RDEPEND="sys-libs/ncurses:0=
+ X? ( x11-libs/libX11 )
+ >=dev-libs/lzo-2"
+DEPEND="${RDEPEND}
+ virtual/yacc
+ sys-devel/flex"
+
+DOCS=( AUTHORS ChangeLog KNOWNBUGS README TODO )
+
+S=${WORKDIR}/${MY_P}
+
+PATCHES=(
+ "${FILESDIR}"/${P}-gcc-7.patch
+ "${FILESDIR}"/${P}-tinfo.patch
+ "${FILESDIR}"/${P}-gcc-6-uchar.patch
+ "${FILESDIR}"/${P}-format-security.patch
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf \
+ $(use_enable X x11-textmode) \
+ --enable-maintainermode
+}
+
+src_compile() {
+ emake AR="$(tc-getAR)" CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}"
+}
+
+src_install() {
+ #For prefix
+ chmod u+x "${S}/install-sh"
+
+ local HTML_DOCS="doc/*.html"
+ doinfo doc/*.info
+
+ default
+}