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