]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Update gnulib files.
authorSimon Josefsson <simon@josefsson.org>
Fri, 19 Sep 2008 12:26:03 +0000 (14:26 +0200)
committerSimon Josefsson <simon@josefsson.org>
Fri, 19 Sep 2008 12:26:03 +0000 (14:26 +0200)
gl/gnulib.mk
gl/m4/gnulib-comp.m4
gl/m4/strdup.m4 [deleted file]
gl/strdup.c [deleted file]
lgl/vasnprintf.c

index 4f3bb9664d125d16cce28d14bb827099abf0cc8f..c441e6c68cb6a241e243bdde55f220a1eaeede84 100644 (file)
@@ -223,15 +223,6 @@ EXTRA_DIST += stdarg.in.h
 
 ## end   gnulib module stdarg
 
-## begin gnulib module strdup
-
-
-EXTRA_DIST += strdup.c
-
-EXTRA_libgnu_la_SOURCES += strdup.c
-
-## end   gnulib module strdup
-
 ## begin gnulib module strerror
 
 
index 384a942f3981a7fd22af37d518c44a49eb7dd6b0..8535ef6665a481a1828d2c5686f962d78d1cbfc5 100644 (file)
@@ -79,8 +79,6 @@ AC_DEFUN([gl_INIT],
   gl_FUNC_READLINE
   gl_TYPE_SOCKLEN_T
   gl_STDARG_H
-  gl_FUNC_STRDUP
-  gl_STRING_MODULE_INDICATOR([strdup])
   gl_FUNC_STRERROR
   gl_STRING_MODULE_INDICATOR([strerror])
   m4_ifval(gl_LIBSOURCES_LIST, [
@@ -239,7 +237,6 @@ AC_DEFUN([gl_FILE_LIST], [
   lib/readline.c
   lib/readline.h
   lib/stdarg.in.h
-  lib/strdup.c
   lib/strerror.c
   lib/version-etc-fsf.c
   lib/version-etc.c
@@ -263,7 +260,6 @@ AC_DEFUN([gl_FILE_LIST], [
   m4/readline.m4
   m4/socklen.m4
   m4/stdarg.m4
-  m4/strdup.m4
   m4/strerror.m4
   tests/test-arpa_inet.c
   tests/test-c-ctype.c
diff --git a/gl/m4/strdup.m4 b/gl/m4/strdup.m4
deleted file mode 100644 (file)
index 8796e9e..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-# strdup.m4 serial 9
-
-dnl Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software
-dnl Foundation, Inc.
-
-dnl This file is free software; the Free Software Foundation
-dnl gives unlimited permission to copy and/or distribute it,
-dnl with or without modifications, as long as this notice is preserved.
-
-AC_DEFUN([gl_FUNC_STRDUP],
-[
-  AC_REQUIRE([gl_HEADER_STRING_H_DEFAULTS])
-  AC_REPLACE_FUNCS(strdup)
-  AC_CHECK_DECLS_ONCE(strdup)
-  if test $ac_cv_have_decl_strdup = no; then
-    HAVE_DECL_STRDUP=0
-  fi
-  gl_PREREQ_STRDUP
-])
-
-# Prerequisites of lib/strdup.c.
-AC_DEFUN([gl_PREREQ_STRDUP], [:])
diff --git a/gl/strdup.c b/gl/strdup.c
deleted file mode 100644 (file)
index bebe5c8..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Copyright (C) 1991, 1996, 1997, 1998, 2002, 2003, 2004, 2006, 2007 Free
-   Software Foundation, Inc.
-
-   This file is part of the GNU C Library.
-
-   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 3, 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.  */
-
-#ifndef _LIBC
-# include <config.h>
-#endif
-
-/* Get specification.  */
-#include <string.h>
-
-#include <stdlib.h>
-
-#undef __strdup
-#ifdef _LIBC
-# undef strdup
-#endif
-
-#ifndef weak_alias
-# define __strdup strdup
-#endif
-
-/* Duplicate S, returning an identical malloc'd string.  */
-char *
-__strdup (const char *s)
-{
-  size_t len = strlen (s) + 1;
-  void *new = malloc (len);
-
-  if (new == NULL)
-    return NULL;
-
-  return (char *) memcpy (new, s, len);
-}
-#ifdef libc_hidden_def
-libc_hidden_def (__strdup)
-#endif
-#ifdef weak_alias
-weak_alias (__strdup, strdup)
-#endif
index f66047f953320d3c944cf82da3b34c5488977970..68cc2acf47aac504702c629fe44a6451ca967d19 100644 (file)
@@ -215,7 +215,7 @@ local_wcslen (const wchar_t *s)
 #undef remainder
 #define remainder rem
 
-#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
+#if (NEED_PRINTF_DIRECTIVE_A || NEED_PRINTF_LONG_DOUBLE || NEED_PRINTF_INFINITE_LONG_DOUBLE || NEED_PRINTF_DOUBLE || NEED_PRINTF_INFINITE_DOUBLE) && !defined IN_LIBINTL
 /* Determine the decimal-point character according to the current locale.  */
 # ifndef decimal_point_char_defined
 #  define decimal_point_char_defined 1
@@ -255,11 +255,11 @@ is_infinite_or_zero (double x)
 
 #if NEED_PRINTF_INFINITE_LONG_DOUBLE && !NEED_PRINTF_LONG_DOUBLE && !defined IN_LIBINTL
 
-/* Equivalent to !isfinite(x), but does not require libm.  */
+/* Equivalent to !isfinite(x) || x == 0, but does not require libm.  */
 static int
-is_infinitel (long double x)
+is_infinite_or_zerol (long double x)
 {
-  return isnanl (x) || (x + x == x && x != 0.0L);
+  return isnanl (x) || x + x == x;
 }
 
 #endif
@@ -2578,8 +2578,10 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
 # elif NEED_PRINTF_INFINITE_LONG_DOUBLE
                         || (a.arg[dp->arg_index].type == TYPE_LONGDOUBLE
                             /* Some systems produce wrong output for Inf,
-                               -Inf, and NaN.  */
-                            && is_infinitel (a.arg[dp->arg_index].a.a_longdouble))
+                               -Inf, and NaN.  Some systems in this category
+                               (IRIX 5.3) also do so for -0.0.  Therefore we
+                               treat this case here as well.  */
+                            && is_infinite_or_zerol (a.arg[dp->arg_index].a.a_longdouble))
 # endif
                        ))
              {
@@ -3139,7 +3141,49 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                              abort ();
 #  else
                            /* arg is finite.  */
-                           abort ();
+                           if (!(arg == 0.0L))
+                             abort ();
+
+                           pad_ptr = p;
+
+                           if (dp->conversion == 'f' || dp->conversion == 'F')
+                             {
+                               *p++ = '0';
+                               if ((flags & FLAG_ALT) || precision > 0)
+                                 {
+                                   *p++ = decimal_point_char ();
+                                   for (; precision > 0; precision--)
+                                     *p++ = '0';
+                                 }
+                             }
+                           else if (dp->conversion == 'e' || dp->conversion == 'E')
+                             {
+                               *p++ = '0';
+                               if ((flags & FLAG_ALT) || precision > 0)
+                                 {
+                                   *p++ = decimal_point_char ();
+                                   for (; precision > 0; precision--)
+                                     *p++ = '0';
+                                 }
+                               *p++ = dp->conversion; /* 'e' or 'E' */
+                               *p++ = '+';
+                               *p++ = '0';
+                               *p++ = '0';
+                             }
+                           else if (dp->conversion == 'g' || dp->conversion == 'G')
+                             {
+                               *p++ = '0';
+                               if (flags & FLAG_ALT)
+                                 {
+                                   size_t ndigits =
+                                     (precision > 0 ? precision - 1 : 0);
+                                   *p++ = decimal_point_char ();
+                                   for (; ndigits > 0; --ndigits)
+                                     *p++ = '0';
+                                 }
+                             }
+                           else
+                             abort ();
 #  endif
                          }