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