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