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