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