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