]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Borrow changes from gnulib.
authorBruno Haible <bruno@clisp.org>
Mon, 9 Oct 2006 12:00:44 +0000 (12:00 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:14:06 +0000 (12:14 +0200)
gettext-runtime/intl/ChangeLog
gettext-runtime/intl/lock.c
gettext-runtime/intl/printf-args.c
gettext-runtime/intl/printf-parse.c
gettext-runtime/intl/relocatable.c
gettext-runtime/intl/vasnprintf.c
gettext-tools/libgrep/ChangeLog
gettext-tools/libgrep/memchr.c
gettext-tools/libgrep/strdup.c

index 92b686d330dca760134e1344703fac6bc5b0a45b..7fa5256a43952f4dd5d1436a0ef9728f77f5e69d 100644 (file)
@@ -1,3 +1,16 @@
+2006-09-14  Bruno Haible  <bruno@clisp.org>
+
+       * lock.c: Include <config.h> unconditionally.
+       * printf-args.c: Likewise.
+       * printf-parse.c: Likewise.
+       * relocatable.c: Likewise.
+       * vasnprintf.c: Likewise.
+
+2006-08-26  Bruno Haible  <bruno@clisp.org>
+
+       * vasnprintf.c (EOVERFLOW): Remove definition.
+       (VASNPRINTF): Return a string of length > INT_MAX without failing.
+
 2006-10-02  Bruno Haible  <bruno@clisp.org>
 
        * libgnuintl.h.in (LIBINTL_VERSION): Bump to 0.15.1.
index a860459d12153ab23017ce64ddebd293e081311c..f60a8d9be1dea2ab03b4450fbcc61a47dd3365ba 100644 (file)
@@ -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 <config.h>
-#endif
+#include <config.h>
 
 #include "lock.h"
 
index 47b73d2c1dee4d8676d26a7b2063cbb39bb14330..bf634d6c4088fd2952f737e1050c9cef82b69439 100644 (file)
@@ -16,9 +16,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
    USA.  */
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
 
 /* Specification.  */
 #include "printf-args.h"
index 20240e3790d3673618015190ff0aadfd6d8f8786..503d8121b76d855283c0dc48fb8cb66173e1976b 100644 (file)
@@ -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 <config.h>
-#endif
+#include <config.h>
 
 /* Specification.  */
 #if WIDE_CHAR_VERSION
index 7cc8daf77cc6a88f82d2e24bfc5a046aa60d6de6..5e1dde6c8dc7c15fd588f2142c9229b3e7def336 100644 (file)
@@ -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 <bruno@clisp.org>, 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 <config.h>
 
 /* Specification.  */
 #include "relocatable.h"
index cef29a7562398ed6842901fd607b36bb7e8e870a..bc0f53af5401b7edb4e1c7ecbd21f1957c5f9e13 100644 (file)
@@ -23,9 +23,7 @@
 # define _GNU_SOURCE    1
 #endif
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <config.h>
 #ifndef IN_LIBINTL
 # include <alloca.h>
 #endif
@@ -41,7 +39,7 @@
 #include <stdlib.h>    /* abort(), malloc(), realloc(), free() */
 #include <string.h>    /* memcpy(), strlen() */
 #include <errno.h>     /* errno */
-#include <limits.h>    /* CHAR_BIT, INT_MAX */
+#include <limits.h>    /* CHAR_BIT */
 #include <float.h>     /* DBL_MAX_EXP, LDBL_MAX_EXP */
 #if WIDE_CHAR_VERSION
 # include "wprintf-parse.h"
 /* 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);
index 463d622d5b8aabc61211b221e609fcb1eebfd0fa..9844494ed88f0278aa6f2ccc1cc3a69c84805e2c 100644 (file)
@@ -1,3 +1,8 @@
+2006-09-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * memchr.c: Include <config.h> unconditionally.
+       * strdup.c: Likewise.
+
 2006-07-30  Bruno Haible  <bruno@clisp.org>
 
        * Makefile.am (AM_CPPFLAGS): Replace ../lib with ../gnulib-lib.
index 3c5ecfd0e10b1dcc32f149fe0a92d4194dedfd35..d44ad6deb516dbaf70c8a7dcd147cd3f14e04ec2 100644 (file)
@@ -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 <config.h>
 #endif
 
index d6d011620445713028b812854ae324c4685489c6..7cff51be098deb0b5cc87f365356fb2ad0ba6574 100644 (file)
@@ -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.
 
    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 <config.h>
-#endif
-
 #ifndef _LIBC
+# include <config.h>
 /* Get specification.  */
 # include "strdup.h"
 #endif