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