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