* getndelim2.c: Include stddef.h, for ptrdiff_t.
[gnulib.git] / lib / ChangeLog
index 4e02c0f..2c28e44 100644 (file)
-2004-03-09  Paul Eggert  <eggert@cs.ucla.edu>
+2004-07-09  Simon Josefsson  <jas@extundo.com>
+
+       * getndelim2.c: Include stddef.h, for ptrdiff_t.  (FreeBSD 4.9
+       failed without this.)
+
+2004-07-09  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * fchown-stub.c: New file.
+
+2004-06-24  Jim Meyering  <jim@meyering.net>
+
+       * obstack.h (obstack_base): Cast to (void *), per documentation.
+
+2004-06-22  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * argz.c, argz_.h: New files, which are autoupdated from libtool.
+
+2004-06-01  Jim Meyering  <jim@meyering.net>
+
+       * calloc.c: New file.
+
+2004-06-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * getdate.y (yylex): Allow space between sign and number.
+       Problem reported by Dan Jacobson.
+
+2004-06-01  Paul Eggert  <eggert@cs.ucla.edu>
+       and  Jim Meyering  <jim@meyering.net>
+
+       Merge from coreutils CVS.
+
+       * stat-macros.h: New file, with contents from file-type.h
+       and coreutils' system.h.
+       * file-type.c: Include "stat-macros.h".
+       * file-type.h (file_type): Move all macro definitions to new file,
+       stat-macros.h.
+
+       * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
+       Wrap old code with this conditional.
+       [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
+       function that does not dereference symlinks.
+       * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
+
+       * xreadlink.c: Include xreadlink.h first, to catch .h file
+       dependency problems.
+       (xreadlink): Accept new arg SIZE, for efficiency.
+       All decls and uses changed.
+       * xreadlink.h: Include <stddef.h>, for size_t.
+
+       * .cppi-disable: Add alloca_.h, allocsa.h, exit.h, getndelim2.h,
+       gettext.h, localcharset.h, strdup.h, strndup.h, strtoul.c, time_r.h.
+
+       * .cvsignore: Add alloca.h, fnmatch.h, poll.h, stdbool.h, sysexits.h.
+
+2004-05-30  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * xmalloc.c (HAVE_MALLOC, HAVE_REALLOC): Do not require these
+       macros to be defined.
+       (xnmalloc_inline, xnrealloc_inline, xcalloc): Do not die if
+       the allocator returns NULL because the requested size is zero.
+
+2004-05-20  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * malloc/obstack.c (_obstack) [defined _LIBC]: Bring back this
+       var.  Add comment explaining why libc still defines it.  This
+       merges the following patch from glibc:
+       http://sources.redhat.com/ml/libc-alpha/2004-05/msg00157.html
+
+2004-05-19  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * obstack.c (_obstack): Remove unused variable.  It hasn't been
+       present in glibc since revision 1.1 of this file.
+       * obstack.h (_obstack_free, obstack_1grow, obstack_1grow_fast,
+       obstack_alignment_mask, obstack_alloc, obstack_base,
+       obstack_blank, obstack_blank_fast, obstack_chunk_size,
+       obstack_copy, obstack_copy0, obstack_finish, obstack_grow,
+       obstack_grow0, obstack_init, obstack_int_grow,
+       obstack_int_grow_fast, obstack_make_room, obstack_memory_used,
+       obstack_next_free, obstack_object_size, obstack_ptr_grow,
+       obstack_ptr_grow_fast, obstack_room): Remove declarations of
+       nonexistent functions.
+
+2004-05-17  Derek R. Price  <derek@ximbiot.com>
+           Paul Eggert  <eggert@cs.ucla.edu>
+
+       * argp-help.c, argp-parse.c: Assume <alloca.h> rather than freecoding.
+
+2004-05-14  Bruno Haible  <bruno@clisp.org>
+
+       * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision
+       that consists of a '.' followed by an empty digit string.
+       Patch by Tor Lillqvist <tml@iki.fi>.
+
+2004-05-17  Paul Eggert  <eggert@cs.ucla.edu>
+
+       Port obstack to the AS/400, where pointers are 16 bytes wide and
+       you cannot cast an integer to a valid pointer.  This patch is
+       currently waiting to be integrated into glibc; see
+       <http://sources.redhat.com/ml/libc-alpha/2004-05/msg00073.html>.
+
+       * obstack.h (__PTR_TO_INT, __INT_TO_PTR): Remove.
+       All uses of __INT_TO_PTR (PTR_TO_INT ...) replaced by __PTR_ALIGN.
+       (__BPTR_ALIGN, __PTR_ALIGN): New macros.
+       (struct obstack): temp member is now a union of a pointer and
+       an integer, instead of an integer.  All integer uses changed.
+       This does not affect the physical layout of struct obstack,
+       except on hosts (like the AS/400) where the size or alignment of
+       void * is greater than that of ptrdiff_t.
+       (obstack_finish) [! (defined __GNUC__ && defined __STDC__ &&
+       __STDC__)]: Store temporary in pointer member of union, not
+       integer member.
+       * obstack.c: Include <stddef.h>, for offsetof.
+       (struct fooalign): Remove; it doesn't need a name.
+       (union fooround): Change double to long double, and add void *.
+       (DEFAULT_ALIGNMENT): Use offsetof to compute.
+       (DEFAULT_ALIGNMENT, DEFAULT_ROUNDING): Now an enum constant,
+       not a macro.  Hence the values are always int; so remove all
+       casts-to-int in uses.
+
+2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
+           Derek Price  <derek@ximbiot.com>
+
+       * alloca.c: Include <alloca.h>, to get our interface.
+       * alloca_.h: Use __alloca on AIX, so that we don't have to
+       include <alloca.h> first.  Use C89 prototype for alloca; this
+       requires including <stddef.h> for size_t.  Use extern "C" if C++.
+       Use #elif for simplicity, since we can assume C89 now.
+       Don't try to source the system alloca.h since it will not be found
+       and to prevent recursively including its replacement.
+       * fnmatch.c: Include <alloca.h> instead of opencoding.
+       * lib/regex.c: Likewise.
+
+2004-05-16  Derek Price  <derek@ximbiot.com>
+           Paul Eggert  <eggert@cs.ucla.edu>
+
+       getline cleanup.  This changes the getndelim2 API: both order of
+       arguments, and meaning of delim2 (now uses EOF, not 0, to indicate
+       no delimiter).
+
+       * getline.c: Don't include stddef.h or stdio.h, since our
+       interface does that.
+       (getline): Always use getdelim, so that we don't have two
+       copies of this code.
+       * getndelim2.c: Include <limits.h>, <inttypes.h>, <stdint.h>
+       if available.
+       (PTRDIFF_MAX, SIZE_MAX, SSIZE_MAX): Define if not defined.
+       (GETNDELIM2_MAXIMUM): New macro.
+       (getndelim2): Reorder arguments.  delim==EOF now means no delimiter,
+       instead of the old practice of delim2==0.  All callers changed.
+       Return -1 on overflow, instead of returning junk.
+       Do not set *linesize unless allocation succeeds.
+       * getndelim2.h: Do not include stddef.h; no longer needed, now
+       that we include sys/types.h.
+       * getnline.h: Likewise.
+       * getndelim2.h (GETNLINE_NO_LIMIT): New macro.
+       (getndelim2): Reorder arguments.
+       * getnline.c (getnline, getndelim):
+       Don't discard the NMAX argument.
+       (getnline): Invoke getndelim, to avoid code duplication.
+       * getnline.h (GETNLINE_NO_LIMIT): New macro, used instead
+       of (size_t) -1 by callers of the getnline family.
+
+2004-05-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * nanosleep.c (suspended): Change its type from int to
+       sig_atomic_t volatile.
+       (first_call): Make it private to rpl_nanosleep, and have it
+       be zero initially as that's a bit faster.
+       (my_usleep): Round up fractional times instead of truncating them,
+       as this is the usual meaning for 'sleep'.
+
+       * gettime.c (gettime): Fall back on `time' if `gettimeofday'
+       doesn't work.
+       * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
+       (ENOSYS): Define if not defined.
+       (settime): Fall back on stime if it exists and settimeofday fails.
+       But don't bother with fallbacks if a method fails with errno == EPERM.
+
+2004-05-11  Jim Meyering  <jim@meyering.net>
+
+       Prior to this change, the save_cwd caller required read access to the
+       current directory on most systems (ones with the fchdir function).
+
+       * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
+       fails, try write-only, and finally, resort to using xgetcwd.
+
+2004-05-06  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * obstack.c, obstack.h: Import changes from libc.
+
+2004-04-28  Bruno Haible  <bruno@clisp.org>
+
+       * findprog.c (find_in_path): Treat Cygwin like Windows, since it also
+       implicitly appends .exe to executables.
+       * localcharset.c (ISSLASH): Treat Cygwin like Windows, since it now
+       accepts Windows pathnames.
+       * pathname.h (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
+       Cygwin like Windows, since it now accepts Windows pathnames.
+       * progreloc.c (ISSLASH, IS_PATH_WITH_DIR, FILESYSTEM_PREFIX_LEN): Treat
+       Cygwin like Windows, since it now accepts Windows pathnames.
+       Reported by Derek Robert Price <derek@ximbiot.com>.
+
+2004-04-20  Jim Meyering  <jim@meyering.net>
+
+       * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
+
+2004-04-20  Jim Meyering  <jim@meyering.net>
+            Bruno Haible  <bruno@clisp.org>
+
+       * localcharset.c (get_charset_aliases) [!VMS && !WIN32]: Don't leak
+       memory when realloc fails.
+
+2004-04-18  Jim Meyering  <jim@meyering.net>
+
+       * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
+       don't leak memory and do call END_UTMP_ENT.
+
+2004-04-11  Paul Eggert  <eggert@twinsun.com>
+
+       * inttostr.h: Include <limits.h> unconditionally, since we assume C89.
+       (CHAR_BIT): Remove, since we assume C89.
+       Include <stdint.h> if available, as per current Autoconf CVS advice.
+
+2004-03-30  Paul Eggert  <eggert@twinsun.com>
+
+       * cloexec.h, cloexec.c (set_cloexec_flag): Return int
+       not bool, to be more consistent with Unix conventions.
+       Suggested by Bruno Haible.
+
+       Merge from coreutils.
+
+       * imaxtostr.c, inttostr.c, inttostr.h, offtostr.c, umaxtostr.c:
+       New files.
+
+       * getdate.h: Include stdbool.h, and timespec.h instead of
+       the usual <time.h> dance.
+       (get_date): Change signature to support fractional time stamps.
+       All callers changed.
+       * getdate.y: Include "getdate.h" first, as we can now
+       assume C89 and don't need to worry about 'const'.
+       Similarly, include "unlocked-io.h" near start, not in middle.
+       Include <limits.h>.
+       (textint.value): Use long int rather than int.
+       (textint.digits): Use size_t rather than int.
+       (BILLION, LOG10_BILLION): New constants.
+       (parser_control): New member rel_ns.  Members day_ordinal,
+       time_zone, month, day, hour, minutes, rel_year, rel_month,
+       rel_day, rel_hour, rel_minutes, rel_seconds
+       are now long int, not int.  Member seconds is now struct timespec,
+       not int.  New member timespec_seen.  Members dates_seen, days_seen,
+       local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
+       not int.
+       (%union.intval): Now long int, not int.
+       New member timespec.
+       (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
+       (seconds, signed_seconds, unsigned_seconds): New nonterminals.
+       (spec): Now is a timespec or an item list.
+       (timespec, items): New nonterminals.
+       (time, rel, relunit, number, get_date):
+       Add support for fractional seconds.
+       (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
+       (gmtime, localtime, mktime): Remove decls; not needed with C89.
+       (to_hour): First arg is now long int, not int.
+       (to_year): Returns long int, not int.
+       Don't treat year -70 like 70.
+       (tm_diff): Returns long int, not int.
+       (lookup_word): Use bool instead of int when appropriate.
+       (yylex): Use size_t for count, not int.
+       Detect overflow when parsing large integer constants.
+       Add support for fractions.
+       (get_date): Make pointers 'const' if possible.
+       Use more-portable code to detect integer overflow.
+       (main) [TEST]: Adjust to above changes.  Test for localtime failure.
+       Don't use ctime; it's not reliable if the year has >4 digits.
+
+       * human.c (humblock): Inspect BLOCKSIZE if BLOCK_SIZE isn't set.
+       This is for compatibility with BSD.
+
+       * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
+       (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
+       From coreutils' system.h.
+
+       * userspec.c: Don't include "posixver.h".
+       (parse_user_spec): Fall back on USER.GROUP parsing, regardless
+       of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
+       compatible extension.  Simplify code by removing a boolean int
+       that was always nonzero if a string was nonnull.
+
+2004-03-30  Jim Meyering  <jim@meyering.net>
+
+       Merge from coreutils.
+
+       * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
+
+       * readtokens.c (readtoken): Don't leak 64 bytes when reading
+       an empty input stream.
+
+       * readtokens.c: Include <stdbool.h>.
+       (readtoken): Use `size_t' rather than int/long.
+       All callers adjusted.
+       Use `bool' rather than `int' where appropriate.
+       Use memset rather than an explicit loop.
+       Use x2nrealloc rather than xrealloc.
+       Allow the use of `\0' as a delimiter.
+       (readtokens): Likewise.
+       * readtokens.h (readtoken, readtokens): Update prototypes.
+
+2004-03-30  Bruno Haible  <bruno@clisp.org>
+
+       * getloadavg.c (getloadavg): Don't assume setlocale returns
+       nonnull.
+
+2004-03-29  Paul Eggert  <eggert@twinsun.com>
+
+       Merge changes to getloadavg.c from coreutils and Emacs.
+
+       * getloadavg.c [!defined HAVE_SETLOCALE] (setlocale):
+       Define to an expression, not to the empty string.
+       Include cloexec.h and xalloc.h.
+       (getloadavg): Restore LC_NUMERIC locale after setting it temporarily.
+       Use set_cloexec_flag rather than rolling our own.
+       * cloexec.c, cloexec.h: New files.
+
+2004-03-18  Paul Eggert  <eggert@twinsun.com>
+
+       * getopt.h: Sync with libc CVS.
+
+2004-03-18  Paul Eggert  <eggert@twinsun.com>
+            Bruno Haible  <bruno@clisp.org>
+
+       * mbswidth.h: Include <wchar.h> only if HAVE_DECL_MBSWIDTH_IN_WCHAR_H,
+       not on all platforms that have <wchar.h>.
+       * mbswidth.c: Include <stdio.h> and <time.h> before <wchar.h>.
+
+2004-03-09  Paul Eggert  <eggert@twinsun.com>
 
        * argp-parse.c, getopt.c, getopt.h, getopt1.c:
        Sync with libc CVS.
-       * lib/getopt_int.h: New file, also synced from libc.
+       * getopt_int.h: New file, also synced from libc.
 
 2004-03-07  Paul Eggert  <eggert@twinsun.com>
 
        * c-stack.c (SIGACTION_WORKS): New macro.  Use it instead of long
-       '#if' expressions.  Unlike the code it replaces, it it does not
+       '#if' expressions.  Unlike the code it replaces, it does not
        depend on (defined _SC_PAGESIZE).  However, it does depend on
        HAVE_STRUCT_SIGACTION_SA_SIGACTION; this last change fixes a bug
        first reported by Jason Andrade in
 
 2003-10-12  Paul Eggert  <eggert@twinsun.com>
 
-       * lib/xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
+       * 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.
+       * 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
+       * xstrdup.c (xstrdup): Use xclone, since memcpy should be
        a bit faster than strcpy.
 
 2003-10-08  Paul Eggert  <eggert@twinsun.com>
 
        Merge some files from coreutils.  These changes were
        originally made by Jim Meyering.
-       * lib/acl.c: Include <sys/types.h> before <sys/stat.h>;
+       * acl.c: Include <sys/types.h> before <sys/stat.h>;
        many older Unixes require this.
-       * lib/alloca.c (alloca): Remove cast to argument of free;
+       * alloca.c (alloca): Remove cast to argument of free;
        no longer needed in C89.
-       * lib/alloca_.h, lib/regex.h: Fix white space to match
+       * alloca_.h, regex.h: Fix white space to match
        what GNU indent does.
 
 2003-08-05  Paul Eggert  <eggert@twinsun.com>