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