summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Olexa <darkside@gentoo.org>2010-01-22 20:15:55 +0000
committerJeremy Olexa <darkside@gentoo.org>2010-01-22 20:15:55 +0000
commitfba4d64d5fd0316fd5795e42a5daed70b44e875f (patch)
treef4a31580929660c50a84c4540ce6d1faebb3fbe3 /sys-devel
parentstable ppc, bug 285406 (diff)
downloadgentoo-2-fba4d64d5fd0316fd5795e42a5daed70b44e875f.tar.gz
gentoo-2-fba4d64d5fd0316fd5795e42a5daed70b44e875f.tar.bz2
gentoo-2-fba4d64d5fd0316fd5795e42a5daed70b44e875f.zip
Add missing strnlen implementation that upstream apparently forgot to include, bug #300845
(Portage version: 2.1.6.13/cvs/Linux x86_64)
Diffstat (limited to 'sys-devel')
-rw-r--r--sys-devel/patch/ChangeLog7
-rw-r--r--sys-devel/patch/files/gnulib_strnlen.c31
-rw-r--r--sys-devel/patch/patch-2.6.1.ebuild9
3 files changed, 45 insertions, 2 deletions
diff --git a/sys-devel/patch/ChangeLog b/sys-devel/patch/ChangeLog
index e74c8f030733..c908e2b5d726 100644
--- a/sys-devel/patch/ChangeLog
+++ b/sys-devel/patch/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for sys-devel/patch
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/patch/ChangeLog,v 1.44 2010/01/02 03:35:04 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/patch/ChangeLog,v 1.45 2010/01/22 20:15:54 darkside Exp $
+
+ 22 Jan 2010; Jeremy Olexa <darkside@gentoo.org> patch-2.6.1.ebuild,
+ +files/gnulib_strnlen.c:
+ Add missing strnlen implementation that upstream apparently forgot to
+ include, bug #300845
02 Jan 2010; Mike Frysinger <vapier@gentoo.org> patch-2.6.1.ebuild:
Pull in ed for tests #299270 by Patrick Lauer.
diff --git a/sys-devel/patch/files/gnulib_strnlen.c b/sys-devel/patch/files/gnulib_strnlen.c
new file mode 100644
index 000000000000..112df49ab48d
--- /dev/null
+++ b/sys-devel/patch/files/gnulib_strnlen.c
@@ -0,0 +1,31 @@
+/* Find the length of STRING, but scan at most MAXLEN characters.
+ Copyright (C) 2005, 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+ Written by Simon Josefsson.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software Foundation,
+ Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include <config.h>
+
+#include <string.h>
+
+/* Find the length of STRING, but scan at most MAXLEN characters.
+ If no '\0' terminator is found in that many characters, return MAXLEN. */
+
+size_t
+strnlen (const char *string, size_t maxlen)
+{
+ const char *end = memchr (string, '\0', maxlen);
+ return end ? (size_t) (end - string) : maxlen;
+}
diff --git a/sys-devel/patch/patch-2.6.1.ebuild b/sys-devel/patch/patch-2.6.1.ebuild
index 9ca75c025b7a..b3ce5e507662 100644
--- a/sys-devel/patch/patch-2.6.1.ebuild
+++ b/sys-devel/patch/patch-2.6.1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-devel/patch/patch-2.6.1.ebuild,v 1.2 2010/01/02 03:35:04 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-devel/patch/patch-2.6.1.ebuild,v 1.3 2010/01/22 20:15:54 darkside Exp $
inherit flag-o-matic
@@ -17,6 +17,13 @@ RDEPEND=""
DEPEND="${RDEPEND}
test? ( sys-apps/ed )"
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ # this file is missing from the tarball bug #300845
+ cp "${FILESDIR}"/gnulib_strnlen.c gl/lib/strnlen.c || die
+}
+
src_compile() {
use static && append-ldflags -static