summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-editors/dav/dav-0.8.5-r2.ebuild41
-rw-r--r--app-editors/dav/files/fix-Wformat-security-warnings.patch39
2 files changed, 80 insertions, 0 deletions
diff --git a/app-editors/dav/dav-0.8.5-r2.ebuild b/app-editors/dav/dav-0.8.5-r2.ebuild
new file mode 100644
index 000000000000..ac71d332b403
--- /dev/null
+++ b/app-editors/dav/dav-0.8.5-r2.ebuild
@@ -0,0 +1,41 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+inherit toolchain-funcs
+
+DESCRIPTION="A minimal console text editor"
+HOMEPAGE="http://dav-text.sourceforge.net/"
+
+# The maintainer does not keep sourceforge's mirrors up-to-date,
+# so we point to the website's store of files.
+SRC_URI="http://dav-text.sourceforge.net/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc ~x86 ~amd64-linux ~x86-linux ~ppc-macos"
+
+RDEPEND="sys-libs/ncurses:0"
+DEPEND="
+ ${RDEPEND}
+ virtual/pkgconfig
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-asneeded.patch"
+ "${FILESDIR}/${P}-davrc-buffer-overflow.patch"
+ "${FILESDIR}/fix-Wformat-security-warnings.patch"
+)
+
+# Makefile only
+src_configure() { :; }
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ CFLAGS="${CFLAGS}" \
+ LDFLAGS="${LDFLAGS} $( $(tc-getPKG_CONFIG) --libs ncurses)"
+}
+
+DOCS=( README )
diff --git a/app-editors/dav/files/fix-Wformat-security-warnings.patch b/app-editors/dav/files/fix-Wformat-security-warnings.patch
new file mode 100644
index 000000000000..fe1733360551
--- /dev/null
+++ b/app-editors/dav/files/fix-Wformat-security-warnings.patch
@@ -0,0 +1,39 @@
+From 8e57c21b3b707c2a81695384688c46faa1d51da8 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Wed, 10 Aug 2016 15:52:30 -0400
+Subject: [PATCH 1/1] fileIO.c: add format strings to sprintf calls.
+
+Two calls to sprintf() in fileIO.c were missing the trivial format
+string "%s". This caused warnings with -Wformat-security, and build
+failures with -Werror=format-security. Those two calls are now fixed.
+
+Gentoo-Bug: 521016
+---
+ fileIO.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/fileIO.c b/fileIO.c
+index a6c535a..1916a46 100644
+--- a/fileIO.c
++++ b/fileIO.c
+@@ -92,7 +92,7 @@ char *doSave(char *filename) {
+ n++;
+ choices = realloc(choices, n*sizeof(char *));
+ choices[n-1] = malloc(256);
+- sprintf(choices[n-1], d->d_name);
++ sprintf(choices[n-1], "%s", d->d_name);
+ }
+ closedir(dir);
+
+@@ -178,7 +178,7 @@ void load(char *filename)
+ n++;
+ choices = realloc(choices, n*sizeof(char *));
+ choices[n-1] = malloc(256);
+- sprintf(choices[n-1], d->d_name);
++ sprintf(choices[n-1], "%s", d->d_name);
+ }
+ closedir(dir);
+
+--
+2.7.3
+