config update
[gnulib.git] / lib / ChangeLog
index 3e95420..885e93c 100644 (file)
@@ -1,3 +1,120 @@
+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.