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