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