dc9a1b9d2029a9c3a312d957915c571f0f0aa1f5
[gnulib.git] / lib / ChangeLog
1 2003-12-14  Karl Berry  <karl@gnu.org>
2
3         * config.charset: update from gettext-runtime.
4
5 2003-12-03  Paul Eggert  <eggert@twinsun.com>
6
7         * getgroups.c (getgroups): xmalloc takes one argument, not two.
8         Bug reported by Alfred M. Szmidt.
9
10 2003-11-29  Karl Berry  <karl@gnu.org>
11
12         * argp-{help.c,parse.c,namefrob.h}, argp.h: update from libc.
13
14 2003-11-23  Paul Eggert  <eggert@twinsun.com>
15             Bruno Haible  <bruno@clisp.org>
16
17         * printf-parse.h: Don't include sys/types.h.
18         (ARG_NONE): New macro.
19         (char_directive): Change type of *arg_index fields to size_t.
20         * printf-parse.c: Don't include sys/types.h.
21         (SSIZE_MAX): Remove macro.
22         (PRINTF_PARSE): Change the type of the arg_index variables to size_t.
23         Remove unnecessary overflow check.
24         * vasnprintf.c (VASNPRINTF): Update for type change of *arg_index
25         fields.
26
27 2003-11-24  Paul Eggert  <eggert@twinsun.com>
28
29         * alloca.c: Remove dependency on xalloc module.
30         (xalloc_die): Remove.
31         (memory_full) [!defined emacs]: New macro.
32         [!defined emacs]: Don't include xalloc.h.
33         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
34         address arithmetic overflows.  Change datatypes a bit to avoid
35         unnecessary casts.
36
37 2003-11-22  Jim Meyering  <jim@meyering.net>
38
39         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
40
41 2003-11-17  Bruno Haible  <bruno@clisp.org>
42
43         * vasnprintf.c (alloca): Remove fallback definition.
44         (freea): Remove definition.
45         (VASNPRINTF): Use alloca only for small sizes, say <= 4000 bytes.
46         Reported by Paul Eggert.
47
48 2003-11-17  Jim Meyering  <jim@meyering.net>
49
50         On systems without utime and without a utimes function capable of
51         dealing with a NULL struct utimbuf* argument, this utime replacement
52         could -- in unusual circumstances -- leak a file descriptor.
53         * utime.c: Include <unistd.h> and <errno.h>.
54         (utime_null): Be sure to close `fd' and to preserve errno.
55         Reported by Geoff Collyer via Arnold Robbins.
56
57 2003-11-16  Paul Eggert  <eggert@twinsun.com>
58             Bruno Haible  <bruno@clisp.org>
59
60         Protect against address arithmetic overflow.
61         * printf-args.h: Include stddef.h.
62         (arguments): Change type of field 'count' to size_t.
63         * printf-args.c (printf_fetchargs): Use size_t instead of
64         'unsigned int' where appropriate.
65         * printf-parse.h: Include sys/types.h.
66         (char_directive): Change type of *arg_index fields to ssize_t.
67         (char_directives): Change type of fields 'count', max_*_length to
68         size_t.
69         * printf-parse.c: Include sys/types.h and xsize.h.
70         (SSIZE_MAX): Define fallback value.
71         (PRINTF_PARSE): Use size_t instead of 'unsigned int' and ssize_t
72         instead of 'int' where appropriate. Check a_allocated, d_allocated
73         against overflow. Reject %m$ argument numbers > SSIZE_MAX + 1.
74         * vasnprintf.c: Include xsize.h.
75         (VASNPRINTF): Use size_t instead of 'unsigned int' where appropriate.
76         Check alloca, malloc, realloc, ENSURE_ALLOCATION arguments against
77         overflow. Avoid wraparound when converting a width or precision from
78         decimal to binary.
79
80 2003-11-16  Bruno Haible  <bruno@clisp.org>
81
82         Update from GNU gettext.
83         * printf-parse.c: Generalize to it can be compiled for wide strings.
84         (PRINTF_PARSE, CHAR_T, DIRECTIVE, DIRECTIVES): New macros.
85         * vasnprintf.c: Generalize to it can be compiled for wide strings.
86         (VASNPRINTF, CHAR_T, DIRECTIVE, DIRECTIVES, PRINTF_PARSE, USE_SNPRINTF,
87         SNPRINTF): New macros.
88         Don't include <alloca.h> if the file is used inside libintl.
89         (local_wcslen): New function, for Solaris 2.5.1.
90         (VASNPRINTF): Use it instead of wcslen.
91
92 2003-11-16  Bruno Haible  <bruno@clisp.org>
93
94         * xsize.h (xmax): New function.
95         (xsum, xsum3, xsum4): Declare as "pure" functions.
96
97 2003-11-12  Paul Eggert  <eggert@twinsun.com>
98
99         * xalloc.h: Do not include <limits.h> or <stdint.h>.
100         (xalloc_oversized): Use sizeof (ptrdiff_t) and sizeof (size_t) for
101         the heuristic, rather than PTRDIFF_MAX and SIZE_MAX.  This
102         heuristic is just as accurate as far as we know, and it removes a
103         dependency on size_max.m4 and ptrdiff_max.m4.
104
105 2003-11-12  Paul Eggert  <eggert@twinsun.com>
106
107         * xstrtol.c (__xstrtol): Remove "break" immediately after
108         "return", to pacify some unknown compiler.  Problem reported
109         by Joerg Schilling.
110
111 2003-11-11  Bruno Haible  <bruno@clisp.org>
112
113         * xsize.h (SIZE_MAX): Remove fallback definition.
114         * xalloc.h: Include limits.h. Assume SIZE_MAX and PTRDIFF_MAX are
115         defined.
116
117 2003-11-10  Paul Eggert  <eggert@twinsun.com>
118
119         * xalloc.h (xalloc_oversized): [! (defined PTRDIFF_MAX &&
120         PTRDIFF_MAX < SIZE_MAX)]: Fix off-by-one error that would have
121         rejected some allocations of exactly SIZE_MAX - 2 bytes.
122         From Bruno Haible.
123         [defined PTRDIFF_MAX && PTRDIFF_MAX < SIZE_MAX]: Use SIZE_MAX,
124         not (size_t) -1, since it's defined here.
125
126 2003-11-06  Paul Eggert  <eggert@twinsun.com>
127
128         * xalloc.h [HAVE_STDINT_H]: Include <stdint.h>.
129         (xalloc_oversized) [! (PTRDIFF_MAX < SIZE_MAX)]:
130         Reject sizes of exactly SIZE_MAX bytes.
131         * xreadlink.c: Include "xalloc.h" before checking whether SIZE_MAX
132         is defined, since "xalloc.h" now defines SIZE_MAX on modern hosts.
133
134 2003-11-05  Bruno Haible  <bruno@clisp.org>
135
136         * xsize.h: Include limits.h, to avoid a possible collision with
137         SIZE_MAX defined in <limits.h> on Solaris.
138
139 2003-11-04  Bruno Haible  <bruno@clisp.org>
140
141         * xsize.h: New file.
142         * linebreak.c: Include xsize.h.
143         (mbs_possible_linebreaks, mbs_width_linebreaks): Check malloc()
144         argument for overflow.
145         Suggested by Paul Eggert.
146
147 2003-10-31  Bruno Haible  <bruno@clisp.org>
148
149         * wait-process.c (wait_process): Use waitid with WNOWAIT if available,
150         to avoid (extremely rare) race condition.
151         Suggested by Paul Eggert.
152
153 2003-11-03  Jim Meyering  <jim@meyering.net>
154
155         * userspec.c: Include "userspec.h".
156         * userspec.h: New file.
157
158 2003-10-31  Paul Eggert  <eggert@twinsun.com>
159
160         * mountlist.h (struct mount_entry.me_type_malloced): New member.
161         * mountlist.c (SIZE_MAX): Define if not defined already.
162         (read_filesystem_list): Set and use me_type_malloced.
163         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
164         whatever the type happens to be), for brevity and consistency.
165         Check for size calculation overflow on Alphas running OSF/1.
166
167 2003-10-31  Jim Meyering  <jim@meyering.net>
168
169         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
170
171         * linebuffer.c: Include <string.h> for declaration of memset.
172
173 2003-10-30  Paul Eggert  <eggert@twinsun.com>
174             Bruno Haible  <bruno@clisp.org>
175
176         * vasprintf.c: Include <limits.h>, <stdlib.h>.
177         (vasprintf): Fail if the resulting length doesn't fit in an 'int'.
178
179 2003-10-29  Paul Eggert  <eggert@twinsun.com>
180
181         * xalloc.h (xalloc_oversized): Now a macro, not a function,
182         so that it works even if SIZE_MAX < N.  Do not include <stdbool.h>;
183         no longer needed.
184         * quotearg.c (quotearg_n_options): Use it.
185         * group-member.c: Include <stdbool.h>.
186         (free_group_info): Arg is now const *; don't free arg.
187         (get_group_info): Now returns bool and accepts struct group_info *,
188         rather than returning a malloc'ed struct group_info *.
189         All uses changed.  Check for overflow in internal size calculation.
190
191         * getusershell.c (readname): Simplify the code by using x2nrealloc
192         rather than xmalloc/xrealloc.
193         * linebuffer.c (initbuffer, readlinebuffer): Simplify the code by
194         using x2realloc rather than xmalloc/xrealloc.  Also, fix a C
195         conformance bug: the old code used a pointer after freeing the
196         storage that it addressed.
197         * hash.c (hash_initialize): Simplify the code by using xalloc_oversized
198         rather than doing it by hand.
199         * getgroups.c (getgroups): Don't use xrealloc, since we don't need
200         the buffer preserved.  Use free and xmalloc instead.
201         * quotearg.c (quotearg_n_options): Likewise.
202         Use a simpler test for size overflow.  Don't use xalloc_oversized
203         because unsigned int might be wider than size_t (!); this suggests
204         that we should switch from unsigned int to size_t for slot numbers.
205
206 2003-10-27  Bruno Haible  <bruno@clisp.org>
207
208         * stdbool_.h: Better support for BeOS.
209
210 2003-10-27  Paul Eggert  <eggert@twinsun.com>
211
212         * exclude.c (new_exclude): Use xzalloc rather than xmalloc
213         to allocate the returned structure.  Do not allocate a subarray,
214         as x2nrealloc will do that.
215         (add_exclude): Use x2nrealloc to reallocate ex->exclude,
216         instead of xnrealloc.
217         (add_exclude_file): Use x2realloc instead of malloc + xnrealloc.
218
219 2003-10-26  Paul Eggert  <eggert@twinsun.com>
220
221         * xalloc.h (xalloc_oversized): New static inline function, for
222         callers that want to do their own size-overflow checking.  Include
223         <stdbool.h>, since xalloc_oversized returns bool.
224         * xalloc.c (array_size_overflow): Remove.  All callers changed
225         to use xalloc_oversized.
226
227         Add two functions x2realloc, x2nrealloc, for programs that grow
228         arrays dynamically by doubling their sizes.
229         * xalloc.h (x2realloc, x2nrealloc): New decls.
230         * xmalloc.c (x2nrealloc_inline, x2nrealloc, x2realloc):
231         New functions.
232
233         Port to C99 semantics for 'inline' of external functions.
234         Bug reported by Bruno Haible.
235         * xmalloc.c (xnmalloc_inline): New static inline function,
236         with the old contents of xnmalloc.
237         (xnmalloc, xmalloc): Use it.
238         (xnrealloc_inline): New static inline function,
239         with the old contents of xnrealloc.
240         (xnrealloc, xrealloc): Use it.
241
242         * alloc.c (alloca): xmalloc cannot return NULL, so don't test for that.
243
244 2003-10-25  Paul Eggert  <eggert@twinsun.com>
245
246         Fix several address-calculation bugs in the hash modules,
247         plus some minor code cleanup.
248
249         * hash.h: Include <stdbool.h>, for bool.
250         * hash.c: Don't include <stdbool.h>, since hash.h does it now.
251         * hash.h (Hash_hasher, hash_get_n_buckets, hash_get_n_buckets_used,
252         hash_get_n_entries, hash_get_max_bucket_length,
253         hash_get_entries, hash_do_for_each, hash_string, hash_initialize,
254         hash_rehash): Use size_t rather than unsigned.
255         * hash.c (struct hash_table, hash_get_n_buckets,
256         hash_get_n_buckets_used, hash_get_n_entries,
257         hash_get_max_bucket_length, hash_table_ok, hash_print_statistics,
258         hash_get_entries, hash_do_for_each, hash_string, is_prime,
259         next_prime, hash_initialize, hash_rehash, hash_delete, hash_print):
260         Likewise.
261         (SIZE_MAX): Define if not defined.
262         (hash_get_max_bucket_length, hash_table_ok, hash_lookup,
263         hash_get_first, hash_get_next, hash_get_entries, hash_do_for_each,
264         hash_print):
265         Use const * when possible.
266         (hash_string): Use (unsigned char) *P rather than *(unsigned char *) P.
267         (check_tuning): Fix bug: if tuning parameters were very close to
268         0 or 1, rounding errors could have caused subscript violations.
269         (hash_initialize, allocate_entry, hash_print): Remove unnecessary cast.
270         (hash_initialize): Add 'fail:' label
271         to free table and return NULL, and use it to simplify code.
272         Use calloc rather than clearing the storage ourself.
273         (hash_initialize, hash_rehash): Check for arithmetic overflow in
274         buffer size calculations.
275         * hash-pjw.h (hash_pjw): Use size_t, not unsigned.
276         Include <stddef.h>, for size_t.
277         * hash-pjw.c (hash_pjw): Likewise.
278         Switch to method described by Bruno Haible.
279         Include <limits.h>, for CHAR_BIT.
280         (SIZE_BITS): New macro.
281
282 2003-10-21  Paul Eggert  <eggert@twinsun.com>
283
284         * getndelim2.c (getndelim2): When size calculation overflows,
285         ceiling the allocation at NMAX bytes rather than silently
286         discarding input bytes before NMAX is reached.  This makes
287         a difference only if NMAX exceeds SIZE_MAX / 2.
288
289         * obstack.c: Merge from glibc.
290         [defined _LIBC]: Include <obstack.h>, not "obstack.h".
291         Add libc_hidden_def (_obstack_newchunk).
292         (_obstack_free) [! defined _LIBC]: Remove.
293         [defined _LIBC]: Make a strong alias from obstack_free, rather than
294         a clone of the function body.
295         (fputs) [defined _LIBC && defined USE_IN_LIBIO]: Remove.
296         [defined _LIBC && !defined USE_IN_LIBIO]: Include <libio/iolibio.h>.
297
298         * obstack.h: Indenting cleanup, to make it easier to merge with glibc.
299         (obstack_grow, obstack_grow0): Remove unnecessary parentheses around
300         arg to memcpy.
301
302         * obstack.h (obstack_1grow_fast): Properly parenthesize arg.
303         (obstack_ptr_grow_fast, obstack_int_grow_fast):
304         Don't use lvalue casts, as GCC plans to remove support for them
305         in GCC 3.5.  Reported by Joseph S. Myers.  This bug
306         was also present in the non-GCC version, indicating that this
307         code had always been buggy and had never been widely used.
308         (obstack_1grow, obstack_ptr_grow, obstack_int_grow, obstack_blank):
309         Use the fast variant of each macro, rather than copying the
310         definiens of the fast variant; that way, we'll be more likely to
311         catch future bugs in the fast variants.
312
313 2003-10-20  Bruno Haible  <bruno@clisp.org>
314
315         * wait-process.h: New file, from GNU gettext.
316         * wait-process.c: New file, from GNU gettext.
317
318 2003-10-19  Jim Meyering  <jim@meyering.net>
319
320         * vasnprintf.c (vasnprintf): Work around losing snprintf on HPUX 10.20.
321
322 2003-10-16  Paul Eggert  <eggert@twinsun.com>
323
324         * getgroups.c: Include <errno.h>, <stdlib.h>.
325         (getgroups): First arg is int, not size_t.
326         Don't let 'free' mangle errno.
327
328 2003-10-16  Jim Meyering  <jim@meyering.net>
329
330         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
331
332 2003-10-15  Paul Eggert  <eggert@twinsun.com>
333
334         * exclude.c: Do not include <inttypes.h> or <stdint.h>.
335         (SIZE_MAX): Remove.
336         (new_exclude, add_exclude_file): Initial size no longer needs to
337         be a power of 2.
338         (add_exclude, add_exclude_file): Use xnrealloc instead of rolling
339         our own address arithmetic overflow checking.
340
341         * fnmatch.c (SIZE_MAX): Define if standard headers don't.
342         (fnmatch): Do not alloca more than 2000 wide characters;
343         instead, use malloc for large buffers.
344         Check for address arithmetic overflow, and return -1
345         with errno set to ENOMEM in that case.
346         * fnmatch_loop.c (ALLOCA_LIMIT): New macro.
347         (NEW_PATTERN): Do not alloca more than 8000 bytes;
348         instead, return -1.  Check for address arithmetic overflow.
349
350 2003-10-14  Paul Eggert  <eggert@twinsun.com>
351
352         Handle invalid suffixes and overflow independently, so that
353         callers can treat them independently as needed.  Fix some bugs in
354         suffix handling, e.g., "100k@" was not diagnosed as an invalid
355         suffix for a human-readable blocksize.  The major caller-visible
356         change is the addition of a new
357         LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW enum value, indicating
358         that both overflow and suffix chars were found.
359
360         * human.c (humblock): Don't check separately for invalid suffix
361         char; that is xstrtoumax's job (now that its bug is fixed).
362         * xstrtoimax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM) [defined
363         INTMAX_MAX]: New macros.
364         * xstrtol.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM, TYPE_MINIMUM,
365         TYPE_MAXIMUM): New macros.
366         (bkm_scale, bkm_scale_by_power): Return strtol_error, not int.
367         (bkm_scale, bkm_scale_by_power, __xstrtol): Return maximal values
368         if overflow occurs, as it's what __strtol does and it's more useful
369         in practice.
370         (__xstrtol): If __strtol reports some error other than ERANGE,
371         reflect it to the caller as LONGINT_INVALID.  If it reports
372         ERANGE, continue the rest of parsing, and report LONGINT_OVERFLOW
373         | LONGINT_INVALID_SUFFIX_CHAR if both errors occur.
374         * xstrtol.h (LONGINT_INVALID_SUFFIX_CHAR_WITH_OVERFLOW): New enum
375         value.
376         (_STRTOL_ERROR): Handle it.  Abort when given unknown error codes.
377         * xstrtoul.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM): New macros.
378         * xstrtoumax.c (STRTOL_T_MINIMUM, STRTOL_T_MAXIMUM)
379         [defined UINTMAX_MAX]: New macros.
380
381 2003-10-14  Bruno Haible  <bruno@clisp.org>
382
383         * fatal-signal.h: Improved comments. Suggested by Paul Eggert.
384         * fatal-signal.c: Use sig_atomic_t. Suggested by Paul Eggert.
385         Also use volatile where needed.
386
387 2003-10-12  Paul Eggert  <eggert@twinsun.com>
388
389         * lib/xalloc.h (xnmalloc, xzalloc, xnrealloc, xclone): New decls.
390         (XMALLOC, XCALLOC, XREALLOC, XFREE, CCLONE, CLONE): Deprecate,
391         and define in terms of the other primitives.
392         * lib/xmalloc.c: Include stdbool.h; do not include exit.h.
393         (SIZE_MAX): Define if not already defined.
394         (array_size_overflow): New function.
395         (xalloc_die): Abort instead of exiting if 'error' returns.
396         (xnmalloc, xnrealloc, xzalloc, xclone): New functions.
397         (xmalloc, xrealloc): Use them.
398         (xcalloc): Check for address arithmetic overflow.
399         * lib/xstrdup.c (xstrdup): Use xclone, since memcpy should be
400         a bit faster than strcpy.
401
402 2003-10-08  Paul Eggert  <eggert@twinsun.com>
403
404         Merge getpass from libc, plus a few fixes.
405
406         * getpass.c (HAVE_STDIO_EXT) [_LIBC]: Define to 1.
407         Include <stdbool.h>.
408         Include <stdio_ext.h> if HAVE_STDIO_H, otherwise define
409         __fsetlocking to empty.
410         [_LIBC]: Do not include "getline.h" or "unlocked-io.h", but
411         do include <bits/libc-lock.h>.
412         Do not include <fcntl.h>; not needed.
413         [_LIBC]: Include <wchar.h>.
414         (NOTCANCEL_MODE): New macro.
415         (flockfile, funlockfile) [_LIBC]: New macros.
416         (__libc_cleanup_push, __libc_cleanup_pop, __getline, __tcgetattr)
417         [!_LIBC]: New macros.
418         (call_fclose): New function.
419         (getpass): Use it.  Save tty stream separately; this simplifies the
420         code and makes it more reliable if stdin happens to equal stdout.
421         Invoke __fsetlocking on tty.
422         Handle thread cancellation if needed.
423         Namespace cleanup (use __tcgetattr, __getline).
424         Use bool for Booleans.
425         [USE_IN_LIBIO]: Handle wide streams.
426         [!_LIBC]: Unconditionally do the fseek, since we don't know what
427         stream might go where.
428
429         * unlocked-io.h: Include <stdio.h>, so that the caller
430         doesn't have to include <stdio.h> before us.
431         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
432         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
433         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
434         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
435         if not declared, so that we can use getpass.c code from libc without
436         rewriting it.
437         (flockfile, ftrylockfile, funlockfile): New macros.
438
439 2003-10-06  Bruno Haible  <bruno@clisp.org>
440
441         * version-etc-2.h: Remove file.
442         * version-etc-2.c: Remove file.
443
444 2003-09-25  Jim Meyering  <jim@meyering.net>
445             Bruno Haible  <bruno@clisp.org>
446
447         This lets translators provide better translations for the
448         "Written by ..." part of --version output.
449         * version-etc.h: Include stdarg.h.
450         (version_etc_copyright): Declare as readonly.
451         (version_etc): Make this function variadic with a NULL-terminated list
452         of author name strings.
453         (version_etc_va): New declaration.
454         * version-etc.c: Include stdarg.h, stdlib.h.
455         (version_etc_copyright): Declare as readonly.
456         (version_etc_va): New function. Provide a different translatable string
457         for each possible number of authors < 10. Abbreviate when there are 10
458         authors or more.
459         (version_etc): Make this function variadic. Call version_etc_va.
460         Suggestion from Gary V. Vaughan.
461
462         * long-options.h (parse_long_options): Change prototype: the authors
463         string is moved to the end and becomes variadic.
464         * long-options.c: Include stdarg.h.
465         (parse_long_options): Make this function variadic, too.
466         Call version_etc_va, not version_etc.
467
468 2003-10-06  Bruno Haible  <bruno@clisp.org>
469
470         * fatal-signal.h: New file, from GNU gettext.
471         * fatal-signal.c: New file, from GNU gettext.
472
473 2003-10-04  Karl Berry  <karl@gnu.org>
474
475         * argp*: update from libc.
476
477 2003-10-01  Larry Jones  <lawrence.jones@eds.com>
478
479         * getpass.c (getpass): Use a no-op fseek when switching from input to
480         output mode on the same stream.
481
482 2003-09-29  Paul Eggert  <eggert@twinsun.com>
483
484         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
485         Fix arg typo in previous patch.
486
487 2003-09-28  Jim Meyering  <jim@meyering.net>
488
489         * error.c: Correct cpp indentation.
490
491 2003-09-27  Paul Eggert  <eggert@twinsun.com>
492
493         * minmax.h (MIN, MAX) [__STDC__ && defined __GNUC__ && __GNUC__ >= 2]:
494         Omit the special code that used __typeof__, since we worry that
495         it could be more trouble than it's worth.  See:
496         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00090.html
497         http://mail.gnu.org/archive/html/bug-gnulib/2003-01/msg00095.html
498
499         * free.c: New file.
500
501 2003-09-26  Jim Meyering  <jim@meyering.net>
502
503         * error.c (error_tail): Move some declarations
504         into inner scope where the local variables are used.
505
506 2003-09-26  Bruno Haible  <bruno@clisp.org>
507
508         * stpncpy.h (gnu_stpncpy): New declaration.
509         (stpncpy): Define as alias for gnu_stpncpy.
510         * stpncpy.c [!_LIBC]: Define gnu_stpncpy, not stpncpy.
511
512 2003-09-26  Paul Eggert  <eggert@twinsun.com>
513
514         * error.c (SIZE_MAX) [!defined SIZE_MAX]: Define.
515         (error_tail): Do not loop, reallocating temporary buffer, since
516         the output cannot contain more wide characters than the input
517         contains bytes, the size must be big enough already.  This avoids
518         one potential size overflow calculation.  Check for size overflow
519         when calculating temporary buffer size.  Free temporary buffer
520         when done, if it was allocated with malloc; this plugs a memory
521         leak.  Remove casts from void * to pointers, that are no longer
522         needed now that we're assuming C89 or better.
523
524         Merge error changes from glibc.
525
526         * error.c, error.h: Update copyright notice header to match glibc.
527         * error.c [defined _LIBC]: Include <errno.h>, <bits/libc-lock.h>.
528         (error, error_at_line) [defined _LIBC && defined __libc_ptf_call]:
529         Disable cancellation while printing error.
530         * error.h: Prepend __ to parameter names.
531
532 2003-09-25  Karl Berry  <karl@gnu.org>
533
534         * argp-fmtstream.c, argp-help.c: update from libc.
535
536 2003-09-25  Bruno Haible  <bruno@clisp.org>
537
538         * version-etc-2.h: New file, from version-etc.h with modifications.
539         * version-etc-2.c: New file, from version-etc.c with modifications.
540
541 2003-09-25  Simon Josefsson  <jas@extundo.com>
542
543         * xgetdomainname.h: New file.
544         * xgetdomainname.c: New file.
545
546 2003-09-25  Simon Josefsson  <jas@extundo.com>
547             Bruno Haible  <bruno@clisp.org>
548
549         * getdomainname.h: New file.
550         * getdomainname.c: New file.
551
552 2003-09-24  Paul Eggert  <eggert@twinsun.com>
553
554         * linebuffer.c (freebuffer): Don't free the argument, just
555         the buffer associated with the argument.  Bug reported by
556         Simon Josefsson.
557
558 2003-09-19  Karl Berry  <karl@gnu.org>
559
560         * argp.h: update from libc.
561
562 2003-09-16  Paul Eggert  <eggert@twinsun.com>
563
564         * linebuffer.c (readlinebuffer): Return NULL immediately upon
565         input error, instead of returning NULL the next time we are called
566         (and therefore losing track of errno).
567
568 2003-09-15  Paul Eggert  <eggert@twinsun.com>
569
570         * getndelim2.c (getndelim2): Don't trash errno when a read
571         fails, so that the caller gets the proper errno.
572
573         * readutmp.c (read_utmp): Likewise.
574         Check for fstat error.  Close stream and free storage
575         when failing.
576
577 2003-09-14  Bruno Haible  <bruno@clisp.org>
578
579         * fwriteerror.h: New file.
580         * fwriteerror.c: New file.
581
582 2003-09-14  Jim Meyering  <jim@meyering.net>
583
584         * getloadavg.c: Correct cpp indentation.
585         * strdup.c: Likewise.
586         * vasnprintf.c: Likewise.
587
588 2003-09-12  Paul Eggert  <eggert@twinsun.com>
589
590         * argmatch.c, fatal.c, xgethostname.c, xmalloc.c: Include exit.h.
591         * obstack.c [!defined _LIBC]: Likewise.
592         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
593         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
594         * exitfail.c: Don't include stdlib.h; no longer needed.
595
596         More changes to assume C89 or better.
597
598         * error.c (error_tail): Assume vprintf.
599
600         * argmatch.c (getenv): Remove decl.
601         * progreloc.c (get_full_program_name): Define via prototype.
602         * setenv.c (clearenv): Likewise.
603         * stpncpy.c: Do not include <string.h> or <sys/types.h>; not
604         needed.
605         * strdup.c: Include <stdlib.h>, <string.h> unconditionally.
606         (malloc, memcpy): Remove decls.
607         * strftime.c (HAVE_LIMITS_H, STDC_HEADERS) [defined _LIBC]: Remove.
608         (HAVE_MEMCPY) [defined emacs && !defined HAVE_BCOPY]: Remove.
609         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
610         (memcpy): Remove macro.
611         (MEMCPY) [!defined COMPILE_WIDE]: Define to memcpy unconditionally.
612         (__P): Remove.  All uses removed.
613         (PTR): Remove.  All uses changed to void *.
614         (CHAR_BIT, NULL): Remove.
615         (spaces, zeros, memset_space, memset_zero)
616         [!defined memset && !defined HAVE_MEMSET && !defined _LIBC]:
617         Remove.
618         (LOCALE_PARAM, LOCALE_PARAM_DECL): Remove.
619         (memcpy_lowcase, memcpy_uppcase, tm_diff, iso_week_days):
620         Define with prototype.
621         Remove now-unnecessary prototype decl.
622         (extra_args_spec): Assume ANSI C.  All uses changed.
623         (extra_args_spec_iso): Remove.
624         (my_strftime, emacs_strftimeu): Define via prototype.
625         * strtod.c: Include <float.h>, <stdlib.h>, <string.h>
626         unconditionally.
627         (DBL_MAX, DBL_MIN, HUGE_VAL, NULL): Remove decls.
628         * strtoimax.c: Include <stdlib.h> unconditionally.
629         (strtoul, strtol): Remove decls.
630         * strtol.c (STDC_HEADERS, HAVE_LIMITS_H, NULL, ULONG_MAX,
631         LONG_MAX): Remove.
632         Include <limits.h>, <stddef.h>, <stdlib.h>, <string.h> unconditionally.
633         (LOCALE_PARAM_DECL): Remove.  All uses changed to LOCALE_PARAM_PROTO.
634         (LOCALE_PARAM_PROTO): New macro.
635         (INTERNAL, INTERNAL1, WEAKNAME): Assume ANSI C, not K&R.
636         (INTERNAL (strtol), strtol): Define with a prototype.
637         (PARAMS): Remove.  All uses removed.
638         * tempname.c: Include <string.h> unconditionally.
639         * userspec.c: Include <stdlib.h>, <string.h> unconditionally.
640         * xgethostname.c (main): Define with a prototype.
641         * xmalloc.c: Include "xalloc.h" first, to check interface.
642         Include <stdlib.h> unconditionally.
643         (calloc, malloc, realloc, free): Remove decls.
644         * xstrtod.c: Include "xstrtod.h" first, to check interface.
645         Include <stdlib.h> unconditionally.  Sort include file names.
646         (strtod): Remove.
647         (xstrtod): Define with a prototype.
648         * xstrtol.c: Include <stdlib.h>, <string.h> unconditionally.
649         (strtol, strtoul): Remove decls.
650
651 2003-09-11  Paul Eggert  <eggert@twinsun.com>
652
653         * strndup.c: Don't include <stdio.h>, <sys/types.h>.
654         Include <stdlib.h>, <string.h> unconditionally.
655         Remove now-unnecessary cast to char *.
656         * strnlen.c: Include <string.h> unconditionally.
657         * yesno.c (yesno): Define with a prototype.
658
659 2003-09-10  Bruno Haible  <bruno@clisp.org>
660
661         * strcspn.c: Include <string.h> unconditionally.
662         * strpbrk.c: Include <string.h> unconditionally.
663         * strstr.c: Include <string.h> unconditionally.
664         * unicodeio.c: Include <string.h> unconditionally.
665         * setenv.c: Include <stdlib.h> and <string.h> unconditionally.
666         * unsetenv.c: Likewise.
667         * xreadlink.c: Include <stdlib.h> unconditionally.
668         * yesno.c: Include <stdlib.h> unconditionally.
669         (rpmatch): Add prototype.
670
671 2003-09-10  Jim Meyering  <jim@meyering.net>
672
673         * error.c: Correct indentation of cpp directives.
674
675 2003-09-09  Paul Eggert  <eggert@twinsun.com>
676
677         More K&R removal.
678
679         * acosl.c (main): Use a prototype.
680         * asinl.c, cosl.c, expl.c, frexpl.c, ldexpl.c, sinl.c,
681         tanl.c: Likewise.
682
683         * getloadavg.c (getloadavg, main): Define via prototypes.
684
685         * getopt.h (struct option.name): Assume C89, and use 'const'.
686         (getopt, etopt_long, getopt_long_only, _getopt_internal)
687         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
688         with a prototype.
689         * getopt.c (const): Remove macro.
690         Include <string.h> unconditionally.
691         (my_index): Remove; all uses changed to strchr.
692         (strlen): Remove decl.
693         (exchange): Remove forward decl; no longer needed.
694         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
695         Define with prototype.
696         * getopt1.c (const): Remove macro.
697         (getopt_long, getopt_long_only, main): Define with prototype.
698
699         * getugroups.c: Include <string.h> unconditionally.
700
701         * getusershell.c: Include <stdlib.h> unconditionally.
702         (getusershell, setusershell, endusershell, readname, main):
703         Define with prototypes.
704
705         * group-member.c: Include group-member.h first.
706         Include <stdlib.h> unconditionally.
707
708         * hard-locale.c: Include hard-locale.h first.
709         Include <stdlib.h>, <string.h> unconditionally.
710
711         * hash.c (free, malloc): Remove decls.
712         Include <stdlib.h> unconditionally.
713
714         * human.c: Include <stdlib.h>, <string.h> unconditionally.
715         (getenv): Do not declare.
716
717         * idcache.c: Include <string.h> unconditionally.
718
719         * long-options.c: Include long-options.h first, to test interface.
720         Include <stdlib.h> unconditionally.
721
722         * makepath.c: Include makepath.h first, to test interface.
723         Include <stdlib.h> and <string.h> unconditionally.
724
725         * linebuffer.c: Include <stdlib.h>.
726         (free): Remove decl.
727
728         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
729         rpl_malloc returns void *, not char *.
730         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
731
732         * md5.h: Include <limits.h> unconditionally.
733         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
734         (__P): Remove; all uses removed.
735         * md5.c: Include "md5.h" first.
736         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
737         md5_buffer, md5_process_bytes, md5_process_block):
738         Define with prototypes.
739         * sha.h (__P): Remove all uses.  (It wasn't defined??)
740         * sha.c: Include "sha.h" first.
741         Include <stdlib.h>, <string.h> unconditionally.
742
743         * memchr.c (__ptr_t): Remove; all uses changed to void *.
744         * memcmp.c (__ptr_t): Likewise.
745         * memrchr.c (__ptr_t): Likewise.
746         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
747         Include <string.h> unconditionally.
748         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
749         * memchr.c: Include <stdlib.h> unconditionally.
750         * memchr.c (LONG_MAX): Remove.
751         * memrchr.c (LONG_MAX): Likewise.
752         * memchr.c (__memchr): Define via a prototype.
753         * memrchr.c (__memrchr): Likewise.
754         * memcmp.c (__P): Remove, and remove all uses.
755         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
756         Remove forward decls; no longer needed.
757         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
758         Use types required by C89 in prototype.
759
760         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
761         * savedir.c: Likewise.
762         * mkdir.c (free): Remove decl.
763         * rmdir.c (rmdir): Define with a prototype.
764         * savedir.c: Include savedir.h first, to test interface.
765
766         * mktime.c (STDC_HEADERS): Remove.
767         Include <stdlib.h>, <string.h> unconditionally.
768
769         * modechange.c: Include <stdlib.h> unconditionally.
770         (malloc): Remove decl.
771
772         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
773         (free): Remove decl.
774
775         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
776         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
777         (This type really should be intptr_t, but that's a C99ism.)
778         (_obstack_memcpy): Remove: all uses changed to memcpy.
779         Include <string.h> unconditionally.
780         (struct obstack): Assume __STDC__ for types of members
781         chunkfun, freefun, extra_arg.
782         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
783         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
784         obstack_begin, obstack_specify_allocation,
785         obstack_specify_allocation_with_arg, obstack_chunkfun,
786         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
787         Remove unprototyped decls and the macros that use them.
788         * obstack.c (POINTER): Remove.  All uses changed to void *.
789         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
790         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
791         (defined __STDC__ && __STDC__)]:
792         Remove nonprototyped code.
793         Include <stdlib.h> unconditionally.
794         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
795         _obstack_allocated_p, _obstack_free, obstack_free,
796         _obstack_memory_used, print_and_abort):
797         Define using prototypes.
798         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
799         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
800         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
801         obstack_next_free, obstack_object_size, obstack_room) [0]:
802         Remove unused, unprototyped code.
803
804         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
805
806         * physmem.c (physmem_total, physmem_available, main): Define
807         with prototypes.
808
809         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
810         (main): Define with a prototype.
811
812         * posixver.c (getenv): Remove decl.
813
814         * putenv.c (malloc): Returns void *, not char *.
815         Include <string.h> unconditionally.
816         (strchr, memcpy, NULL): Do not define.
817
818         * readtokens.c: Include readtokens.h first, to test interface.
819         Include <stdlib.h>, <string.h> unconditionally.
820         (init_tokenbuffer): Define with a prototype.
821
822         * regex.c (PARAMS): Remove.  All uses removed.
823         All uses of _RE_ARGS removed, too.
824         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
825         unconditionally.
826         (bzero): Assume memset exists.
827         (memcmp, memcpy, NULL): Remove.
828         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
829         char, or assignments to local vars of type signed char.
830         (init_syntax_once, PREFIX(extract_number_and_incr),
831         PREFIX(print_partial_compiled_pattern),
832         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
833         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
834         PREFIX(regex_grow_registers), PREFIX(regex_compile),
835         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
836         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
837         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
838         wcs_compile_range, byte_compile_range, truncate_wchar,
839         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
840         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
841         count_mbs_length, wcs_re_match_2_internal,
842         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
843         PREFIX(alt_match_null_string_p),
844         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
845         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
846         regfree, PREFIX(extract_number)): Define with prototype.  Remove
847         now-unnecessary declaration, if any.
848         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
849         regcomp, regexec):
850         Remove now-unnecessary casts among pointer types.
851         * regex.h (_RE_ARGS): Remove.  All uses removed.
852
853         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
854         (free): Remove decl.
855
856         * rpmatch.c: Include <stdlib.h> unconditionally.
857
858         * same.c: Include <stdlib.h>, <string.h> unconditionally.
859         (free): Remove decl.
860
861         * save-cwd.c: Include <stdlib.h> unconditionally.
862         * xgetcwd.c: Likewise.
863
864         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
865         (free): Remove decl.
866
867         * strchrnul.c (strchrnul): Define with a prototype.
868         Fix bug: c_in was not converted to char before searching.
869
870         The following changes are not K&R related:
871
872         * group-member.h: Include <sys/types.h>, so that this file is
873         self-contained.
874         * makepath.h: Likewise.
875
876         * getusershell.c (readname, default_index, line_size, readname):
877         Use size_t, not int, for sizes.
878         (readname): If the size overflows, report an error instead of
879         looping forever.
880
881 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
882
883         * getndelim2.c: Assume stdlib.h per the C89 spec.
884
885 2003-09-08  Paul Eggert  <eggert@twinsun.com>
886
887         Assume C89 or better; remove K&R cruft.
888         A few of these changes were first proposed by Derek Robert Price
889         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
890
891         * addext.c: Include <string.h> unconditionally.
892         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
893         Don't declare getenv or malloc.
894
895         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
896         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
897         (NULL): Remove.
898         (find_stack_direction, alloca): Use prototypes.
899
900         * atexit.c (atexit): Define using a prototype.
901
902         * basename.c, dirname.c, stripslash.c:
903         Include <string.h> unconditionally.
904
905         * bcopy.c: Include <stddef.h>.
906         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
907
908         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
909
910         * error.h (error, error_at_line, error_print_progname)
911         [! (defined (__STDC__) && __STDC__)]: Remove decls.
912         * error.c: Include error.h first, to check interface.
913         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
914         (VA_START): Remove; all uses changeed to va_start.
915         (exit, strerror): Remove decls.
916         (error_print_progname): Prototype uncondionally.
917         Don't include <errno.h>; no longer needed.
918         (private_strerror): Remove.
919         (error_tail): Always define.
920         (error, error_at_line): Assume C89 or better; always use prototypes.
921         * fatal.c: Include "fatal.h" first, to test interface.
922         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
923         (VA_START): Remove; all uses changed to va_start.
924         [! (HAVE_VPRINTF || HAVE_DOPRNT || _LIBC)]: Remove support for
925         this case.
926         (exit): Remove decl.
927         (fatal): Prototype unconditionally.  Assume va_start works.
928         Abort at end, to pacify gcc.
929
930         * euidaccess.c (main): Define with a prototype.
931
932         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
933
934         * exitfail.c: Include <stdlib.h> unconditionally.
935
936         * fnmatch_.h (__P): Remove.  All uses changed to assume
937         prototypes.
938         * fnmatch.c: Include fnmatch.h first, to test interface.
939         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
940         (getenv): Remove decl.
941         (fnmatch): Define using a prototype.
942         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
943         (FCT): Define using a prototype.
944
945         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
946
947         * gethostname.c: Include <stddef.h>.
948         (gethostname): Define with prototype.  Length is size_t, not int.
949
950 2003-09-08  Paul Eggert  <eggert@twinsun.com>
951
952         * getversion.c: Remove; was migrated to backupfile.c in 1997.
953         getversion.c should have been removed then, but was accidentally
954         preserved.
955
956         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
957         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
958
959 2003-09-07  Paul Eggert  <eggert@twinsun.com>
960
961         * time_r.c (gmtime_r, localtime_r): Fix silly typo: missing arg to
962         copy_tm_result.  Bug reported by Simon Josefsson in
963         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00028.html>.
964
965 2003-09-06  Paul Eggert  <eggert@twinsun.com>
966
967         * time_r.c, time_r.h: New files.
968
969         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
970         __localtime_r.
971         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
972         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
973
974         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
975         __gmtime_r.
976         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
977         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
978         Include <time_r.h>.
979
980         * timegm.c: Switch to glibc implementation, with the following changes:
981         [defined HAVE_CONFIG_H]: Include <config.h>.
982         [!defined _LIBC]: Include "timegm.h" rather than <time.h>.
983         (__mktime_internal) [!defined _LIBC]: New decl.
984         (__gmtime_r) [!defined _LIBC]: New macro and function.
985         (timegm): Use a prototype, since gnulib assumes C89.
986         Do not bother declaring tmp to be const, as it's not really usefu.
987         * timegm.h: Hoist "#include <time.h>" out of #ifdef.
988         (timegm): Declare only if HAVE_DECL_TIMEGM.
989
990 2003-09-03  Paul Eggert  <eggert@twinsun.com>
991
992         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
993         Bug reported by Lute Kamstra in
994         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
995
996         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
997         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
998         course with correspondingly smaller numbers for tomorrow and
999         yesterday.  From Tadayoshi Funaba.  Originally installed into
1000         sh-utils on 1999-08-07, but the patch got lost (I guess during the
1001         coreutils merge?).
1002
1003 2003-08-31  Simon Josefsson  <jas@extundo.com>
1004
1005         * timegm.h: New file.
1006         * timegm.c: New file.  Based on wget-1.8.2/src/http.c:mktime_from_utc.
1007
1008 2003-08-31  Karl Berry  <karl@gnu.org>
1009
1010         * argp.h: update from libc.
1011
1012 2003-08-28  Bruno Haible  <bruno@clisp.org>
1013
1014         * binary-io.h: Undefine O_BINARY before defining it. This avoids a
1015         warning on QNX, which defines O_BINARY to 000000.
1016
1017 2003-08-24  Bruno Haible  <bruno@clisp.org>
1018
1019         * binary-io.h: Include <stdio.h>, to avoid a compilation error when
1020         MSVC7 <stdio.h> is included later.
1021
1022 2003-08-20  Bruno Haible  <bruno@clisp.org>
1023
1024         * progname.h: New file, from GNU gettext.
1025         * progname.c: New file, from GNU gettext.
1026         * progreloc.c: New file, from GNU gettext.
1027
1028 2003-08-19  Bruno Haible  <bruno@clisp.org>
1029
1030         * xstrdup.c: Assume <string.h> exists.
1031
1032 2003-08-18  Jim Meyering  <jim@meyering.net>
1033
1034         * setenv.h: Indent nested cpp directive.
1035         * vasnprintf.c: Remove trailing blanks.
1036
1037 2003-08-17  Simon Josefsson  <jas@extundo.com>
1038             Bruno Haible  <bruno@clisp.org>
1039
1040         * xstrndup.h: New file.
1041         * xstrndup.c: New file.
1042
1043 2003-08-17  Bruno Haible  <bruno@clisp.org>
1044
1045         * strndup.h: New file.
1046
1047 2003-08-16  Paul Eggert  <eggert@twinsun.com>
1048
1049         * regex.h, strdup.c, strtoll.c, strtoul.c: Do not normalize white
1050         space, undoing this 2003-08-12 change:
1051         <http://mail.gnu.org/archive/html/bug-gnulib/2003-08/msg00080.html>
1052
1053 2003-08-16  Jim Meyering  <jim@meyering.net>
1054
1055         Merge from coreutils.
1056         * xstrtoimax.c: #else #if -> #elif.
1057         * xstrtoumax.c: Likewise.
1058
1059 2003-08-15  Paul Eggert  <eggert@twinsun.com>
1060
1061         * config.charset, ref-add.sin, ref-del.sin: Use three spaces,
1062         rather than tab, after '#' in shell-script copyright notices.
1063         Suggested by Bruno Haible.
1064
1065 2003-08-15  Jim Meyering  <jim@meyering.net>
1066         and Paul Eggert  <eggert@twinsun.com>
1067
1068         Merge from coreutils.
1069         * readutmp.h (HAVE_UTMPX_H): Undef if struct utmp has the ut_exit
1070         member but strut utmpx does not.  Needed for AIX 4.3.3.
1071         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
1072
1073 2003-08-15  Jim Meyering  <jim@meyering.net>
1074
1075         Merge from coreutils.
1076         * xgethostname.c: Include <stdlib.h>.
1077         (xghostname): Don't exit for anything other than memory-related
1078         failure; just return NULL.
1079         * userspec.c: Include "posixver.h".
1080         (parse_user_spec): Accept `.' as a separator only
1081         in pre-POSIX-200112 mode.
1082         * strtoimax.c: Use #elif rather than #else #if.
1083         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
1084         Remove function, now that we can rely on a working tzset function.
1085         [!_LIBC]: Ensure that the required autoconf test has been run.
1086         [!defined _NL_CURRENT && HAVE_STRFTIME]:
1087         Use underlying_strftime for %r.
1088         * sha.c: Merge in some clean-up and optimization changes from glibc.
1089         * sha.c (sha_stream) [BLOCKSIZE]: Move definition to top of file.
1090         Ensure that it is a multiple of 64.
1091         Rearrange loop exit tests so as to avoid performing an
1092         additional fread after encountering an error or EOF.
1093         * realloc.c: Update copyright date.
1094
1095 2003-08-14  Jim Meyering  <jim@meyering.net>
1096
1097         Merge from coreutils.
1098         * obstack.h: Whitespace changes.
1099         * mountlist.c: Remove anachronistic casts of xmalloc, xrealloc,
1100         and xcalloc return values.
1101         (read_filesystem_list) [MOUNTED_GETFSSTAT]:
1102         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
1103         hang on OSF/1 5.1 for DIR on both local and remote file systems.
1104         Reported by (and fix confirmed by) Nelson H. F. Beebe.
1105         (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
1106         error from mntctl.
1107         Use mntctl's return value to drive the entry-processing loop, since
1108         we can't rely on the value of the vmt_length member in the last
1109         entry.  On some systems doing so could result in exhausting
1110         virtual memory.  Based in part on a patch from Mike Jetzer.
1111
1112 2003-08-14  Jim Meyering  <jim@meyering.net>
1113         and Paul Eggert  <eggert@twinsun.com>
1114
1115         Merges from coreutils, plus other fixes.
1116         * physmem.c: Merge in portability changes from gcc/libiberty
1117         to support AIX, IRIX, Tru64, and Windows.  See the ChangeLog there
1118         for credits and details.  Thanks to Kaveh Ghazi for helping
1119         to keep these files in sync.
1120         (ARRAY_SIZE): Define it.
1121         (physmem_total, physmem_available): Add comments. From Kaveh Ghazi.
1122         * memcasecmp.c: Remove unnecessary parentheses after 'defined'.
1123         (memcasecmp): Don't assume size_t fits in unsigned int.
1124         Remove casts and duplicate code.
1125         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
1126         (memcpy): Remove definition.
1127         Merge in some clean-up and optimization changes from glibc.
1128         [BLOCKSIZE]: Move definition to top of file.
1129         Ensure that it is a multiple of 64.
1130         Rearrange loop exit tests so as to avoid performing an
1131         additional fread after encountering an error or EOF.
1132         * md5.h (md5_uintptr): Define.
1133         * makepath.c (CLEANUP_CWD): Report an error if we failed to
1134         return to the initial working directory.  Preserve errno
1135         for caller.
1136         * idcache.c: Include "xalloc.h".
1137         (xmalloc, xrealloc): Remove decls.
1138         (getuser): Remove casts no longer required in C89.
1139         * human.c: Include stdio.h, for sprintf.
1140         * group-member.c: Include "xalloc.h".
1141         (xmalloc, xrealloc): Remove decls.
1142         (get_group_info): Remove casts no longer required in C89.
1143         * getusershell.c (readname): Remove casts no longer required in C89.
1144         * gettimeofday.c (rpl_gmtime, rpl_tzset): New functions.
1145         * getline.c: Whitespace fix, from coreutils.
1146
1147 2003-08-13  Paul Eggert  <eggert@twinsun.com>
1148
1149         * exclude.c: Include <ctype.h>
1150         (IN_CTYPE_DOMAIN): New macro.
1151         (is_space): New fn.
1152         (add_exclude_file): If LINE_END is a space, ignore trailing spaces
1153         and empty lines.
1154
1155         * argp-help.c, argp-parse.c, config.charset, getopt.h:
1156         Undo previous (whitespace-only) change.
1157
1158 2003-08-12  Paul Eggert  <eggert@twinsun.com>
1159
1160         * argp-help.c, argp-parse.c, config.charset, getopt.h:
1161         Normalize leading white space and remove trailing white space.
1162         * ref-add.sin, ref-del.sin: Use '#' before empty line in copyright
1163         notice, as per ../config/srclist-update.
1164
1165         Merge from coreutils.
1166         * euidaccess.h: New file.
1167         * euidaccess.c: Include it.
1168         * .cppi-disable: Add printf-args.h, printf-parse.h, stdbool_.h,
1169         vasnprintf.h, vasprintf.h.  Remove strdup.c, gettext.h.
1170         * regex.h, strdup.c, strtoll.c, strtoul.c: Normalize white space.
1171
1172 2003-08-11  Bruno Haible  <bruno@clisp.org>
1173
1174         * vasnprintf.c (local_wcslen): New function, for Solaris 2.5.1.
1175         (vasnprintf): Use it instead of wcslen.
1176
1177 2003-08-11  Bruno Haible  <bruno@clisp.org>
1178
1179         * stdbool_.h (_Bool): Undo last change; instead use a negative enum
1180         value to ensure that _Bool promotes to int. Use #define for _Bool when
1181         using the Solaris C compiler. Adds comments suggested by Paul Eggert.
1182
1183 2003-08-10  Karl Berry  <karl@gnu.org>
1184
1185         * regex.h: update from libc (whitespace fix).
1186
1187 2003-08-09  Paul Eggert  <eggert@twinsun.com>
1188
1189         Merge some files from coreutils.  These changes were
1190         originally made by Jim Meyering.
1191         * lib/acl.c: Include <sys/types.h> before <sys/stat.h>;
1192         many older Unixes require this.
1193         * lib/alloca.c (alloca): Remove cast to argument of free;
1194         no longer needed in C89.
1195         * lib/alloca_.h, lib/regex.h: Fix white space to match
1196         what GNU indent does.
1197
1198 2003-08-05  Paul Eggert  <eggert@twinsun.com>
1199
1200         * bumpalloc.h: Remove.
1201
1202 2003-08-04  Paul Eggert  <eggert@twinsun.com>
1203
1204         * getloadavg.c: Change copyright notice and spacing to conform to
1205         GNU coding style.
1206
1207         Merge from coreutils.
1208         * error.c [!USE_IN_LIBIO]: Omit this case; assume USE_IN_LIBIO is 1.
1209         From glibc.
1210         * getdate.y (date): Also accept dates like May-23-2003; suggestion
1211         from Karl Berry, implemented by Jim Meyering.
1212         * getgroups.c: Include "xalloc.h" instead of declaring xalloc fns;
1213         from Dmitry V. Levin.
1214         Remove anachronistic cast of xrealloc.
1215         * fnmatch_.h (__const): Remove.  Use 'const'.
1216         * fnmatch_loop.c (NEW_PATTERN): Cast alloca return value to proper
1217         type. Otherwise, it wouldn't compile with at least /bin/cc on
1218         ymp-cray-unicos9.0.2.X.
1219         Combine two mostly-identical uses of alloca into one.
1220         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
1221
1222 2003-08-04  Dave Love <d.love@dl.ac.uk>
1223
1224         [From Emacs.]
1225
1226         * getloadavg.c: Check `__unix' as well as `unix'.  Use #ifdef, not
1227         #if.  Check HAVE_LIBKSTAT as well as LOAD_AVE_TYPE.  Check
1228         F_SETFD, not FD_SETFD.  Use HAVE_STRUCT_NLIST_N_UN_N_NAME, not
1229         obsolete NLIST_NAME_UNION.
1230         [__GNU__]: Undef BSD and FSCALE.
1231         [!NLIST_STRUCT]: Remove conditional definition of NLIST_STRUCT.
1232
1233 2003-08-03  Paul Eggert  <eggert@twinsun.com>
1234
1235         * stdbool_.h (_Bool): Make it signed char, instead of
1236         an enum type, so that it's guaranteed to promote to int.  See:
1237         <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00124.html>
1238
1239 2003-07-31  Paul Eggert  <eggert@twinsun.com>
1240
1241         * strerror.c: Include config.h, limits.h.  Declare sprintf.
1242         (strerror): Don't assume that a printable int fits in 14 bytes.
1243
1244 2003-07-24  Derek Robert Price  <derek@ximbiot.com>
1245             Bruno Haible  <bruno@clisp.org>
1246
1247         * getline.h (getline, getdelim): Change return type to ssize_t.
1248         * getline.c (getline, getdelim): Likewise.
1249         Remove _GNU_SOURCE define; now it's defined in config.h through
1250         m4/getline.m4.
1251
1252 2003-07-22  Paul Eggert  <eggert@twinsun.com>
1253
1254         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
1255         over-parenthesization in macros.
1256
1257         Sync with coreutils.
1258
1259         * xalloc.h (XMALLOC, XCALLOC, XREALLOC): Remove casts not
1260         required by C99.
1261
1262         Use `exit_failure' for xalloc and xmemcoll instead of their own
1263         private exit-failure variables.
1264         * xalloc.h (xalloc_exit_failure): Remove.
1265         * xmalloc.c: Likewise.  Include exitfail.h.
1266         (xalloc_die): Use exit_failure instead of xalloc_exit_failure.
1267         * xmemcoll.h (xmemcoll_exit_failure): Remove.
1268         * xmemcoll.c: Likewise.  Include exitfail.h.
1269         (xmemcoll): Use exit_failure instead of xalloc_exit_failure.
1270
1271 2003-07-18  Paul Eggert  <eggert@twinsun.com>
1272
1273         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
1274         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
1275         to test that it can stand by itself.  Include "exitfail.h".
1276         Clients should set exit_failure instead.
1277         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
1278
1279 2003-07-18  Andreas Schwab  <schwab@suse.de>
1280
1281         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
1282
1283 2003-07-18  Bruno Haible  <bruno@clisp.org>
1284
1285         * getndelim2.h: New file.
1286         * getndelim2.c: Make into a module of its own. Include config.h,
1287         getndelim2.h.
1288         (getndelim2): Make non-static. Change return type to ssize_t.
1289         * getline.h: Change argument names.
1290         * getline.c: Include getndelim2.h instead of getndelim2.c.
1291         * getnline.c: Include getndelim2.h.
1292
1293 2003-07-17  Bruno Haible  <bruno@clisp.org>
1294
1295         * Makefile.am: Remove file.
1296         * Makefile.in: Remove file.
1297
1298 2003-07-17  Bruno Haible  <bruno@clisp.org>
1299
1300         * getnline.h: New file.
1301         * getnline.c: New file.
1302         * getndelim2.c: New file, extracted from getline.c.
1303         (getndelim2): Renamed from getdelim2, with added nmax argument.
1304         * getline.c: Include getndelim2.c.
1305         (getdelim2): Moved out to getndelim2.c.
1306         (getline, getdelim): Update.
1307
1308 2003-07-15    <karl@gnu.org>
1309
1310         * vasnprintf.c: update from gettext.
1311
1312 2003-07-15  Jim Meyering  <jim@meyering.net>
1313
1314         * makepath.c (make_path): Enclose diagnostic in _(...).
1315
1316 2003-07-14  Paul Eggert  <eggert@twinsun.com>
1317
1318         * asnprintf.c, asprintf.c, config.charset, gettext.h,
1319         localcharset.c, localcharset.h, mkdtemp.c, printf-args.c,
1320         printf-args.h, printf-parse.c, printf-parse.h, ref-add.sin,
1321         ref-del.sin, setenv.c, unsetenv.c, vasnprintf.c, vasnprintf.h,
1322         vasprintf.c, vasprintf.h: Regenerate.  These files are now being
1323         updated automatically by ../config/srclist-update.  This changes
1324         their license from LPGL to GPL.
1325
1326 2003-07-14  Jim Meyering  <jim@meyering.net>
1327
1328         Don't emit diagnostics.  Let callers do that.
1329         * save-cwd.c: Don't include "error.h".
1330         (save_cwd): Don't call error.  Ensure that errno is valid
1331         when returning nonzero.
1332
1333         * save-cwd.h (restore_cwd): Update prototype.
1334         * save-cwd.c (restore_cwd): Remove two parameters.
1335         Simplify.  Don't call error upon failure.  Let callers do that.
1336         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
1337         when auditing is enabled.  But don't bother updating the #if.
1338
1339 2003-07-14  Simon Josefsson  <jas@extundo.com>
1340
1341         * mempcpy.h: New file.
1342         * mempcpy.c: New file.
1343
1344 2003-07-14  Paul Eggert  <eggert@twinsun.com>
1345
1346         * ceill.c, expl.c, floorl.c, frexpl.c, ldexpl.c, mathl.h,
1347         sincosl.c, sqrtl.c, trigl.c, trigl.h, poll.c, poll_.h, mkstemp.c,
1348         unicodeio.c, unicodeio.h, unlocked-io.h:
1349         Switch from LGPL to GPL.
1350
1351 2003-07-11  Alexandre Duret-Lutz  <adl@gnu.org>
1352
1353         * obstack.h (__INT_TO_PTR): Revert change of 2003-03-13;
1354         it breaks C++ compilation.
1355         [!__GNUC__ || !__STDC__] (obstack_finish): Cast result to void*.
1356
1357 2003-07-10  Jim Meyering  <jim@meyering.net>
1358
1359         * vasnprintf.c: Remove trailing blanks.
1360         Make cpp indentation consistent.
1361
1362 2003-07-09  Paul Eggert  <eggert@twinsun.com>
1363
1364         * alloca_.h, euidaccess.c, getpass.c, memrchr.c, obstack.h,
1365         posixver.c, strftime.c, strnlen.c, strverscmp.c:
1366         Switch from LGPL to GPL.
1367
1368 2003-07-07  Paul Eggert  <eggert@twinsun.com>
1369
1370         * mktime.c: Fix some boundary cases and remove need for floating point.
1371
1372         Issue a compile-time diagnostic if time_t is floating point, or if
1373         two's complement arithmetic is not in effect, or if arithmetic
1374         right shift does not propagate the sign.  These assumptions were
1375         all in the original code but they weren't checked.
1376
1377         (TIME_T_MIDPOINT, verify): New macros.
1378         (__isleap): Remove; it has integer overflow problems.
1379         (leapyear): New function, without those problems.
1380         (ydhms_tm_diff): Remove; splitting into two parts.
1381         (ydhms_diff): New function, containing the arithmetic part of
1382         the old ydhms_tm_diff function.  Issue a compile-time
1383         diagnostic if we are not using C99 integer division.
1384         Avoid casts when possible.
1385         (guess_time_tm): New function, containing the checking part of
1386         the old ydhms_tm_diff function.  Return the new value, rather than
1387         the difference between it and the old.  Accept a new argument T
1388         so that *T specifies the old value.  Check for overflow in the result.
1389
1390         (__mktime_internal): Use a time_t offset, not a long int offset.
1391         This undoes the 2003-06-04 change, which is no longer needed now
1392         that we have better overflow checking.
1393         (localtime_offset): Likewise.
1394
1395         (__mktime_internal): Avoid harmful overflow on hosts where time_t
1396         and long are 64-bit but int is only 32-bit.
1397         (ydhms_diff): Use long int to store year1 and yday1.
1398         Issue a compile-time diagnostic if long int is not wide enough.
1399
1400         (__mktime_internal): Use long int to store adjusted year and yday.
1401         Use plain C rather than preprocessor commands, if that doesn't
1402         affect efficiency.
1403         Check for overflow (and try to repair) after each probe
1404         rather than checking only at the very end.  This avoids some bugs
1405         (e.g., southern hemisphere, behind GMT, and GMT offset at minimum time
1406         does not equal GMT offset at maximum time).
1407         Use integer to check for overflow rather than floating point; this
1408         is more portable to non-IEEE hosts, and is a tad faster.
1409         When we detect that we are oscillating between two values,
1410         don't check whether tm_isdst has the requested value, since
1411         we already know the answer.  When tm_isdst has the wrong value,
1412         use a different heuristic to find the right one, based on the
1413         extreme values actually observed in practice in tz2003a,
1414         rather than the (overly optimistic) "previous 3 calendar quarters".
1415
1416         (not_equal_tm, print_tm, check_result): Use "const T" rather than
1417         "T const" to accommodate glibc style.
1418         (check_result): Use less-confusing report format.  "long" -> "long int.
1419         (main): Likewise.
1420         Don't loop if the iteration overflows time_t.
1421         Allow a negative step in the iteration.
1422
1423 2003-07-01  Paul Eggert  <eggert@twinsun.com>
1424
1425         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
1426         having it depend on HAVE_SYS_TYPES_H.
1427
1428 2003-06-25  Bruno Haible  <bruno@clisp.org>
1429
1430         * readlink.c: New file.
1431
1432 2003-06-20  Bruno Haible  <bruno@clisp.org>
1433
1434         Assume C89, so PARAMS isn't needed.
1435         * unicodeio.h (PARAMS): Remove.
1436         * unicodeio.c: Don't use PARAMS.
1437
1438 2003-06-18  Jim Meyering  <jim@meyering.net>
1439
1440         Merge changes from coreutils.
1441         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
1442         Remove explicit declarations of xmalloc and realloc.
1443         Include xalloc.h.
1444         (read_utmp): Remove anachronistic cast of xmalloc.
1445
1446 2003-06-17  Paul Eggert  <eggert@twinsun.com>
1447
1448         Assume C89, so PARAMS isn't needed.
1449         * backupfile.h (PARAMS): Remove.  All uses removed.
1450         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
1451         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
1452         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
1453         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
1454         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
1455         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
1456         xstrtol.h: Likewise.
1457         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h,
1458         same.h, strverscmp.h: Do not include config.h; no longer needed.
1459         Anyway, config.h should always be included before any other file.
1460
1461 2003-06-11  Simon Josefsson  <jas@extundo.com>
1462
1463         * sysexit_.h: New file.
1464
1465 2003-05-20  Derek Price  <derek@ximbiot.com>
1466
1467         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
1468
1469 2003-06-10  Simon Josefsson  <jas@extundo.com>
1470
1471         * strchrnul.h: New file.
1472         * strchrnul.c: New file.
1473
1474 2003-06-10  Simon Josefsson <jas@extundo.com>
1475
1476         * argp.h: New file, from glibc.
1477         * argp-ba.c: New file, from glibc.
1478         * argp-eexst.c: New file, from glibc.
1479         * argp-fmtstream.c: New file, from glibc.
1480         * argp-fmtstream.h: New file, from glibc.
1481         * argp-fs-xinl.c: New file, from glibc.
1482         * argp-help.c: New file, from glibc.
1483         * argp-namefrob.h: New file, from glibc.
1484         * argp-parse.c: New file, from glibc.
1485         * argp-pv.c: New file, from glibc.
1486         * argp-pvh.c: New file, from glibc.
1487         * argp-xinl.c: New file, from glibc.
1488
1489 2003-06-07  Jim Meyering  <jim@meyering.net>
1490
1491         * readtokens.h: Put `Free Software Foundation, Inc.'
1492         in place of my name in the copyright comment.
1493         Remove definition and uses of __P.
1494
1495         From coreutils.
1496         * stat.c: Don't declare xmalloc explicitly.
1497         Instead, include "xalloc.h".
1498         * readtokens.c (readtokens): Remove anachronistic casts of xmalloc,
1499         xrealloc, and xcalloc return values.
1500         * xgetcwd.c (xgetcwd): Include "xgetcwd.h".
1501         Improve comment.
1502         * xgetcwd.h: Remove definition/uses of PARAMS.
1503
1504 2003-06-06  Jim Meyering  <jim@meyering.net>
1505
1506         * stdbool_.h: Renamed from stdbool.h.in.
1507
1508 2003-06-06  Jim Meyering  <jim@meyering.net>
1509
1510         Merge from coreutils.
1511         * same.c: (same_name): Declare *_basename locals to be `const'.
1512         Consolidate declarations and initializations of *_base* locals.
1513
1514         Merge from coreutils.
1515         This avoids a core dump on systems without GNU putenv,
1516         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
1517         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
1518         (unsetenv): New static function, from GNU libc.
1519         (rpl_putenv): Use it.
1520
1521         * modechange.c: Remove trailing blanks.
1522
1523         Merge from coreutils.
1524         * fsusage.c: Remove declaration of statfs.
1525         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
1526
1527         * posixtm.c: Include <stdbool.h> unconditionally.
1528
1529 2003-06-05  Paul Eggert  <eggert@twinsun.com>
1530
1531         * mktime.c (__mktime_internal): When resolving a tm_isdst
1532         mismatch, look in future quarters as well as past.  This fixes a
1533         bug when processing fall-backwards gaps immediately after a long
1534         period of daylight-saving time.
1535
1536         * mktime.c: Assume freestanding C89 or better.
1537         (HAVE_LIMITS_H): Remove.  Assume it's 1.
1538         (__P): Remove; not used.
1539         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
1540         (mktime, not_equal_tm, print_tm, check_result,
1541         main): Use prototypes.  Use const * where appropriate.
1542         (main): Fix typo in testing code that uncovered by above changes.
1543         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
1544
1545 2003-06-04  Paul Eggert  <eggert@twinsun.com>
1546
1547         * mktime.c: Fix Debian bug 177940
1548         <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=177940>.
1549         (localtime_offset): Now long int, not time_t, because we want it
1550         to be guaranteed to be signed.  All uses changed.
1551         (__mktime_internal): If overflow would occur when adding offset,
1552         don't add it.
1553
1554         Merge 'human' changes from coreutils.  Rewrite to support
1555         locale-specific notations like thousands separators.
1556         * human.c: Simplify authorship notice.
1557         Include human.h immediately after config.h.
1558         <sys/types.h>, <stdio.h>: Do not include; no longer needed.
1559         <limits.h>: Do not include, since human.h does.
1560         (SIZE_MAX, UINTMAX_MAX): New macros.
1561         <strings.h>: Include if HAVE_STRINGS_H, not if !HAVE_STRING_H.
1562         <locale.h>: Include if HAVE_LOCALE_H and HAVE_LOCALECONV.
1563         (HUMAN_READABLE_SUFFIX_LENGTH_MAX): New macro.
1564         (power_letter): Renamed from suffixes.
1565         (generate_suffix_backwards): Remove.
1566         (adjust_value): Now takes int style (because of human.h changes)
1567         and long double value (for greater precision on some platforms).
1568         (group_number): New function.
1569         (human_readable): Use it.  Use integer options, not enum.
1570         Put the options before the sizes in the arg list.
1571         Support all the new options.
1572         The old human_readable function has been removed;
1573         use inttostr.h instead.
1574         (human_readable, default_block_size, humblock):
1575         Use uintmax_t, not int, for block sizes.
1576         (human_readable_inexact, block_size_types): Remove.
1577         (block_size_opts): New constant.
1578         (human_options): Renamed from human_block_size, with new signature
1579         that allows block sizes up to UINTMAX_MAX.  All callers changed.
1580         * human.h: Add copyright and authorship notice.
1581         Include <limits.h> and <stdbool.h> unconditionally.
1582         (PARAMS): Remove.  All uses removed.
1583         (LONGEST_HUMAN_READABLE): Add support for thousands separator.
1584         (enum human_inexact_style): Remove tag; now a nameless enum.
1585         (human_floor, human_ceiling, human_round_to_even): Now have
1586         values 2, 0, 1 rather than -1, 1, 0.
1587         (human_group_digits, human_suppress_point_zero, human_autoscale,
1588         human_base_1024, human_SI, human_B): New constants.
1589         (human_readable_inexact, human_block_size): Remove.
1590         (human_readable): Size args are now uintmax_t, not int.
1591         (human_options): New decl.
1592
1593         * exclude.c: (new_exclude, add_exclude): Remove casts that are
1594         unnecessary now that we assume C89 or better.  This change
1595         imported from coreutils.
1596
1597         * mktime.c (__mktime_internal): Do not reject negative timestamps
1598         arbitrarily.  This is the same patch as 2003-05-28, but it got lost
1599         in the 2003-05-30 sync from glibc.
1600
1601         .h files should stand alone, but we shouldn't include <sys/types.h>
1602         if we can get away with just <stddef.h>.
1603
1604         * __fpending.h, addext.c, backupfile.c, exclude.c, getline.c,
1605         malloc.c, putenv.c, realloc.c, strcasecmp.c: Include <stddef.h>
1606         rather than <sys/types.h>, as we merely need size_t.
1607         * dirname.h, memcoll.h, xalloc.h, xmemcoll.h: Include <stddef.h>,
1608         to get size_t.
1609         * hash.h, linebuffer.h, readtokens.h, stdio-safer.h, version-etc.h:
1610         Include <stdio.h>, to get FILE.
1611         * memcasecmp.c: Don't include <sys/types.h>, as we can assume
1612         memcasecmp.h has included <stddef.h> and all we need is size_t.
1613         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
1614         our interface, instead of including <sys/types.h>
1615
1616 2003-06-02  Paul Eggert  <eggert@twinsun.com>
1617
1618         [from coreutils]
1619         Fix some minor time-related bugs with POSIX time arguments.
1620         Some valid time stamps were being rejected (notably -1, and
1621         time stamps before 1900 on 64-bit hosts).  And some invalid
1622         time stamps were being accepted, e.g. September 31.
1623
1624         * posixtm.h (posixtime): Return bool instead of time_t, so
1625         that we can return (time_t) -1 successfully.
1626         * posixtm.c: Likewise.
1627         [HAVE_STDBOOL_H]: Include <stdbool.h>.
1628         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
1629         (t): Remove static var.
1630         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
1631         of static var.  All uses changed.
1632         (year): Do not reject years before 1900; they can occur with
1633         64-bit time_t.
1634         (posix_time_parse): Do not check for out-of-range components;
1635         that is now the caller's responsibility, since our checks were
1636         only approximations.
1637         (posixtime): Use mktime to check for out-of-range components,
1638         since it knows them exactly.
1639         If mktime returns (time_t) -1, check whether an error actually occurred
1640         by invoking localtime on -1.
1641         (main) [TEST_POSIXTIME]: Check for input data errors, and report
1642         posixtime failures better.
1643         Improve the test data (in comments only).
1644
1645 2003-05-30    <karl@gnu.org>
1646
1647         * mktime.c: update from libc.
1648
1649 2003-05-30  Bruno Haible  <bruno@clisp.org>
1650
1651         * config.charset: Upgrade to gettext-0.12.1 and libiconv-1.9.1.
1652         * localcharset.h: Likewise.
1653         * localcharset.c: Likewise.
1654
1655 2003-05-28  Paul Eggert  <eggert@twinsun.com>
1656
1657         Assume the headers required for C89 freestanding compilers.
1658         * addext.c, backupfile.c, fsusage.c, human.c, pathmax.h,
1659         rpmatch.c, userspec.c, xreadlink.c, xstrtol.c: Include <limits.h>
1660         without checking for HAVE_LIMITS_H.
1661         * backupfile.c, fsusage.c, hash.c, human.c, safe-read.c, userspec.c,
1662         xstrtol.c (CHAR_BIT) : Don't define, since <limits.h> is guaranteed
1663         to do that.
1664         * fatal.c: Include <stdarg.h> without checking for __STDC__.
1665         * exclude.c: Include <stdbool.h> unconditionally.
1666         * tempname.c: Include <stddef.h> unconditionally.
1667         * hash.c: Include <limits.h>, since we no longer define CHAR_BIT.
1668         * modechange.c, rpmatch.c (NULL): Don't define, since
1669         <stddef.h> does that.
1670         * quote.c: Dont include <stddef.h> or <sys/types.h>; not needed.
1671         * safe-read.c (INT_MAX): Don't define, since <limits.h> does that.
1672         * safe-read.c (TYPE_MINIMUM, TYPE_MAXIMUM): Remove; no longer needed.
1673         * xstrtol.c: Likewise.
1674         * safe-read.c: Remove TYPE_SIGNED; no longer needed.
1675         * savedir.c: Include <stddef.h> instead of defining NULL.
1676
1677         * addext.c (addext): Use assignment rather than cast, to avoid
1678         warnings on some platforms.
1679
1680         * mktime.c (__mktime_internal): Do not reject negative timestamps
1681         arbitrarily.
1682
1683 2003-05-10  Bruno Haible  <bruno@clisp.org>
1684
1685         * linebreak.c (iconv_string_length): Don't return -1 just because the
1686         string is longer than 4 KB.
1687
1688 2003-05-12  Jim Meyering  <jim@meyering.net>
1689
1690         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
1691         the space-padded-by-default conversion specifiers, %e, %k, %l.
1692
1693 2003-05-03  Bruno Haible  <bruno@clisp.org>
1694
1695         Upgrade to Unicode-4.0.
1696         * linebreak.c (nonspacing_table_data): Change width of U+00AD,
1697         U+0350..U+0357, U+035D..U+035F, U+0600..U+0603, U+0610..U+0615,
1698         U+0656..U+0658, U+0A01, U+0AE2..U+0AE3, U+0CBC, U+17B4..U+17B5,
1699         U+17DD, U+1920..U+1922, U+1927..U+192B, U+1932, U+1939..U+193B
1700         from 1 to 0. Change width of U+0CBF, U+0CC6, U+180E from 0 to 1.
1701         (uc_width): Change width of U+4DC0..U+4DFF from 2 to 1. Change width
1702         of U+2A6D7..U+2F7FF, U+2FA1E..U+2FFFD, U+30000..U+3FFFD from 1 to 2.
1703         Change width of U+E0100..U+E01EF from 1 to 0.
1704
1705 2003-04-25  Bruno Haible  <bruno@clisp.org>
1706
1707         * copy-file.c: Include <stddef.h>, for size_t.
1708
1709 2003-04-25  Jim Meyering  <jim@meyering.net>
1710
1711         * copy-file.c (copy_file_preserving): Declare buf_size to be
1712         of type size_t, not int.
1713
1714 2003-04-11  Jim Meyering  <jim@meyering.net>
1715
1716         Merge changes from Coreutils.
1717
1718         2003-03-22  Jim Meyering  <jim@meyering.net>
1719
1720         * strftime.c (widen): Cast alloca return value to proper type.
1721
1722         2003-01-19  Ulrich Drepper  <drepper@redhat.com>
1723
1724         From GNU libc.
1725         * strftime.c (my_strftime): Handle very large width
1726         specifications for numeric values correctly.  Improve checks for
1727         overflow.
1728
1729         2003-01-19  Jim Meyering  <jim@meyering.net>
1730
1731         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
1732         (nl_get_alt_digit) [! defined my_strftime]: Define.
1733         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
1734         _nl_get_alt_digit and _nl_get_walt_digit.
1735
1736         * strftime.c (my_strftime): Merge in locale-related changes from libc.
1737         These changes have no effect outside of _LIBC.
1738
1739 2003-04-10  Bruno Haible  <bruno@clisp.org>
1740
1741         * findprog.h: New file, from GNU gettext.
1742         * findprog.c: New file, from GNU gettext.
1743
1744 2003-04-05  Jim Meyering  <jim@meyering.net>
1745
1746         Merge changes from Coreutils.
1747
1748         * exclude.h (PARAMS): Remove definition and uses.
1749         * exclude.c: Remove uses of `PARAMS'.
1750
1751         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
1752         Add test-cases for DOS filenames. Declare program_name.
1753         (main): Set up program_name.  Patch by Rich Dawe.
1754
1755         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
1756         error from mntctl.
1757         Use mntctl's return value to drive the entry-processing loop, since
1758         we can't rely on the value of the vmt_length member in the last
1759         entry.  On some systems doing so could result in exhausting
1760         virtual memory.  Based in part on a patch from Mike Jetzer.
1761
1762 2003-04-04  Bruno Haible  <bruno@clisp.org>
1763
1764         * linebreak.h: New file, from GNU gettext.
1765         * linebreak.c: New file, from GNU gettext with slight modifications.
1766         * lbrkprop.h: New file, from GNU gettext.
1767
1768 2003-04-03  Bruno Haible  <bruno@clisp.org>
1769
1770         * utf8-ucs4.h: New file, from GNU gettext.
1771         * utf16-ucs4.h: New file, from GNU gettext.
1772         * ucs4-utf8.h: New file, from GNU gettext.
1773         * ucs4-utf16.h: New file, from GNU gettext.
1774
1775 2003-04-02  Bruno Haible  <bruno@clisp.org>
1776
1777         * binary-io.h: New file, from GNU gettext.
1778
1779 2003-04-01  Bruno Haible  <bruno@clisp.org>
1780
1781         * pathname.h: New file, from GNU gettext.
1782         * concatpath.c: New file, from GNU gettext.
1783
1784 2003-03-30  Bruno Haible  <bruno@clisp.org>
1785
1786         * copy-file.c (copy_file_preserving): Don't set owner if the function
1787         chown() doesn't exist.
1788
1789 2003-03-28  Bruno Haible  <bruno@clisp.org>
1790
1791         * copy-file.h: New file, from GNU gettext.
1792         * copy-file.c: New file, from GNU gettext.
1793
1794 2003-03-18  Jim Meyering  <jim@meyering.net>
1795
1796         * quote.c (quote_n): Fix typo in comment.
1797
1798 2003-03-14  Jim Meyering  <jim@meyering.net>
1799
1800         Merge changes from Coreutils.
1801         * obstack.h (obstack_object_size): Declare temporary, __o,
1802         to be const, in order to avoid warnings.
1803         (obstack_room): Likewise.
1804         (obstack_empty_p): Likewise.
1805
1806 2003-03-13  Paul Eggert  <eggert@twinsun.com>
1807
1808         Merge changes from Bison.
1809         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
1810         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
1811         when compiling Bison 1.875's `bitset bset = obstack_alloc
1812         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
1813         * hash.c: Include <stdbool.h> unconditionally.
1814
1815 2003-03-09  Paul Eggert  <eggert@twinsun.com>
1816
1817         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
1818         Reported by Bruce Becker; see:
1819         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
1820
1821 2003-03-03  Paul Eggert  <eggert@twinsun.com>
1822             Bruno Haible  <bruno@clisp.org>
1823
1824         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
1825         Reported by John Hughes, see
1826         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
1827
1828 2003-02-19  Paolo Bonzino  <bonzini@gnu.org>
1829
1830         * poll_.h: New file.
1831         * poll.c: New file.
1832
1833 2003-02-18  Paolo Bonzino  <bonzini@gnu.org>
1834
1835         * mathl.h: New file.
1836         * acosl.c: New file.
1837         * asinl.c: New file.
1838         * atanl.c: New file.
1839         * ceill.c: New file.
1840         * cosl.c: New file.
1841         * expl.c: New file.
1842         * floorl.c: New file.
1843         * frexpl.c: New file.
1844         * ldexpl.c: New file.
1845         * logl.c: New file.
1846         * sincosl.c: New file.
1847         * sinl.c: New file.
1848         * sqrtl.c: New file.
1849         * tanl.c: New file.
1850         * trigl.c: New file.
1851         * trigl.h: New file.
1852
1853 2003-02-17  Bruno Haible  <bruno@clisp.org>
1854
1855         * mkdtemp.h: New file, from GNU gettext.
1856         * mkdtemp.c: New file, from GNU gettext.
1857
1858 2003-01-31  Bruno Haible  <bruno@clisp.org>
1859
1860         * rename.c: #undef rename before defining rpl_rename.
1861         * strnlen.c: #undef strnlen, define rpl_strnlen instead of strnlen.
1862
1863 2003-01-30  Bruno Haible  <bruno@clisp.org>
1864
1865         * printf-args.h: New file, from GNU gettext.
1866         * printf-args.c: New file, from GNU gettext.
1867         * printf-parse.h: New file, from GNU gettext.
1868         * printf-parse.c: New file, from GNU gettext.
1869         * vasnprintf.h: New file, from GNU gettext.
1870         * vasnprintf.c: New file, from GNU gettext.
1871         * asnprintf.c: New file, from GNU gettext.
1872         * vasprintf.h: New file, from GNU gettext with modifications.
1873         * vasprintf.c: New file, from GNU gettext.
1874         * asprintf.c: New file, from GNU gettext.
1875
1876 2003-01-29  Bruno Haible  <bruno@clisp.org>
1877
1878         * stpncpy.h: New file, from GNU gettext with modifications.
1879         * stpncpy.c: New file, from GNU gettext with modifications.
1880
1881 2003-01-28  Bruno Haible  <bruno@clisp.org>
1882
1883         * c-ctype.h: New file, from GNU gettext, with changes suggested by
1884         Paul Eggert.
1885         * c-ctype.c: New file, from GNU gettext, with changes suggested by
1886         Paul Eggert.
1887
1888 2003-01-27  Bruno Haible  <bruno@clisp.org>
1889
1890         * xsetenv.h: New file, from GNU gettext.
1891         * xsetenv.c: New file, from GNU gettext.
1892
1893 2003-01-23  Bruno Haible  <bruno@clisp.org>
1894
1895         * minmax.h: New file, from GNU gettext, with comments from Paul Eggert.
1896
1897 2003-01-22  Bruno Haible  <bruno@clisp.org>
1898
1899         * exit.h: New file, from GNU gettext.
1900
1901 2003-01-11  Bruno Haible  <bruno@clisp.org>
1902
1903         * stpcpy.h (stpcpy): Use ANSI C function declarations.
1904         * strcase.h (strcasecmp, strncasecmp): Likewise.
1905
1906 2003-01-14  Jim Meyering  <jim@meyering.net>
1907
1908         * same.c (same_name): Tweak a comment.
1909
1910 2003-01-11  Bruno Haible  <bruno@clisp.org>
1911
1912         * same.c (same_name): Reorder tests so as to avoid calling stat()
1913         when a string comparison is sufficient.
1914
1915 2003-01-11  Bruno Haible  <bruno@clisp.org>
1916
1917         * readtokens.c (readtoken): Cast character to 'unsigned char', not
1918         'unsigned int'.
1919
1920 2003-01-11  Bruno Haible  <bruno@clisp.org>
1921
1922         * hash-pjw.c: Add comment about low quality of this function.
1923
1924 2003-01-12  Paul Eggert  <eggert@twinsun.com>
1925
1926         Finish renaming getstr -> getdelim2 and readline -> readlinebuffer,
1927         to avoid collisions with libcurses and libreadline.
1928
1929         * Makefile.am (libfetish_a_SOURCES): Remove getstr.c, getstr.h.
1930         * getstr.h, getstr.c: Remove.
1931         * getline.c: Include "getline.h", to check interface.
1932         Move body of old getstr.c here: this defines MIN_CHUNK and
1933         declares getdelim2, which is renamed from getstr.
1934         (getline, getdelim): Adjust to renaming of getstr -> getdelim2.
1935
1936         * linebuffer.c (readlinebuffer): Renamed from readline.
1937         All uses changed.
1938         * linebuffer.h: Likewise.
1939         (readline): Remove backward-compatibility macro.
1940
1941 2003-01-12  Jim Meyering  <jim@meyering.net>
1942
1943         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
1944
1945 2003-01-10  Bruno Haible  <bruno@clisp.org>
1946
1947         * alloca_.h: New file.
1948         * getdate.y: Unconditionally include alloca.h.
1949         * makepath.c: Likewise.
1950         * setenv.c: Likewise.
1951         * userspec.c: Likewise.
1952
1953 2003-01-09  Bruno Haible  <bruno@clisp.org>
1954
1955         * stdbool.h.in: New file.
1956
1957 2003-01-08  Bruno Haible  <bruno@clisp.org>
1958
1959         * safe-read.c: Include specification header first, to ensure its
1960         selfcontainedness.
1961         * full-write.c: Likewise.
1962
1963 2003-01-08  Jim Meyering  <jim@meyering.net>
1964
1965         * full-write.c: Undefine and define-away `const' after inclusion
1966         of errno.h, not before.  Suggestion from Bruno Haible.
1967
1968 2003-01-07  Jim Meyering  <jim@meyering.net>
1969
1970         * full-write.c: Rework so that it may serve to define full_read, too.
1971         * full-read.c: Simply #define FULL_READ and include full-write.c.
1972
1973 2003-01-06  Jim Meyering  <jim@meyering.net>
1974
1975         * version-etc.c: Update year in translatable copyright string.
1976
1977 2002-12-25  Bruno Haible  <bruno@clisp.org>
1978
1979         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
1980         * xstrtol.h: Likewise.
1981         * xstrtoimax.c: Likewise.
1982         * xstrtoumax.c: Likewise.
1983         * human.h: Likewise.
1984
1985         * tempname.c: Include <inttypes.h> too. Avoids a compilation error
1986         on systems that have <inttypes.h> but not <stdint.h>.
1987
1988 2002-12-31  Paul Eggert  <eggert@twinsun.com>
1989
1990         * memcoll.c (memcoll): Fall back on a simple algorithm using
1991         memcmp if strcoll doesn't work.
1992
1993 2002-12-23  Bruno Haible  <bruno@clisp.org>
1994
1995         * localcharset.h: New file.
1996         * localcharset.c: Include it.
1997         * unicodeio.c: Likewise.
1998
1999 2002-12-22  Bruno Haible  <bruno@clisp.org>
2000
2001         * utime.c (utime_null): No need to call ftruncate if the file was
2002         nonempty.
2003
2004 2002-12-23  Bruno Haible  <bruno@clisp.org>
2005
2006         * memcoll.c (STRCOLL): New macro.
2007         (memcoll): Use it.
2008
2009 2002-12-22  Bruno Haible  <bruno@clisp.org>
2010
2011         * getstr.h (getstr): Define, to avoid clash with libcurses.
2012         * linebuffer.h (readline): Define, to avoid clash with libreadline.
2013
2014 2002-12-22  Bruno Haible  <bruno@clisp.org>
2015
2016         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
2017
2018 2002-12-23  Bruno Haible  <bruno@clisp.org>
2019
2020         * getline.h: Include <stddef.h>, for size_t.
2021
2022         * unicodeio.h: Include <stddef.h>, for size_t.
2023         * unicodeio.c: Don't include <stddef.h>.
2024
2025 2002-12-17  Bruno Haible  <bruno@clisp.org>
2026
2027         * canon-host.c (strdup): Remove unused declaration.
2028
2029         * fsusage.c: Include full_read.h.
2030         (get_fs_usage): Use full_read instead of safe_read.
2031
2032         * utime.c (utime_null): Use SAFE_READ_ERROR.
2033
2034 2002-12-11  Bruno Haible  <bruno@clisp.org>
2035
2036         * setenv.h: Rewritten to cope with systems that have setenv() but not
2037         unsetenv().
2038         * setenv.c, unsetenv.c: Taken from glibc-2.2.4 with the following
2039         modifications:
2040
2041         2002-12-11  Bruno Haible  <bruno@clisp.org>
2042
2043                 * setenv.c (alloca): Fall back to malloc.
2044                 (freea): New macro.
2045                 (setenv): Use freea() to free memory allocated with alloca().
2046
2047         2002-11-13  Bruno Haible  <bruno@clisp.org>
2048
2049                 * setenv.c (compar_fn_t, __add_to_environ, setenv): Use ANSI C
2050                 function declarations.
2051                 * unsetenv.c (unsetenv): Likewise.
2052
2053         2002-03-04  Bruno Haible  <bruno@clisp.org>
2054
2055                 Portability to AIX 4.3.3.
2056                 * unsetenv.c: New file, extracted from setenv.c.
2057                 * setenv.c: Move the unsetenv() function to unsetenv.c.
2058
2059         2001-12-20  Bruno Haible  <bruno@clisp.org>
2060
2061                 * setenv.c (__add_to_environ): Don't call realloc(NULL,...),
2062                 use malloc instead. For SunOS 4.
2063
2064         2001-12-11  Bruno Haible  <bruno@clisp.org>
2065
2066                 * setenv.c: Declare alloca.
2067                 (compar_fn_t): New typedef.
2068                 (KNOWN_VALUE, STORE_VALUE): Use it.
2069
2070         * Makefile.am (libfetish_a_SOURCES): Add setenv.c, unsetenv.c,
2071         setenv.h.
2072
2073 2002-12-10  Paul Eggert  <eggert@twinsun.com>
2074
2075         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
2076         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
2077         Choose values that are less likely to collide with system fnmatch
2078         options.
2079         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
2080         defined (e.g., a pure POSIX system).
2081         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
2082         instead of FNM_FILE_NAME, for compatibility with pure POSIX sytems.
2083
2084 2002-12-06  Jim Meyering  <jim@meyering.net>
2085
2086         * error.c: Be consistent: change `#ifndef _LIBC' to `#if !_LIBC'.
2087
2088         Merge in changes from libc's misc/error.c, in preparation
2089         for the merge of gnulib's changes back into libc.
2090
2091         * error.c (_): Define only if not already defined.
2092         Move definition to follow all #include directives.
2093         Include unlocked-io.h only if !_LIBC.
2094         [_LIBC]: Include <libio/libioP.h>.
2095         [USE_IN_LIBIO]: Include <libio/iolibio.h>
2096         (fflush): Tweak definition to use INTUSE.
2097         (putc): Define.
2098
2099 2002-12-05  Paul Eggert  <eggert@twinsun.com>
2100
2101         * alloca.c [defined emacs]: Include "lisp.h".
2102         (xalloc_die) [defined emacs]: New macro.
2103         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
2104         [! defined emacs]: Include <xalloc.h>.
2105         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
2106         (pointer): Typedef to POINTER_TYPE *.
2107         (malloc): Remove decl; we now always use xmalloc.
2108         (alloca): Use old-style definition, since Emacs needs this.
2109         Check for arithmetic overflow when computing combined size.
2110
2111 2002-12-04  Paul Eggert  <eggert@twinsun.com>
2112
2113         Do not generate unlocked-io.h automatically, since it's easier to
2114         maintain it by hand.
2115
2116         * unlocked-io.h: New file, from GNU diffutils,
2117         but with proper copyright notice and attribution.
2118         * gen-uio: Remove.
2119         * Makefile.am: Add copyright notice.
2120         (libfetish_a_SOURCES): Add unlocked-io.h.
2121         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
2122         (DISTCLEANFILES, io_functions): Remove macros.
2123         (EXTRA_DIST): Remove gen_uio.
2124         (unlocked-io.h): Remove rule.
2125
2126 2002-12-04  Jim Meyering  <jim@meyering.net>
2127
2128         Reflect the fact that stat.c and lstat.c are no longer generated.
2129         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
2130         (DISTCLEANFILES): Likewise.
2131         (EXTRA_DIST): Likewise.
2132         (all_local): Don't depend on stat.c or lstat.c.
2133         (stat.c, lstat.c): Remove rules.
2134         (EXTRA_DIST): Remove xstat.in.
2135
2136         * xstat.in: Remove file.  Contents moved into stat.c.
2137         * stat.c: New file.  Contents mostly from xstat.in.
2138         * stat.c: Rework so that it may serve to define rpl_lstat, too.
2139         * lstat.c: New file. Simply #define LSTAT and include stat.c.
2140
2141         * safe-read.c: Rework so that it may serve to define safe_write, too.
2142         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
2143
2144 2002-12-03  Jim Meyering  <jim@meyering.net>
2145
2146         * safe-read.c, safe-write.c: Change variable names and comments, but
2147         not semantics, to minimize the differences between these two files.
2148         (safe_read): Change comment to mention SAFE_READ_ERROR.
2149
2150         * safe-read.c (IS_EINTR): Define.
2151         (safe_read): Use IS_EINTR in place of in-function cpp directives.
2152
2153 2002-12-02  Bruno Haible  <bruno@clisp.org>
2154
2155         * safe-write.c (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM):
2156         Define, taken from safe-read.c.
2157         (INT_MAX): Provide fallback.
2158         (safe_write): Rewrite to iterate IFF the write fails with EINTR.
2159         * safe-write.h (SAFE_WRITE_ERROR): Define.
2160
2161         * safe-read.c (EINTR): Remove definition.
2162         (safe_read): Don't use EINTR if it is absent.
2163
2164 2002-12-02  Jim Meyering  <jim@meyering.net>
2165
2166         * safe-read.c (EINTR): Define.
2167         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
2168         (INT_MAX): Provide fallback.
2169         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
2170
2171         * safe-read.h (SAFE_READ_ERROR): Define.
2172
2173 2002-12-01  Jim Meyering  <jim@meyering.net>
2174
2175         * safe-read.c: (safe_read): Also exit the loop when read returns zero.
2176         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
2177
2178 2002-11-27  Paul Eggert  <eggert@twinsun.com>
2179
2180         * hash.c (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
2181         hash_rehash): Replace `if (limit <= value) abort ();' with
2182         `if (! (value < limit)) abort ();', for readability.
2183
2184 2002-11-26    <karl@gnu.org>
2185
2186         * strdup.c: copy from libc again, with jim's ok.
2187         * .cppi-disable: re-add strdup.c
2188
2189 2002-11-25    <karl@gnu.org>
2190
2191         * strtoll.c: copy from libc, meaning we now #include <strtol.c>
2192         instead of "strtol.c".
2193
2194 2002-11-25  Jim Meyering  <jim@meyering.net>
2195
2196         * mktime.c: Sync from libc, now that it has the latest fix.
2197
2198 2002-11-24    <karl@gnu.org>
2199
2200         * error.c, getopt.c, getopt.h, getopt1.c, obstack.c, regex.c,
2201         regex.h, strdup.c, strtoll.c, tempname.c: change license to gpl.
2202
2203 2002-11-24  Jim Meyering  <jim@meyering.net>
2204
2205         Update from coreutils:
2206
2207         * mktime.c: Merge in changes from libc.
2208
2209         Avoid a link-time failure on some Linux systems.
2210         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
2211         (__mon_yday): Declare with the STATIC attribute.
2212         (__mktime_internal): Likewise.
2213         Based on a report from Greg Schafer.
2214
2215 2002-11-23  Jim Meyering  <jim@meyering.net>
2216
2217         * sig2str.c (str2signum, sig2str): Avoid a warning from gcc:
2218         Use `unsigned', not `int', as type of index.
2219
2220         * xstat.in [@BEGIN_LSTAT_ONLY@]: Include <string.h>.
2221
2222         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
2223
2224 2002-11-22  Paul Eggert  <eggert@twinsun.com>
2225
2226         * hash.c: Avoid use of <assert.h>, as the GNU Coding Standards
2227         hint that one should use `if (! x) abort ();' rather than `assert
2228         (x);', and anyway it's one less thing to worry about configuring.
2229         (hash_lookup, hash_get_first, hash_get_next, hash_find_entry,
2230         hash_rehash, hash_insert): Use abort rather than assert.
2231
2232 2002-11-22  Paul Eggert  <eggert@twinsun.com>
2233
2234         * quotearg.h: Allow multiple inclusion by surrounding with
2235         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
2236         so that we can be included first.
2237         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
2238         * quotearg.c: Include quotearg.h immediately after config.h.
2239         No need to include stddef.h or sys/types.h any more.
2240         Surround local include files with "", not "<>".
2241         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
2242         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
2243         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
2244         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
2245         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
2246         (ISPRINT): Remove; no longer needed now that we assume C89.
2247
2248         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
2249         Preserve errno.
2250
2251         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
2252         quotearg_char): Use SIZE_MAX rather than
2253         (size_t) -1 when we are talking about "infinity".
2254
2255         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
2256
2257 2002-11-22  Bruno Haible  <bruno@clisp.org>
2258
2259         * safe-read.h: Assume C89. Add comments.
2260         (safe_read): Change return type to size_t.
2261         * safe-read.c (safe_read): Change return type to size_t. Handle byte
2262         counts > SSIZE_MAX correctly.
2263         * safe-write.h: New file.
2264         * safe-write.c: New file.
2265         * full-read.h: New file.
2266         * full-read.c: New file.
2267         * full-write.h: Assume C89. Add comments.
2268         * full-write.c: Include safe-write.h.
2269         (full_write): Rewritten to use safe_write.
2270         Suggested by Jim Meyering and Paul Eggert.
2271
2272 2002-11-21  Bruno Haible  <bruno@clisp.org>
2273
2274         Remove case insensitive option matching.
2275         * argmatch.h (argcasematch): Remove declaration.
2276         (ARGCASEMATCH): Remove macro.
2277         (__xargmatch_internal): Remove case_sensitive argument.
2278         (XARGMATCH): Update.
2279         (XARGCASEMATCH): Remove macro.
2280         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
2281         case_sensitive argument.
2282         (argcasematch): Remove function.
2283         (__xargmatch_internal): Remove case_sensitive argument.
2284         (main): Use XARGMATCH instead of XARGCASEMATCH.
2285
2286         * xmalloc.c: Change compile-time error message. Add comment about
2287         required autoconf version.
2288
2289 2002-11-21  Jim Meyering  <jim@meyering.net>
2290
2291         * strdup.c (strdup): Tweak comment and initial #if/#include.
2292
2293         Merge in changes from the coreutils.
2294
2295         2002-09-25  Paul Eggert  <eggert@twinsun.com>
2296         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
2297         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
2298         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
2299         int.  Work more efficiently if X is the same width as uintmax_t.
2300         Do not compare X to -1, to avoid bogus compiler warning.
2301         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
2302         Don't assume that f_frsize and f_bsize are the same type.
2303
2304         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
2305         on FreeBSD.
2306
2307         * makepath.c (make_path): Restore umask *before* creating the final
2308         component.
2309         (make_path): Minor reformatting.
2310
2311         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
2312         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
2313
2314         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
2315         ones.  At least on GNU/Linux systems, `auto' means something else.
2316         From Michael Stone.
2317
2318 2002-11-20  Paul Eggert  <eggert@twinsun.com>
2319
2320         Merge argmatch cleanups from Bison.  Assume C89.
2321
2322         * argmatch.c: Include config.h here, not in argmatch.h.
2323         Include stdlib.h, for EXIT_FAILURE.
2324         Always include <string.h>, since we assume C89.
2325         (EXIT_FAILURE): Remove pre-C89 bug workaround.
2326         * argmatch.h: Do not include <config.h> or <sys/types.h>.
2327         Include <stddef.h> instead, since it's all we need for size_t.
2328         (PARAMS): Remove.  All uses removed.
2329         (ARRAY_CARDINALITY): Do not bother to #undef.
2330         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
2331         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
2332         Remove unnecessary parentheses.
2333         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
2334         Insert necessary parentheses.
2335         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
2336         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
2337
2338 2002-11-19  Bruno Haible  <bruno@clisp.org>
2339
2340         * mbswidth.c: Include mbswidth.h right at the beginning.
2341         * mbswidth.h: Include <stddef.h>, for size_t.
2342
2343         * mbswidth.h (PARAMS): Remove macro.
2344         (mbswidth, mbsnwidth): Use ANSI C function declarations.
2345         * mbswidth.c (mbswidth, mbsnwidth): Likewise.
2346
2347         * gcd.h (PARAMS): Remove macro.
2348         (gcd): Use ANSI C function declarations.
2349         * gcd.c (gcd): Likewise.
2350
2351 2002-11-15  Bruno Haible  <bruno@clisp.org>
2352
2353         * strcspn.c: Include <stddef.h>.
2354         (strcspn): Use ANSI C function declaration. Change return type to
2355         size_t. Use NULL.
2356         * strpbrk.c: Minimize diffs to glibc. Include <stddef.h>.
2357         (strpbrk): Use NULL.
2358         * strpbrk.h (PARAMS): Remove macro.
2359         (strpbrk): Use ANSI C function declaration.
2360         * strstr.c: Don't include <sys/types.h>.
2361         * strstr.h (PARAMS): Remove macro.
2362         (strstr): Use ANSI C function declarations.
2363
2364 2002-11-06  Bruno Haible  <bruno@clisp.org>
2365
2366         * gcd.h (gcd): Change argument type to 'unsigned long'.
2367         * gcd.c (gcd): Likewise.
2368
2369 2002-11-05  Bruno Haible  <bruno@clisp.org>
2370
2371         * gcd.h: New file, from gettext-0.11.5.
2372         * gcd.c: New file, from gettext-0.11.5.
2373
2374 2002-11-05  Bruno Haible  <bruno@clisp.org>
2375
2376         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
2377         * getopt.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
2378         * obstack.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
2379         * regex.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
2380
2381         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
2382         * makepath.c: Include gettext.h instead of <locale.h> and <libintl.h>.
2383
2384         * closeout.c: Include gettext.h instead of <libintl.h>.
2385         * human.c: Include gettext.h instead of <libintl.h>.
2386         * quotearg.c: Include gettext.h instead of <libintl.h>.
2387         * rpmatch.c: Include gettext.h instead of <libintl.h>.
2388         * unicodeio.c: Include gettext.h instead of <libintl.h>.
2389         * userspec.c: Include gettext.h instead of <libintl.h>.
2390         * version-etc.c: Include gettext.h instead of <libintl.h>.
2391         * xmalloc.c: Include gettext.h instead of <libintl.h>.
2392         (textdomain): Remove definition.
2393         * xmemcoll.c: Include gettext.h instead of <libintl.h>.
2394
2395         * long-options.c: Remove include of <libintl.h> and definition of _.
2396         * same.c: Remove include of <libintl.h> and definition of _.
2397
2398 2002-11-04  Bruno Haible  <bruno@clisp.org>
2399
2400         * stpcpy.h: New file, from GNU gettext-0.11.5.
2401         * strcase.h: New file, from GNU gettext-0.11.5.
2402         * strpbrk.h: New file, from GNU gettext-0.11.5.
2403         * strstr.h: New file, from GNU gettext-0.11.5.
2404         * xgetcwd.h: New file, from GNU gettext-0.11.5.
2405
2406 2002-05-09  Bruno Haible  <bruno@clisp.org>
2407
2408         * config.charset: Update for newest glibc. Add canonical names
2409         ISO-8859-14, KOI8-T, TCVN5712-1, GEORGIAN-PS.
2410
2411 2002-05-09  Bruno Haible  <bruno@clisp.org>
2412
2413         * localcharset.c (get_charset_aliases): Add more Windows specific
2414         aliases.
2415
2416 2002-05-08  Owen Taylor  <otaylor@redhat.com>
2417
2418         * config.charset: A few additions for Solaris.
2419
2420 2001-12-05  Bruno Haible  <bruno@clisp.org>
2421
2422         * localcharset.c (locale_charset): Don't return an empty string.
2423
2424 2001-10-23  Bruno Haible  <haible@clisp.cons.org>
2425
2426         * config.charset: msdos in uk_UA uses CP1125.
2427
2428 2001-08-05  Bruno Haible  <haible@clisp.cons.org>
2429
2430         Make it possible to build libcharset with CC=gcc CFLAGS="-x c++".
2431         * localcharset.c (locale_charset): Declare as extern "C".
2432
2433 2002-02-15  Bruno Haible  <bruno@clisp.org>
2434
2435         * config.charset [msdosdjgpp]: For Russian, use CP866.
2436
2437 2002-02-11  Bruno Haible  <bruno@clisp.org>
2438
2439         * config.charset: Add support for NetBSD.
2440
2441 2002-09-25    <karl@gnu.org>
2442
2443         * strdup.c: copy from libc/string (via ../config/srclist*).
2444         * getopt*: copy from libc/posix.
2445         * gettext.h: copy from gettext.
2446         * .cppi-disable: add strdup.c, gettext.h.
2447
2448 2002-07-01  Jim Meyering  <meyering@lucent.com>
2449
2450         * c-stack.c: Include sys/time.h.
2451         From Volker Borchert.
2452
2453 2002-06-11  Paul Eggert  <eggert@twinsun.com>
2454
2455         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
2456         New macro.  Use it uniformly instead of
2457         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
2458         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
2459         reported by Vin Shelton.
2460
2461 2002-06-22  Jim Meyering  <meyering@lucent.com>
2462
2463         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
2464         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
2465
2466 2002-06-22  Paul Eggert  <eggert@twinsun.com>
2467
2468         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
2469         Do not assume SA_SIGINFO behavior.
2470         Bug reported by Jim Meyering on NetBSD 1.5.2.
2471
2472 2002-06-22  Jim Meyering  <meyering@lucent.com>
2473
2474         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
2475
2476         * exitfail.c, exitfail.h: Likewise.
2477         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
2478
2479         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
2480         of fnmatch.h.
2481         (EXTRA_DIST): Add fnmatch_loop.c.
2482         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
2483
2484         * fnmatch_loop.c: New file, from diffutils-2.8.2.
2485         * fnmatch.c: Update from diffutils-2.8.2.
2486         * fnmatch_.h: New file.  From diffutils-2.8.2.
2487         * fnmatch.h: Remove file.
2488
2489 2002-06-18  Paul Eggert  <eggert@twinsun.com>
2490
2491         * file-type.h: Report an error if neither S_ISREG nor
2492         S_IFREG is defined, instead of using a test specific to glibc
2493         2.2.  This should be safe, since POSIX requires S_ISREG and
2494         Unix Version 7 had S_IFREG.  We don't need to check for
2495         <sys/types.h> since we don't use any symbols that it defines.
2496
2497 2002-06-15  Jim Meyering  <meyering@lucent.com>
2498
2499         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
2500         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
2501         have been included before this file.
2502
2503 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
2504
2505         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
2506         so that each temporary file name is unique and valid in the first
2507         8 characters, for operation under DOS.
2508
2509 2002-06-15  Jim Meyering  <meyering@lucent.com>
2510
2511         Work even with DJGPP 2.03, which lacks support for symlinks.
2512         From Richard Dawe.
2513         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
2514         is defined.
2515         * lchown.c (S_ISLNK): Likewise.
2516
2517 2002-06-14  Jim Meyering  <meyering@lucent.com>
2518
2519         * file-type.h: Use the version from diffutils-2.8.2.
2520         * file-type.c: Likewise.
2521
2522 2002-05-27  Jim Meyering  <meyering@lucent.com>
2523
2524         Fix a problem seen only on nonconforming systems whereby ls.c's
2525         use of localtime, and then of gettimeofday would cause trouble:
2526         the localtime call used to initialize rpl_gettimeofday's save
2527         mechanism would clobber ls's current local time information so
2528         that in any long listing the first file would always be listed
2529         with date 1970-01-01.  Analysis by Volker Borchert.
2530
2531         * gettimeofday.c (localtime): Undefine.
2532         (rpl_localtime): New function.
2533
2534 2002-05-22  Jim Meyering  <meyering@lucent.com>
2535
2536         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
2537         * file-type.h: New file.
2538         * file-type.c (file_type): New file/function.  Extracted from diffutils.
2539
2540 2002-04-29  Paul Eggert  <eggert@twinsun.com>
2541
2542         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
2543
2544 2002-04-28  Paul Eggert  <eggert@twinsun.com>
2545
2546         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
2547         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
2548         of 127, since 64 is the largest conceivable number for ancient
2549         nonstandard hosts.
2550         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
2551
2552 2002-04-28  Jim Meyering  <meyering@lucent.com>
2553
2554         * sig2str.c (WTERMSIG): Remove definition (unused).
2555
2556 2002-04-28  Paul Eggert  <eggert@twinsun.com>
2557
2558         * sig2str.h, sig2str.c: New files.
2559         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
2560
2561 2002-04-24  Jim Meyering  <meyering@lucent.com>
2562
2563         * gettext.h: New file, from Gettext.
2564         * Makefile.am (INCLUDES): Remove -I../intl.
2565         (libfetish_a_SOURCES): Add gettext.h.
2566
2567 2002-04-16  Jim Meyering  <meyering@lucent.com>
2568
2569         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
2570         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
2571         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
2572
2573 2002-04-12  Jim Meyering  <meyering@lucent.com>
2574
2575         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
2576
2577 2002-03-10  Jim Meyering  <meyering@lucent.com>
2578
2579         * makepath.c (make_path): Remove a comma from a diagnostic.
2580         Suggestion from Santiago Vila.
2581
2582 2002-03-08  Jim Meyering  <meyering@lucent.com>
2583
2584         * rename.c: Mention that this wrapper is needed also on
2585         mips-dec-ultrix4.4 systems.
2586
2587 2002-03-02  Jim Meyering  <meyering@lucent.com>
2588
2589         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
2590         not HAVE_CLOCK_SETTIME.
2591
2592 2002-02-27  Paul Eggert  <eggert@twinsun.com>
2593
2594         * nanosleep.h: Rename to....
2595         * timespec.h: New name for nanosleep.h.  All uses changed.
2596
2597         * gettime.c: New file.
2598         * settime.c: New file.
2599         * stime.c: Remove.
2600
2601         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
2602         timespec.h.  Remove nanosleep.h.
2603
2604 2002-02-25  Paul Eggert  <eggert@twinsun.com>
2605
2606         * acl.c, acl.h: New files.
2607         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
2608
2609 2002-02-24  Jim Meyering  <meyering@lucent.com>
2610
2611         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
2612         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
2613         cause trouble.  Reported by Nelson Beebe.
2614
2615 2002-02-23  Paul Eggert  <eggert@twinsun.com>
2616
2617         * path-concat.c (xpath_concat): Reorder code to pacify
2618         compilers that don't know that xalloc_die never returns.
2619
2620 2002-02-20  Jim Meyering  <meyering@lucent.com>
2621
2622         * getdate.c: Regenerate using bison-1.33.
2623
2624 2002-02-15  Paul Eggert  <eggert@twinsun.com>
2625
2626         * posixver.c, posixver.h: New files.
2627         * Makefile.am (libfetish_a_SOURCES): Add them.
2628
2629 2002-02-02  Paul Eggert  <eggert@twinsun.com>
2630             Bruno Haible  <bruno@clisp.org>
2631
2632         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
2633         (fwrite_success_callback): New declaration.
2634         * unicodeio.c (unicode_to_mb): New function, extracted from
2635         print_unicode_char. Call failure callback instead of error.
2636         (fwrite_success_callback): New function.
2637         (exit_failure_callback): New function.
2638         (fallback_failure_callback): New function.
2639         (print_unicode_char): Call unicode_to_mb.
2640
2641 2002-01-26  Jim Meyering  <meyering@lucent.com>
2642
2643         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
2644
2645 2002-01-22  Jim Meyering  <meyering@lucent.com>
2646
2647         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
2648         Otherwise, some versions of automake would omit the rule that makes
2649         Makefile from Makefile.in.
2650
2651 2001-01-21  Paul Eggert  <eggert@twinsun.com>
2652
2653         * xmemcoll.h, xmemcoll.c: New files.
2654         * Makefile.am (libfetish_a_SOURCES): Add them.
2655         * memcoll.c: Include errno.h, and declare errno if not defined.
2656         (memcoll): Set errno to zero if there is no error.
2657
2658         * quotearg.c (quotearg_buffer_restyled):
2659         Fix bug with quoting buffers containing NUL when backslashing escapes.
2660         This bug was exposed by the other changes in this patch.
2661         (quotearg_n_options): New arg ARGSIZE.
2662         All callers changed.
2663         (quoting_options_from_style): New function.
2664         (quotearg_n_style): Use it.
2665         (quotearg_n_style_mem): New function.
2666
2667         * quotearg.h (quotearg_n_style_mem): New function.
2668
2669 2002-01-16  Jim Meyering  <meyering@lucent.com>
2670
2671         * getdate.y: Add three semicolons, each just before a closing brace.
2672         Bison (as of version 1.31) no longer papers over that mistake.
2673
2674 2002-02-14  Paul Eggert  <eggert@twinsun.com>
2675
2676         * backupfile.c (ISDIGIT): Comment fix.
2677         * getdate.y (ISDIGIT): Likewise.
2678         * posixtm.c (ISDIGIT, year): Likewise.
2679         * strverscmp.c (ISDIGIT): Likewise.
2680         * userspec.c (ISDIGIT): Likewise.
2681
2682 2002-01-05  Jim Meyering  <meyering@lucent.com>
2683
2684         * version-etc.c (version_etc_copyright): Update copyright year.
2685
2686 2001-01-19  Paul Eggert  <eggert@twinsun.com>
2687
2688         * closeout.c (close_stdout_status): If ferror (stdout), do
2689         not silently exit merely because the output buffer happens to
2690         have nothing pending.
2691
2692 2001-12-18  Paul Eggert  <eggert@twinsun.com>
2693
2694         See the big note in ../ChangeLog.
2695         * human.c (suffixes): Prefer K to k for 1024.
2696         (generate_suffix_backwards): New function.
2697         (human_readable_inexact): Use it.
2698         * xstrtol.c (__xstrtol): If there is no number but there
2699         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
2700         Accept 'K' as well as 'k'.
2701
2702 2001-12-15  Jim Meyering  <meyering@lucent.com>
2703
2704         * regex.h (__restrict_arr): Update from libc.
2705
2706         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
2707         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
2708         (STREQ): Define.
2709
2710 2001-12-10  Jim Meyering  <meyering@lucent.com>
2711
2712         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
2713         Instead, include "xalloc.h".
2714         (initbuffer): Don't cast xmalloc return value to char*.
2715         (readline): Reword comment.
2716         Don't cast xrealloc return value to char*
2717         Return NULL, not 0.
2718
2719 2001-12-09  Jim Meyering  <meyering@lucent.com>
2720
2721         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
2722         `signed and unsigned type in conditional expression'.
2723         * posixtm.c (posix_time_parse): Likewise.
2724
2725         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
2726
2727         * readtokens.c (readtoken): Declare an index to be of type unsigned
2728         to avoid a pedantic warning.
2729
2730         * getstr.c: Don't include assert.h.
2731         (getstr): Remove warning-evoking assertions.
2732         Return -1 if offset parameter is out of bounds.
2733         Change the type of a local from int to size_t.
2734
2735         * strftime.c (my_strftime_localtime_r): Include this function
2736         definition in the `#if ! HAVE_TM_GMTOFF' block.
2737
2738         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
2739         Include xalloc.h instead.
2740
2741 2001-12-02  Jim Meyering  <meyering@lucent.com>
2742
2743         * tempname.c: Don't declare getenv, thus reverting the change of
2744         2001-11-18.  It's no longer necessary, now that stdlib.h is always
2745         included.
2746
2747         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
2748         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
2749
2750 2001-11-30  Akim Demaille  <akim@epita.fr>
2751
2752         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
2753         before being defined.
2754
2755 2001-11-27  Paul Eggert  <eggert@twinsun.com>
2756
2757         * quotearg.h (quotearg_n, quotearg_n_style):
2758         First arg is int, not unsigned.
2759         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
2760         (SIZE_MAX, UINT_MAX): New macros.
2761         (quotearg_n_options): Abort if N is negative.
2762         Avoid overflow check on hosts where size_t is 64 bits and int
2763         is 32 bits, as overflow is impossible there.
2764         Fix off-by-one typo that caused unnecessary reallocation.
2765
2766 2001-11-27  Jim Meyering  <meyering@lucent.com>
2767
2768         * tempname.c: Merge with version from libc.
2769         * regex.c: Likewise.
2770
2771         * tempname.c: Include stdlib.h unconditionally.  On some old systems
2772         for which STDC_HEADERS is 0, it was not included, resulting in a
2773         warning about an integer-to-pointer conversion problem with getenv.
2774         Reported by Volker Borchert.
2775
2776 2001-11-26  Jim Meyering  <meyering@lucent.com>
2777
2778         * gtod.h: Remove file.
2779         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
2780         * gettimeofday.c: Don't include gtod.h.
2781         (GTOD_init): Remove function.
2782         (rpl_gettimeofday): Do its job here instead, rather than aborting.
2783         Suggestion from Volker Borchert.
2784
2785 2001-11-23  Jim Meyering  <meyering@lucent.com>
2786
2787         * hash.h (struct hash_table): Don't define here.  Merely declare it.
2788         * hash.c (struct hash_table): Define it here instead.
2789
2790 2001-11-22  Jim Meyering  <meyering@lucent.com>
2791
2792         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
2793
2794 2001-11-18  Paul Eggert  <eggert@twinsun.com>
2795
2796         * tempname.c (TMP_MAX): Remove; no longer needed.
2797         (TEMPORARIES): New macro.
2798         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
2799         removes an artificial limitation (e.g. HP-UX 10.20, where
2800         TMP_MAX is 17576).
2801
2802 2001-11-18  Jim Meyering  <meyering@lucent.com>
2803
2804         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
2805         on SunOS 4.
2806
2807         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
2808         files will be created before anything else.
2809
2810 2001-11-17  Jim Meyering  <meyering@lucent.com>
2811
2812         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
2813         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
2814         rather than group writable.  Patch by Juan F. Codagnone.
2815
2816         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
2817         Instead, include "xalloc.h".
2818
2819         * mountlist.c: Include unlocked-io.h after all system headers.
2820         Remove explicit declarations of xmalloc, xrealloc,
2821         and xstrdup.  Instead, include "xalloc.h".
2822
2823         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
2824         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
2825         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
2826
2827         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
2828         Reported by Padraig Brady.
2829
2830         * mkstemp.c: #undef mkstemp.
2831         Include config.h.
2832         (rpl_mkstemp): Rename from mkstemp.
2833         Protoize.
2834
2835 2001-11-16  Jim Meyering  <meyering@lucent.com>
2836
2837         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
2838         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
2839         determine the amount of total physical memory, use pstat_getstatic.
2840         HPUX-11 doesn't define _SC_PHYS_PAGES.
2841         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
2842         If sysconf couldn't be used to determine the amount of available
2843         physical memory, use both pstat_getstatic and pstat_getdynamic.
2844         Based on a patch from Bob Proulx.
2845
2846 2001-11-05  Jim Meyering  <meyering@lucent.com>
2847
2848         * xstat.in (slash_aware_lstat): Correct a misleading comment.
2849
2850 2001-11-03  Jim Meyering  <meyering@lucent.com>
2851
2852         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
2853         in argmatch_to_argument call.
2854
2855         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
2856         argument.
2857
2858         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
2859         e.g., a fault due to an attempt to free a NULL pointer.
2860
2861 2001-11-01  Jim Meyering  <meyering@lucent.com>
2862
2863         * dirfd.c, dirfd.h: New files.
2864         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
2865
2866         * hash.c (hash_print) [TESTING]: Clean up.
2867
2868 2001-10-22  Paul Eggert  <eggert@twinsun.com>
2869
2870         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
2871         to avoid a warning if -Wall.
2872
2873 2001-10-21  Paul Eggert  <eggert@twinsun.com>
2874
2875         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
2876
2877 2001-10-21  Jim Meyering  <meyering@lucent.com>
2878
2879         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
2880         this code would end up calling gettext even in packages built
2881         with --disable-nls.
2882         * getopt.c (_): Likewise.
2883         * regex.c (_): Likewise.
2884
2885 2001-10-20  Paul Eggert  <eggert@twinsun.com>
2886
2887         * error.c (strerror_r): Do not declare unless !_LIBC.
2888         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
2889         Use strerror_r that is only a macro, even if it is not a function.
2890         (strerror): Check for HAVE_DECL_STRERROR before declaring.
2891         (private_strerror): Use prototypes, not old-style function definition.
2892         (print_errno_message): New function.
2893         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
2894         char*-flavored one.
2895         (error_tail, error, error_at_line): Use it.
2896
2897 2001-10-11  Jim Meyering  <meyering@lucent.com>
2898
2899         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
2900         and quote_n (1, ... to avoid clobbering a buffer.
2901
2902 2001-10-05  Jim Meyering  <meyering@lucent.com>
2903
2904         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
2905         * hash-pjw.c: New file (factored out of fileutils' remove.c).
2906         * hash-pjw.h: New file.
2907
2908 2001-09-30  Jim Meyering  <meyering@lucent.com>
2909
2910         * mountlist.c [MOUNTED_GETFSSTAT]:
2911         Include <sys/ucred.h>, for Apple Darwin.
2912         Include sys/mount.h and sys/fs_types.h only if available.
2913         (FS_TYPE): Define.
2914         (read_filesystem_list): Use FS_TYPE.
2915
2916 2001-09-29  Paul Eggert  <eggert@twinsun.com>
2917
2918         * exclude.c (excluded_filename): 0 -> false, since it's
2919         a boolean context.
2920
2921 2001-09-28  Paul Eggert  <eggert@twinsun.com>
2922
2923         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
2924         #defines strtoimax.  Also treat the other strto* functions
2925         like strtoimax.
2926
2927         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
2928         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
2929         (strtoimax, strtoumax): Do not declare if already defined as a macro.
2930
2931 2001-09-26  Jim Meyering  <meyering@lucent.com>
2932
2933         Most macros in unlocked-io.h had the wrong number of arguments.
2934         * gen-uio: New script.
2935         (USE_UNLOCKED_IO): Define to 1 if not already defined.
2936         * unlocked-io.hin: Remove file.
2937         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
2938         rather than trying to embed it here.
2939         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
2940         Reported by Padraig Brady.
2941
2942 2001-09-25  Volker Borchert  <bt@teknon.de>
2943
2944         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
2945
2946 2001-09-23  Jim Meyering  <meyering@lucent.com>
2947
2948         * mountlist.c: Remove useless parentheses in #if directives.
2949         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
2950         the deprecated MOUNTED symbol is no longer defined in mntent.h.
2951
2952 2001-09-22  Jim Meyering  <meyering@lucent.com>
2953
2954         * localcharset.c: Update from latest gettext.
2955         * config.charset: Likewise.
2956
2957 2001-09-20  Jim Meyering  <meyering@lucent.com>
2958
2959         * xstrtol.c (strtoimax): Guard declaration with
2960         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
2961         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
2962         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
2963         (strtoumax): Likewise, for completeness (it wasn't necessary).
2964
2965 2001-09-06  Paul Eggert  <eggert@twinsun.com>
2966
2967         * strtoimax.c (HAVE_LONG_LONG):
2968         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
2969         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
2970         to work around bug in IBM C compiler.
2971
2972 2001-09-16  Jim Meyering  <meyering@lucent.com>
2973
2974         * mkdir.c: New file.
2975
2976 2001-09-04  Paul Eggert  <eggert@twinsun.com>
2977
2978         * xgetcwd.c: Revert some of the previous change; intead,
2979         fix the HAVE_GETCWD_NULL code to behave more like the
2980         !HAVE_GETCWD_NULL code used to.
2981
2982         Include "xalloc.h".
2983         (xgetcwd): Do not return NULL when memory is exhausted; instead,
2984         invoke xalloc_die.
2985
2986 2001-09-04  Paul Eggert  <eggert@twinsun.com>
2987
2988         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
2989         Use ssize_t, not int, to store result of readlink.
2990         Check for ssize_t overflow as well as size_t overflow,
2991         as POSIX says the result of readlink is implementation-defined
2992         when ssize_t overflows.
2993         Remove unnecessary cast to char*.
2994         Use free+malloc instead of realloc, as the storage doesn't need
2995         to be preserved and it's clearer and can be more efficient that way.
2996         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
2997         * xreadlink.h (xreadlink): Update prototype.
2998
2999 2001-09-03  Paul Eggert  <eggert@twinsun.com>
3000
3001         * exclude.c (fnmatch_no_wildcards): Fix confusion between
3002         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
3003         spotted by Jim Meyering.
3004
3005 2001-09-03  Jim Meyering  <meyering@lucent.com>
3006
3007         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
3008
3009 2001-09-03  Paul Eggert  <eggert@twinsun.com>
3010
3011         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
3012         like the HAVE_GETCWD_NULL code.
3013         Include pathmax.h if not HAVE_GETCWD.
3014         Do not include xalloc.h.
3015         (INITIAL_BUFFER_SIZE): New symbol.
3016         Do not use xmalloc / xrealloc, since the caller is responsible for
3017         handling errors.  Preserve errno around `free' during failure.
3018         Do not overrun buffer when using getwd.
3019
3020 2001-09-03  Paul Eggert  <eggert@twinsun.com>
3021
3022         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
3023         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
3024
3025 2001-09-02  Jim Meyering  <meyering@lucent.com>
3026
3027         * error.c: Update from GNU libc.
3028
3029 2001-09-01  Jim Meyering  <meyering@lucent.com>
3030
3031         * xreadlink.c: New file.
3032         * xreadlink.h: New file.
3033         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
3034
3035         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
3036         doesn't conflict with sparc Solaris 7's definition in
3037         /usr/include/sys/int_types.h.
3038
3039         * exclude.c: Use `""', not `<>' to #include non-system header files.
3040         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
3041         and strncasecmp as r-values.  Unixware didn't have declarations.
3042
3043 2001-08-31  Jim Meyering  <meyering@lucent.com>
3044
3045         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
3046         Use an initial, malloc'd, buffer of length 128 rather than
3047         a statically allocated one of length 1024.
3048
3049 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3050
3051         * xgetcwd.c: Don't include pathmax.h.
3052         Include stdlib.h and unistd.h if available.
3053         Include xalloc.h.
3054         (xmalloc, xstrdup, free): Remove decls.
3055         (xgetcwd): Don't assume sizes fit in unsigned.
3056         Check for overflow when computing sizes.
3057         Simplify reallocation code.
3058
3059 2001-08-28  Paul Eggert  <eggert@twinsun.com>
3060
3061         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
3062
3063         * strtoimax.c: Renamed from strtoxmax.c, removing the
3064         old strtoimax.c.
3065
3066         Also, make the following further changes to make this file's
3067         configuration more similar to that of strtol.c:
3068         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
3069         (strtoumax, uintmax_t, strtoull, strtol): Remove.
3070         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
3071         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
3072         changed to signed values.
3073
3074         And make the following changes as well:
3075         Fix copyright notice, as 1999 was missing.
3076         (verify): New macro.
3077         (strtoimax): Check sizes at compile-time, not run-time.
3078         Prefer strtol to strtoll if both work.
3079         (main): Remove; it was not that useful and was a pain to maintain.
3080
3081         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
3082
3083 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3084
3085         * savedir.c (savedir): Remove size parameter, as POSIX says that
3086         a directory's st_size can have an arbitrary value, so the old
3087         usage could waste an arbitrary amount of memory.  All uses
3088         changed.
3089         * savedir.h: Update prototype.
3090
3091 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3092
3093         * xstrtol.c (strtoimax): New decl.
3094
3095 2001-08-28  Paul Eggert  <eggert@twinsun.com>
3096
3097         * xstrtol.h: Add copyright notice.
3098         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
3099         LONGINT_INVALID_SUFFIX_CHAR.
3100
3101 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3102
3103         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
3104         tm to be declared.
3105
3106 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3107
3108         * hash.c: Remove '2001' from copyright notice.
3109
3110 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3111
3112         * full-write.h: New file.
3113         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
3114         * full-write.c: Correct credits, as cccp.c no longer
3115         exists and anyway it was so heavily changed from the old cccp
3116         code as to be unrecognizable.  Include full-write.h.
3117         (full_write) Return size_t, with short writes meaning failure.
3118         All callers changed.  This fixes a bug with large buffers
3119         on 64-bit hosts.
3120         * utime.c: Include full-write.h.
3121
3122 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3123
3124         Merge 'exclude' changes from tar 1.13.22.
3125         This fixes one or two unlikely storage allocation overflow bugs,
3126         but doesn't change user-visible behavior otherwise.
3127
3128 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3129
3130         * exclude.c (bool): Declare, perhaps by including stdbool.h.
3131         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
3132         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
3133         Include if available.
3134         (<xalloc.h>): Include
3135         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
3136         (verify): New macro.  Use it to verify that EXCLUDE macros do not
3137         collide with FNM macros.
3138         (struct patopts): New struct.
3139         (struct exclude): Use it, as exclude patterns now come with options.
3140         (new_exclude): Support above changes.
3141         (new_exclude, add_exclude_file):
3142         Initial size must now be a power of two to simplify overflow checking.
3143         (free_exclude, fnmatch_no_wildcards): New function.
3144         (excluded_filename): No longer requires options arg, as the options
3145         are determined by add_exclude.  Now returns bool, not int.
3146         (excluded_filename, add_exclude):
3147         Add support for the fancy new exclusion options.
3148         (add_exclude, add_exclude_file): Now takes int options arg.
3149         Check for arithmetic overflow when computing sizes.
3150         (add_exclude_file): xrealloc might modify errno, so don't
3151         realloc until after errno might be used.
3152
3153         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
3154         New macros.
3155         (free_exclude): New decl.
3156         (add_exclude, add_exclude_file): Now takes int options arg.
3157         (excluded_filename): No longer requires options arg, as the options
3158         are determined by add_exclude.  Now returns bool, not int.
3159
3160 2001-08-30  Paul Eggert  <eggert@twinsun.com>
3161
3162         * alloca.c (alloca): Arg is of type size_t, not unsigned.
3163
3164 2001-08-27  Jim Meyering  <meyering@lucent.com>
3165
3166         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
3167
3168         * version-etc.c (N_): Remove definition.
3169         Revert most of last change.
3170         Instead, simply don't mark the `Copyright...' string for translation.
3171         Based on advice from Paul Eggert.
3172
3173         * strtoxmax.c: Tweak comment.
3174
3175 2001-08-26  Jim Meyering  <meyering@lucent.com>
3176
3177         * version-etc.c (version_etc_copyright_fmt): Replace literal year
3178         of copyright with `%s' so translators don't get an untranslated
3179         message in 2002.
3180         (COPYRIGHT_YEAR): Define.
3181         (version_etc): Use fprintf rather than fputs.
3182         Suggestion from Ulrich Drepper.
3183
3184         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
3185
3186         * strtoll.c: New file, from GNU libc.
3187         * xstrtoimax.c: New file.
3188
3189         * xstrtol.h: Add xstrtoimax.
3190         * strtoumax.c: New file.  Simply include "strtoumax.c".
3191         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
3192
3193         * strtoumax.c: Factor to work both for unsigned and signed types, ...
3194         * strtoxmax.c: ... then renamed to this.
3195
3196 2001-08-13  Paul Eggert  <eggert@twinsun.com>
3197
3198         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
3199         Port to Solaris 8, where 'sed' requires a space after the 'r'
3200         command, and where sh dislikes "$/".  Clean up the spacing a bit.
3201         Redirect output to $tmp just once.
3202
3203 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
3204
3205         * addext.c (<errno.h>): Include.
3206         (errno): Declare if not defined.
3207         (addext): Work correctly when pathconf returns -1 and leaves
3208         errno alone because there is no limit.  Also, work even if
3209         pathconf returns a value greater than SIZE_MAX.
3210
3211 2001-08-12  Jim Meyering  <meyering@lucent.com>
3212
3213         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
3214         Simply `return getcwd (NULL, 0);'.
3215         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
3216         Use 1300 as initial value for length, not PATH_MAX.
3217
3218         * pathmax.h: Clean up cpp syntax.
3219
3220 2001-08-12  Jim Meyering  <meyering@lucent.com>
3221
3222         * gettimeofday.c: New file.
3223         * gtod.h: New file.
3224         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
3225
3226 2001-08-04  Jim Meyering  <meyering@lucent.com>
3227
3228         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
3229         to get in sync with glibc.
3230
3231 2001-08-03  Paul Eggert  <eggert@twinsun.com>
3232
3233         The following changes are from gettext 0.10.39 as maintained by
3234         Bruno Haible.
3235
3236         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
3237         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
3238         with inverted sense.  All uses changed.
3239
3240         * mbswidth.c: Don't include <limits.h>.
3241         Include <stdlib.h> and <string.h> unconditionally.
3242         (iswcntrl, mbsinit, ISCNTRL): New macros.
3243         (mbsnwidth): Use K&R style function declarations.
3244         Don't bother checking for MB_LEN_MAX == 1, since the compiler
3245         can optimize it when MB_CUR_MAX == 1.
3246         The width of control characters is zero, not 1.
3247
3248 2001-07-15  Jim Meyering  <meyering@lucent.com>
3249
3250         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
3251         (BUILT_SOURCES): Add unlocked-io.h.
3252         (io_functions): Define.
3253         (unlocked-io.h): New rule.
3254         (DISTCLEANFILES): Add unlocked-io.h.
3255         (all-local): Depend on unlocked-io.h, to ensure it is created.
3256
3257         * unlocked-io.hin: New file
3258
3259         * regex.c: Update from glibc.
3260
3261 2001-07-05  Jim Meyering  <meyering@lucent.com>
3262
3263         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
3264         recommendation.
3265         (libfetish_a_SOURCES): Put all .h files here instead.
3266         Remove a thus-exposed (better checks in automake) duplicate and
3267         two unnecessary .h files.
3268
3269 2001-06-11  Jim Meyering  <meyering@lucent.com>
3270
3271         * regex.c: Update from GNU libc.
3272
3273 2001-05-27  Jim Meyering  <meyering@lucent.com>
3274
3275         * readutmp.h (UT_TYPE): Define.
3276
3277 2001-05-24  Jim Meyering  <meyering@lucent.com>
3278
3279         * argmatch.c: Include "quote.h".
3280         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
3281         quote function.  Reported by Göran Uddeborg.
3282
3283 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
3284
3285         * dirname.c (dir_name): Compute append_dot using path, not newpath
3286         which is not yet declared.
3287
3288 2001-05-11  Paul Eggert  <eggert@twinsun.com>
3289
3290         * Makefile.am (libfetish_a_SOURCES):
3291         Add strftime.c, since we now compile it on all hosts.
3292
3293         * strftime.c (my_strftime):
3294         Define to nstrftime if emacs, but only if my_strftime is not defined.
3295         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
3296         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
3297         Add one more extra argument: a nanoseconds value.
3298         All uses changed.
3299         (ns): New macro.
3300         (my_strftime function): Add %N format.
3301         (emacs_strftimeu): Renamed from emacs_strftime,
3302         with extra ut argument.
3303
3304 2001-05-11  Paul Eggert  <eggert@twinsun.com>
3305
3306         dirname code cleanup.  base_name now behaves more compatibly
3307         with POSIX basename when given file names that have trailing
3308         slashes, and similarly for dir_name.  Add new primitives
3309         base_len and dir_len.  Put the directory-name-related decls
3310         into dirname.h.
3311
3312         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
3313         * backupfile.c (base_name): Likewise.
3314         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
3315         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
3316         * makepath.c (strip_trailing_slashes): Likewise.
3317         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
3318         Likewise.
3319         * rename.c (strip_trailing_slashes): Likewise.
3320         * same.c (base_name): Likewise.
3321         * stripslash.c (ISSLASH): Likewise.
3322
3323         * addext.c: Include <dirname.h> after size_t is defined.
3324         * backupfile.c: Likewise.
3325
3326         * addext.c (addext): Use base_len to trim redundant
3327         trailing slashes instead of doing it ourselves.
3328         But do not trim the last slash if it is not redundant.
3329
3330         * backupfile.c (find_backup_file_name,
3331         max_backup_version): Use base_len instead of rolling it ourselves.
3332         Handle the case of "" and (on DOS) "C:" correctly.
3333
3334         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
3335         Include <string.h>, <dirname.h>.
3336         (base_name): Allow file names ending in slashes, other than names
3337         that are all slashes.  In this case, return the basename followed
3338         by the slashes.  This is more general, and can be used in places
3339         where the original base_name purposely had an assertion failure.
3340         (base_len): New function.
3341
3342         * dirname.c: Include <string.h> instead of <stdlib.h>.
3343         Do not include <assert.h>; no longer needed.
3344         Include xalloc.h.
3345         (memrchr): Remove decl.
3346         (dir_name_r): Remove.
3347         (dir_len): Renamed from dirlen.  All callers changed.
3348         Rewrite in terms of base_name, for simplicity and consistency.
3349         (dir_name): Never return NULL.  All callers changed.
3350         Do not include <stdlib.h> in test program; no longer needed.
3351         return 0; is fine for test program.
3352
3353         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
3354         New macros.
3355         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
3356
3357         * path-concat.c (path_concat): Use base_len to compute
3358         base length, not strlen; this means we cannot rely on memcpy
3359         to null-terminate.
3360
3361         * same.c (STREQ): Remove.
3362         (same_name): Handle the case where the basename ends in trailing '/'.
3363
3364         * stripslash.c (strip_trailing_slashes): Return nonzero if
3365         a slash was stripped.  Do not strip the last slash after a
3366         file system prefix.
3367
3368 2001-04-08  Jim Meyering  <meyering@lucent.com>
3369
3370         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
3371         recomputed; that's necessary when the offset spans a DST transition.
3372         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
3373
3374 2001-04-02  Jim Meyering  <meyering@lucent.com>
3375
3376         * regex.h, regex.c: Update from GNU libc.
3377
3378 2001-03-19  Paul Eggert  <eggert@twinsun.com>
3379
3380         * version-etc.c (version_etc_copyright): Update to 2001.
3381
3382 2001-03-16  Paul Eggert  <eggert@twinsun.com>
3383
3384         * tempname.c (uint64_t): Define to uintmax_t if
3385         not defined, and if UINT64_MAX is not defined.
3386         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
3387         Reported by John David Anglin.
3388
3389 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
3390
3391         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
3392         alias if codeset is empty.
3393         * config.charset (BeOS): Use wildcard syntax.
3394
3395 2001-03-13  Jim Meyering  <meyering@lucent.com>
3396
3397         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
3398         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
3399         From Bruno Haible.
3400
3401 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
3402
3403         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
3404         Don't return NULL.
3405         * unicodeio.c (print_unicode_char): Simplify accordingly.
3406
3407 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
3408
3409         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
3410         support for DOS/DJGPP.
3411
3412 2001-02-28  Paul Eggert  <eggert@twinsun.com>
3413
3414         * Makefile.am (libfetish_a_SOURCES):
3415         Add dup-safer.c, fopen-safer.c.
3416         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
3417
3418         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
3419
3420 2001-02-25  Paul Eggert  <eggert@twinsun.com>
3421
3422         The mkstemp replacement is taken from glibc 2.2.2, with some
3423         portability fixes for use outside glibc, as follows:
3424
3425         * tempname.c (struct_stat64): New macro.
3426         (direxists, __gen_tempname): Use it.
3427         This avoids a portability problem with Solaris 8.
3428
3429         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
3430         (<stddef.h>, <stdint.h>, <string.h>):
3431         Include only if STDC_HEADERS || _LIBC.
3432         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
3433         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
3434         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
3435         (__set_errno): Define this macro if <errno.h> doesn't.
3436         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
3437         Define these macros if <stdio.h> doesn't.
3438         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
3439         Define these macros if <sys/stat.h>
3440         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
3441         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
3442         __xstat64): Define if not _LIBC.
3443         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
3444         (__gen_tempname): Invoke gettimeofday only if
3445         HAVE_GETTIMEOFDAY || _LIBC;
3446         otherwise, fall back on plain "time".
3447         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
3448
3449         * mkstemp.c (__GT_FILE): Define to zero if not defined.
3450
3451         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
3452
3453 2001-02-17  Jim Meyering  <meyering@lucent.com>
3454
3455         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
3456         around included file name.
3457
3458         * strnlen.c (__strnlen): Merge in a change from GNU libc.
3459
3460         * strftime.c: Update from GNU libc (the only changes were to comments).
3461
3462 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
3463
3464         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
3465
3466 2001-02-17  Paul Eggert  <eggert@twinsun.com>
3467
3468         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
3469         Remove workaround macros for hosts that have mbrtowc but not
3470         mbstate_t, as we now insist on proper declarations for both
3471         before using mbrtowc.
3472
3473 2001-02-17  Jim Meyering  <meyering@lucent.com>
3474
3475         * regex.c: Update from libc.
3476
3477 2001-02-16  Paul Eggert  <eggert@twinsun.com>
3478
3479         * alloca.c (malloc): Undef before defining, since stdlib.h
3480         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
3481         Reported by Mark Hounschell via Paul Eggert.
3482
3483 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
3484
3485         * config.charset: Update for FreeBSD 4.2.
3486
3487 2001-01-26  Jim Meyering  <meyering@lucent.com>
3488
3489         * quotearg.c: Include stddef.h.
3490         * quote.c: Include stddef.h.
3491         Reported by Axel Kittenberger.
3492
3493         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
3494         line in double quotes so that it evokes a better diagnostic.
3495         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
3496         Reported by Axel Kittenberger.
3497
3498 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
3499
3500         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
3501         to avoid a warning.  Add back 'const' to inptr.
3502
3503 2001-01-16  Jim Meyering  <meyering@lucent.com>
3504
3505         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
3506         From Bruno Haible.
3507
3508 2001-01-14  Jim Meyering  <meyering@lucent.com>
3509
3510         * rename.c: New file.  From Volker Borchert.
3511         Include stdlib.h, string.h or strings.h, and xalloc.h.
3512         Use strip_trailing_slashes rather than open-coding it.
3513
3514 2001-01-03  Paul Eggert  <eggert@twinsun.com>
3515
3516         * strftime.c: Sync with glibc time/strftime.c 1.81.
3517
3518 2001-01-03  Jim Meyering  <meyering@lucent.com>
3519
3520         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
3521         local `inptr' to avoid warning with some system declarations of iconv.
3522
3523 2000-12-29  Paul Eggert  <eggert@twinsun.com>
3524
3525         * modechange.c: Do not assume that mode_t uses the
3526         traditional octal encoding.  E.g. "chmod 1 FOO" should set
3527         the other-execute bit of FOO even if S_IXOTH != 1.
3528
3529         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
3530         WOTH, XOTH, ALLM): New macros.
3531         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
3532          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
3533         Use them.
3534         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
3535         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
3536         (mode_compile):
3537         No need to use uintmax_t; unsigned long is long enough.
3538         Don't bother to get suffix since we don't use it.
3539
3540 2000-12-24  Jim Meyering  <meyering@lucent.com>
3541
3542         * hash.c (is_prime): Return explicit boolean values.
3543         (hash_get_first): Return NULL to appease Irix5.6's 89.
3544         Reported by Nelson Beebe.
3545
3546 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
3547
3548         * localcharset.c (locale_charset): Add support for Win32.
3549
3550 2000-12-18  Paul Eggert  <eggert@twinsun.com>
3551
3552         * physmem.h, physmem.c: New files.
3553
3554         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
3555         (noinst_HEADERS): Add physmem.h.
3556
3557         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
3558         't' for compatibility with Solaris 8 sort.
3559
3560 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
3561
3562         * config.charset: Add support for BeOS.
3563
3564 2000-12-16  Jim Meyering  <meyering@lucent.com>
3565
3566         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
3567         SHELLS_FILE to a file name that's useful on djgpp systems.
3568         Include stdlib.h.
3569         (ADDITIONAL_DEFAULT_SHELLS): Define.
3570         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
3571         Based mostly on a patch from Prashant TR.
3572
3573 2000-12-16  Jim Meyering  <meyering@lucent.com>
3574
3575         This bug had a serious impact on chown: `chown N:M FILE' (for integer
3576         N and M) would have treated it like `chown N:N FILE'.
3577
3578         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
3579
3580 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
3581
3582         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
3583         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
3584         to the list of canonical encodings. Rename EUC-CN to GB2312.
3585
3586 2000-12-08  Andreas Schwab  <schwab@suse.de>
3587
3588         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
3589         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
3590
3591 2000-12-07  Jim Meyering  <meyering@lucent.com>
3592
3593         * stripslash.c (ISSLASH): Define.
3594         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
3595         From Prashant TR.
3596
3597         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
3598         (dir_name_r): Declare this function as static.
3599         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
3600         manifest itself on a name containing a mix of slashes and
3601         backslashes.
3602         Make this function work with names starting with a DOS-style
3603         drive letter and colon prefix.
3604         (dir_name): Append `.' if necessary.
3605         Based mostly on patches from Prashant TR and Eli Zaretskii.
3606
3607         * dirname.h (dir_name_r): Remove prototype.
3608
3609 2000-12-05  Jim Meyering  <meyering@lucent.com>
3610
3611         * dirname.c (dir_name_r): Add `const' in a few local declarations.
3612
3613 2000-12-04  Jim Meyering  <meyering@lucent.com>
3614
3615         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
3616         Also include memory.h, stdlib.h, unistd.h if appropriate.
3617         Reported by Andreas Jaeger (conflicting declaration of malloc).
3618
3619 2000-12-02  Jim Meyering  <meyering@lucent.com>
3620
3621         * closeout.h: Make idempotent, to avoid some obscure warnings.
3622
3623 2000-12-01  Paul Eggert  <eggert@twinsun.com>
3624
3625         * memrchr.c: Include <config.h> before any system include file.
3626
3627 2000-11-29  Paul Eggert  <eggert@twinsun.com>
3628
3629         * dirname.c (dir_name_r): Fix typo: int -> size_t.
3630
3631 2000-11-26  Jim Meyering  <meyering@lucent.com>
3632
3633         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
3634
3635 2000-11-22  Paul Eggert  <eggert@twinsun.com>
3636
3637         * strftime.c (my_strftime): Do not invoke mbrlen with a
3638         size of (size_t) -1; it's not portable.
3639
3640 2000-11-17  Akim Demaille  <akim@epita.fr>
3641
3642         * obstack.h: Formatting changes.
3643         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
3644         prevent type checking.
3645         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
3646         cast the value to (void *): assigning a `foo *' to a `void *'
3647         variable is valid.
3648         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
3649
3650 2000-11-17  Jim Meyering  <meyering@lucent.com>
3651
3652         * strstr.c: Update from GNU libc.
3653
3654 2000-11-16  Jim Meyering  <meyering@lucent.com>
3655
3656         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
3657
3658 2000-11-11  Jim Meyering  <meyering@lucent.com>
3659
3660         * error.c: Add a couple #includes, merging from GNU libc version.
3661
3662 2000-11-10  Jim Meyering  <meyering@lucent.com>
3663
3664         * obstack.h: Update from GNU libc.
3665         * obstack.c: Likewise.
3666
3667 2000-11-06  Paul Eggert  <eggert@twinsun.com>
3668
3669         * getusershell.c (setusershell): Use rewind rather than
3670         fseek/fseeko, to avoid configuration hassles with fseeko.
3671         Don't bother opening SHELLS_FILE if shellstream is NULL;
3672         it's not necessary.
3673
3674 2000-11-05  Jim Meyering  <meyering@lucent.com>
3675
3676         * makepath.h (make_dir): Declare.
3677         * makepath.c (make_dir): Remove `static' attribute.
3678         Tweak a comment.
3679
3680 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
3681
3682         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
3683         last one in a bucket, advance to the next bucket.
3684
3685 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
3686
3687         * fnmatch.c: Do not comment out all the code if we are using
3688         the GNU C library, because in some cases we are replacing buggy
3689         code in the GNU C library itself.
3690
3691 2000-10-30  Paul Eggert  <eggert@twinsun.com>
3692
3693         * error.h, getline.h, modechange.h:
3694         Remove "2000" from Copyright line, as the file hasn't been
3695         changed this year other than in the copyright notice.
3696
3697         * xalloc.h: Add "2000" to Copyright line, as this file
3698         was changed this year.
3699
3700 2000-10-30  Paul Eggert  <eggert@twinsun.com>
3701
3702         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
3703         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
3704         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
3705
3706 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
3707
3708         * regex.h (__restrict_arr): Move definition out of #ifndef block.
3709         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
3710         doesn't define __restrict_arr.
3711
3712 2000-10-29  Jim Meyering  <meyering@lucent.com>
3713
3714         * xstat.in: Fix grammar in comment.
3715
3716 2000-10-28  Jim Meyering  <meyering@lucent.com>
3717
3718         * memchr.c: Update from libc.
3719         Adjust for portability:
3720         [HAVE_STDLIB_H]: Include stdlib.h.
3721         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
3722         Undef __memchr, too.
3723         [!weak_alias]: Define __memchr to memchr.
3724
3725         * regex.c: Update from libc.
3726         * regex.h: Likewise.
3727         * getopt1.c: Likewise.
3728         * memcmp.c: Likewise.
3729
3730         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
3731         Avoid using fseek, when possible -- it's broken by design.
3732         Patch by Ulrich Drepper.
3733
3734 2000-10-26  Jim Meyering  <meyering@lucent.com>
3735
3736         * strftime.c: Update from libc.
3737
3738 2000-10-25  Jim Meyering  <meyering@lucent.com>
3739
3740         * obstack.c: Update from libc.
3741
3742 2000-10-23  Jim Meyering  <meyering@lucent.com>
3743
3744         * hard-locale.c (hard_locale): Revert last change -- it was simply
3745         wrong.  That set_locale call must not have any side effects.
3746         From Paul Eggert.
3747
3748 2000-10-22  Jim Meyering  <meyering@lucent.com>
3749
3750         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
3751         [CYCLIC]: Remove now-unused definition.
3752
3753         * save-cwd.c (O_DIRECTORY): Define, if needed.
3754         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
3755         Suggestion from Ulrich Drepper.
3756
3757 2000-10-21  Jim Meyering  <meyering@lucent.com>
3758
3759         * dirname.c (dir_name_r): New function, factored out of dir_name.
3760         (dir_name): Use dir_name_r.
3761         * dirname.h (dir_name_r): Declare it.
3762
3763 2000-10-21  Jim Meyering  <meyering@lucent.com>
3764
3765         * dirname.c (memrchr): Declare if necessary.
3766         (dir_name): Remove the restriction that there be no
3767         trailing slashes.  Now, this code skips past them, effectively
3768         ignoring them.
3769         [TEST_DIRNAME] (main): New unit tests.
3770
3771         * memrchr.c: New file from GNU libc.
3772         Undef __memrchr, too.
3773         [!weak_alias]: Define __memrchr to memrchr.
3774         Guard weak_alias use with `#ifdef weak_alias'.
3775
3776 2000-10-17  Jim Meyering  <meyering@lucent.com>
3777
3778         * quote.h (PARAMS): Define and use.
3779         Reported by Akim Demaille.
3780
3781         * getopt.c: Update from libc.
3782
3783 2000-10-16  Jim Meyering  <meyering@lucent.com>
3784
3785         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
3786         From Jan Fedak.
3787
3788 2000-09-25  Jim Meyering  <meyering@lucent.com>
3789
3790         * md5.h (rol): Define (from GnuPG).
3791
3792         * sha.c: Give credit (GnuPG) where due.
3793         (M): Use rol rather than open-coding it.
3794         Add a FIXME comment.
3795
3796 2000-09-21  Jim Meyering  <meyering@lucent.com>
3797
3798         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
3799         Reported by Michael Stone.
3800
3801 2000-09-20  Jim Meyering  <meyering@lucent.com>
3802
3803         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
3804         (noinst_HEADERS): Add sha.h.
3805         Based on code from Scott G. Miller and from GnuPG.
3806
3807 2000-09-15  Jim Meyering  <meyering@lucent.com>
3808
3809         * regex.c: Update from libc.
3810
3811 2000-09-10  Jim Meyering  <meyering@lucent.com>
3812
3813         * getopt.c (_getopt_internal): Update from glibc.
3814
3815 2000-09-09  Jim Meyering  <meyering@lucent.com>
3816
3817         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
3818         think it should be used as a general replacement for isascii.
3819         * fnmatch.c: Likewise.
3820         * mbswidth.c: Likewise
3821         * regex.c: Likewise.
3822
3823         Don't use atoi.
3824         * userspec.c: Include sys/param.h and limits.h.
3825         Include xstrtol.h.
3826         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
3827         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
3828         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
3829         UID, GID.  Check range.
3830
3831 2000-09-06  Jim Meyering  <meyering@lucent.com>
3832
3833         * getopt.c (_getopt_internal): Update from glibc.
3834
3835 2000-08-30  Jim Meyering  <meyering@lucent.com>
3836
3837         * strftime.c: Merge in changes from GNU libc.
3838
3839 2000-08-26  Jim Meyering  <meyering@lucent.com>
3840
3841         * closeout.c: Include "__fpending.h".
3842         (close_stdout_status): Return right away if there's nothing to flush.
3843
3844         * Makefile.am (noinst_HEADERS): Add __fpending.h.
3845         * __fpending.c: New file.
3846         * __fpending.h: New file.
3847
3848 2000-08-07  Paul Eggert  <eggert@twinsun.com>
3849
3850         Standardize on "memory exhausted" instead of "Memory exhausted"
3851         or "virtual memory exhausted".
3852         * obstack.c (print_and_abort): Use "memory exhausted", not
3853         "virtual memory exhausted".
3854         * same.c (same_name): Invoke xalloc_die instead of printing
3855         our own message.
3856         * userspec.c (parse_user_spec): Likewise.
3857         * bumpalloc.h: comment fix
3858         * same.c, userspec.c: Include xalloc.h.
3859
3860         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
3861         not char *const and pointing to a constant array.
3862         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
3863         (xrealloc): Comment fix.
3864
3865         * userspec.c (parse_user_spec):
3866         Don't translate a message until just before returning,
3867         to avoid unnecessary translation.
3868
3869 2000-08-07  Jim Meyering  <meyering@lucent.com>
3870
3871         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
3872         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
3873         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
3874         getgroups.c, gethostname.c, getopt.h, group-member.c,
3875         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
3876         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
3877         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
3878         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
3879         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
3880         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
3881         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
3882         yesno.c: Back out Copyright date changes for each file with no change
3883         this year.  This eases coordination with other programs using the same
3884         source code modules.  From Paul Eggert.
3885
3886 2000-08-03  Greg McGary  <greg@mcgary.org>
3887
3888         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
3889         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
3890         (EXTEND_BUFFER): Use them.
3891
3892 2000-08-01  Jim Meyering  <meyering@lucent.com>
3893
3894         * dirname.c (ISSLASH): Define.
3895         (BACKSLASH_IS_PATH_SEPARATOR): Define.
3896         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
3897         both `\' and `/' may be use as path separators.
3898         Based on a patch from Prashant TR.
3899
3900 2000-07-31  Paul Eggert  <eggert@twinsun.com>
3901
3902         * quotearg.c (quotearg_n_options): Don't make the initial
3903         slot vector a constant, since it might get modified.
3904
3905 2000-07-31  Jim Meyering  <meyering@lucent.com>
3906
3907         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
3908         * obstack.c (print_and_abort): Likewise.
3909
3910 2000-07-30  Paul Eggert  <eggert@twinsun.com>
3911
3912         * quotearg.c (quotearg_n_options): Preallocate a slot 0
3913         buffer, so that the caller can always quote one small
3914         component of a "memory exhausted" message in slot 0.
3915         From a suggestion by Jim Meyering.
3916
3917 2000-07-30  Jim Meyering  <meyering@lucent.com>
3918
3919         * makepath.c (make_path): Quote the other instance, too.
3920
3921         * quotearg.c (N_STATIC_SLOTVECS): Define.
3922         (STATIC_BUF_SIZE): Define.
3923         (quotearg_n_options): Use only statically allocated storage when
3924         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
3925         than STATIC_BUF_SIZE.
3926
3927 2000-07-29  Jim Meyering  <meyering@lucent.com>
3928
3929         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
3930         * dirname.c (dir_name): Likewise.
3931
3932         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
3933
3934         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
3935         (dir_name): Assert that there are no trailing slashes.
3936
3937 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
3938
3939         * mbswidth.h (mbswidth): Add a flags argument.
3940         (mbswidth): New declaration.
3941         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
3942         * mbswidth.c (mbswidth): Add a flags argument.
3943         (mbsnwidth): New function.
3944
3945 2000-07-24  Jim Meyering  <meyering@lucent.com>
3946
3947         * mbswidth.c: Remove useless #else.  From Bruno Haible.
3948
3949 2000-07-23  Paul Eggert  <eggert@twinsun.com>
3950
3951         * mbswidth.c (_XOPEN_SOURCE):
3952         Don't define; this causes problems on Solaris 7.
3953         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
3954
3955 2000-07-23  Paul Eggert  <eggert@twinsun.com>
3956
3957         * quotearg.c:
3958         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
3959         so that mbstate_t is always defined.
3960
3961         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
3962         be 1 in at least one GCC installation, and this configuration
3963         error is likely to be common.  Ignoring MB_LEN_MAX hurts
3964         performance on hosts that have mbrtowc but have only unibyte
3965         locales, but I assume these hosts are rare.
3966
3967 2000-07-23  Paul Eggert  <eggert@twinsun.com>
3968
3969         * quotearg.c: Streamline by invoking multibyte code only if needed.
3970         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
3971         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
3972         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
3973         invoke multibyte primitives.
3974
3975 2000-07-23  Jim Meyering  <meyering@lucent.com>
3976
3977         * basename.c (base_name): Add an assertion.
3978
3979 2000-07-15  Bruno Haible  <clisp.cons.org>
3980
3981         * quotearg.c: When the system forces us to redefine mbstate_t,
3982         shadow its mbsinit function.
3983
3984 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
3985
3986         * mbswidth.h: New file.
3987         * mbswidth.c: New file.
3988         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
3989         (noinst_HEADERS): Add mbswidth.h.
3990
3991 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
3992
3993         * config.charset: Add support for FreeBSD. Improve support for HP-UX
3994         and IRIX 6.
3995
3996 2000-07-15  Jim Meyering  <meyering@lucent.com>
3997
3998         * makepath.c: Include quote.h.
3999         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
4000         corresponding argument in a `quote (...)' call.
4001         Give better diagnostics.
4002
4003         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
4004         (noinst_HEADERS): Add quote.h.
4005
4006         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
4007         from tar's src/misc.c.
4008         * quote.h: New file.  Prototypes for same.
4009
4010 2000-07-10  Paul Eggert  <eggert@twinsun.com>
4011
4012         From a suggestion by Bruno Haible.
4013         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
4014         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
4015         to decide whether to define the BeOS workaround macro;
4016         this adjusts to the change to AC_MBSTATE_T.
4017
4018 2000-07-13  Paul Eggert  <eggert@twinsun.com>
4019
4020         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
4021
4022         * quotearg.c (quoting_style_args, quoting_style_vals,
4023         quotearg_buffer_restyled): Add support for
4024         clocale_quoting_style.  Undo previous change to
4025         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
4026         and "{RIGHT QUOTATION MARK}" msgids.
4027
4028 2000-07-05  Paul Eggert  <eggert@twinsun.com>
4029
4030         The old behavior of quoting `like this' doesn't look good with
4031         newer, ISO-style fonts.  See:
4032         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
4033
4034         Instead, quote "like this" by default.  Let the translator
4035         tailor the locale-specific quoting behavior by providing
4036         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
4037
4038         * quotearg.c (N_): New macro.
4039         (gettext_default): New function.
4040         (quotearg_buffer_restyled): Use
4041         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
4042         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
4043
4044 2000-07-09  Jim Meyering  <meyering@lucent.com>
4045
4046         * Most files: Update copyright dates to include 2000.
4047
4048 2000-07-08  Jim Meyering  <meyering@lucent.com>
4049
4050         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
4051         if not defined.
4052         (xgethostname): Remove now-unnecessary #ifdef.
4053         Move declaration of `err' into loop where it's used.
4054
4055 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
4056
4057         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
4058         by allocating a larger buffer. Test the gethostname return value for
4059         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
4060         returns an error and ENAMETOOLONG isn't defined.
4061
4062 2000-07-05  Paul Eggert  <eggert@twinsun.com>
4063         and Bruno Haible  <haible@clisp.cons.org>
4064
4065         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
4066
4067 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
4068
4069         * quotearg.c (struct quoting_options): Simplify quote_these_too
4070         dimension.
4071
4072 2000-07-03  Jim Meyering  <meyering@lucent.com>
4073
4074         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
4075         Reported by Bruno Haible.
4076
4077 2000-07-04  Jim Meyering  <meyering@lucent.com>
4078
4079         * quotearg.c: Make inclusion of <wchar.h> independent of whether
4080         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
4081         lacks mbrtowc.
4082
4083 2000-07-03  Paul Eggert  <eggert@twinsun.com>
4084         and Bruno Haible  <haible@clisp.cons.org>
4085
4086         * quotearg.c (mbrtowc):
4087         Assign to *pwc, and return 1 only if result is nonzero.
4088         (iswprint): Use ISPRINT when substituting our own mbrtowc.
4089
4090 2000-07-03  Jim Meyering  <meyering@lucent.com>
4091
4092         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
4093         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
4094         From Bob Proulx.
4095
4096 2000-07-02  Jim Meyering  <meyering@lucent.com>
4097
4098         * quotearg.c (mbstate_t): Don't define here.
4099
4100 2000-07-02  Jim Meyering  <meyering@lucent.com>
4101
4102         * nanosleep.c (SIGCONT): Define if not already defined.
4103
4104 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
4105
4106         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
4107         per change in ../m4/ls-mntd-fs.m4.
4108         (read_filesystem_list): Ignore symbolic links.
4109
4110 2000-06-29  Jim Meyering  <meyering@lucent.com>
4111
4112         * same.c: Include <string.h> or <strings.h>, as appropriate,
4113         for declaration of strcmp.
4114
4115         * long-options.c: Include <stdlib.h>, for declaration of exit.
4116
4117         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
4118         Avoid warning by casting result to `char *' to remove `const'.
4119
4120 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
4121
4122         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
4123
4124 2000-06-26  Paul Eggert  <eggert@twinsun.com>
4125
4126         savedir now sets errno on failure and invokes xmalloc to get memory.
4127         Fix a couple of other minor bugs while we're at it.
4128
4129         * savedir.c (<unistd.h>): Do not include; there's no need.
4130         (NAMLEN): Remove macro.
4131         (malloc, realloc): Remove decls.
4132         (stpcpy): Likewise.
4133         ("xalloc.h"): Include.
4134         (NAME_SIZE_DEFAULT): New macro.
4135         (savedir): Use xmalloc / xrealloc to allocate memory.
4136         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
4137         Skip "" directory entries.
4138         Use strlen to calculate directory entry length, since the old method
4139         is rarely used these days and isn't worth supporting.
4140         Don't use a pointer after freeing it.
4141         Check for integer overflow when calculating allocation size.
4142         Use memcpy to copy entries, instead of stpcpy.
4143         Set errno properly when returning NULL.
4144         Check for readdir error.
4145
4146 2000-06-26  Jim Meyering  <meyering@lucent.com>
4147
4148         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
4149
4150 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
4151
4152         * getusershell.c (xmalloc, xrealloc): Remove functions.
4153         Include xalloc.h.
4154         Don't include <stdlib.h>.  Don't declare malloc, realloc.
4155
4156 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
4157
4158         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
4159
4160 2000-06-24  Jim Meyering  <meyering@lucent.com>
4161
4162         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
4163
4164 2000-06-21  Jim Meyering  <meyering@lucent.com>
4165
4166         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
4167
4168 2000-06-19  Paul Eggert  <eggert@twinsun.com>
4169
4170         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
4171         (mbrtowc, mbstate_t): Define substitutes if
4172         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
4173         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
4174         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
4175
4176 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
4177
4178         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
4179         than 1024, return a memory chunk of least possible size, instead
4180         of size PATH_MAX + 2. In the loop, increment the size proportionally.
4181         Use free/xmalloc instead of xrealloc to avoid copying for very long
4182         paths.
4183
4184 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
4185
4186         * canon-host.c (canon_host): Use malloc and memcpy to copy an
4187         address, not strdup.  Include <stdlib.h> and don't declare free().
4188
4189 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
4190
4191         * path-concat.c (path_concat): Don't access dir[-1] if dir is
4192         the empty string.
4193
4194 2000-06-21  Jim Meyering  <meyering@lucent.com>
4195
4196         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
4197         (noinst_HEADERS): Add getstr.h.
4198
4199         * getline.c (getstr): Move into a separate file.
4200         * getstr.c (getstr): New file, extracted from getline.c, with
4201         the following changes: new parameter, delim2; both delim[12]
4202         parameters have type `int', not `char'.  The latter would lose
4203         with 8-bit delimiters.
4204         * getstr.h: New file.
4205
4206 2000-06-19  Jim Meyering  <meyering@lucent.com>
4207
4208         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
4209
4210 2000-06-18  Jim Meyering  <meyering@lucent.com>
4211
4212         * mkdir.c: Remove file, due mainly to copyright incompatibility.
4213         Besides, these days every porting target provides a mkdir function.
4214
4215         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
4216         (this snippet comes from src/system.h).
4217
4218 2000-06-15  Paul Eggert  <eggert@twinsun.com>
4219
4220         * human.c (adjust_value): New function.
4221         (human_readable_inexact): Apply rounding style even when
4222         printing approximate values.
4223
4224 2000-06-14  Paul Eggert  <eggert@twinsun.com>
4225
4226         * human.c (human_readable_inexact): Allow an input block
4227         size that is not a multiple of the output block size, and vice versa.
4228         Reported by Piergiorgio Sartor.
4229
4230 2000-06-14  Paul Eggert  <eggert@twinsun.com>
4231
4232         * getdate.y (get_date): Apply relative times after time
4233         zone indicator, not before.  Reported by Todd A. Jacobs.
4234
4235 2000-06-13  Jim Meyering  <meyering@lucent.com>
4236
4237         * Makefile.am (all-local): Depend on lstat.c and stat.c.
4238
4239         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
4240
4241 2000-06-12  Paul Eggert  <eggert@twinsun.com>
4242
4243         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
4244
4245 2000-06-04  Paul Eggert  <eggert@twinsun.com>
4246
4247         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
4248
4249 2000-06-04  Jim Meyering  <meyering@lucent.com>
4250
4251         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
4252         SunOS 4.1.4 for which gid_t is an unsigned type.
4253
4254 2000-06-03  Jim Meyering  <meyering@lucent.com>
4255
4256         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
4257
4258 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
4259
4260         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
4261         newer, don't install charset.alias.
4262         * config.charset: Change the Linux/glibc rules so they become empty
4263         on glibc-2.1 or newer.
4264
4265 2000-06-02  Jim Meyering  <meyering@lucent.com>
4266
4267         * mountlist.c: Back out last change.  Instead, do this...
4268         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
4269         member using the same `ignore'-testing code.
4270         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
4271         fs_type strings.
4272         From Mark D. Roth.
4273
4274 2000-05-29  Jim Meyering  <meyering@lucent.com>
4275
4276         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
4277         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
4278
4279 2000-05-22  Jim Meyering  <meyering@lucent.com>
4280
4281         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
4282
4283 2000-05-18  Jim Meyering  <meyering@lucent.com>
4284
4285         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
4286         back, too, since it may have been modified by allocate_entry.
4287         (hash_delete): Rewrite to use neither the assignment operator
4288         nor the comma operator in an if-expression.
4289
4290 2000-05-15  Paul Eggert  <eggert@twinsun.com>
4291
4292         * closeout.c:
4293         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
4294         Remove; no longer needed.
4295         "quotearg.h": Add include.
4296         (file_name): Do not bother to explicitly initialize to NULL; it's less
4297         efficient on some hosts.
4298         (close_stdout_status): Remove test as to whether stdout was already
4299         closed; it breaks for the case "echo x | sort >&-".
4300         Quote file name colons.
4301         Do not assume that _("write error") lacks format strings.
4302
4303 2000-05-15  Jim Meyering  <meyering@lucent.com>
4304
4305         * version-etc.c (version_etc_copyright): Update the copyright string
4306         used in all --version output.
4307
4308 2000-05-14  Jim Meyering  <meyering@lucent.com>
4309
4310         * closeout.c (close_stdout_set_file_name): New function.
4311         (close_stdout_status): Use new file-scoped global.
4312         Return right away if fstat says the stdout file descriptor is invalid.
4313         * closeout.h (close_stdout_set_file_name): Declare.
4314
4315 2000-05-10  Jim Meyering  <meyering@lucent.com>
4316
4317         * closeout.c [default_exit_status]: New file-scoped variable.
4318         (close_stdout_set_status): New function.
4319         * closeout.h (close_stdout_set_status): Declare.
4320
4321 2000-05-08  Jim Meyering  <meyering@lucent.com>
4322
4323         * long-options.c: Don't include closeout.h.
4324         (parse_long_options): Don't call close_stdout for --version.
4325
4326 2000-05-06  Jim Meyering  <meyering@lucent.com>
4327
4328         * strnlen.c: Undefine __strnlen and strnlen.
4329         [!weak_alias]: Define __strnlen to strnlen.
4330
4331         * atexit.c: New file, from libiberty.
4332
4333 2000-05-06  Jim Meyering  <meyering@lucent.com>
4334
4335         * closeout.c (close_stdout_status): Also check for errors on the
4336         stderr stream.
4337
4338 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
4339
4340         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
4341         instead of xmalloc, xrealloc, path_concat.
4342         (locale_charset): Treat empty environment variables as absent.
4343         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
4344
4345 2000-05-04  Jim Meyering  <meyering@lucent.com>
4346
4347         * getopt.c: Update from glibc.
4348         * obstack.c: Likewise.
4349         * obstack.h: Likewise.
4350         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
4351
4352         * regex.h: Likewise.
4353         * strndup.c: Likewise.
4354         * strnlen.c: New file, from glibc.
4355
4356 2000-05-01  Jim Meyering  <meyering@lucent.com>
4357
4358         * full-write.c (full_write): Remove `FIXME' part of comment.
4359
4360 2000-04-29  Jim Meyering  <meyering@lucent.com>
4361
4362         * path-concat.c: Declare strdup only if it's not defined.
4363         * canon-host.c: Likewise.
4364
4365 2000-04-28  Jim Meyering  <meyering@lucent.com>
4366
4367         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
4368         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
4369         included first, then limits.h is included by locale.h by libintl.h.
4370         From John David Anglin.
4371
4372 2000-04-25  Jim Meyering  <meyering@lucent.com>
4373
4374         * makepath.c (S_IRWXUGO): Define.
4375         (make_path): Always perform explicit chmod if MODE specifies any
4376         of the `special' permission bits.  Prompted by a bug report against
4377         install from Mate Wierdl and Joost van Baal.
4378
4379 2000-04-18  Jim Meyering  <meyering@lucent.com>
4380
4381         * README: New file.
4382
4383         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
4384         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
4385
4386 2000-04-17  Jim Meyering  <meyering@lucent.com>
4387
4388         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
4389         the definition of it to rpl_strftime also defined-away the system's
4390         declaration.
4391
4392 2000-04-15  Jim Meyering  <meyering@lucent.com>
4393
4394         Use `C' to denote so-called `contiguous' files, the same way
4395         that tar does.
4396         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
4397         (ftypelet): Use S_ISCTG.
4398         From Michael Deutschmann.
4399
4400 2000-04-14  Jim Meyering  <meyering@lucent.com>
4401
4402         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
4403
4404 2000-04-08  Jim Meyering  <meyering@lucent.com>
4405
4406         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
4407         names don't conflict.  Reported by Eli Zaretskii.
4408
4409 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
4410
4411         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
4412         bug.  Deal with the different error behavior of Irix iconv.
4413
4414 2000-04-07  Jim Meyering  <meyering@lucent.com>
4415
4416         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
4417         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
4418
4419 2000-04-05  Jim Meyering  <meyering@lucent.com>
4420
4421         Portability tweaks required for ultrix4.3.
4422         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
4423         * readutmp.c: Include sys/types.h before sys/stat.h.
4424         * canon-host.c: Declare strdup.
4425         * path-concat.c: Likewise.
4426         From John David Anglin.
4427
4428 2000-04-04  Jim Meyering  <meyering@lucent.com>
4429
4430         Be more DOS 8.3-friendly.
4431         * ref-add.sin: Renamed from ref-add.sed.in.
4432         * ref-del.sin: Renamed from ref-del.sed.in.
4433         * Makefile.am: Reflect renaming.
4434         Reported by Eli Zaretskii.
4435
4436         Use a temporary file name that won't clash with `charset.alias'
4437         in the DOS 8.3 name space.
4438         * Makefile.am (charset_tmp): Define.
4439         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
4440         (uninstall-local): Likewise.
4441         Reported by Eli Zaretskii.
4442
4443 2000-03-29  Paul Eggert  <eggert@twinsun.com>
4444
4445         * time/strftime.c (my_strftime): Make sure we call the system
4446         strftime, not ourselves, when invoking the underlying strftime.
4447
4448 2000-03-24  Jim Meyering  <meyering@lucent.com>
4449
4450         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
4451         (charset_alias): Define.
4452         (install-exec-local): Factor out common code.
4453         (uninstall-local): Split lines longer than 80.
4454         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
4455         (SUFFIXES): Define.
4456         (.sed.in.sed): New rule.  Don't redirect directly to $@.
4457         (CLEANFILES): Add ref-add.sed and ref-del.sed.
4458
4459 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
4460
4461         * config.charset: Output a line containing "Packages using this file".
4462         * ref-add.sed.in, ref-del.sed.in: New files.
4463         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
4464         ref-del.sed): New rules.
4465
4466 2000-03-17  Jim Meyering  <meyering@lucent.com>
4467
4468         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
4469         Otherwise, include <strings.h>
4470
4471 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
4472
4473         * unicodeio.c (utf8_wctomb): New function.
4474         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
4475         format instead of in UCS-4 with platform dependent endianness.
4476
4477 2000-03-07  Paul Eggert  <eggert@twinsun.com>
4478
4479         * savedir.c (savedir): Work even if directory size is
4480         negative; this can happen with some screwy NFS configurations.
4481
4482 2000-03-06  Jim Meyering  <meyering@lucent.com>
4483
4484         * localcharset.c (get_charset_aliases): Don't try to free file_name
4485         if it's NULL (because we ran out of memory).  From Bruno Haible.
4486
4487 2000-03-05  Jim Meyering  <meyering@lucent.com>
4488
4489         * localcharset.c ("path-concat.h"): Include.
4490         (get_charset_aliases): Use path_concat instead of ANSI string
4491         concatenation.
4492
4493         * unicodeio.h (PARAMS): Define.
4494         Use it to guard prototype.
4495
4496 2000-03-04  Jim Meyering  <meyering@lucent.com>
4497
4498         * Makefile.am (install-exec-local): Create $(libdir) before installing
4499         into it.
4500         (uninstall-local): Uncomment this rule so `make distcheck' works
4501         once again.
4502
4503         * unicodeio.c (<errno.h>): Include it.
4504         (errno): Declare if not defined.
4505
4506         * localcharset.c: Add Bruno's comment justifying use of volatile.
4507
4508         * config.charset: New version, incorporating remarks from a linux
4509         i18n mailing list.  From Bruno Haible.
4510
4511 2000-03-02  Jim Meyering  <meyering@lucent.com>
4512
4513         * Makefile.am (EXTRA_DIST): Add config.charset.
4514
4515 2000-03-01  Jim Meyering  <meyering@lucent.com>
4516
4517         * localcharset.c: Guard some #includes with `#if HAVE_...'.
4518         * unicodeio.c: Likewise.
4519
4520 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
4521
4522         * config.charset: New file.
4523         * localcharset.c: New file.
4524         * unicodeio.h, unicodeio.c: New files.
4525         * Makefile.am (DEFS): Add -DLIBDIR=...
4526         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
4527         (noinst_HEADERS): Add unicodeio.h.
4528         (all-local, install-exec-local, charset.alias): New targets.
4529
4530 2000-02-28  Paul Eggert  <eggert@twinsun.com>
4531
4532         * quotearg.c (ALERT_CHAR): New macro.
4533         (quotearg_buffer_restyled): Use it.
4534
4535 2000-02-27  Jim Meyering  <meyering@lucent.com>
4536
4537         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
4538         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
4539
4540         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
4541         not `#if STDC_HEADERS'.
4542         Declare malloc if needed.
4543
4544         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
4545         now that autoconf always defines the HAVE_DECL_ symbols.
4546         * human.c: Likewise.
4547         * same.c: Likewise.
4548         * strtoumax.c: Likewise.
4549
4550         * backupfile.c: Arrange for cpp to fail if the configure-time
4551         declaration check was not run.
4552         * hash.c: Likewise.
4553         * human.c: Likewise.
4554         * same.c: Likewise.
4555         * strtoumax.c: Likewise.
4556
4557         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
4558         then first look up the entire `.'-containing string as a login name.
4559
4560 2000-02-18  Paul Eggert  <eggert@twinsun.com>
4561
4562         * getdate.y: Handle two-digit years with leading zeros correctly.
4563         (textint): New typedef.
4564         (parser_control): Member year changed from int to textint.
4565         All uses changed.
4566         (YYSTYPE): Removed; replaced by %union with int and textint members.
4567         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
4568         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
4569         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
4570         (tSNUMBER, tUNUMBER): Now of type <textintval>.
4571         (date, number, to_year): Use width of number in digits, not its value,
4572         to determine whether it's a 2-digit year, or a 2-digit time.
4573         (yylex): Store number of digits of numeric tokens.
4574         Reported by John Kendall.
4575
4576         (parser_control): Changed from struct parser_control to typedef (for
4577         consistency).  All uses changed.
4578
4579         (tID): Removed; not used.
4580         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
4581
4582 2000-02-14  Paul Eggert  <eggert@twinsun.com>
4583
4584         * getpagesize.h (getpagesize): Port to VMS for Alpha;
4585         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
4586
4587 2000-02-12  Jim Meyering  <meyering@lucent.com>
4588
4589         * userspec.c (ISDIGIT): Define it.
4590         (isdigit): Remove definition.
4591         (is_number): Use ISDIGIT, not isdigit.
4592         <libintl.h>: Include.
4593         (_ and N_): Define.
4594         (parse_user_spec): Mark translatable strings.
4595
4596 2000-02-10  Jim Meyering  <meyering@lucent.com>
4597
4598         With these changes, nanosleep.[ch] are finally enough like the other
4599         lib/* replacement files to compile on a few more losing systems.
4600
4601         * nanosleep.h: Don't include config.h.
4602         Remove prototype from declaration of nanosleep.
4603         (PARAMS): Remove now-unneeded definition.
4604         * nanosleep.c: #undef nanosleep.
4605         (rpl_nanosleep): Rename from nanosleep.
4606
4607 2000-02-03  Jim Meyering  <meyering@lucent.com>
4608
4609         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
4610         rather than with `#if HAVE_UTMPNAME'.
4611
4612 2000-02-01  Jim Meyering  <meyering@lucent.com>
4613
4614         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
4615
4616 2000-01-31  Jim Meyering  <meyering@lucent.com>
4617
4618         * nanosleep.h (nanosleep): Guard declaration with
4619         `#if ! HAVE_DECL_NANOSLEEP'.
4620         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
4621         the declaration in that vendor's sys/timers.h.
4622         Reported by Christian Krackowizer.
4623
4624         * quotearg.c (ISASCII): Add #undef and move definition to follow
4625         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
4626         (ISPRINT): Likewise.
4627         Reported by Tom Tromey.
4628
4629 2000-01-30  Jim Meyering  <meyering@lucent.com>
4630
4631         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
4632         uses of ->ut_name.  The latter doesn't work with new Linux header files
4633         where only utmpx.ut_user is declared.
4634
4635         * readutmp.h (UT_USER): Define.
4636
4637 2000-01-23  Jim Meyering  <meyering@lucent.com>
4638
4639         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
4640         obstack.c.
4641
4642 2000-01-22  Jim Meyering  <meyering@lucent.com>
4643
4644         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
4645         [! HAVE_DECL_STRTOULL]: Declare strtoull.
4646         Required for some AIX systems.  Reported by Christian Krackowizer.
4647         [TESTING] (main): New function.
4648
4649         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
4650         * dirname.c (dir_name): Support for DOS-style file names with drive
4651         letters.
4652
4653         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
4654
4655         * strverscmp.c (ISDIGIT): Define.
4656         (strverscmp): Use ISDIGIT, not isdigit.
4657
4658 2000-01-17  Paul Eggert  <eggert@twinsun.com>
4659
4660         * nanosleep.c (nanosleep):
4661         Don't use SA_INTERRUPT to decide whether to call sigaction, as
4662         POSIX.1 doesn't require SA_INTERRUPT and some systems
4663         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
4664         it's been part of POSIX.1 since day 1 (in 1988).
4665
4666 2000-01-17  Jim Meyering  <meyering@lucent.com>
4667
4668         * interlock: Remove unused file.  Reported by François Pinard.
4669
4670 2000-01-16  Paul Eggert  <eggert@twinsun.com>
4671
4672         * quotearg.c (quotearg_buffer_restyled): Do not quote
4673         alert, backslash, formfeed, and vertical tab unnecessarily in
4674         shell quoting style.
4675
4676 Local Variables:
4677 version-control: never
4678 End: