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