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