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