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