From 8ee0415dbe113fd16461ea60be8f1851e95565cc Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Tue, 26 Nov 2002 22:58:57 +0000 Subject: [PATCH] copy strdup.c from libc again. --- config/srclist-update | 7 ++++--- config/srclist.txt | 4 ++-- lib/.cppi-disable | 1 + lib/ChangeLog | 5 +++++ lib/strdup.c | 8 +++----- 5 files changed, 15 insertions(+), 10 deletions(-) diff --git a/config/srclist-update b/config/srclist-update index ef1bc2999..74438f9dc 100755 --- a/config/srclist-update +++ b/config/srclist-update @@ -1,5 +1,5 @@ #!/bin/sh -# $Id: srclist-update,v 1.4 2002-11-25 13:17:17 meyering Exp $ +# $Id: srclist-update,v 1.5 2002-11-26 22:58:57 karl Exp $ # # Check for files in directory $1 being up to date, according to the # list on stdin. Don't actually make any changes, just show the diffs. @@ -13,8 +13,9 @@ fi verbose=false #chicken="echo (would)" -srctmp=${TMPDIR-/tmp}/srclist.src -dsttmp=${TMPDIR-/tmp}/srclist.dst +: ${TMPDIR=/tmp} +srctmp=$TMPDIR/srclist.src +dsttmp=$TMPDIR/srclist.dst mydir=`dirname $0` test -r $mydir/srclistvars.sh && . $mydir/srclistvars.sh diff --git a/config/srclist.txt b/config/srclist.txt index c0efcfab6..a5eef51f2 100644 --- a/config/srclist.txt +++ b/config/srclist.txt @@ -1,4 +1,4 @@ -# $Id: srclist.txt,v 1.10 2002-11-25 22:24:53 karl Exp $ +# $Id: srclist.txt,v 1.11 2002-11-26 22:58:57 karl Exp $ # Files for which we are not the source. See ./srclistvars.sh for the # variable definitions. @@ -26,7 +26,7 @@ $LIBCSRC/sysdeps/generic/strtoll.c lib gpl $LIBCSRC/posix/getopt.h lib gpl $LIBCSRC/posix/getopt1.c lib gpl $LIBCSRC/posix/regex.h lib gpl -#$LIBCSRC/string/strdup.c lib gpl +$LIBCSRC/string/strdup.c lib gpl $LIBCSRC/time/mktime.c lib gpl # # - libc/sysdeps/generic has memcpy.c, memmove.c, strcasecmp.c, but they diff --git a/lib/.cppi-disable b/lib/.cppi-disable index 7bd80c269..81537e743 100644 --- a/lib/.cppi-disable +++ b/lib/.cppi-disable @@ -9,3 +9,4 @@ md5.h obstack.h regex.c regex.h +strdup.c diff --git a/lib/ChangeLog b/lib/ChangeLog index 38b6653a7..3c12748ab 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2002-11-26 + + * strdup.c: copy from libc again, with jim's ok. + * .cppi-disable: re-add strdup.c + 2002-11-25 * strtoll.c: copy from libc, meaning we now #include diff --git a/lib/strdup.c b/lib/strdup.c index 06260fa03..5aa09a652 100644 --- a/lib/strdup.c +++ b/lib/strdup.c @@ -15,8 +15,8 @@ with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#if HAVE_CONFIG_H -# include +#ifdef HAVE_CONFIG_H +#include #endif #if defined _LIBC || defined STDC_HEADERS @@ -34,9 +34,7 @@ char *memcpy (); # define __strdup strdup #endif -/* Duplicate S, returning an identical malloc'd string. - Return NULL if out of memory. */ - +/* Duplicate S, returning an identical malloc'd string. */ char * __strdup (const char *s) { -- 2.11.0