From: Bruno Haible Date: Wed, 25 Feb 2004 19:45:31 +0000 (+0000) Subject: Include strdup.h. From Simon Josefsson. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04ed75a6669acb5bb4ee8e7d1b0c20d715cb70fd;p=pspp Include strdup.h. From Simon Josefsson. --- diff --git a/lib/ChangeLog b/lib/ChangeLog index 2c665cc901..9d8a505b9f 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,10 @@ +2004-01-18 Simon Josefsson + + * strdup.h: New file. + * strdup.c: Include it. + * path-concat.c: Include strdup.h. Drop strdup declaration. + * userspec.c: Include strdup.h. Drop strdup declaration. + 2004-02-06 Karl Berry * config.charset: update from gettext 0.14.1. diff --git a/lib/path-concat.c b/lib/path-concat.c index 7f3bc5a494..db96debad6 100644 --- a/lib/path-concat.c +++ b/lib/path-concat.c @@ -1,6 +1,6 @@ /* path-concat.c -- concatenate two arbitrary pathnames - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -23,6 +23,9 @@ # include #endif +/* Specification. */ +#include "path-concat.h" + #ifndef HAVE_MEMPCPY # define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N))) #endif @@ -35,13 +38,9 @@ # include #endif -#ifndef strdup -char *strdup (); -#endif - +#include "strdup.h" #include "dirname.h" #include "xalloc.h" -#include "path-concat.h" /* Concatenate two pathname components, DIR and BASE, in newly-allocated storage and return the result. Return 0 if out of diff --git a/lib/strdup.c b/lib/strdup.c index 52667e98e0..114a32b85d 100644 --- a/lib/strdup.c +++ b/lib/strdup.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1996, 1997, 1998, 2002, 2003 Free Software +/* Copyright (C) 1991, 1996, 1997, 1998, 2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -21,6 +21,11 @@ # include #endif +#ifndef _LIBC +/* Get specification. */ +#include "strdup.h" +#endif + #include #include diff --git a/lib/userspec.c b/lib/userspec.c index 4ae083f470..8cf62391a3 100644 --- a/lib/userspec.c +++ b/lib/userspec.c @@ -1,5 +1,5 @@ /* userspec.c -- Parse a user and group string. - Copyright (C) 1989-1992, 1997-1998, 2000, 2002-2003 Free Software + Copyright (C) 1989-1992, 1997-1998, 2000, 2002-2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify @@ -24,6 +24,9 @@ #include +/* Specification. */ +#include "userspec.h" + #include #include #include @@ -41,7 +44,7 @@ # include #endif -#include "userspec.h" +#include "strdup.h" #include "posixver.h" #include "xalloc.h" #include "xstrtol.h" @@ -109,10 +112,6 @@ struct group *getgrgid (); of `digit' even when the host does not conform to POSIX. */ #define ISDIGIT(c) ((unsigned) (c) - '0' <= 9) -#ifndef strdup -char *strdup (); -#endif - /* Return nonzero if STR represents an unsigned decimal integer, otherwise return 0. */