config update
[gnulib.git] / lib / ChangeLog
index 60bf664..885e93c 100644 (file)
@@ -1,3 +1,217 @@
+2003-10-16  Paul Eggert  <eggert@twinsun.com>
+
+       * getgroups.c: Include <errno.h>, <stdlib.h>.
+       (getgroups): First arg is int, not size_t.
+       Don't let 'free' mangle errno.
+
+2003-10-16  Jim Meyering  <jim@meyering.net>
+
+       * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
+
+2003-10-15  Paul Eggert  <eggert@twinsun.com>
+
+       * exclude.c: Do not include <inttypes.h> or <stdint.h>.
+       (SIZE_MAX): Remove.
+       (new_exclude, add_exclude_file): Initial size no longer needs to
+       be a power of 2.
+       (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
+       our own address arithmetic overflow checking.
+
+       * fnmatch.c (SIZE_MAX): Define if standard headers don't.
+       (fnmatch): Do not alloca more than 2000 wide characters;
+       instead, use malloc for large buffers.
+       Check for address arithmetic overflow, and return -1
+       with errno set to ENOMEM in that case.
+       * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
+       (NEW_PATTERN): Do not alloca more than 8000 bytes;
+       instead, return -1.  Check for address arithmetic overflow.
+
+2003-10-14  Paul Eggert  <eggert@twinsun.com>
+
+       Handle invalid suffixes and overflow independently, so that
+       callers can treat them independently as needed.  Fix some bugs in
+       suffix handling, e.g., "100k@" was not diagnosed as an invalid
+       suffix for a human-readable blocksize.  The major caller-visible
+       change is the addition of a new
+       LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
+       that both overflow and suffix chars were found.
+
+       * human.c (humblock): Don't check separately for invalid suffix
+       char; that is xstrtoumax's job (now that its bug is fixed).
+       * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
+       INTMAX_MAX]: New macros.
+       * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
+       TYPE_MAXIMUM): New macros.
+       (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
+       (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
+       if overflow occurs, as it's what __strtol does and it's more useful
+       in practice.
+       (__xstrtol): If __strtol reports some error other than ERANGE,
+       reflect it to the caller as LONGINT_INVALID.  If it reports
+       ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
+       | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
+       * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
+       value.
+       (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
+       * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
+       * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
+       [defined UINTMAX_MAX]: New macros.
+
+2003-10-14  Bruno Haible  <bruno@clisp.org>
+
+       * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
+       * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
+       Also use volatile where needed.
+
+2003-10-12  Paul Eggert  <eggert@twinsun.com>
+
+       * lib/xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
+       (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
+       and define in terms of the other primitives.
+       * lib/xmalloc.c: Include stdbool.h; do not include exit.h.
+       (SIZE_MAX): Define if not already defined.
+       (array_size_overflow): New function.
+       (xalloc_die): Abort instead of exiting if 'error' returns.
+       (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
+       (xmalloc, xrealloc): Use them.
+       (xcalloc): Check for address arithmetic overflow.
+       * lib/xstrdup.c (xstrdup): Use xclone, since memcpy should be
+       a bit faster than strcpy.
+
+2003-10-08  Paul Eggert  <eggert@twinsun.com>
+
+       Merge getpass from libc, plus a few fixes.
+
+       * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
+       Include <stdbool.h>.
+       Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
+       __fsetlocking to empty.
+       [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
+       do include <bits/libc-lock.h>.
+       Do not include <fcntl.h>; not needed.
+       [_LIBC]: Include <wchar.h>.
+       (NOTCANCEL_MODE): New macro.
+       (flockfile, funlockfile) [_LIBC]: New macros.
+       (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
+       [!_LIBC]: New macros.
+       (call_fclose): New function.
+       (getpass): Use it.  Save tty stream separately; this simplifies the
+       code and makes it more reliable if stdin happens to equal stdout.
+       Invoke __fsetlocking on tty.
+       Handle thread cancellation if needed.
+       Namespace cleanup (use __tcgetattr, __getline).
+       Use bool for Booleans.
+       [USE_IN_LIBIO]: Handle wide streams.
+       [!_LIBC]: Unconditionally do the fseek, since we don't know what
+       stream might go where.
+
+       * unlocked-io.h: Include <stdio.h>, so that the caller
+       doesn't have to include <stdio.h> before us.
+       (clearerr_unlocked, feof_unlocked, ferror_unlocked,
+       fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
+       fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
+       putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
+       if not declared, so that we can use getpass.c code from libc without
+       rewriting it.
+       (flockfile, ftrylockfile, funlockfile): New macros.
+
+2003-10-06  Bruno Haible  <bruno@clisp.org>
+
+       * version-etc-2.h: Remove file.
+       * version-etc-2.c: Remove file.
+
+2003-09-25  Jim Meyering  <jim@meyering.net>
+            Bruno Haible  <bruno@clisp.org>
+
+       This lets translators provide better translations for the
+       "Written by ..." part of --version output.
+       * version-etc.h: Include stdarg.h.
+       (version_etc_copyright): Declare as readonly.
+       (version_etc): Make this function variadic with a NULL-terminated list
+       of author name strings.
+       (version_etc_va): New declaration.
+       * version-etc.c: Include stdarg.h, stdlib.h.
+       (version_etc_copyright): Declare as readonly.
+       (version_etc_va): New function. Provide a different translatable string
+       for each possible number of authors < 10. Abbreviate when there are 10
+       authors or more.
+       (version_etc): Make this function variadic. Call version_etc_va.
+       Suggestion from Gary V. Vaughan.
+
+       * long-options.h (parse_long_options): Change prototype: the authors
+       string is moved to the end and becomes variadic.
+       * long-options.c: Include stdarg.h.
+       (parse_long_options): Make this function variadic, too.
+       Call version_etc_va, not version_etc.
+
+2003-10-06  Bruno Haible  <bruno@clisp.org>
+
+       * fatal-signal.h: New file, from GNU gettext.
+       * fatal-signal.c: New file, from GNU gettext.
+
+2003-10-04  Karl Berry  <karl@gnu.org>
+
+       * argp*: update from libc.
+
+2003-10-01  Larry Jones  <lawrence.jones@eds.com>
+
+       * getpass.c (getpass): Use a no-op fseek when switching from input to
+       output mode on the same stream.
+
+2003-09-29  Paul Eggert  <eggert@twinsun.com>
+
+       * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
+       Fix arg typo in previous patch.
+
+2003-09-28  Jim Meyering  <jim@meyering.net>
+
+       * error.c: Correct cpp indentation.
+
+2003-09-27  Paul Eggert  <eggert@twinsun.com>
+
+       * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
+       Omit the special code that used __typeof__, since we worry that
+       it could be more trouble than it's worth.  See:
+       http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
+       http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
+
+       * free.c: New file.
+
+2003-09-26  Jim Meyering  <jim@meyering.net>
+
+       * error.c (error_tail): Move some declarations
+       into inner scope where the local variables are used.
+
+2003-09-26  Bruno Haible  <bruno@clisp.org>
+
+       * stpncpy.h (gnu_stpncpy): New declaration.
+       (stpncpy): Define as alias for gnu_stpncpy.
+       * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
+
+2003-09-26  Paul Eggert  <eggert@twinsun.com>
+
+       * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
+       (error_tail): Do not loop, reallocating temporary buffer, since
+       the output cannot contain more wide characters than the input
+       contains bytes, the size must be big enough already.  This avoids
+       one potential size overflow calculation.  Check for size overflow
+       when calculating temporary buffer size.  Free temporary buffer
+       when done, if it was allocated with malloc; this plugs a memory
+       leak.  Remove casts from void * to pointers, that are no longer
+       needed now that we're assuming C89 or better.
+
+       Merge error changes from glibc.
+
+       * error.c, error.h: Update copyright notice header to match glibc.
+       * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
+       (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
+       Disable cancellation while printing error.
+       * error.h: Prepend __ to parameter names.
+
+2003-09-25  Karl Berry  <karl@gnu.org>
+
+       * argp-fmtstream.c, argp-help.c: update from libc.
+
 2003-09-25  Bruno Haible  <bruno@clisp.org>
 
        * version-etc-2.h: New file, from version-etc.h with modifications.
        * getdomainname.h: New file.
        * getdomainname.c: New file.
 
+2003-09-24  Paul Eggert  <eggert@twinsun.com>
+
+       * linebuffer.c (freebuffer): Don't free the argument, just
+       the buffer associated with the argument.  Bug reported by
+       Simon Josefsson.
+
 2003-09-19  Karl Berry  <karl@gnu.org>
 
        * argp.h: update from libc.