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