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