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