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