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