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