From: Bruno Haible Date: Mon, 9 Oct 2006 12:00:44 +0000 (+0000) Subject: Borrow changes from gnulib. X-Git-Tag: 0.16.x-branchpoint~98 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=481ea33e9a4309dc4434152d2a14e3329f5e82a9;p=thirdparty%2Fgettext.git Borrow changes from gnulib. --- diff --git a/gettext-runtime/intl/ChangeLog b/gettext-runtime/intl/ChangeLog index 92b686d33..7fa5256a4 100644 --- a/gettext-runtime/intl/ChangeLog +++ b/gettext-runtime/intl/ChangeLog @@ -1,3 +1,16 @@ +2006-09-14 Bruno Haible + + * lock.c: Include unconditionally. + * printf-args.c: Likewise. + * printf-parse.c: Likewise. + * relocatable.c: Likewise. + * vasnprintf.c: Likewise. + +2006-08-26 Bruno Haible + + * vasnprintf.c (EOVERFLOW): Remove definition. + (VASNPRINTF): Return a string of length > INT_MAX without failing. + 2006-10-02 Bruno Haible * libgnuintl.h.in (LIBINTL_VERSION): Bump to 0.15.1. diff --git a/gettext-runtime/intl/lock.c b/gettext-runtime/intl/lock.c index a860459d1..f60a8d9be 100644 --- a/gettext-runtime/intl/lock.c +++ b/gettext-runtime/intl/lock.c @@ -1,5 +1,5 @@ /* Locking in multithreaded situations. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005-2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published @@ -20,9 +20,7 @@ Based on GCC's gthr-posix.h, gthr-posix95.h, gthr-solaris.h, gthr-win32.h. */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include #include "lock.h" diff --git a/gettext-runtime/intl/printf-args.c b/gettext-runtime/intl/printf-args.c index 47b73d2c1..bf634d6c4 100644 --- a/gettext-runtime/intl/printf-args.c +++ b/gettext-runtime/intl/printf-args.c @@ -16,9 +16,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include /* Specification. */ #include "printf-args.h" diff --git a/gettext-runtime/intl/printf-parse.c b/gettext-runtime/intl/printf-parse.c index 20240e379..503d8121b 100644 --- a/gettext-runtime/intl/printf-parse.c +++ b/gettext-runtime/intl/printf-parse.c @@ -1,5 +1,5 @@ /* Formatted output to strings. - Copyright (C) 1999-2000, 2002-2003 Free Software Foundation, Inc. + Copyright (C) 1999-2000, 2002-2003, 2006 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published @@ -16,9 +16,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H -# include -#endif +#include /* Specification. */ #if WIDE_CHAR_VERSION diff --git a/gettext-runtime/intl/relocatable.c b/gettext-runtime/intl/relocatable.c index 7cc8daf77..5e1dde6c8 100644 --- a/gettext-runtime/intl/relocatable.c +++ b/gettext-runtime/intl/relocatable.c @@ -1,5 +1,5 @@ /* Provide relocatable packages. - Copyright (C) 2003-2005 Free Software Foundation, Inc. + Copyright (C) 2003-2006 Free Software Foundation, Inc. Written by Bruno Haible , 2003. This program is free software; you can redistribute it and/or modify it @@ -25,9 +25,7 @@ # define _GNU_SOURCE 1 #endif -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif +#include /* Specification. */ #include "relocatable.h" diff --git a/gettext-runtime/intl/vasnprintf.c b/gettext-runtime/intl/vasnprintf.c index cef29a756..bc0f53af5 100644 --- a/gettext-runtime/intl/vasnprintf.c +++ b/gettext-runtime/intl/vasnprintf.c @@ -23,9 +23,7 @@ # define _GNU_SOURCE 1 #endif -#ifdef HAVE_CONFIG_H -# include -#endif +#include #ifndef IN_LIBINTL # include #endif @@ -41,7 +39,7 @@ #include /* abort(), malloc(), realloc(), free() */ #include /* memcpy(), strlen() */ #include /* errno */ -#include /* CHAR_BIT, INT_MAX */ +#include /* CHAR_BIT */ #include /* DBL_MAX_EXP, LDBL_MAX_EXP */ #if WIDE_CHAR_VERSION # include "wprintf-parse.h" @@ -52,11 +50,6 @@ /* Checked size_t computations. */ #include "xsize.h" -/* Some systems, like OSF/1 4.0 and Woe32, don't have EOVERFLOW. */ -#ifndef EOVERFLOW -# define EOVERFLOW E2BIG -#endif - #ifdef HAVE_WCHAR_T # ifdef HAVE_WCSLEN # define local_wcslen wcslen @@ -870,19 +863,12 @@ VASNPRINTF (CHAR_T *resultbuf, size_t *lengthp, const CHAR_T *format, va_list ar free (buf_malloced); CLEANUP (); *lengthp = length; - if (length > INT_MAX) - goto length_overflow; + /* Note that we can produce a big string of a length > INT_MAX. POSIX + says that snprintf() fails with errno = EOVERFLOW in this case, but + that's only because snprintf() returns an 'int'. This function does + not have this limitation. */ return result; - length_overflow: - /* We could produce such a big string, but its length doesn't fit into - an 'int'. POSIX says that snprintf() fails with errno = EOVERFLOW in - this case. */ - if (result != resultbuf) - free (result); - errno = EOVERFLOW; - return NULL; - out_of_memory: if (!(result == resultbuf || result == NULL)) free (result); diff --git a/gettext-tools/libgrep/ChangeLog b/gettext-tools/libgrep/ChangeLog index 463d622d5..9844494ed 100644 --- a/gettext-tools/libgrep/ChangeLog +++ b/gettext-tools/libgrep/ChangeLog @@ -1,3 +1,8 @@ +2006-09-13 Paul Eggert + + * memchr.c: Include unconditionally. + * strdup.c: Likewise. + 2006-07-30 Bruno Haible * Makefile.am (AM_CPPFLAGS): Replace ../lib with ../gnulib-lib. diff --git a/gettext-tools/libgrep/memchr.c b/gettext-tools/libgrep/memchr.c index 3c5ecfd0e..d44ad6deb 100644 --- a/gettext-tools/libgrep/memchr.c +++ b/gettext-tools/libgrep/memchr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1993, 1996, 1997, 1999, 2000, 2003, 2004 Free +/* Copyright (C) 1991, 1993, 1996, 1997, 1999, 2000, 2003, 2004, 2006 Free Software Foundation, Inc. Based on strlen implementation by Torbjorn Granlund (tege@sics.se), @@ -24,7 +24,7 @@ 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. */ -#ifdef HAVE_CONFIG_H +#ifndef _LIBC # include #endif diff --git a/gettext-tools/libgrep/strdup.c b/gettext-tools/libgrep/strdup.c index d6d011620..7cff51be0 100644 --- a/gettext-tools/libgrep/strdup.c +++ b/gettext-tools/libgrep/strdup.c @@ -1,5 +1,5 @@ -/* Copyright (C) 1991, 1996, 1997, 1998, 2002, 2003, 2004 Free Software - Foundation, Inc. +/* Copyright (C) 1991, 1996, 1997, 1998, 2002, 2003, 2004, 2006 Free + Software Foundation, Inc. This file is part of the GNU C Library. @@ -17,11 +17,8 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef HAVE_CONFIG_H -# include -#endif - #ifndef _LIBC +# include /* Get specification. */ # include "strdup.h" #endif