mktemp, sort, tac: don't use undefined after mkstemp failure
[coreutils/bo.git] / lib / ChangeLog
blob99eba6641fea6b497611678276a53a75529cd044
1 2007-05-31  Jim Meyering  <jim@meyering.net>
3         * printf-parse.c, vasnprintf.c, unicodeio.c: Remove local
4         copies, so we now get these files from gnulib.
6 2007-03-20  Jim Meyering  <jim@meyering.net>
8         Fix a typo in the handling of %x and %X.
9         * vasnprintf.c (VASNPRINTF): When adding 2 to buffer length,
10         don't double it.
12 2007-03-04  Jim Meyering  <jim@meyering.net>
14         * vasnprintf.c (VASNPRINTF): Add missing semicolon.
16 2007-03-02  Jim Meyering  <jim@meyering.net>
18         * vasnprintf.c (VASNPRINTF): Remove cast of alloca return value.
20 2007-03-01  Jim Meyering  <jim@meyering.net>
22         Merge in changes from gnulib:
23         * vasnprintf.c: Add a comment explaining why coreutils has its own
24         version of this file.
25         Include <stdint.h>.
26         (SIZE_MAX): Remove definition (now, stdint.h covers that).
27         (EOVERFLOW): Remove definition (now done via the eoverflow module).
28         Update some #ifdef to #if.
29         Use HAVE_LONG_LONG_INT, not HAVE_LONG_LONG.
30         * printf-parse.c: Likewise.
32 2007-02-28  Jim Meyering  <jim@meyering.net>
34         * tsearch.c: Remove unused file.
36 2007-02-23  Jim Meyering  <jim@meyering.net>
38         * randperm.c (randperm_new): Comment: say that this function
39         returns a pointer to malloc'd storage.
41 2007-02-18  Jim Meyering  <jim@meyering.net>
43         * xfts.c: Include <stdlib.h> rather than exit.h, now that stdlib.h
44         is guaranteed to provide a valid definition of EXIT_FAILURE.
46 2007-01-19  Jim Meyering  <jim@meyering.net>
48         * .cvsignore, .gitignore: Add sys, as well as more
49         bootstrap-inserted file names.
51 2007-01-14  Jim Meyering  <jim@meyering.net>
53         * fchdir-stub.c: Remove file.  No longer needed.
55 2006-12-03  Jim Meyering  <jim@meyering.net>
57         * Makefile.am (libcoreutils_a_SOURCES): Remove xmemcoll.c and
58         xmemcoll.h.  Now, they're handled by the gnulib xmemcoll module.
60 2006-11-22  Paul Eggert  <eggert@cs.ucla.edu>
62         * randread.c (__attribute__): Don't define if __attribute__ is
63         already defined.  Otherwise, the code won't conform to C99, since
64         the macro arg is spelled differently by some include file, and the
65         compilation fails with pedantic GCC.
67 2006-11-22  Jim Meyering  <jim@meyering.net>
69         * .cvsignore, .gitignore: Add fstat.c.
71 2006-11-14  Jim Meyering  <jim@meyering.net>
73         * readlink-stub.c, lstat-stub.c: Remove now-unused files.
75 2006-10-14  Paul Eggert  <eggert@cs.ucla.edu>
77         Port sha512sum to hosts where uintmax_t is only 32 bits, e.g.,
78         HP/Tandom NonStop OSS circa 2005 has 32-bit uintmax_t, 64-bit intmax_t.
79         * u64.h: New file.
80         * sha512.c (SWAP, sha512_init_ctx, sha384_init_ctx, sha512_read_ctx):
81         (sha384_read_ctx, sha512_conclude_ctx, sha512_process_bytes):
82         (sha512_round_constants, F2, F1, sha512_process_block):
83         (S0, S1, SS0, SS1, M, R):
84         Rewrite to use u64.h instead of assuming uint64_t.
85         * sha512.h: Include u64.h rather than stdint.h.
86         (rol64): Remove; moved to u64.h and renamed to u64rol.
88 2006-10-12  Jim Meyering  <jim@meyering.net>
90         * Makefile.am (libcoreutils_a_LIBADD): Append $(LIBOBJS),
91         to accommodate the latest version of gnulib-tool.
92         (libcoreutils_a_DEPENDENCIES): Likewise.
93         From Bruno Haible.
95 2006-10-06  Jim Meyering  <jim@meyering.net>
97         Avoid a compiler warning: const'ify and remove a cast.
98         * randread.c (struct randread_source) [handler]: Make parameter "const".
99         [handler_arg]: Add "const" attribute.
100         (randread_error): Make parameter "const".
101         (simple_new, randread_set_handler, randread_set_handler_arg): Likewise.
102         (randread_new): Remove now-unnecessary cast.
103         * randread.h: Adjust prototypes.
105 2006-09-29  Paul Eggert  <eggert@cs.ucla.edu>
107         * .cvsignore: Add openat-proc.c.
109 2006-09-25  Paul Eggert  <eggert@cs.ucla.edu>
111         * .cvsignore: Add fchmodat.c.
113 2006-09-25  Jim Meyering  <jim@meyering.net>
115         * fchmodat.c: Remove file.  gnulib's copy is identical.
117 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
119         * .cvsignore: Add fcntl.h, fcntl_.h, inttypes_.h, isapipe.c,
120         isapipe.h.
122 2006-08-25  Paul Eggert  <eggert@cs.ucla.edu>
124         * euidaccess-stat.c: Include <config.h> unconditionally, since
125         we now assume config.h exists.
126         * fchmodat.c: Likewise.
127         * fd-reopen.c: Likewise.
128         * fdopendir-glibc.c: Likewise.
129         * memxfrm.c: Likewise.
130         * printf-parse.c: Likewise.
131         * rand-isaac.c: Likewise.
132         * randint.c: Likewise.
133         * randperm.c: Likewise.
134         * randread.c: Likewise.
135         * root-dev-ino.c: Likewise.
136         * sha256.c: Likewise.
137         * sha512.c: Likewise.
138         * stdopen.c: Likewise.
139         * strintcmp.c: Likewise.
140         * strnumcmp.c: Likewise.
141         * t-chdir-long: Likewise.
142         * tsearch.c: Likewise.
143         * unicodeio.c: Likewise.
144         * vasnprintf.c: Likewise.
145         * xfts.c: Likewise.
146         * xmemxfrm.c: Likewise.
148         * .cvsignore: Add configmake.h, stamp-h1.
150 2006-08-23  Paul Eggert  <eggert@cs.ucla.edu>
152         * .cvsignore: Add config.h, config.hin.
153         * Makefile.am (AM_CPPFLAGS): Remove; we no longer need '-I..'.
155 2006-08-22  Paul Eggert  <eggert@cs.ucla.edu>
157         * .cvsignore: Add Makefile.in, getdate.tab.h.
158         Remove stat.c, sysexit.h.
160 2006-08-22  Jim Meyering  <jim@meyering.net>
162         * .cvsignore: Add files that are now generated by ../bootstrap.
164 2006-08-21  Eric Blake  <ebb9@byu.net>
166         * Makefile.am (LDADD): Restore this line; it is still needed for
167         t-fpending on platforms without __fpending.
169 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
171         Add a bootstrap procedure, so that the CVS version contains fewer
172         files and we bootstrap the rest from gnulib, gettext, etc.
173         * Makefile.am: include gnulib.mk, so that we can remove most of
174         this file.
175         (AM_CPPFLAGS): Don't mention -I$(srcdir), since that's now done
176         for us.
177         (noinst_LIBRARIES, LDDADD, DEFS): Remove.
178         (libcoreutils_a_SOURCES): Trim down greatly, just to the files
179         that aren't in gnulib.
180         (libcoreutils_a_LIBADD, lib_OBJECTS, BUILT_SOURCES, CLEANFILES):
181         (MAINTAINERCLEANFILES, MOSTLYCLEANDIRS, MOSTLYCLEANFILES):
182         (SUFFIXES, EXTRA_DIST, all-local, charset_alias, charset_tmp):
183         (install-exec-local, uninstall-local, charset.alias, .sin.sed):
184         (stdbool.h, stdint.h, fnmatch.h, arpa/inet.h, netinet/in.h):
185         (sys/socket.h, getopt.h): Remove.
187         * Makefile.in, README, __fpending.c, __fpending.h, acl.c, acl.h:
188         * alloca.c, alloca_.h, allocsa.c, allocsa.h, argmatch.c, argmatch.h:
189         * asnprintf.c, asprintf.c, at-func.c, atexit.c, backupfile.c:
190         * backupfile.h, base64.c, base64.h, basename.c, bcopy.c, c-strtod.c:
191         * c-strtod.h, c-strtold.c, calloc.c, canon-host.c, canon-host.h:
192         * canonicalize.c, canonicalize.h, chdir-long.c, chdir-long.h:
193         * chdir-safer.c, chdir-safer.h, chown.c, cloexec.c, cloexec.h:
194         * close-stream.c, close-stream.h, closeout.c, closeout.h:
195         * config.charset, creat-safer.c, cycle-check.c, cycle-check.h:
196         * dev-ino.h, diacrit.c, diacrit.h, dirchownmod.c, dirchownmod.h:
197         * dirfd.c, dirfd.h, dirname.c, dirname.h, dup-safer.c, dup2.c:
198         * error.c, error.h, euidaccess.c, euidaccess.h, exclude.c:
199         * exclude.h, exit.h, exitfail.c, exitfail.h, fchown-stub.c:
200         * fcntl--.h, fcntl-safer.h, fd-safer.c, file-type.c, file-type.h:
201         * fileblocks.c, filemode.c, filemode.h, filenamecat.c:
202         * filenamecat.h, fnmatch.c, fnmatch_.h, fnmatch_loop.c:
203         * fopen-safer.c, fprintftime.c, fprintftime.h, free.c, fsusage.c:
204         * fsusage.h, ftruncate.c, fts-cycle.c, fts.c, fts_.h, full-read.c:
205         * full-read.h, full-write.c, full-write.h, gai_strerror.c:
206         * getaddrinfo.c, getaddrinfo.h, getcwd.c, getcwd.h, getdate.h:
207         * getdate.y, getdelim.c, getdelim.h, getgroups.c, gethostname.c:
208         * gethrxtime.c, gethrxtime.h, getline.c, getline.h, getloadavg.c:
209         * getndelim2.c, getndelim2.h, getopt.c, getopt1.c, getopt_.h:
210         * getopt_int.h, getpagesize.h, getpass.c, getpass.h, gettext.h:
211         * gettime.c, gettimeofday.c, getugroups.c, getusershell.c:
212         * group-member.c, group-member.h, hard-locale.c, hard-locale.h:
213         * hash-pjw.c, hash-pjw.h, hash.c, hash.h, human.c, human.h:
214         * idcache.c, imaxtostr.c, inet_ntop.c, inet_ntop.h, intprops.h:
215         * inttostr.c, inttostr.h, lchmod.h, lchown.c, lchown.h:
216         * linebuffer.c, linebuffer.h, localcharset.c, localcharset.h:
217         * long-options.c, long-options.h, lstat.c, lstat.h, malloc.c:
218         * mbchar.c, mbchar.h, mbswidth.c, mbswidth.h, mbuiter.h, md5.c:
219         * md5.h, memcasecmp.c, memcasecmp.h, memchr.c, memcmp.c, memcoll.c:
220         * memcoll.h, memcpy.c, memmove.c, mempcpy.c, mempcpy.h, memrchr.c:
221         * memrchr.h, memset.c, mkancesdirs.c, mkancesdirs.h, mkdir-p.c:
222         * mkdir-p.h, mkdir.c, mkdirat.c, mkstemp-safer.c, mkstemp.c:
223         * mktime.c, modechange.c, modechange.h, mountlist.c, mountlist.h:
224         * nanosleep.c, obstack.c, obstack.h, offtostr.c, open-safer.c:
225         * openat-die.c, openat-priv.h, openat.c, openat.h, pathmax.h:
226         * physmem.c, physmem.h, pipe-safer.c, posixtm.c, posixtm.h:
227         * posixver.c, posixver.h, printf-args.c, printf-args.h:
228         * printf-parse.h, putenv.c, quote.c, quote.h, quotearg.c:
229         * quotearg.h, raise.c, readlink.c, readtokens.c, readtokens.h:
230         * readtokens0.c, readtokens0.h, readutmp.c, readutmp.h, realloc.c:
231         * ref-add.sin, ref-del.sin, regcomp.c, regex.c, regex.h:
232         * regex_internal.c, regex_internal.h, regexec.c, rename.c, rmdir.c:
233         * rpmatch.c, safe-read.c, safe-read.h, safe-write.c, safe-write.h:
234         * same-inode.h, same.c, same.h, save-cwd.c, save-cwd.h, savedir.c:
235         * savedir.h, setenv.c, setenv.h, settime.c, sha1.c, sha1.h:
236         * sig2str.c, sig2str.h, snprintf.c, snprintf.h, socket_.h:
237         * stat-macros.h, stat-time.h, stdbool_.h, stdint_.h, stdio--.h:
238         * stdio-safer.h, stdlib--.h, stdlib-safer.h, stpcpy.c, strcase.h:
239         * strcasecmp.c, strcspn.c, strdup.c, strdup.h, strftime.c:
240         * strftime.h, stripslash.c, strncasecmp.c, strndup.c, strndup.h:
241         * strnlen.c, strnlen.h, strnlen1.c, strnlen1.h, strpbrk.c, strstr.c:
242         * strstr.h, strtod.c, strtoimax.c, strtol.c, strtoll.c, strtoul.c:
243         * strtoull.c, strtoumax.c, strverscmp.c, strverscmp.h, tempname.c:
244         * time_r.c, time_r.h, timespec.h, umaxtostr.c, unicodeio.h:
245         * unistd--.h, unistd-safer.h, unlinkdir.c, unlinkdir.h:
246         * unlocked-io.h, unsetenv.c, userspec.c, userspec.h, utime.c:
247         * utimecmp.c, utimecmp.h, utimens.c, utimens.h, vasnprintf.h:
248         * vasprintf.c, vasprintf.h, verify.h, version-etc-fsf.c:
249         * version-etc.c, version-etc.h, wcwidth.h, xalloc-die.c, xalloc.h:
250         * xgetcwd.c, xgetcwd.h, xgethostname.c, xgethostname.h, xmalloc.c:
251         * xmemcoll.c, xmemcoll.h, xnanosleep.c, xnanosleep.h, xreadlink.c:
252         * xreadlink.h, xstrndup.c, xstrndup.h, xstrtod.c, xstrtod.h:
253         * xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtold.c, xstrtoul.c:
254         * xstrtoumax.c, xtime.h, yesno.c, yesno.h:
255         Remove from CVS, since ../bootstrap generates them automatically.
257 2006-08-18  Bruno Haible  <bruno@clisp.org>
259         * mountlist.c [MOUNTED_GETMNTINFO2]: Include sys/statvfs.h.
260         (ME_DUMMY): Treat "kernfs" as a dummy.
261         (read_file_system_list) [MOUNTED_GETMNTINFO2]: Implement.
263 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
265         * ChangeLog: Add copyright notice.
266         * .gdb-history: Likewise.
267         * TODO: Likewise.
268         * __fpending.h: Likewise.
269         * fdopendir-glibc.c: Likewise.
270         * fprintftime.h: Likewise.
271         * root-dev-ino.h: Likewise.
272         * search_.h: Likewise.
273         * t-chdir-long: Likewise.
274         * t-fpending.c: Likewise.
275         * savedir.c: Use (C) in copyright notice.
276         * savedir.h: Likewise.
278 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
280         * memcoll.c (memcoll): Set errno = 0 in the shortcut case, too.
281         Problem and fix reported by Pádraig Brady in
282         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00099.html>.
284 2006-08-16  Jim Meyering  <jim@meyering.net>
286         * fts.c (fts_children): Remove obsolete "// FIXME ..." comment.
287         Reported by Bruno Haible.
289 2006-08-15  Jim Meyering  <jim@meyering.net>
291         * at-func.c: New file, with the logic of all emulated at-functions.
292         * openat-priv.h: Include <errno.h> and define ENOSYS,
293         in support of the EXPECTED_ERRNO macro.
294         * openat.c (fstatat, unlinkat, fchownat): Remove function definitions.
295         Instead, define the appropriate symbols and include "at-func.c".
296         * mkdirat.c (mkdirat): Likewise.
297         * fchmodat.c (fchmodat): Likewise.
298         (ENOSYS): Remove definition.
299         * openat.c: Don't include <errno.h>, now that "openat-priv.h" does it.
300         Don't include "unistd--.h" -- it wasn't ever used.
302 2006-08-14  Paul Eggert  <eggert@cs.ucla.edu>
304         * memcoll.c (memcoll): Optimize for the common case where the
305         arguments are bytewise equal.
307 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
309         * pipe-safer.c (pipe_safer): Fix misspelling: HAVE_FUNC_PIPE ->
310         HAVE_PIPE.  Fix a file descriptor leak when fd_safer fails.
312         * regex_internal.c (re_string_skip_chars): Don't assume WEOF fits
313         in wchar_t.  Problem reported by Eric Blake.
315         * snprintf.c (snprintf): memcpy LEN bytes, not SIZE - 1, when
316         LEN is smaller than SIZE.  Suggested by Bruno Haible.
317         Also, help the compiler to keep LEN in a register.
319 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
321         Import the following changes from libc:
323         2006-06-02  Jakub Jelinek  <jakub@redhat.com>
325         * posix/regex_internal.c (re_string_skip_chars): If no character has
326         been converted at all, set *last_wc to WEOF.  If mbrtowc failed, set wc
327         to the byte which couldn't be converted.
328         (re_string_reconstruct): Don't clear valid_raw_len before calling
329         re_string_skip_chars.  If wc is WEOF after re_string_skip_chars, set
330         tip_context using re_string_context_at.
332         2006-05-02  Ulrich Drepper  <drepper@redhat.com>
334         * posix/regex.h: g++ still cannot handled [restrict].
336         2006-04-21  Ulrich Drepper  <drepper@redhat.com>
338         * posix/regex.h: Remove special handling for VMS.
340         Accommodate new getaddrinfo implementation in gnulib.
341         * inet_ntop.c, inet_ntop.h, snprintf.c, snprintf.h, socket_.h:
342         New files, from gnulib.
343         * .cppi-disable: Add snprintf.h, socket_.h.
344         * Makefile.am (libcoreutils_a_SOURCES): Add inet_ntop.h, snprintf.h.
345         (MOSTLYCLEANDIRS): New macro.
346         (BUILT_SOURCES): Add $(ARPA_INET_H), $(SYS_SOCKET_H), $(NETINET_IN_H).
347         (arpa/inet.h, netinet/in.h, sys/socket.h): New rules.
348         (MOSTLYCLEANFILES): Add arpa/inet.h, arpa/inet.h-t, netinet/in.h,
349         netinet/in.h-t, sys/socket.h, sys/socket.h-t.
350         (EXTRA_DIST): Add socket_.h.
352 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
354         * allocsa.h, config.charset, error.c, error.h, exitfail.c, full-write.c:
355         * getaddrinfo.c, getaddrinfo.h, gettext.h, localcharset.c, mbchar.h:
356         * mbswidth.c, mkstemp-safer.c, pipe-safer.c, printf-args.c, quote.c:
357         * readlink.c, regex_internal.h, setenv.c, stdint_.h, stdio--.h:
358         * stdio-safer.h, stpcpy.c, strcspn.c, strtoimax.c, vasnprintf.h:
359         * version-etc.c, wcwidth.h:
360         Update from gnulib.
362 2006-08-09  Jim Meyering  <jim@meyering.net>
364         * rand-isaac.c: Include <config.h>.
366 2006-08-08  Paul Eggert  <eggert@cs.ucla.edu>
368         * Makefile.am (libcoreutils_a_SOURCES): Add xmemxfrm.c, xmemxfrm.h.
369         * memxfrm.c, memxfrm.h, randint.c, randint.h, randperm.c, randperm.h:
370         * randread.c, randread.h, xmemxfrm.c, xmemxfrm.h: New files.
371         * rand-isaac.h: New file.
372         * rand-isaac.c: New file, mostly taken from ../src/rand-isaac.c.
374 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
376         * modechange.c (mode_compile): Numeric modes now affect setuid and
377         setgid on directories only if they set these bits.
378         * modechange.h: Remove obsolete comment about masks.
380 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
382         * close-stream.c, close-stream.h: New files.
383         * closeout.c (close_stdout): Use new function close_stream.
385 2006-07-19  Mike Frysinger  <vapier@gentoo.org>
387         * mountlist.c [ME_REMOTE]: Filter out cifs.
388         Reported by Toralf Förster in <http://bugs.gentoo.org/141012>.
390 2006-07-20  Jim Meyering  <jim@meyering.net>
392         * mountlist.c (ME_REMOTE): Compare strchr's result to NULL, not 0,
393         for better readability.
395 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
397         * dirchownmod.c, dirchownmod.h, mkancesdirs.c, mkancesdirs.h:
398         New files.
399         * mkdir-p.c: Don't include alloca.h, stdio.h, sys/types.h,
400         unistd.h, string.h, chdir-safer.h, dirname.h, lchmod.h, lchown.h,
401         save-cwd.h.  Instead, include dirchownmod.h and mkancesdirs.h.
402         (make_dir_parents): New args MAKE_ANCESTOR, OPTIONS, ANNOUNCE,
403         MODE_BITS.  Remove options VERBOSE_FMT_STRING, CWD_ERRNO.  All
404         callers changed.  Revamp internals significantly, by not
405         attempting to create directories that are temporarily more
406         permissive than the final results.  Do not attempt to use
407         save_cwd/restore_cwd; it isn't worth it for mkdir and install.
408         This removes some race conditions, fixes some bugs, and simplifies
409         things.  Use new dirchownmod function to do owner and mode changes.
410         * mkdir-p.h: Likewise.
411         * modechange.c (octal_to_mode): New function.
412         (struct mode_change): New member mentioned.
413         (make_node_op_equals): New arg mentioned.  All callers changed.
414         (mode_compile): Keep track of which mode bits the user has explicitly
415         mentioned.
416         (mode_adjust): New arg DIR, so that we implement the X op correctly.
417         New arg PMODE_BITS, to keep track of which mode bits the user
418         mentioned; it treats S_ISUID and S_ISGID speciall.
419         All callers changed.
420         * modechange.h: Likewise.
422 2006-07-16  Jim Meyering  <jim@meyering.net>
424         * userspec.c (parse_with_separator): Say "invalid spec" rather than
425         the sometimes erroneous "cannot get the login group of a numeric UID"
426         for a spec like "not-a-username:" or "1:".  Reported by
427         suckfish@ihug.co.nz in https://bugzilla.redhat.com/bugzilla/199027.
429 2006-07-10  Derek R. Price  <derek@ximbiot.com>
431         * backupfile.c, dirfd.h, fts.c, getcwd.c:
432         Ignore the obsolescent !HAVE_DIRENT_H case.  Consolidate NAMLEN
433         macros into the GNU _D_EXACT_NAMLEN.
434         * savedir.c:  Likewise.
435         (savedirstream): Use _D_EXACT_NAMLEN in preference to strlen.
437 2006-07-08  Paul Eggert  <eggert@cs.ucla.edu>
439         * Makefile.am (stdint.h): FULL_PATH_STDINT_H -> ABSOLUTE_STDINT_H,
440         to accommodate update from gnulib.
442         Update from gnulib, as follows:
444         2006-07-06  Jim Hyslop  <jhyslop@dreampossible.ca>  (tiny change)
446         * getaddrinfo.c: Changes to compile under MSVC6: changed
447         '#if WIN32_NATIVE' to '#ifdef' & moved WSAAPI macro inside
448         brackets.  Other minor changes to suppress some compiler
449         warnings.
451         2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
453         * getloadavg.c: Use __VMS, not VMS.
454         * getopt.c: Likewise.
455         * getpagesize.h: Likewise.
457         2006-07-06  Derek R. Price  <derek@ximbiot.com>
458         and Paul Eggert  <eggert@cs.ucla.edu>
460         * backupfile.c [HAVE_DIRENT_H && ! HAVE_NDIR_H]:
461         Don't worry about this obsolete case any more.
462         (HAVE_DIR): Remove.  All uses removed; we now assume you can read
463         directories.
464         * dirfd.h [HAVE_DIRENT_H && ! HAVE_NDIR_H]: Don't
465         worry about this obsolete case any more.
466         * fts.c: Likewise.
467         * getcwd.c: Likewise.
468         * savedir.c: Likewise.
470         2006-07-06  Paul Eggert  <eggert@cs.ucla.edu>
472         * fnmatch.c (ISBLANK): Remove.  All uses changed to isblank.
473         (isblank) [! (defined isblank || HAVE_DECL_ISBLANK)]: New macro.
474         (ISGRAPH): Remove.  All uses changed to isgraph.
475         (FOLD) [!defined _LIBC]: Remove special case.
476         * getdate.y (lookup_word): Remove no-longer-needed call to islower.
477         * regext_internal.h (isblank): Depend on HAVE_DECL_ISBLANK, not
478         HAVE_ISBLANK.
479         * strftime.c (TOLOWER, TOUPPER) [!defined _LIBC]: Remove special case.
481         2006-07-06  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
483         * strtod.c (strtod): cast the argument of tolower to unsigned char.
485         2006-07-05  Paul Eggert  <eggert@cs.ucla.edu>
487         * memcasecmp.c: Include <limits.h>.
488         (memcasecmp): Don't assume UCHAR_MAX <= INT_MAX.
489         * strtod.c (strtod): Don't assume isspace works on negative chars.
490         Don't assume isdigit succeeds only on '0' through '9'.
492         2006-07-05  Derek R. Price  <derek@ximbiot.com>
494         * exclude.c (IN_CTYPE_DOMAIN, is_space): Remove; no longer needed.
495         All uses of is_space replaced by isspace.
496         * exit.h: Don't talk about STDC_HEADERS.
497         * fnmatch.c (ISASCII): Remove; no longer needed.  All uses removed.
498         (ISPRINT, ISDIGIT, ISALNUM, ISALPHA, ISCNTRL, ISLOWER, ISPUNCT):
499         (ISSPACE, ISUPPER, ISXDIGIT): Remove; no longer needed.  All uses
500         replaced by isprint etc.
501         * getdate.y (IN_CTYPE_DOMAIN, ISSPACE, ISALPHA, ISLOWER): Likewise.
502         * getusershell.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
503         * memcasecmp.c (IN_CTYPE_DOMAIN, ISLOWER, TOUPPER): Likewise.
504         * strtod.c (IN_CTYPE_DOMAIN, ISSPACE, ISDIGIT, TOLOWER): Likewise.
505         * strtol.c (IN_CTYPE_DOMAIN): Likewise.
506         * xstrtol.c (IN_CTYPE_DOMAIN, ISSPACE): Likewise.
508         2006-07-05  Eric Blake  <ebb9@byu.net>
510         * getaddrinfo.h (NI_NUMERICHOST, NI_NUMERICSERV): Define if
511         missing from netdb.h.
512         * getaddrinfo.c (includes): Include inet_ntop and snprintf.
514         2006-06-27  Bruno Haible  <bruno@clisp.org>
516         Assume ANSI C header files and <ctype.h> functions.
517         * mbswidth.c (IN_CTYPE_DOMAIN, ISPRINT, ISCNTRL): Remove macros.
518         (mbsnwidth): Use isprint, iscntrl instead.
520 2006-07-08  Jim Meyering  <jim@meyering.net>
522         * getndelim2.h (getndelim2): Remove doubled "after" in comment.
524 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
526         * Makefile.am (libcoreutils_a_SOURCES): Add setenv.h, wcwidth.h,
527         to accommodate sync from gnulib.
529         Sync from gnulib.
531         2006-06-30  Jim Hyslop <jhyslop@dreampossible.ca>  (tiny change)
533         * getaddrinfo.c: fixed typo
535         2006-06-28  Bruno Haible  <bruno@clisp.org>
537         * getaddrinfo.h: Fix POSIX URL.
538         * getaddrinfo.c (WIN32_NATIVE): New macro. Use it instead of _WIN32.
539         (use_win32_p): Make static.
540         (getaddrinfo): Reject service name if it is empty or does not consist
541         solely of decimal digits, or if its value is > 65535.
542         (getnameinfo): Remove useless casts.
544         2006-06-28  Eric Blake  <ebb9@byu.net>
546         * mbchar.h (wcwidth): Include wcwidth.h.
547         * mbswidth.c (wcwidth): Move from here...
548         * wcwidth.h: ...to this new file.
550         2006-06-28  Simon Josefsson  <jas@extundo.com>
552         * getaddrinfo.c: Try to load ws2_32.dll on Windows, to find the
553         functions there.  It will succeed on Windows XP, but on Windows
554         2000 and (presumably) earlier, it will fail, and use the internal
555         re-implementation.
556         (use_win32_p): New function.
557         (getaddrinfo): Use strtoul on servname, to support numeric ports.
558         Support AI_NUMERICSERV to disable getservbyname.
559         (getnameinfo): New function, only supports
560         NI_NUMERICHOST|NI_NUMERICSERV for now.
562         * getaddrinfo.h: Test and check for AI_* flags separately, MinGW
563         only have some of them.  Add AI_NUMERICSERV.  Add prototype for
564         getnameinfo.
566         2006-06-26  Paul Eggert  <eggert@cs.ucla.edu>
568         * base64.c (B64): Use _ as the formal parameter, not x, to avoid
569         bug in IBM C V6 for AIX.  Problem reported by Larry Jones in
570         <http://lists.gnu.org/archive/html/bug-gnulib/2006-06/msg00181.html>.
572         2006-06-21  Simon Josefsson  <jas@extundo.com>
574         * getaddrinfo.c (getaddrinfo): Set ai_family in the return
575         variable.
577         2006-06-19  Paul Eggert  <eggert@cs.ucla.edu>
579         * alloca_.h (alloca) [defined alloca]: Don't define or declare.
581         2006-06-16  Eric Blake  <ebb9@byu.net>
583         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
584         * unicodeio.c [!defined errno]: Likewise.
585         * strtol.c [!defined errno]: Likewise.
586         * strtod.c [!defined errno]: Likewise.
588         2006-05-26  Martin Lambers  <marlam@marlam.de>
590         * getpass.c: Updates the test for the native W32 API, and adds
591         missing includes, thus fixing compilation warnings.
593         2006-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>
595         * exclude.c (exclude_fnmatch): New function.
596         (excluded_file_name): Call exclude_fnmatch.
597         * exclude.h (excluded_file_name): New prototype
599         2006-05-19  Jim Meyering  <jim@meyering.net>
601         * getugroups.c: Correct an outdated comment.  From Bruno Haible.
603         2006-05-10  Paul Eggert  <eggert@cs.ucla.edu>
605         * sha1.c (rol): Cast right-shift arg to uint32_t to prevent
606         unwanted sign propagation, e.g., on hosts with 64-bit int.
607         There still are some problems with reeelly weird theoretical hosts
608         (e.g., 33-bit int) but it's not worth worrying about now.
609         (K1, K2, K3, K4): Remove unnecessary L suffix.
611         2006-03-24  Simon Josefsson  <jas@extundo.com>
613         * base64.c: Fix problems reported by Eric Blake <ebb9@byu.net>,
614         including some doc fixes.
615         (base64_encode_alloc): Fix +1 bug on allocation failures.
617         2006-03-24  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
619         * base64.c (base64_encode): Do not read past end of array with
620         unsanitized input on systems with CHAR_BIT > 8.
622         2006-03-24  Eric Blake  <ebb9@byu.net>
624         * time_r.c (copy_string_result): Remove, as it is no longer used.
626 2006-07-03  Paul Eggert  <eggert@cs.ucla.edu>
628         * stdint_.h: Include <sys/types.h> after @FULL_PATH_STDINT_H@, for
629         MacOS X 10.4.6.  Don't mention <sys/int_types.h>.  Problems
630         reported by Mark D. Baushke, one in
631         <http://lists.gnu.org/archive/html/bug-gnulib/2006-07/msg00015.html>.
633 2006-07-03  Jim Meyering  <jim@meyering.net>
635         * cycle-check.h (CYCLE_CHECK_REFLECT_CHDIR_UP): Abort if this
636         macro is used before the first cycle_check call.
638 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
640         * stdint_.h (intmax_t, uintmax_t): Prefer long to long long if
641         both are 64 bits, since this seems to be the tradition, and this
642         prevents gcc -Wformat from warning about usages with PRIuMAX.  If
643         we ever run into a host that prefers long long to long in this
644         case, we'll need another configure-time test.  Problem reported by
645         Jim Meyering.
647 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
649         * Makefile.am (stdint.h): Sync from gnulib.
650         * stdint_.h: Sync from gnulib.
652 2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
654         * xstrtod.c (XSTRTOD, DOUBLE): New macros, so that we can support
655         both double and long double versions.
656         (XSTRTOD): Renamed from xstrtod.  Use DOUBLE internally.
657         * xstrtold.c: New file.
658         * xstrtod.h (xstrtold): New decl.
660 2006-06-29  Derek R. Price  <derek@ximbiot.com>
662         * strftime.c: Assume strftime exists.
664 2006-06-28  Derek R. Price  <derek@ximbiot.com>
666         * savedir.c (CLOSEDIR): Remove.  All uses changed to closedir.
667         Autoconf 2.60 says this stuff was obsolete.
669 2006-06-20  Paul Eggert  <eggert@cs.ucla.edu>
671         * openat.c (openat): Use ?:, not if, to work around GCC bug 4210
672         <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=4210>.
673         Problem reported by Denis Excoffier in
674         <http://lists.gnu.org/archive/html/bug-tar/2006-06/msg00023.html>.
676 2006-06-19  Jim Meyering  <jim@meyering.net>
678         Apply this change from gnulib:
679         2006-06-16  Eric Blake  <ebb9@byu.net>
680         * unsetenv.c [!defined errno]: Assume errno.h declares errno.
682 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
684         * getdate.y (__attribute__): Don't define if already defined.
685         Problem reported by Larry Jones.
686         * utimens.c (__attribute__): Likewise.
688 2006-06-10  Jim Meyering  <jim@meyering.net>
690         Apply this change from gnulib:
692         2006-05-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
693                     Bruno Haible  <bruno@clisp.org>
695         * strndup.c (strndup) [!_LIBC]: Don't undefine macro definition.
697 2006-06-04  Paul Eggert  <eggert@cs.ucla.edu>
699         * regexec.c (group_nodes_into_DFAstates): Fix a buffer overrun
700         reported by Andreas Schwab.
702 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
704         * tempname.c (small_open, large_open): New macros.
705         (__open, __open64) [!_LIBC]: Remove.
706         (__gen_tempname): Use small_open and large_open instead of __open
707         and __open64.  This fixes a portability bug on HP-UX 11.11i
708         reported by Simon Wing-Tang in
709         <http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00114.html>.
711 2006-05-23  Paul Eggert  <eggert@cs.ucla.edu>
713         * filemode.c: Don't include <string.h>; this include was
714         inadvertently put into the previous patch.  Problem noted
715         by Jim Meyering.
717 2006-05-22  Paul Eggert  <eggert@cs.ucla.edu>
719         * filemode.c (setst): Remove.
720         (strmode): Rewrite to avoid setst.  This makes the code shorter,
721         (arguably) clearer, and the generated code is a bit smaller on my
722         Debian GNU/Linux stable x86 host.
724         Import from gnulib.
725         * verify.h: Document the internals better.  Most of this change
726         was written by Bruno Haible.
728 2006-05-21  Jim Meyering  <jim@meyering.net>
730         * fts.c (fts_open): Fail with EINVAL if a caller violates this rule:
731         Either FTS_LOGICAL or FTS_PHYSICAL must be provided to the
732         fts_open() function.
734 2006-05-19  Paul Eggert  <eggert@cs.ucla.edu>
736         * nanosleep.c [HAVE_SYS_SELECT_H]: Include <sys/select.h>.
737         Use the usual Autoconf way to include <time.h> and/or sys/time.h.
738         (my_usleep): Don't mishandle maximum value.
740 2006-05-15  Jim Meyering  <jim@meyering.net>
742         Avoid the expense of an fstat, when possible.
743         * fts.c (O_NOFOLLOW, STREQ): Define.
744         (diropen_fd): Remove function.  Merge it into sole caller...
745         (diropen): ...here.  Use O_NOFOLLOW when appropriate.
746         (fts_safe_changedir): Call fstat for dev/inode check, only if the
747         previous open/openat call may have opened the wrong directory.
749 2006-05-13  Jim Meyering  <jim@meyering.net>
751         * xfts.c (xfts_open): Always use FTS_CWDFD.
753         Restore the parts of fts that were removed on 2006-01-17, so that
754         it's easier for legacy applications designed for the version
755         of fts in glibc or BSD to convert to this more robust version.
756         Add a new mode, FTS_CWDFD, by which to enable the improved
757         (openat- based -- aka no-chdir) semantics.
758         * fts_.h (FTS_CWDFD): Define.  Callers must use this fts_open
759         option to enable the more robust behavior.
760         (FTS_OPTIONMASK): Widen accordingly.
761         * fts.c: Restore removed code, reverting the default behavior.
763 2006-05-11  Jim Meyering  <jim@meyering.net>
765         * sha1.c (sha1_buffer): Correct comment: s/MD5/SHA1/.  From James Lemley.
767 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
769         * getdate.y (get_date): When adding relative date, start with the
770         initial time, not with the result of the first mktime call.
772 2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
774         * filemode.c: Include "filemode.h" first, to test the interface.
775         Assume that filemode.h includes sys/types.h and sys/stat.h.
776         (HAVE_ST_DM_MODE): New macro, moved here from ls.c.
777         (ftypelet): Reorder to put common cases first, for efficiency.
778         Add 'P', 'w'.  Remove 'M', since it's now the caller's responsibility
779         to do 'M'.
780         (strmode): Renamed from mode_string, and now stores 12 bytes instead
781         of 10, for compatibility with FreeBSD.  All callers changed.
782         (filemodestring): Now stores 12 bytes instead of 10, and sets file types
783         that can't be deduced solely from st_mode.  First arg is now a const
784         pointer.
785         * filemode.h (HAVE_DECL_STRMODE): Include <string.h> for strmode.
786         (strmode): Renamed from mode_string.
787         (filemodestring): New decl.
788         * stat-macros.h: Don't undef S_ISDOOR, since it's never buggy.
789         (S_ISDOOR): Don't bother with S_IFDOOR, since that code is never needed.
790         (S_ISPORT, S_ISWHT): New macros, if not already defined.
792         * openat.h (openat_needs_fchdir) [ ! defined __OPENAT_PREFIX]:
793         Turn this into a macro that always returns false.
795 2006-04-15  Paul Eggert  <eggert@cs.ucla.edu>
797         * utimens.c (futimens): glibc futimesat messes up if /proc
798         isn't mounted.  Problem reported by Kir Kolyshkin.
800 2006-04-14  Jim Meyering  <jim@meyering.net>
802         Remove unreachable code and plug leaks in code that handles degenerate
803         input and some failure cases.
804         * fts.c (fts_build): #if-0-out a block of unused code. Patch from glibc.
805         (fts_build): Remove just-#if-0'd code and the code that
806         declares and sets cderrno.
807         (fts_build): Free `head' before returning NULL, in two places,
808         to avoid leaks.  Patch from glibc.
809         (fts_open): Don't allocate parent if *argv==NULL.  Patch from glibc.
811 2006-04-13  Paul Eggert  <eggert@cs.ucla.edu>
813         * regcomp.c (init_dfa): Don't use wchar_t or wctype_t if RE_ENABLE_I18N
814         is not defined.  Problem reported by Mark D. Baushke via Derek R. Price.
815         * regex.h (RE_DUP_MAX): Update comment to match current implementation.
817 2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
819         * fsusage.c: Don't include <inttypes.h> or <stdint.h>, since
820         fsusage.h now does that.  Include fsusage.h first, to test interface.
821         Prefer statvfs if it works, since it's blessed by POSIX.  Attempt
822         at most one method (the old code could have generated decls that
823         didn't conform to C89, not that this was ever exercised).
824         * fsusage.h: Include <inttypes.h> and <stdint.h> if they exist.
826 2006-04-09  Paul Eggert  <eggert@cs.ucla.edu>
828         Merge regex changes from libc, removing some of our
829         POSIX-conformance changes that were rejected and redoing them in a
830         less-intrusive way.
832         * regcomp.c (re_compile_internal, init_dfa):
833         Length arg is now size_t, not Idx.  All uses changed.
834         (peek_token): Forward decl now says internal_function.
835         (__re_error_msgid, __re_error_msgid_idx):
836         Now static rather than extern with attribute_hidden.
837         (re_compile_pattern) [!defined _LIBC]: Use K&R-style defn.
838         For some reason libc prefers K&R style defns for external functions.
839         (regerror) [!defined _LIBC]: Likewise.
840         (re_set_syntax, re_compile_fastmap, regcomp, regfree, re_comp):
841         (seek_collating_symbol_entry, lookup_collation_sequence_value):
842         (build_range_exp, build_collating_symbol):
843         Use K&R-style defn.
844         (re_compile_fastmap): Use '\0' to memset, not 0.
845         (utf8_sb_map): Make the calculations more obvious.
846         (init_dfa, parse_bracket_exp, build_charclass_op):
847         Call calloc and cast result, as glibc does.
848         (init_word_char, fetch_token, peek_token, peek_token_bracket):
849         (build_range_exp, build_collating_symbol):
850         Now internal functions.
852         * regex.c [!defined _LIBC]: Allow compiling with C++ compilers.
854         * regex.h (__USE_GNU_REGEX): New macro.  Don't depend on
855         _REGEX_SOURCE any more; depend on _GNU_SOURCE instead.
856         Don't depend on VMS; depend on __VMS instead, for POSIX
857         namespace cleanness.
858         (regoff_t): Define to ssize_t, not long int.
860         Remove the REG_ macros named below.  Instead, make the old names
861         (e.g., RE_BACKSLASH_ESCAPE_IN_LISTS) visible only if
862         __USE_GNU_REGEX.
863         (REG_BACKSLASH_ESCAPE_IN_LISTS):
864         (REG_BK_PLUS_QM, REG_CHAR_CLASSES, REG_CONTEXT_INDEP_ANCHORS):
865         (REG_CONTEXT_INDEP_OPS, REG_CONTEXT_INVALID_OPS):
866         (REG_DOT_NEWLINE, REG_DOT_NOT_NULL, REG_HAT_LISTS_NOT_NEWLINE):
867         (REG_INTERVALS, REG_LIMITED_OPS, REG_NEWLINE_ALT):
868         (REG_NO_BK_BRACES, REG_NO_BK_PARENS, REG_NO_BK_REFS):
869         (REG_NO_BK_VBAR, REG_NO_EMPTY_RANGES):
870         (REG_UNMATCHED_RIGHT_PAREN_ORD, REG_NO_POSIX_BACKTRACKING):
871         (REG_NO_GNU_OPS, REG_DEBUG, REG_INVALID_INTERVAL_ORD):
872         (REG_IGNORE_CASE, REG_CARET_ANCHORS_HERE):
873         (REG_CONTEXT_INVALID_DUP, REG_NO_SUB, REG_SYNTAX_EMACS):
874         (REG_SYNTAX_AWK, REG_SYNTAX_GNU_AWK, REG_SYNTAX_POSIX_AWK):
875         (REG_SYNTAX_GREP, REG_SYNTAX_EGREP, REG_SYNTAX_POSIX_EGREP):
876         (REG_SYNTAX_ED, REG_SYNTAX_SED, _REG_SYNTAX_POSIX_COMMON):
877         (REG_SYNTAX_POSIX_BASIC, REG_SYNTAX_POSIX_MINIMAL_BASIC):
878         (REG_SYNTAX_POSIX_EXTENDED, REG_SYNTAX_POSIX_MINIMAL_EXTENDED):
879         (REG_DUP_MAX, REG_UNALLOCATED, REG_REALLOCATE, REG_FIXED):
880         (REG_NREGS):
881         Remove.  All uses replaced by the old RE_* names.
882         (RE_BACKSLASH_ESCAPE_IN_LISTS):
883         (RE_BK_PLUS_QM, RE_CHAR_CLASSES, RE_CONTEXT_INDEP_ANCHORS):
884         (RE_CONTEXT_INDEP_OPS, RE_CONTEXT_INVALID_OPS):
885         (RE_DOT_NEWLINE, RE_DOT_NOT_NULL, RE_HAT_LISTS_NOT_NEWLINE):
886         (RE_INTERVALS, RE_LIMITED_OPS, RE_NEWLINE_ALT):
887         (RE_NO_BK_BRACES, RE_NO_BK_PARENS, RE_NO_BK_REFS):
888         (RE_NO_BK_VBAR, RE_NO_EMPTY_RANGES):
889         (RE_UNMATCHED_RIGHT_PAREN_ORD, RE_NO_POSIX_BACKTRACKING):
890         (RE_NO_GNU_OPS, RE_DEBUG, RE_INVALID_INTERVAL_ORD):
891         (RE_IGNORE_CASE, RE_CARET_ANCHORS_HERE):
892         (RE_CONTEXT_INVALID_DUP, RE_NO_SUB):
893         Don't bother having these macros be independent of each others'
894         values, since they no longer exist in the POSIX name space.
896         Rename the following member names back to their old names,
897         unless !__USE_GNU_REGEX.  All uses changed back.
898         (buffer): Renamed from re_buffer.
899         (allocated): Renamed from re_allocated.
900         (used): Renamed from re_used.
901         (syntax): Renamed from re_syntax.
902         (fastmap): Renamed from re_fastmap.
903         (translate): Renamed from re_translate.
904         (can_be_null): Renamed from re_can_be_null.
905         (regs_allocated): Renamed from re_regs_allocated.
906         (fastmap_accurate): Renamed from re_fastmap_accurate.
907         (no_sub): Renamed from re_no_sub.
908         (not_bol): Renamed from re_not_bol.
909         (not_eol): Renamed from re_not_eol.
910         (newline_anchor): Renamed from re_newline_anchor.
911         (num_regs): Renamed from rm_num_regs.
912         (start): Renamed from rm_start.
913         (end): Renamed from rm_end.
915         (free_state): Move up a bit.
917         * regex_internal.h (inline) [__GNUC__ < 3 && defined _LIBC]:
918         #define to be empty.
919         (ASCII_CHARS): New macro, replacing all uses of 0x80 and/or SBC_MAX / 2
920         when that is what is intended.
921         (SBC_MAX): Define to UCHAR_MAX + 1, not 256.
922         (__re_error_msgid, __re_error_msgid_idx): Remove decls; not needed.
923         (MAX): New macro.
924         (re_xmalloc, re_calloc, re_xrealloc, re_x2realloc): Remove.
925         All uses changed back to re_malloc, etc.  It's now the caller's
926         responsibility to check for overflow; all callers changed.
927         (re_alloc_oversized, re_x2alloc_oversized, re_xnmalloc, re_xnrealloc):
928         (re_x2nrealloc): Remove.
929         (free_state): Remove decl.
931         * regexc.c (regexec, re_match, re_search, re_match_2, re_search_2):
932         (re_set_registers, re_exec):
933         Use K&R-style defn.
935         2006-01-31  Roland McGrath  <roland@redhat.com>
937         * regcomp.c (calc_eclosure_iter): Remove dead variables.
938         Reported by Mike Frysinger <vapier@gentoo.org>.
940         2006-01-15  Andreas Jaeger  <aj@suse.de>
942         [BZ #1950]
943         * regex_internal.c (re_string_reconstruct): Adjust for
944         build_wcs_upper_buffer change.
945         (build_wcs_upper_buffer): Change return type.
947         2005-12-10  Ulrich Drepper  <drepper@redhat.com>
949         * regex_internal.h: Include <stdint.h> if available.
951         2005-12-06  Paolo Bonzini  <bonzini@gnu.org>
953         * regex_internal.h (SIZE_MAX): Provide a default definition.
955         2005-10-14  Ulrich Drepper  <drepper@redhat.com>
957         * regcomp.c: Adjust for changed secondary hash function.
959         2005-09-30  Ulrich Drepper  <drepper@redhat.com>
961         * regex.h: Pretty printing.
962         Clean up namespace a bit.
964         2005-09-30  Jakub Jelinek  <jakub@redhat.com>
966         * regexec.c (update_cur_sifted_state, check_arrival,
967         check_arrival_add_next_nodes): Avoid using uninitialized variable.
969         2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
970                     Ulrich Drepper  <drepper@redhat.com>
972         [BZ #1302]
973         * regex_internal.h (bitset_t): Renamed from bitset.  All uses changed.
974         (bitset_word_t): Renamed from bitset_word.  All uses changed.
976         2005-09-22  Ulrich Drepper  <drepper@redhat.com>
978         [BZ #281]
979         * regex.h: Define RE_TRANSLATE_TYPE as unsigned char *.
980         * regcomp.c: Remove unnecessary uses of
981         unsigned RE_TRANSLATE_TYPE.
982         * regex_internal.h: Likewise.
983         * regex_internal.c: Likewise.
984         * regexec.c: Likewise.
985         Based on a patch by Stepan Kasal <kasal@ucw.cz>.
987         2005-09-07  Ulrich Drepper  <drepper@redhat.com>
989         * regexec.c (find_recover_state): Remove unnecessary
990         initialization.
991         (transit_state_bkref): Make DFA a const pointer.
992         (get_subexp): Likewise.
993         (check_arrival): Likewise.
994         (update_cur_sifted_state): Likewise.
995         (re_search_internal): Likewise.
996         (prune_impossible_nodes): Likewise.
997         (acquire_init_state_context): Likewise.
998         (proceed_next_node): Likewise.
999         (set_regs): Likewise.
1000         (free_fail_stack_return): Likewise.
1001         (check_arrival_expand_ecl): Mark DFA parameter as const.
1002         (check_arrival_expand_ecl_sub): Likewise.
1003         (check_subexp_limits): Likewise.
1004         (sub_epsilon_src_nodes):  Likewise.
1005         (add_epsilon_src_nodes):  Likewise.
1006         (merge_state_array): Likewise.
1007         (update_regs): Likewise.
1008         (build_trtable): Likewise.
1009         (sift_states_backward): Mark MCTX parameter as const.
1010         (build_sifted_states): Likewise.
1011         (update_cur_sifted_state): Likewise.
1012         (sift_states_mkref): Likewise.
1013         (check_arrival_expand_ecl): Mark eclosure as const.
1014         (check_dst_limits_calc_pos_1): Likewise.
1015         * regex_internal.h (re_match_context_t): Make dfa a const
1016         pointer.
1018         2005-09-06  Ulrich Drepper  <drepper@redhat.com>
1020         * regexec.c (merge_state_with_log): Define dfa as const pointer.
1021         (transit_state_sb): Likewise.
1022         (transit_state_mb): Likewise.
1023         (sift_states_iter_mb): Likewise.
1024         (check_arrival_add_next_nodes): Likewise.
1025         (check_node_accept_bytes): Change first parameter to pointer-to-const.
1026         [_LIBC] (re_search_2_stub): Use mempcpy.
1028         * regex_internal.c (re_string_reconstruct): Avoid calling
1029         mbrtowc for very simple UTF-8 case.
1031         * regex_internal.c (re_acquire_state): Make DFA pointer arg
1032         a pointer-to-const.
1033         (re_acquire_state_context): Likewise.
1034         * regex_internal.h: Adjust prototypes.
1036         * regex.c: Prevent using C++ compilers.
1038         * regex_internal.c (re_acquire_state): Minor code rearrangement.
1039         (re_acquire_state_context): Likewise.
1041 2006-03-11  Eric Blake  <ebb9@byu.net>
1043         * same.c (same_name): s/base_name/last_component/
1044         * backupfile.c (check_extension, numbered_backup): Likewise.
1045         * filenamecat.c (file_name_concat): Likewise.
1047 2006-03-11  Eric Blake  <ebb9@byu.net>,
1048             Paul Eggert  <eggert@cs.ucla.edu>
1050         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Move here from dos.m4.
1051         [FILE_SYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]: Don't treat 1: as a
1052         drive prefix.
1053         (IS_ABSOLUTE_FILE_NAME): Treat all drive letters as absolute on
1054         platforms like cygwin with FILE_SYSTEM_DRIVE_PREFIX_IS_ABSOLUTE.
1055         (last_component): New method.
1056         * dirname.c (dir_len): Determine when drive letters need a
1057         subsequent slash.  Preserve // when it is special.
1058         (dir_name): Don't append dot when drive letter is absolute.
1059         [TEST_DIRNAME]: Move into a full-blown gnulib test.
1060         * basename.c (base_name): New semantics - malloc the result.
1061         Preserve // when it is special.  Preserve relative files that look
1062         like drive letters.
1063         (base_len): Preserve // when it is special.
1064         (last_component): New method, similar to old base_name semantics.
1065         * stripslash.c (strip_trailing_slashes): Use last_component, not
1066         base_name.  Strip redundant slashes from ///.
1068 2006-03-19  Jim Meyering  <jim@meyering.net>
1070         Work even in a chroot where d_ino values for entries in "/"
1071         don't match the stat.st_ino values for the same names.
1072         * getcwd.c (__getcwd): When no d_ino value matches the target inode
1073         number, iterate through all entries again, using lstat instead.
1074         Reported by Kenshi Muto in http://bugs.debian.org/355810, and by
1075         Zouhir Hafidi in https://bugzilla.redhat.com/bugzilla/190656.
1077         * getcwd.c (__getcwd): Clarify a comment.
1078         Use memcpy in place of a call to strcpy.
1080 2006-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1082         * regex.h (regoff_t) [defined _REGEX_LARGE_OFFSETS]:
1083         Typedef to long int, not to off_, as POSIX will likely change
1084         in that direction.
1086 2006-03-12  Jim Meyering  <jim@meyering.net>
1088         * fts-cycle.c (leave_dir): If cycle-check's saved dev-ino pair matches
1089         that of the current directory (which we're about to chdir ".." out of),
1090         then save the dev-ino of the parent, instead.
1092         * same-inode.h (SAME_INODE): New file/macro.
1093         * chdir-safer.c (SAME_INODE): Remove definition.
1094         Include "same-inode.h", instead.
1095         * same.c: Likewise.
1096         * cycle-check.h: Include "same-inode.h".
1097         (CYCLE_CHECK_REFLECT_CHDIR_UP): Define.
1098         * cycle-check.c (SAME_INODE): Remove definition.
1099         * root-dev-ino.h: Include "same-inode.h".
1101 2006-03-12  Paul Eggert  <eggert@cs.ucla.edu>
1103         * Makefile.am (libcoreutils_a_SOURCES): Remove time_r.c, time_r.h,
1104         as this is now done in m4.
1105         * time_r.h (asctime_r, ctime_r): Remove.  These functions can
1106         overrun buffers and shouldn't be used (much as gets shouldn't be
1107         used).
1108         * time_r.c (asctime_r, ctime_r): Likewise.
1110 2006-02-17  Simon Josefsson  <jas@extundo.com>
1112         * base64.h, base64.c: New files.
1113         * Makefile.am (libcoreutils_a_SOURCES): Add base64.h and base64.c.
1115 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1117         * getcwd.c (AT_FDCWD): Work around a bug in Solaris 9 and 10, where
1118         AT_FDCWD exceeds INT_MAX.
1119         * openat.h (AT_FDCWD): Likewise.
1121 2006-02-17  Jim Meyering  <jim@meyering.net>
1123         * openat.c: Include lstat.h, so that uses of lstat are converted
1124         to uses of rpl_lstat, e.g., on Solaris 9.  Otherwise, programs like
1125         du (which now uses the openat-enabled fts and hence fstatat) would
1126         mistakenly fail to dereference a symlink-to-directory specified
1127         with a trailing slash.
1129 2006-02-14  Paul Eggert  <eggert@cs.ucla.edu>
1131         * vasnprintf.c (VASNPRINTF): Rewrite the computation so that we
1132         need not use xsum.
1134 2006-02-14  Bruno Haible  <bruno@clisp.org>
1136         Sync from gnulib.
1138         * vasnprintf.c (VASNPRINTF): In the computation of the size of the
1139         temporary buffer for sprintf, take into account the precision also
1140         for 'd', 'i', 'u', 'o', 'x', 'X'.
1142 2006-02-14  Simon Josefsson  <jas@extundo.com>
1144         Sync from gnulib.
1146         * getaddrinfo.h: Define EAI_ADDRFAMILY and EAI_SYSTEM if not set,
1147         for mingw32.
1149         * gai_strerror.c, getaddrinfo.h: Protect netdb.h #include (for
1150         mingw32).
1152 2006-02-07  Paul Eggert  <eggert@cs.ucla.edu>
1154         * closeout.c (close_stdout): Don't assume 'bool' converts nonzero
1155         ints to 0 or 1, as this isn't true for the stdbool.h substitute.
1157 2006-02-02  Jim Meyering  <jim@meyering.net>
1159         Eliminate the unwelcome (albeit unlikely) possibility of xmalloc
1160         failure on deficient systems, and simplify gnulib lgpl dependencies.
1161         * lstat.c (rpl_lstat): Rewrite to use stat() in place of the
1162         xmalloc/lstat combination.  Based on a patch from Bruno Haible.
1164 2006-01-27  Paul Eggert  <eggert@cs.ucla.edu>
1166         * fnmatch.c (L_): Renamed from L, to work around a bug in
1167         Mac OS X 10.3.9 with GCC 3 reported by Claudio Fontana in
1168         <http://lists.gnu.org/archive/html/bug-gnulib/2006-01/msg00074.html>.
1169         All uses changed.
1171 2006-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1173         * stdbool_.h: Sync from gnulib.
1174         Use signed char with all non-GCC compilers.
1176 2006-01-25  Paul Eggert  <eggert@cs.ucla.edu>
1178         * stdbool_.h: Merge from gnulib; we still don't quite match exactly,
1179         but we're getting closer.
1180         (true, false) [defined __BEOS__]: undef, as before.
1181         (_Bool) [!@HAVE__BOOL@ && defined __GNUC__]: Use an enum
1182         rather than a #define.
1184 2006-01-25  Jim Meyering  <jim@meyering.net>
1186         * fileblocks.c: Remove useless parentheses in cpp directive.
1187         * readutmp.h: Likewise.
1189 2006-01-23  Paul Eggert  <eggert@cs.ucla.edu>
1191         Work around porting bugs reported by Dieter in
1192         <http://lists.gnu.org/archive/html/bug-bison/2006-01/msg00049.html>.
1193         * getopt.c (_NOPROTO): Remove; no longer needed.
1194         Include <stdlib.h> and <unistd.h> in all environments; it's safe now.
1195         Include "getopt.h" first, to check interface.
1196         (getenv): Declare only if defined HAVE_DECL_GETENV &&
1197         !HAVE_DECL_GETENV.
1198         * strndup.c [!_LIBC]: Include "strndup.h" to get prototype.
1199         (__strndup): Revert to K&R-style function dfns, the glibc style.
1200         * strnlen.c: Don't claim it's taken from glibc; it's not.
1201         (strnlen, __strnlen): Remove #defines and #undefs; not needed.
1202         Include strnlen.h first, to get prototype properly.
1203         (strnlen): Renamed from __strnlen.
1204         Remove weak alias.
1206 2006-01-23  Ulrich Drepper  <drepper@redhat.com>
1208         These changes imported from libc.
1209         * getopt.c: Use __fxprintf instead of inline stream orientation
1210         test and two separate function calls.
1211         * strndup.c (__strndup): Add libc_hidden_def.
1213 2006-01-23  Jim Meyering  <jim@meyering.net>
1215         * xalloc-die.c: Remove unused definition of N_.
1217 2006-01-22  Paul Eggert  <eggert@cs.ucla.edu>
1219         * quotearg.c (quotearg_buffer_restyled): Add "default: break;"
1220         to pacify gcc -Wswitch-default.
1222 2006-01-17  Jim Meyering  <jim@meyering.net>
1224         Rewrite fts.c not to change the current working directory,
1225         by using openat, fstatat, fdopendir, etc..
1227         * fts.c [! _LIBC]: Include "openat.h" and "unistd--.h".
1228         (HAVE_OPENAT_SUPPORT): Define.
1229         [_LIBC] (fchdir): Don't undef or define; no longer used.
1230         (FCHDIR): Define in terms of cwd_advance_fd rather than fchdir.
1231         Now, this `function' always succeeds, and consumes its file descriptor
1232         parameter -- so callers must not close such FDs.  Update callers.
1233         (diropen_fd, opendirat, cwd_advance_fd): New functions.
1234         (diropen): Add parameter, SP.  Adjust all callers.
1235         Implement using diropen_fd, rather than open.
1236         (fts_open): Initialize new member, fts_cwd_fd.
1237         Remove fts_rft-setting code.
1238         (fts_close): Close fts_cwd_fd, if necessary.
1239         (__opendir2): Define in terms of opendir or opendirat,
1240         depending on whether the FST_NOCHDIR flag is set.
1241         (fts_build): Since fts_safe_changedir consumes its FD, and since
1242         this code must do `closedir(dirp)', dup the dirfd(dirp) argument,
1243         and close the dup'd file descriptor upon failure.
1244         (fts_stat): Use fstatat(...AT_SYMLINK_NOFOLLOW) in place of lstat.
1245         (fts_safe_changedir): Tweak semantics to reflect that this function
1246         now calls cwd_advance_fd and hence consumes its FD argument.
1247         * fts_.h [struct FTS] (fts_cwd_fd): New member.
1248         [struct FTS] (fts_rft): Remove now-unused member.
1249         [struct FTS] (fts_cycle.state): Improve comment.
1251         * openat.c (openat_needs_fchdir): New function.
1252         * openat.h (openat_needs_fchdir): Declare it.
1254 2006-01-12  Jim Meyering  <jim@meyering.net>
1256         * stdint_.h: Remove useless parentheses in cpp directives, so that
1257         this file passes coreutils' `make syntax-check' tests.
1259 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1261         * .cvsignore: Add stdint.h.
1262         * Makefile.am (BUILT_SOURCES, EXTRA_DIST, stdint.h, MOSTLYCLEANFILES):
1263         Add gnulib snippet.
1264         * md5.c: Fix commentary typos.
1265         (alignof, UNALIGNED_P): No need for a GCC-specific version.
1266         * md5.h (__attribute__): Remove; unused.
1267         * sha1.c, sha256.c, sha256.c: Fix commentary to match md5 better.
1268         * sha1.h (struct sha1_ctx): Use a word buffer, not a byte buffer,
1269         so that we don't need to worry about alignment.  All uses changed.
1270         This merges the 2005-10-28 md5 change into sha1.
1271         * sha256.h (struct sha256_ctx): Likewise.
1272         * sha512.h (struct sha512_ctx): Likewise.
1273         * sha256.h: Include stdint.h rather than md5.h.
1274         * sha512.h: Include stdint.h uniformly, since we now have the
1275         stdint module.
1276         * stdint_.h: New file, from gnulib.
1278 2006-01-11  Jim Meyering  <jim@meyering.net>
1280         * fts.c (fts_stat): When following a symlink-to-directory,
1281         don't necessarily interpret stat-fails+lstat-succeeds as indicating
1282         a dangling symlink.  That can also happen at least for ELOOP.
1283         The fix: return FTS_SLNONE only when the stat errno is ENOENT.
1284         FYI, this bug predates the inclusion of fts.c in coreutils.
1286 2006-01-11  Jim Meyering  <jim@meyering.net>
1288         * fts.c [!_LIBC]: Include "fcntl--.h", to map open to open_safer.
1289         (fts_open): Put new (2006-01-04) maxarglen declaration and uses
1290         in their own block, so pre-c99 compilers don't object.
1292         * openat.c (fchownat): New function.
1293         * openat.h (fchmodat, fchownat): Declare.
1294         (chmodat, lchmodat): Define convenience functions.
1295         (chownat, lchownat): Likewise.
1296         * fchmodat.c (fchmodat): New file and function.
1298         * md5.c (OP): Remove useless space-before-TAB.
1300 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
1302         * localcharset.c, md5.c, md5.h, savedir.c, savedir.h, sha1.c, sha1.h
1303         * strcasecmp.c, strncasecmp.c, verify.h, regex_internal.h:
1304         Sync from gnulib.
1305         * sha256.c, sha256.h, sha512.c, sha512.h:
1306         Replace all instances of md5_uint32_t with uint32_t, to accommodate
1307         gnulib change.
1309 2006-01-10  Jim Meyering  <jim@meyering.net>
1311         Avoid the double-free (first in fts_read, second in fts_close) that
1312         would occur when an `active' directory is made inaccessible (e.g.,
1313         via chmod a-x) during a traversal.
1314         * fts.c (fts_read): After a failed fchdir, update sp->fts_cur
1315         before returning.  Reproduce this failure by
1316         mkdir -p a/b; cd a; chmod a-x . b
1317         Reported by Stavros Passas.
1319 2006-01-06  Jim Meyering  <jim@meyering.net>
1321         * version-etc.c (COPYRIGHT_YEAR): Update to 2006.
1323 2006-01-04  Paul Eggert  <eggert@cs.ucla.edu>
1325         * strftime.c (tzname): Don't declare if it is already #defined.
1326         Problem reported for Mingw by Mark Junker.
1328 2006-01-04  Jim Meyering  <jim@meyering.net>
1330         Merge from glibc.
1331         * fts.c (fts_open): Avoid function call in MAX macro use.
1333 2006-01-03  Paul Eggert  <eggert@cs.ucla.edu>
1335         * xtime.h (xtime_make, xtime_nonnegative_nsec, xtime_nsec): Use
1336         long int, not int, for nanosecond counts, so that people who are
1337         used to POSIX struct timespec won't be surprised.  Reported by Jim
1338         Meyering.
1340 2006-01-01  Paul Eggert  <eggert@cs.ucla.edu>
1342         * chmod-safer.c, chmod-safer.h: Remove.
1343         * lchmod.h: New file.
1344         * mkdir-p.c: Include lchmod.h, lchown.h.
1345         (make_dir_parents): Use lchown rather than chown, and
1346         lchmod rather than chmod.
1348 2005-12-26  Paul Eggert  <eggert@cs.ucla.edu>
1350         * chdir-long.c (cdb_free): Don't bother trying to open directory
1351         for write access: POSIX says that must fail.
1352         * chdir-safer.c (chdir_no_follow): Likewise.
1353         * fts.c (diropen): Likewise.
1354         * save-cwd.c (save_cwd): Likewise.
1355         * chdir-long.c (cdb_free): Open with O_NOCTTY | O_NONBLOCK as
1356         well, for minor improvements on hosts that lack O_DIRECTORY.
1357         * chmod-safer.c (defined_S_IFMT): New macro.
1358         Include stat-macros.h.
1359         Include stdlib.h, for abort().
1360         Don't include stdio.h or assert.h; no longer needed.
1361         (same_file_type): Don't assume S_IFMT is defined, as POSIX
1362         does not require this.  Don't assume S_IFCHR and S_IFBLK have
1363         their usual sort of bit pattern.
1364         (fchmod_new): Open with O_NOCTTY for as well, for minor
1365         improvement on hosts where that matters.  Don't bother to assert,
1366         since the caller (in this source file) checks the same thing.
1367         Discard any errno from a close failure, for consistency with other
1368         code.
1369         * chown.c (rpl_chown) [CHOWN_MODIFIES_SYMLINK]:
1370         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1371         Fall back on chown if open failed with EACCES.
1373 2005-12-26  Jim Meyering  <jim@meyering.net>
1375         * chdir-safer.c (chdir_no_follow): Move declaration of local,
1376         sb2, `down' into the scope where it is used.
1377         Note that on some systems this function also fails when DIR
1378         is a writable-yet-unreadable directory.
1380 2005-12-25  Paul Eggert  <eggert@cs.ucla.edu>
1382         * chdir-safer.h (FCHMOD_SAFER_H): Remove: it was misnamed, and
1383         wasn't needed anyay.
1384         * chdir-safer.c (chdir_no_follow): Don't include stdio.h, assert.h,
1385         fcntl--.h; not needed.
1386         (O_DIRECTORY): Define if not already defined.
1387         (chdir_no_follow): Revamp describing comment to match code more
1388         closely.  Redo use of internal vars to avoid lint complaints.
1389         Work even if directory is writeable but not readable.
1390         Open with O_DIRECTORY | O_NOCTTY, for benefit of hosts that
1391         don't have O_NOFOLLOW.  Use O_NONBLOCK (POSIX spelling) rather
1392         than O_NDELAY.  Don't bother invoking fstat if open does not
1393         dereference symlink, since the result isn't used then.
1394         Don't assume file descriptor is positive; it might be zero
1395         now that we no longer include fcntl--.h (we don't need fcntl--.h
1396         since we immediately close the descriptor).
1398 2005-12-25  Jim Meyering  <jim@meyering.net>
1400         * chdir-safer.c (chdir_no_follow): Remove unnecessary
1401         test of S_ISDIR (sb_init.st_mode).
1403 2005-12-23  Jim Meyering  <jim@meyering.net>
1405         * mkdir-p.c (make_dir_parents): Use chdir_no_follow only
1406         if we've just created the directory.
1408         * chdir-safer.c (chdir_no_follow): Rewrite to use fchdir even
1409         when O_NOFOLLOW is not defined.  Suggested by James Youngman.
1411         * chmod-safer.c (O_NOFOLLOW): Define, if necessary.
1412         * chdir-safer.c (O_NOFOLLOW): Likewise.
1413         Reported by Eric Blake.
1415 2005-12-22  Jim Meyering  <jim@meyering.net>
1417         * openat.c: Include "fcntl--.h" and "unistd--.h", to map open
1418         and dup to open_safer and dup_safer, respectively.
1419         (openat_permissive): Fix typo in comment.
1421 2005-12-21  Jim Meyering  <jim@meyering.net>
1423         Like chdir(2), but safer, if possible.
1424         * chdir-safer.c, chdir-safer.h: New files.
1426 2005-12-20  Jim Meyering  <jim@meyering.net>
1428         * mkdir-p.c (RW_USR): Remove definition.
1429         (make_dir_parents): Use S_IRWXU, now that read access is also required.
1431         Avoid a race condition, on systems where open honors O_NOFOLLOW.
1432         * mkdir-p.c (make_dir_parents): Include chdir-safer.h.
1433         Use chdir_no_follow in place of chdir.
1435         * mkdir-p.c (make_dir_parents): Remove unnecessary casts of alloca,
1436         since now it's guaranteed to be (void *).
1438         * chmod-safer.c (fchmod_new): Don't try to close fd if it's < 0.
1440 2005-12-19  Jim Meyering  <jim@meyering.net>
1442         * chmod-safer.c, chmod-safer.h: New files.
1444 2005-12-05  Andreas Gruenbacher  <agruen@suse.de>
1446         Add POSIX ACL support
1447         * acl.h (copy_acl, set_acl): Add declarations.
1448         * acl.c (acl_entries): Add fallback implementation for POSIX ACL
1449         systems other than Linux.
1450         (chmod_or_fchmod): New function: use fchmod when possible,
1451         and chmod otherwise.
1452         (file_has_acl): Add a POSIX ACL implementation, with a
1453         Linux-specific subcase.
1454         (copy_acl): Add: copy an acl and S_ISUID, S_ISGID, and
1455         S_ISVTX from one file to another.  Fall back to fchmod/chmod when
1456         acls are unsupported.
1457         (set_acl): Add: set a file's acl and S_ISUID, S_ISGID, and
1458         S_ISVTX to a defined value.  Fall back to fchmod/chmod when acls
1459         are unsupported.
1461 2005-12-16  Paul Eggert  <eggert@cs.ucla.edu>
1463         * openat.c: Don't include <stdlib.h>, <unistd.h>, <fcntl.h>,
1464         "gettext.h"; either no longer needed or are guaranteed by openat.h.
1465         (_): Remove; no longer needed.
1466         (openat): Renamed from rpl_openat; no need for rpl_openat
1467         since openat.h renames openat for us.
1468         Replace most of the body with a call to openat_permissive,
1469         to avoid duplicate code.
1470         Port to (probably hypothetical) environments were mode_t is
1471         wider than int.
1472         (openat_permissive): Require mode arg, so that we can check
1473         types better.  Put it just after flags.  Change cwd failure
1474         indicator from pointer-to-bool to pointer-to-errno-value.
1475         All callers changed.
1476         Invoke openat_save_fail and/or openat_restore_fail if
1477         cwd_errno is null, so that openat can call us.
1478         (openat_permissive, fdopendir, fstatat, unlinkat):
1479         Simplify errno handling to avoid some duplicate code,
1480         as it's OK to set errno on success.
1481         * openat.h: Revamp code so that function macros depend on
1482         __OPENAT_PREFIX only, not also on AT_FDCWD.
1483         (openat_ro): Remove.  Caller changed to use openat_permissive.
1484         (openat_permissive): Now a macro, if not a function.
1485         (openat_restore_fail, openat_save_fail): Now always functions,
1486         since mkdirat needs them even if __OPENAT_PREFIX is defined.
1488 2005-12-14  Jim Meyering  <jim@meyering.net>
1490         * Makefile.am (libcoreutils_a_SOURCES): Remove fprintftime.c
1491         and fprintftime.h.  Now they're pulled in via the .m4 file.
1493 2005-12-13  Paul Eggert  <eggert@cs.ucla.edu>
1495         * Makefile.am (stdbool.h): Resurrect the 'sed' that goes along
1496         with '#if !@HAVE_BOOL@".
1497         * stdbool_.h (_Bool): Resurrect the "#if !@HAVE__BOOL@" check, to
1498         work around compilers that have a (possibly-broken) _Bool but lack
1499         a working <stdbool.h>.
1501 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
1503         * stat-time.h (STATE_TIMESPEC, STAT_TIMESPEC_NS): Add check for
1504         TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC, to fix IRIX 5.3
1505         porting problem reported by Georg Schwarz in
1506         <http://lists.gnu.org/archive/html/bug-coreutils/2005-12/msg00083.html>.
1508 2005-12-04  Jim Meyering  <jim@meyering.net>
1510         * openat-priv.h (EXPECTED_ERRNO): Add ENOSYS, for Solaris 8.
1511         Paul Eggert reported that unlink/rmdir vs. e.g., /proc/self/fd/N/FILE
1512         fails with ENOSYS.  This makes openat revert to using save-cwd.c
1513         functions in that case.
1515 2005-12-01  Paul Eggert  <eggert@cs.ucla.edu>
1517         Sync from gnulib.
1519         * exclude.c: Include verify.h.
1520         (verify): Remove.  All callers changed to use verify.h's version.
1521         * strtoimax.c: Likewise.
1522         * utimecmp.c: Likewis.e
1524         * obstack.c [defined _LIBC && defined USE_IN_LIBIO]: Don't
1525         include <wchar.h>; no longer needed.
1527 2005-12-01  Jim Meyering  <jim@meyering.net>
1529         Sync from gnulib.
1531         * intprops.h (signed_type_or_expr__): Define.
1532         (INT_STRLEN_BOUND) [__GNUC__]: Use a slightly tighter bound
1533         for unsigned types.
1535 2005-12-01  Jakub Jelinek  <jakub@redhat.com>
1536         and  Ulrich Drepper  <drepper@redhat.com>
1538         Import from libc via gnulib.
1539         * obstack.c (print_and_abort) [defined _LIBC]: Use __fxprintf
1540         instead of inline stream orientation test and two separate
1541         function calls.  Pay no attention to USE_IN_LIBIO.
1543 2005-12-01  Roland McGrath  <roland@redhat.com>
1545         Import from libc via gnulib.  [BZ #1331]
1546         * obstack.h [!__STDC__] (obstack_int_grow_fast): Fix misnamed
1547         macro argument.
1548         Reported by Matej Vela <vela@debian.org>.
1550 2005-11-30  Jim Meyering  <jim@meyering.net>
1552         * openat-priv.h: New file, defining macros used by mkdirat.c
1553         and openat.c.
1554         * mkdirat.c: Include openat-priv.h.
1555         Remove definitions of macros defined therein.
1556         * openat.c: Likewise.
1558         * mkdirat.c (mkdirat): New file and function.
1559         * openat.h (mkdirat): Declare.
1561 2005-11-25  Paul Eggert  <eggert@cs.ucla.edu>
1563         * mountlist.c (ME_DUMMY): "none" and "proc" file systems are dummies
1564         too.  Problem with "none" reported by Bob Proulx.  Problem with
1565         "proc" reported by n0dalus.
1567         * mountlist.c: Include <limits.h>.
1568         (dev_from_mount_options)
1569         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]:
1570         New function.  It no longer assumes "dev=" has the System V meaning
1571         on Linux (since it doesn't).  It also parses "dev=" more carefully.
1572         (read_file_system_list)
1573         [defined MOUNTED_GETMNTENT1 || defined MOUNTED_GETMNTENT2]: Use it.
1574         MOUNTED_GETMNTENT2 is new here; the code didn't used to look for
1575         dev= in that case.
1577         * Makefile.am (stdbool.h): Just copy stdbool_.h; no need to sed
1578         any more.
1580         * stdbool_.h: Simplify greatly, under the assumption that these
1581         days most people use C99-compatible compilers to debug, so it's
1582         not worth worrying about catering to older compilers for that.
1583         This works around some porting problems with HP-UX compilers.
1584         (false, true) [defined __BEOS__]: Don't #undef; no longer needed.
1585         (_Bool): typedef to bool if C++ or BeOS, and #define to signed char
1586         otherwise.
1588         * gettime.c (gettime) [!defined OK_TO_USE_1S_CLOCK]:
1589         Report an error at compile-time if only a 1-second nominal clock
1590         resolution is found.
1592 2005-11-23  Paul Eggert  <eggert@cs.ucla.edu>
1594         * Makefile.am (libcoreutils_a_SOURCES): Add buffer-lcm.c, buffer-lcm.h.
1595         * buffer-lcm.c, buffer-lcm.h: New files, from diffutils.
1597 2005-11-23  Jim Meyering  <jim@meyering.net>
1599         * openat.c (fdopendir): Don't change errno when returning non-NULL.
1601 2005-11-22  Jim Meyering  <jim@meyering.net>
1603         * openat.h (openat_permissive): Declare.
1604         (openat_ro): Define.
1606         * openat.c (EXPECTED_ERRNO): New macro.
1607         (openat_permissive): New function -- used in remove.c rewrite.
1608         (all functions): Set errno just before returning, only if there
1609         was an actual failure.
1610         Use EXPECTED_ERRNO rather than comparing against only ENOTDIR.
1612 2005-11-20  Jim Meyering  <jim@meyering.net>
1614         * euidaccess-stat.c: New file, mostly from euidaccess.c.
1615         * euidaccess-stat.h: New file.
1617 2005-11-15  Paul Eggert  <eggert@cs.ucla.edu>
1619         * xstrtod.c: Don't bother with #pragma STDC FENV_ACCESS ON, as
1620         coreutils no longer futzes with rounding modes.
1622 2005-11-08  Eric Blake  <ebb9@byu.net>
1624         * getaddrinfo.h: Use #if !, not #ifndef, for AC_CHECK_DECLS.
1626 2005-11-13  Jim Meyering  <jim@meyering.net>
1628         * mkstemp-safer.c: Include <config.h>, required for possible
1629         replacement of mkstemp.
1631 2005-11-12  Jim Meyering  <jim@meyering.net>
1633         Emulate openat-family functions using Linux's procfs, if possible.
1634         Idea and some code based on Ulrich Drepper's glibc changes.
1636         * openat.c: (BUILD_PROC_NAME): New macro.
1637         Include <stdio.h>, <string.h>, "alloca.h" and "intprops.h".
1638         (rpl_openat): Emulate by trying to open /proc/self/fd/%d/%s,
1639         before falling back on save_cwd and restore_cwd.
1640         (fdopendir, fstatat, unlinkat): Likewise.
1642 2005-11-11  Jim Meyering  <jim@meyering.net>
1644         * openat.c (fstatat, unlinkat): Perform the syscall directly,
1645         skipping the save_cwd...restore_cwd overhead, if FILE is absolute.
1647 2005-11-10  Paul Eggert  <eggert@cs.ucla.edu>
1649         * gethrxtime.c: Include "timespec.h" rather than the sys/time / time
1650         business.
1651         (gethrxtime) [! (HAVE_NANOUPTIME
1652         || (defined CLOCK_MONOTONIC && HAVE_CLOCK_GETTIME)
1653         || HAVE_MICROUPTIME)]: Fall back on gettime rather than rolling
1654         our own approximation.
1656 2005-11-01  Paul Eggert  <eggert@cs.ucla.edu>
1658         * posixtm.h (PDS_PRE_2000): New macro.
1659         * posixtm.c (year): Arg is now syntax_bits rather than allow_century.
1660         All usages changed.  Reject dates outside the range 1969-1999 if
1661         PDS_PRE_2000 is used.
1663 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
1665         Fix porting problems reported by Theodoros V. Kalamatianos.
1666         * fd-reopen.c [defined HAVE_CONFIG_H]: Include <config.h>,
1667         so that large files can be opened.
1668         * utimens.c (futimens) [HAVE_WORKING_UTIMES && HAVE_FUTIMES]:
1669         Don't assume that futimes failing means we must fail.
1671 2005-10-29  Paul Eggert  <eggert@cs.ucla.edu>
1673         * getcwd.c (__getcwd): Don't assume that system calls after readdir
1674         leave errno alone.  Problem reported by Dmitry V. Levin.
1676 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
1678         * savedir.c (savedir): Don't assume that xrealloc etc. leave
1679         errno alone.  Problem reported by Frederic Jolliton.
1681 2005-10-24  Jim Meyering  <jim@meyering.net>
1683         * mkdir-p.c (make_dir_parents): Like the code above, don't rely
1684         on mkdir failing with a particular errno value (EEXIST).
1685         Based on a patch by Dmitry V. Levin.
1687         * mkdir-p.c (make_dir_parents): Make the preceding fix a little
1688         more robust, e.g., when the final component is created as a non-
1689         directory by another process just before `mkdir -p's final mkdir.
1691         A command like `mkdir -p nonexistent/.' would create the
1692         directory but exit nonzero with a diagnostic.  This could also be
1693         triggered with a non-`.' component, e.g., in a race with another
1694         process running the same `mkdir -p nonexistent/sub' command.
1696         * mkdir-p.c (make_dir_parents): Handle the case of an
1697         existing final component.
1698         Reported by Matthias Andree here:
1699         http://savannah.gnu.org/bugs/?func=detailitem&item_id=14848
1701 2005-10-23  Jim Meyering  <jim@meyering.net>
1703         * sha512.h: Remove no-longer-relevant comment.
1705 2005-08-27  David Madore  <david.madore@ens.fr>
1707         * sha256.h, sha256.c, sha512.h, sha512.c: New files - sha-2
1708         implementation.
1710 2005-10-20  Jim Meyering  <jim@meyering.net>
1712         * modechange.c (mode_compile): Reject an invalid mode string
1713         that starts with an octal digit.  From Andreas Gruenbacher.
1715 2005-10-13  Paul Eggert  <eggert@cs.ucla.edu>
1717         * mkdir-p.c (make_dir_parents): Don't report an error if an
1718         intermediate directory is in a read-only file system.  Problem
1719         reported by Eric Blake.
1721 2005-10-08  Jim Meyering  <jim@meyering.net>
1723         * openat.c (rpl_openat): Use the promoted type (int), not mode_t,
1724         as second argument to va_arg.  Otherwise, some versions of gcc
1725         warn that `if this code is reached, the program will abort'.
1727         Update from gnulib.
1728         * getdelim.c: (SIZE_MAX): New macro, if not already defined.
1730 2005-10-05  Jim Meyering  <jim@meyering.net>
1732         * Makefile.am (libcoreutils_a_DEPENDENCIES): Remove definition.
1733         Once it's gone, automake generates an equivalent one.
1734         Suggestion from Stepan Kasal.
1736         * getaddrinfo.h: Merge from gnulib.
1738 2005-10-04  Jim Meyering  <jim@meyering.net>
1740         Merge from gnulib.
1741         * getaddrinfo.h: Include sys/types.h before other headers.
1743 2005-10-02  Paul Eggert  <eggert@cs.ucla.edu>
1745         * getdelim.c: Import from gnulib (to fix unused var warnings) then
1746         apply the following fixes:
1747         Include getdelim.h first.  Include <limits.h>.
1748         (SSIZE_MAX): New macro, if not already defined.
1749         (getdelim): Fix buffer overrun on 64-bit hosts with lines longer
1750         than 2 GiB.
1752 2005-10-01  Simon Josefsson  <jas@extundo.com>
1754         * getaddrinfo.h: Protect #include's of sys/socket.h and netdb.h.
1755         Only define struct addrinfo if !HAVE_STRUCT_ADDRINFO.  Protect
1756         AI_* and EAI_* definitions.  Protect function declarations.
1758 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
1760         * openat.c (fdopendir): Do not define if HAVE_FDOPENDIR.
1761         Remove AT_FDCWD test.
1762         Do not consume the fd unless successful.
1763         * openat.h (fdopendir): Do not define if HAVE_FDOPENDIR.
1765 2005-09-29  Paul Eggert  <eggert@cs.ucla.edu>
1767         * xtime.h (XTIME_PRECISION): Now of type int, not long long int,
1768         so that the code works even with ancient cpp.  Portability problem
1769         with GCC 2.7.2.1 reported by Thomas M.Ott.
1771         * settime.c (settime): Fix { typo in previous patch.  Also, don't
1772         bother returning ENOSYS if settimeofday or stime fails; just let
1773         them return whatever errno they want to return.
1775 2005-09-29  Jim Meyering  <jim@meyering.net>
1777         * settime.c (settime): Move the HAVE_STIME block `up' into an #elif
1778         block, so that we don't even try to compile it if settimeofday is
1779         available.  This works around a compilation failure on OSF1 V5.1,
1780         due to stime requiring a `long int*' while tv_sec is `int'.
1782 2005-09-27  Jim Meyering  <jim@meyering.net>
1784         * fprintftime.c [HAVE_CONFIG_H]: Include <config.h> conditionally,
1785         to be consistent with gnulib.
1786         * getcwd.c: Change #ifdef<TAB>HAVE_CONFIG_H to #ifdef HAVE_CONFIG_H.
1787         * fts-cycle.c [HAVE_CONFIG_H]: Include <config.h>.
1788         * strnumcmp.c [HAVE_CONFIG_H]: Include <config.h> here, now that
1789         strnumcmp-in.h no longer includes it.
1791 2005-09-26  Paul Eggert  <eggert@cs.ucla.edu>
1793         * utimens.c: Include unistd.h, for dup2.
1794         (futimens): Fix typo: HAVE_FUTIMESAT was misspelled in an #if.
1795         (futimens) [! HAVE_FUTIMESAT]: If !file, set errno before returning -1.
1797 2005-09-25  Jim Meyering  <jim@meyering.net>
1799         * strnumcmp-in.h: Protect against multiple inclusion.
1801 2005-09-24  Paul Eggert  <eggert@cs.ucla.edu>
1803         * utimens.c (ENOSYS): Define if not already defined.
1804         (futimens): Support having a null PATH if the file descriptor
1805         is nonnegative.
1807         * Makefile.am (libcoreutils_a_SOURCES): Remove mbchar.c, since
1808         it doesn't build in OpenBSD 3.4.  See
1809         <http://lists.gnu.org/archive/html/bug-gnulib/2005-09/msg00242.html>.
1811         * regex_internal.h (__GNUC_PREREQ, always_inline, inline, pure):
1812         Remove.
1813         (__attribute): Define to empty unless GCC 3.1 or later.
1814         This works around a core dump on OpenBSD 3.4, which has GCC
1815         2.95.3, which dumps core when given __attribute__(()).  It also
1816         simplifies other tests, since we really don't want to bother with
1817         worrying about which ancient version of GCC supported what.
1818         Original problem reported by Yoann Vandoorselaere, with part of
1819         the fix suggested by Derek Price.
1821 2005-09-24  Jim Meyering  <jim@meyering.net>
1823         * openat-die.c, root-dev-ino.c, setenv.c, stdopen.c:
1824         * tsearch.c, unsetenv.c, xfts.c: Use `#ifdef HAVE_CONFIG_H',
1825         not `#if HAVE_CONFIG_H', for consistency with gnulib.
1827         * strintcmp.c: Include <config.h> here, ...
1828         * strnumcmp-in.h: ..., not here.
1830         Sync from gnulib.
1832         * verify.h (verify_type__): Use `unsigned int' as the bitfield type
1833         so we can once again use a positive bitfield width of 1 -- now we
1834         don't have to explain why we were using a bitfield width of 2.
1836 2005-09-23  Paul Eggert  <eggert@cs.ucla.edu>
1838         * utimens.c (futimens): Use futimesat if available.
1839         Prefer it to futimes since it doesn't have the futimes bug.
1841         * verify.h (GL_CONCAT0, GL_CONCAT): Remove.
1842         (verify): Don't use the __LINE__ trick, as it doesn't work in general.
1843         Instead, declare a function that returns a pointer to an array,
1844         and use verify_type__ to declare the size of the array.
1845         Problem and germ of a solution reported by Bruno Haible.
1846         (verify_type__): Use 2, not 1, for bitfield size, to avoid
1847         a warning with Irix 6.5 cc.  Problem reported by Bruno Haible.
1849 2005-09-23  Jim Meyering  <jim@meyering.net>
1851         * strnumcmp-in.h: Include <config.h>.  Otherwise builds with strict
1852         C89 (e.g., Sun's /opt/SUNWspro/bin/c89) would fail due to the use
1853         of `inline'.
1855 2005-09-22  Paul Eggert  <eggert@cs.ucla.edu>
1857         * getaddrinfo.c [HAVE_NETINET_IN_H]: Include <netinet/in.h>.
1858         Problem reported by Eric Blake.
1859         (getaddrinfo): Initialize se so that it's not garbage.
1860         Redo internal storage allocation so that it doesn't make unportable
1861         assumptions about alignment.
1862         Fix a memory leak.
1864 2005-09-21  Paul Eggert  <eggert@cs.ucla.edu>
1866         Sync from gnulib.
1868         * Makefile.am (libcoreutils_a_SOURCES): Add getaddrinfo.h,
1869         mbchar.c, mbchar.h, mbuiter.h, strcase.h, strlen1.c, strnlen1.h,
1870         strstr.h.
1872         * argmatch.h (GL_CONCAT): Remove.
1873         Include "verify.h" instead.
1874         (ARGMATCH_CONSTRAINT, ARGMATCH_ASSERT): Remove.
1875         (ARGMATCH_VERIFY): Rewrite in terms of new verify macros.
1877         * xalloc.h (VERIFY_EXPR, X2NREALLOC, X2REALLOC): Remove.
1878         The latter two macros are moving to ../src/system.h for now.
1879         This reverts this file to the gnulib version.
1881         * xanstrftime.c, xanstrftime.h: Remove; no longer used.
1883         * .cppi-disable: Add getaddrinfo.h, getdelim.h, mbchar.h,
1884         mbuiter.h, strcase.h, strnlen.h, strnlen1.h.
1886         * canon-host.h, gai_strerror.c, getaddrinfo.c, getaddrinfo.h:
1887         * getdelim.c, getdelim.h, mbchar.c, mbchar.h, mbuiter.h:
1888         * strcase.h, strnlen.h, strnlen1.c, strnlen1.h, strstr.h:
1889         New files, from gnulib.
1891         * __fpending.c, __fpending.h, acl.c, argmatch.c, atexit.c:
1892         * backupfile.c, basename.c, calloc.c, canonicalize.c:
1893         * chdir-long.c, chown.c, cloexec.c, closeout.c, creat-safer.c:
1894         * cycle-check.c, dirfd.c, dirfd.h, dirname.c, dup-safer.c:
1895         * dup2.c, euidaccess.c, exclude.c, exitfail.c, fchown-stub.c:
1896         * fd-safer.c, file-type.c, fileblocks.c, filemode.c:
1897         * filenamecat.c, fnmatch.c, fopen-safer.c, free.c, fsusage.c:
1898         * ftruncate.c, full-write.c, getcwd.c, getcwd.h, getdate.h:
1899         * getgroups.c, getndelim2.c, getopt1.c, getopt_.h:
1900         * gettimeofday.c, getugroups.c, group-member.c, hard-locale.c:
1901         * hash-pjw.c, hash.c, human.c, human.h, idcache.c, inttostr.c:
1902         * inttostr.h, lchown.c, long-options.c, lstat.c, malloc.c:
1903         * memcasecmp.c, memchr.c, memcmp.c, memcoll.c, memcpy.c:
1904         * memmove.c, mkdir.c, mkstemp.c, mktime.c, modechange.c:
1905         * mountlist.c, nanosleep.c, open-safer.c, openat.c, physmem.c:
1906         * pipe-safer.c, posixtm.c, posixver.c, putenv.c, quote.c:
1907         * quotearg.c, raise.c, readlink.c, readtokens0.c, readutmp.c:
1908         * realloc.c, regex.c, regex_internal.h, rename.c, rmdir.c:
1909         * rpmatch.c, safe-read.c, same.c, save-cwd.c, savedir.c:
1910         * settime.c, sig2str.c, strcspn.c, stripslash.c, strndup.c:
1911         * strnlen.c, strtod.c, strtoimax.c, strtol.c, strverscmp.c:
1912         * tempname.c, time_r.c, time_r.h, timespec.h, unicodeio.h:
1913         * unistd--.h, unlinkdir.c, userspec.c, utimecmp.c:
1914         * version-etc-fsf.c, version-etc.c, xalloc-die.c, xgetcwd.c:
1915         * xgethostname.c, xmalloc.c, xmemcoll.c, xnanosleep.c:
1916         * xreadlink.c, xstrndup.c, xstrtoimax.c, xstrtol.c:
1917         * xstrtoumax.c, yesno.c:
1918         Sync from gnulib.
1920         * canon-host.c, getline.c, getline.h, getpass.c, strcasecmp.c:
1921         * strncasecmp.c, strstr.c:
1922         Nontrivial sync from gnulib.
1924         * .cvsignore: Sort entries.
1926         * mkdir-p.c (ENOSYS): Define to EEXIST if not defined.
1927         (make_dir_parents): Treat ENOSYS like EEXIST.
1929 2005-09-20  Jim Meyering  <jim@meyering.net>
1931         * openat.c (fdopendir): Be sure to close the supplied
1932         file descriptor before returning.  This makes our replacement
1933         implementation a little closer to Solaris's, where fdopendir
1934         ties the file descriptor to the returned DIR* pointer.
1936 2005-09-19  Jim Meyering  <jim@meyering.net>
1938         * openat.c (unlinkat): New function.
1939         * openat.h (unlinkat): Add prototype.
1941 2005-09-16  Paul Eggert  <eggert@cs.ucla.edu>
1943         Import from gnulib.
1944         * stat-time.h: New file.
1945         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP, ATIME_CMP, CTIME_CMP):
1946         (MTIME_CMP, TIMESPEC_NS): Remove.  Now done by stat-time.h,
1947         in a different way.
1948         (timespec_cmp): New function.
1949         * utimecmp.c: Include stat-time.h.
1950         (SYSCALL_RESOLUTION): Depend on whether various struct stat
1951         members exist, not on the obsolescent ST_MTIM_NSEC.
1952         (utimecmp): Use the new stat-time functions rater than TIMESPEC_NS.
1954         * .cppi-disable: Add stat-time.h.
1956 2005-09-16  Jim Meyering  <jim@meyering.net>
1958         * strftime.c [FPRINTFTIME] (fprintftime): Provide a new interface:
1959         size_t fprintftime (FILE *fp, char const *fmt, struct tm const *tm,
1960                             int utc, int nanoseconds);
1961         Background:
1962         date should not have to allocate a megabyte of virtual memory to
1963         handle a format argument like +%1048575T.  When implemented with
1964         strftime, it must allocate such a buffer, use strftime to fill it
1965         in, print it, then free it.
1966         With fprintftime, it simply prints everything and exits.
1967         With no need for memory allocation, that's one fewer way to fail.
1969         * fprintftime.c, fprintftime.h: New files.
1970         * Makefile.am (libcoreutils_a_SOURCES):
1971         Add fprintftime.c and fprintftime.h.
1973 2005-09-15  Paul Eggert  <eggert@cs.ucla.edu>
1975         * strftime.c (my_strftime): Rewrite the previous change slightly,
1976         to make it a bit faster and (I hope) clearer.
1978 2005-09-14  Jim Meyering  <jim@meyering.net>
1980         * strftime.c (my_strftime): Parse the colons of %:::z *after* the
1981         optional field width, not before, so we accept %9:z, not %:9z.
1982         (my_strftime): Be sure to use L_('x') for literals.
1984 2005-09-13  Paul Eggert  <eggert@cs.ucla.edu>
1986         Merge md5 from libc, and clean up some sha1 glitches.
1987         * md5.h (__GNUC_PREREQ, __THROW, __attribute__): New macros.
1988         (__md5_buffer): Renamed from md5_buffer.  Add a macro undoing this
1989         if _LIBC is not defined.  Add __THROW.
1990         (__md5_finish_ctx, __md5_init_ctx, __md5_process_block):
1991         (__md5_process_bytes, __md5_read_ctx, __md5_stream): Likewise.
1992         (struct md5_ctx): Mark buffer as being aligned.
1993         (rol): Remove; all uses changed to CYCLIC.
1994         * md5.c (CYCLIC): New macro.  All uses of rol changed to use CYCLIC.
1995         Redo comment to minimize changes from libc.
1996         * sha1.h (struct sha1_ctx): Mark buffer as being aligned.
1997         * sha1.c (SWAP): Renamed from NOTSWAP, to avoid a horrible misnaming.
1998         All uses changed.  Remove the old SWAP.
1999         Remove obvious comment about BLOCKSIZE.
2000         (rol): New macro, moved here from md5.h.
2001         (sha1_process_block): Remove an incoherent FIXME comment.
2003         * strftime.c (my_strftime): Add support for %:z, %::z, %:::z.
2004         Fix bug in formats like %2N.
2006 2005-09-13  Jim Meyering  <jim@meyering.net>
2008         * xalloc.h: Revert unintended change that removed definitions
2009         of X2REALLOC and X2NREALLOC.
2011         * backupfile.c: Use ARGMATCH_VERIFY, just in case.
2013 2005-09-09  Paul Eggert  <eggert@cs.ucla.edu>
2015         * regcomp.c, regex.c, regex.h, regex_internal.c, regex_internal.h:
2016         * regexec.c: Import from gnulib, to fix some 64-bit bugs.
2018 2005-09-06  Paul Eggert  <eggert@cs.ucla.edu>
2020         * verify.h (__builtin_constant_p): Remove, undoing previous change.
2021         (verify_type__): Solve the problem by using a bit-field rather
2022         than an array.
2024 2005-09-05  Jim Meyering  <jim@meyering.net>
2026         * verify.h (__builtin_constant_p) [__GNUC__ <= 2]: Define to 1.
2027         (verify_type__) [verify_error_if_non_const__]: New member/test,
2028         to help detect when verify or verify_expr is mistakenly passed
2029         a non-constant argument within a function.
2031 2005-08-31  Jim Meyering  <jim@meyering.net>
2033         * quotearg.c (quotearg_n_options): Change code to be suboptimal, in
2034         order to avoid an unsuppressible warning from gcc on 64-bit systems.
2036         * localcharset.c (get_charset_aliases): Add `void' in parameter list
2037         to placate gcc's -Wstrict-prototypes.
2039 2005-08-27  Jim Meyering  <jim@meyering.net>
2041         * md5.c: Use `#error' rather than a string literal to provoke failure.
2042         * sha1.c: Likewise.
2044 2005-08-25  Jim Meyering  <jim@meyering.net>
2046         * open-safer.c: Include <config.h>.
2047         Otherwise, we'd lose LARGEFILE support in any file using
2048         e.g. "fcntl--.h"
2050 2005-08-24  Jim Meyering  <jim@meyering.net>
2052         * stdopen.c (stdopen): Revert to iterating over descriptors, but
2053         rather than using fstat, use fcntl with its F_GETFD flag, which
2054         is more efficient.  Unlike the 2-syscall dup-close approach,
2055         this one doesn't apply any unnecessary pressure on the file
2056         descriptor pool -- thus there is one fewer way to fail.
2058 2005-08-23  Jim Meyering  <jim@meyering.net>
2060         * regcomp.c, regex.c, regex.h, regex_internal.c: Update from gnulib.
2061         * regex_internal.h, regexec.c: Likewise.
2063 2005-08-19  Jim Meyering  <jim@meyering.net>
2065         * stdopen.c (stdopen): Return `bool' so caller can detect failure.
2067 2005-08-17  Jim Meyering  <jim@meyering.net>
2069         Make the %s format (seconds since the epoch) work for a negative
2070         number and when used with a zero-padded field width, e.g. %015s.
2072         * strftime.c (my_strftime): Move the `do_number_sign_and_padding'
2073         label so that it precedes the code to set `digits'.  Otherwise,
2074         %0Ns wouldn't work.  Before this change, `date -d @-22 +%05s' would
2075         print `00-22'.  Now, it prints `-0022', as it should.
2077 2005-08-15  Bruno Haible  <bruno@clisp.org>
2079         Import from gnulib.
2080         * regex.h (__restrict_arr): Don't define to __restrict if __cplusplus
2081         is defined.
2083 2005-08-13  Jim Meyering  <jim@meyering.net>
2085         * getdate.y (get_date): Undo part of the 2005-04-04 change, so that
2086         the command "date -d'2005-03-27 +1 day'" succeeds once again, even
2087         when run in a time zone for which daylight savings time is in effect
2088         for the starting date.
2090 2005-08-12  Jim Meyering  <jim@meyering.net>
2092         * regcomp.c (duplicate_node) [lint]: Set *new_idx to -1, to avoid
2093         warnings (unfounded) in caller that it may be used uninitialized.
2095         * regex.c (IF_LINT): Define.
2097         * regex_internal.c (re_string_realloc_buffers): Rename local-shadowed
2098         variable: s/new_array/offsets/.
2099         (re_acquire_state) [lint]: Set *err, to avoid warnings in caller.
2101         * regexec.c (regexec, re_search_stub) [!_LIBC]: Omit declaration
2102         of unused local, dfa.
2103         (proceed_next_node): Remove outer declaration and
2104         unnecessary initialization of local-shadowed `dest_node'.
2105         Declare it in inner scopes, nearer its uses instead.
2107         * regex.h (RE_SYNTAX_POSIX_AWK): Remove useless space-before-TAB.
2109         * fts-cycle.c (setup_dir, enter_dir, leave_dir, free_dir):
2110         Use the hash-table-based cycle-detection code not just when
2111         FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
2112         Reported by James Youngman in
2113         <http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html>.
2114         * fts_.h: Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
2116         * fts.c (fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
2117         This lets us compile with -DFTS_DEBUG, once again.
2119 2005-08-02  Jim Meyering  <jim@meyering.net>
2121         * xanstrftime.c, xanstrftime.h: New files.
2123 2005-07-21  Paul Eggert  <eggert@cs.ucla.edu>
2125         * getdate.y (relative_time): New type.
2126         (RELATIVE_TIME_0): New constant.
2127         (parser_control): Use relative_time instead of doing it ourselves.
2128         (%union): Add new relative_time rel member.
2129         (tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
2130         Now typeless.
2131         (relunit, relunit_snumber): Now of type rel.
2132         (zone, rel, relunit, get_date): Adjust to above changes.
2134 2005-07-12  Jim Meyering  <jim@meyering.net>
2136         * xalloc.h (X2NREALLOC): Define.
2138 2005-07-11  Paul Eggert  <eggert@cs.ucla.edu>
2140         * verify.h (verify_expr): Use ((verify_type__ (R) *) 0), not
2141         sizeof (verify_type__ (R)), to pacify C++ compilers.  Problem
2142         reported by Bruno Haible.
2144         * version-etc-fsf.c (version_etc_copyright): Parameterize the
2145         copyright symbol and the year.
2146         * version-etc.c (COPYRIGHT_YEAR): New constant.
2147         (version_etc_va): Use parameterized copyright notice.
2148         Reword to conform to the current GNU coding standards.
2150 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
2152         * getloadavg.c (getloadavg) [__CYGWIN__]: Port to cygwin.
2153         [__linux__]: Allocate a big enough buffer for /proc/loadavg.
2154         [!LDAV_DONE]: Avoid unused variable warning.
2156 2005-07-08  Eric Blake  <ebb9@byu.net>  (tiny change)
2157         and  Paul Eggert  <eggert@cs.ucla.edu>
2159         * regcomp.c (init_dfa, build_range_exp): Store __btowc value
2160         in wint_t, not wchar_t.  Remove now-unnecessary cast.
2162 2005-07-07  Paul Eggert  <eggert@cs.ucla.edu>
2164         Switch to Isamu Hasegawa's implementation of regex, which is
2165         now in gnulib.
2166         * regcomp.c, regex_internal.c, regex_internal.h, regexec.c:
2167         New files, from gnulib.
2168         * regex.h, regex.c: Sync from gnulib.
2169         * Makefile.am (libcoreutils_a_SOURCES): Remove regex.h; gnulib
2170         now does this automatically for us.
2171         * .cppi-disable: Add regcomp.c, regex_internal.c, regex_internal.h.
2173 2005-07-04  Paul Eggert  <eggert@cs.ucla.edu>
2175         * verify.h (GL_CONCAT0, GL_CONCAT): Define unconditionally; don't
2176         depend on whether verify_decl is defined.
2177         (verify): Renamed from verify_decl.  All uses changed.
2178         Use an extern function decl, as it can't possibly collide with other
2179         decls.
2180         (verify_expr): Renamed from verify.  All uses changed.
2181         (verify_type__): New private macro.
2182         (verify, verify_expr): Use it.
2184 2005-07-04  Jim Meyering  <jim@meyering.net>
2186         * verify.h (verify, verify_decl): New file/macros.
2187         * Makefile.am (libcoreutils_a_SOURCES): Add verify.h here, temporarily.
2188         Eventually, it'll be pulled in via AC_LIBSOURCES.
2190         * argmatch.h (verify_dcl): Rename from VERIFY.  Update use.
2192 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
2194         Remove the dependency of the strftime module on the tzset module.
2195         * strftime.c (my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
2196         Copy the input structure, to work around some of the bug with
2197         Solaris 2.5.1 and Solaris 2.6.
2199 2005-07-03  Jim Meyering  <jim@meyering.net>
2201         * posixtm.c (posixtime) [lint]: Initialize *all* of tm0, not just
2202         the .tm_year member, since otherwise gcc-4.0 would now warn about
2203         tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2205 2005-07-03  Paul Eggert  <eggert@cs.ucla.edu>
2207         * Makefile.am (libcoreutils_a_SOURCES): Undo previous change.
2209         * Makefile.am (libcoreutils_a_SOURCES): Add fcntl--.h, stdio--h,
2210         stdlib--.h, unistd--.h.
2211         * fts.c [! _LIBC]: Include "lstat.h" rather than rolling our own.
2212         * lstat.c: Sync from gnulib.
2213         * lstat.h: New file, from gnulib.
2214         * stat.c: Remove.
2216 2005-07-03  Jim Meyering  <jim@meyering.net>
2218         * fd-reopen.c: Include <unistd.h> for declaration of close.
2220 2005-07-02  Paul Eggert  <eggert@cs.ucla.edu>
2222         Cleanup to isolate "safer" functions to a small part of the code.
2223         * fcntl--.h, stdio--.h, stdlib--.h, unistd--.h, fcntl-safer.h:
2224         * open-safer.c, stdlib-safer.h, mkstemp-safer.c, fd-reopen.h:
2225         * fd-reopen.c: New files.
2226         * fopen-safer.c: Include stdio-safer.h first, to check interface.
2227         Don't bother including stdio.h, since stdio-safer.h does.
2228         * fts.c (fd_safer): Remove decl.
2229         Include fcntl--.h rather than unistd-safer.h
2230         (fts_safe_changedir): Don't call fd_safer; no longer needed
2231         now that we include fcntl--.h.
2232         * getloadavg.c: Include fcntl--.h rather than fcntl.h.
2233         Do not include unistd-safer.h.
2234         (getloadavg): Don't call fd_safer; no longer needed
2235         now that we include fcntl--.h.
2236         * getusershell.c: Include stdio--.h rather than stdio.h
2237         and stdio-safer.h.
2238         (getusershell): Call fopen, not fopen_safer.
2239         * save-cwd.c: Include fcntl--.h rather than fcntl.h.
2240         Do not include unistd-safer.h.
2241         (save_cwd): Don't call fd_safer; no longer needed
2242         now that we include fcntl--.h.
2244 2005-07-02  Jim Meyering  <jim@meyering.net>
2246         * getopt_.h: Assume HAVE_UNISTD_H, i.e., include <unistd.h>
2247         unconditionally.
2249         * fnmatch.c: Update from gnulib.
2251         * backupfile.c, canon-host.c, canonicalize.c, chown.c, cloexec.c:
2252         * dup-safer.c, dup2.c, euidaccess.c, fd-safer.c, fileblocks.c:
2253         * fopen-safer.c, fsusage.c, ftruncate.c, getcwd.c, getcwd.h:
2254         * getloadavg.c, getopt_.h, getpagesize.h, getugroups.c, group-member.c:
2255         * human.h, idcache.c, mkdir-p.c, mountlist.c, nanosleep.c, pathmax.h:
2256         * physmem.c, posixver.c, putenv.c, raise.c, safe-read.c, same.c:
2257         * save-cwd.c, setenv.c, settime.c, tempname.c, unlinkdir.c:
2258         * unsetenv.c, userspec.c, xgethostname.c, xreadlink.c:
2259         Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2261 2005-07-01  Jim Meyering  <jim@meyering.net>
2263         * chown.c, cloexec.c, dup-safer.c, dup2.c, fsusage.c, getcwd.c:
2264         * getloadavg.c, mountlist.c, openat.h, save-cwd.c, tempname.c:
2265         Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
2266         and don't include <sys/file.h>).
2268 2005-07-01  Paul Eggert  <eggert@cs.ucla.edu>
2270         * xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
2271         declares only 'struct timespec;' (!).
2273 2005-06-30  Jim Meyering  <jim@meyering.net>
2275         * stdopen.c: Add copyright.
2276         Include <fcntl.h> and <unistd.h> unconditionally --
2277         it seems to be ok to do this, these days.
2279         * stdopen.c: Rewritten by Paul Eggert.
2280         Now, the minimum overhead is just two system calls: dup and close.
2282         * stdopen.c: New file.  As yet unused.
2283         The minimum overhead is three fstat calls.
2284         * stdopen.h: New file.
2286         * argmatch.h [!VERIFY] (VERIFY): Define.
2287         (ARGMATCH_VERIFY): Use it, so this macro may be used more than
2288         once in any given scope.
2290         * xalloc.h (VERIFY_EXPR): Undef before defining, and add a comment.
2292 2005-06-29  Jim Meyering  <jim@meyering.net>
2294         * mkdir-p.c (make_dir_parents): Don't apply sizeof to a hard-coded
2295         type name.  Use the variable name instead.
2296         * idcache.c (getuser, getuidbyname, getgroup, getgidbyname): Likewise.
2298         * xalloc.h (VERIFY_EXPR): Define.
2299         (X2REALLOC): New macro, to make using x2realloc a little safer.
2301 2005-06-26  Jim Meyering  <jim@meyering.net>
2303         * Makefile.am (libcoreutils_a_SOURCES): Remove diacrit.c and diacrit.h.
2305 2005-06-25  Jim Meyering  <jim@meyering.net>
2307         * Makefile.am (libcoreutils_a_SOURCES): Remove
2308         root-dev-ino.c and root-dev-ino.h.
2309         (libcoreutils_a_SOURCES): Remove dev-ino.h too, now that we
2310         get it via root-dev-ino.m4
2311         (libcoreutils_a_SOURCES): Remove version-etc.c version-etc.h
2312         and version-etc-fsf.c.
2314 2005-06-24  Paul Eggert  <eggert@cs.ucla.edu>
2316         * canon-host.c (canon_host) [HAVE_GETADDRINFO]: Use `= { 0, };' to
2317         initialize local `hint'.  This undoes the previous change, and
2318         syncs with gnulib.
2320 2005-06-23  Jim Meyering  <jim@meyering.net>
2322         * Makefile.am (libcoreutils_a_SOURCES): Remove xreadlink.c
2323         and xreadlink.h.
2324         (libcoreutils_a_SOURCES): Remove xstrtod.c and xstrtod.h.
2326         * backupfile.c (backup_args): Change a `0' to NULL.
2328 2005-06-22  Paul Eggert  <eggert@cs.ucla.edu>
2330         * mktime.c: Include <string.h> even if !DEBUG.  (From glibc.)
2331         (ranged_convert): Don't save conversion in a temporary struct.
2332         This causes a warning with GCC 4.0.0, and anyway in the typical
2333         case it's not worth the extra 100 bytes or so of code.
2334         (ranged_convert, __mktime_internal): When calling a function via a
2335         pointer P, use P () rather than (*P) (), as we now assume C89 or better.
2337         * readutmp.c (desirable_utmp_entry): Fix bug where "who -b" and
2338         "who -r" failed to give output.  Problem reported by Tim Waugh.
2340 2005-06-22  Jim Meyering  <jim@meyering.net>
2342         * xmalloc.c: Update from gnulib.
2344 2005-06-19  Jim Meyering  <jim@meyering.net>
2346         * Makefile.am (libcoreutils_a_SOURCES): Remove xgetcwd.c, xgetcwd.h,
2347         xfts.c and xfts.h.
2349 2005-06-16  Jim Meyering  <jim@meyering.net>
2351         * calloc.c (rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
2352         when either N or S is zero.
2354 2005-06-15  Jim Meyering  <jim@meyering.net>
2356         * mkdir-p.c (make_dir_parents): Don't let a failed chdir($PWD)
2357         stop us from restricting permissions of just-created absolute-named
2358         directories.
2360 2005-06-14  Paul Eggert  <eggert@cs.ucla.edu>
2362         Improve quality of diagnostics on restore_cwd failure.
2363         * mkdir-p.h (make_dir): Remove.  All uses replaced by mkdir.
2364         (make_dir_parents): Last arg is now int * (for errno), not bool *.
2365         * mkdir-p.c (make_dir, make_dir_parents): Likewise.
2366         Rewrite "mkdir -p" algorithm to avoid the need for "stat"
2367         each time through the loop.  Do not diagnose restore_cwd failure;
2368         that is the caller's job (and perhaps the caller does not care).
2370         * mkdir-p.c (CLEANUP_CWD, CLEANUP): Remove.
2371         (make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
2372         If the file already exists but is not a directory, don't bother
2373         to try to make its parents.
2374         Close potential file descriptor leak if we can't chdir("/") (!).
2375         Don't always return true if chdir($PWD) fails; return true only
2376         if the requested action was done successfully (except for the
2377         chdir($PWD)).
2378         Don't log final directory unless we actually made it.
2379         Refactor to avoid duplicate code to fix up permissions.
2380         Don't attempt to fix up parent permissions if chdir($PWD) fails.
2382 2005-06-14  Jim Meyering  <jim@meyering.net>
2384         * openat-die.c (openat_save_fail): Rename from openat_save_die.
2385         (openat_restore_fail): Rename from openat_restore_die.
2386         * openat.c, openat.h: Reflect s/_die/_fail/ renaming.
2388         * mkdir-p.c (CLEANUP_CWD): Return *true*, not false when failing
2389         to restore initial working directory.
2391         Provide an alternative to exiting immediately upon save_cwd or
2392         restore_cwd failure.  Now, an application can arrange e.g.,
2393         to perform a longjump in that case.
2394         * openat.c: Include dirname.h.
2395         Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
2396         (rpl_openat, fdopendir, fstatat): Call openat_save_die
2397         and openat_restore_die rather than calling error directly.
2398         Don't include "error.h" or "exitfail.h"; they're no longer needed.
2400         * openat-die.c (openat_save_die, openat_restore_die): New file.
2401         * openat.h (openat_save_die, openat_restore_die): Declare and define.
2403 2005-06-13  Jim Meyering  <jim@meyering.net>
2405         * mkdir-p.c (make_dir_parents): New parameter: different_working_dir,
2406         to tell caller if/when we change the working directory and are
2407         unable to return to the initial one.
2408         * mkdir-p.h (make_dir_parents): Update prototype.
2410 2005-06-12  Jim Meyering  <jim@meyering.net>
2412         * mkdir-p.c (CLEANUP_CWD): Change one more `return 1' to
2413         `return false'.  This fixes a bug introduced on 2004-07-30.
2415 2005-06-01  Paul Eggert  <eggert@cs.ucla.edu>
2417         Use "file name" when talking about file names, instead of "filename"
2418         or "path", as per the GNU coding standards.
2419         * mkdir-p.c: Renamed from makepath.c.
2420         (make_dir_parents): Renamed from make_path.  All callers changed.
2421         * mkdir-p.h: Likewise.  All includers changed.
2422         * filenamecat.c: Renamed from path-concat.c.
2423         (file_name_concat): Renamed from path_concat.  All callers changed.
2424         [TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
2425         * filenamecat.h: Likewise.  All includers changed.
2426         * acl.c: Don't use "path" or "filename" to mean "file name"
2427         in comments or local variable names.
2428         * basename.c: Likewise.
2429         * canonicalize.c, canonicalize.h: Likewise.
2430         * dirname.c, dirname.h: Likewise.
2431         * euidaccess.c: Likewise.
2432         * exclude.c: Likewise
2433         * fnmatch_.h, fnmatch_loop.c: Likewise.
2434         * fsusage.c, fsuage.h: Likewise.
2435         * fts.c, fts_.h: Likewise.
2436         * getcwd.c: Likewise.
2437         * getloadavg.c: Likewise.
2438         * mkstemp.c: Likewise.
2439         * mountlist.c, mountlist.h: Likewise.
2440         * openat.c, openat.h: Likewise.
2441         * readlink-stub.c: Likewise.
2442         * readutmp.c, readutmp.h: Likewise.
2443         * rename.c: Likewise.
2444         * rmdir.c: Likewise.
2445         * same.c: Likewise.
2446         * savedir.c: Likewise.
2447         * stripslash.c: Likewise.
2448         * tempname.c: Likewise.
2449         * xreadlink.c: Likewise.
2450         * exclude.c (excluded_file_name): Renamed from excluded_filename.
2451         All uses changed.
2452         * exclude.h: Likewise.
2454 2005-05-30  Paul Eggert  <eggert@cs.ucla.edu>
2456         * euidaccess.c (getuid, getgid, getuid, getegid)
2457         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2458         * idcache.c (getpwuid, getpwnam, getgrgid, getgrnam)
2459         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2460         * pathmax.h: Include <limits.h> unconditionally, since other
2461         files have been getting away with it for years (MORE/BSD 4.3
2462         is extinct now).
2463         * userspec.c (getpwnam, getgrnam, getgrgid)
2464         [!defined _POSIX_VERSION]: Remove decls; not needed these days.
2466 2005-05-29  Paul Eggert  <eggert@cs.ucla.edu>
2468         * pathmax.h (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
2469         Define to 256, not 255, as per modern POSIX.
2471 2005-05-27  Paul Eggert  <eggert@cs.ucla.edu>
2473         * fts.c: Don't worry about debugging on pre-C99-comopatible hosts;
2474         the configuration hassle isn't worth it.
2475         Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
2476         (LONGEST_MODIFIER, PRIuMAX): Remove.
2478         * strnumcmp.c, strnumcmp.h, strnumcmp-in.h, strintcmp.c:
2479         New files.
2481 2005-05-22  Paul Eggert  <eggert@cs.ucla.edu>
2483         * fts.c (fd_safer) [_LGPL_PACKAGE]: New static function,
2484         so that unistd-safer.h (GPL'ed code) need not be included.
2486 2005-05-20  Paul Eggert  <eggert@cs.ucla.edu>
2488         Split the fts code into GPL'ed and LGPL'ed parts, and fix some
2489         minor memory-allocation bugs.
2491         * fts.c: Don't include "cycle-check.h" or "hash.h".
2492         (setup_dir, free_dir): New functions.
2493         (enter_dir, leave_dir): Define trivial
2494         alternatives of _LGPL_PACKAGE.  Move to fts-cycle.c if !_LGPL_PACKAGE.
2495         (HT_INITIAL_SIZE, ENTER_DIR): Remove.  All uses removed.
2496         (LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
2497         (struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
2498         Move to fts-cycle.c.
2499         (fts_open): Use setup_dir.
2500         (fts_close): Use free_dir.
2501         (fts_read): Have just one copy of the ENTER_DIR code rather than three.
2502         This adds a label and some gotos, but the alternatives were messier.
2503         Check for memory allocation failure when entering a dir.
2504         (fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
2505         * fts_.h (_LGPL_PACKAGE) [defined _LIBC]: New macro.
2506         (FTS): New member fts_cycle, that is a union that contains the
2507         old active_dir_ht and cycle_state.  All uses changed to mention
2508         fts_cycle.ht and fts_cycle.state.
2509         * fts-cycle.c: New file, containing GPL'ed code migrated out of
2510         fts.c, with the following changes:
2511         (setup_dir, free_dir): New functions.
2512         (enter_dir): Now returns bool.  Return true if successful, false
2513         if memory exhausted.  All callers changed.
2514         Do not bother partly cleaning up on
2515         memory allocation failure; that is free_dir's job.
2516         However, free ad if hash_insert fails, to avoid memory leak.
2517         (enter_dir, leave_dir): Accommodate change to FTS by inspecting
2518         fts->fts_options to see which union member to use.
2520 2005-05-20  Eric Blake  <ebb9@byu.net>  (tiny change)
2522         * chown.c (rpl_chown): Return -1 on failure.
2524 2005-05-20  Jim Meyering  <jim@meyering.net>
2526         * fts.c (fts_open): Remove useless but otherwise harmless malloc call.
2527         Spotted by Paul Eggert.
2529 2005-05-19  Jim Meyering  <jim@meyering.net>
2531         * unlinkdir.h (cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
2532         Use #define rather than a static function, to avoid a warning
2533         when the function was not used.
2535 2005-05-18  Paul Eggert  <eggert@cs.ucla.edu>
2537         * canonicalize.c: Include canonicalize.h first, to test interface.
2538         Include <stddef.h> unconditionally, since we assume C89 now.
2539         All uses of PTR_INT_TYPE replaced by ptrdiff_t.
2540         * fts.c: Include fts_.h first, to check interface.
2541         Do not include intprops.h; no longer needed.
2542         Include cycle-check.h and hash.h, since fts_.h no longer does.
2543         Remove unnecessary casts of closedir to void.
2544         (fts_build): Use a simpler method (not involving TYPE_SIGNED) to
2545         decide whether to decrement nlinks.
2546         * fts_.h: Do not include hash.h or cycle-check.h; no longer needed.
2547         (FTS): Use struct hash_table * instead of Hash_table, so that
2548         we no longer need to include hash.h here.
2550 2005-05-14  Paul Eggert  <eggert@cs.ucla.edu>
2552         * unlinkdir.c, unlinkdir.h: New files.
2554 2005-05-14  Jim Meyering  <jim@meyering.net>
2556         * unlocked-io.h, gethrxtime.c, gethrxtime.h, mountlist.h,
2557         * xtime.h, path-concat.c: Correct cpp indentation.
2559 2005-05-14  Jim Meyering  <jim@meyering.net>
2561         Update FSF postal mail address everywhere.
2563 2005-05-09  Paul Eggert  <eggert@cs.ucla.edu>
2565         * fts_.h (FTS): Use correct type for fts_compar member.
2566         (FTSENT): New member fts_fts.  Remove members fts_ino, fts_dev,
2567         fts_nlink; no longer needed now that fts_statp is always there.
2568         All uses changed to use fts_statp instead.
2569         * fts.c (__P): Remove.  All uses rewritten to assume C89 or better.
2570         (fts_open): Don't cast a function value in a possibly-unsafe way.
2571         (fts_compar): New function.
2572         (fts_sort): Use it.  But optimize the common case where all
2573         pointers smell the same.
2575 2005-05-08  Paul Eggert  <eggert@cs.ucla.edu>
2577         * yesno.c: Include getline.h, not ctype.h.
2578         (yesno): Don't remove leading white space; POSIX doesn't allow it.
2579         Use getline to remove arbitrary restriction on response length.
2581 2005-05-05  Paul Eggert  <eggert@cs.ucla.edu>
2583         * makepath.c (make_path): chdir to "//", not "/", if the file name
2584         starts with exactly two slashes.  This doesn't solve the problem
2585         in general but it's better than nothing.  Problem reported by
2586         Pierre A. Humblet via Eric Blake.
2588 2005-05-01  Paul Eggert  <eggert@cs.ucla.edu>
2590         * modechange.h (mode_free): Remove; all callers changed to invoke
2591         'free'.
2592         * modechange.c: Likewise.
2593         xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
2594         (MODE_DONE): New constant.
2595         (struct mode_change): Remove 'next' member.
2596         (make_node_op_equals): New function; like the old one of the
2597         same name, except it allocates an array.
2598         (mode_compile, mode_create_from_ref): Use it.
2599         (mode_compile): Allocate result as an array, not a linked list.
2600         Parse octal string ourself, so that we catch mistakes like "+0".
2601         (mode_adjust): Arg is an array, not a linked list.
2603         * mbswidth.c, regex.c, strtol.c: Sync from gnulib.
2605 2005-04-28  Paul Eggert  <eggert@cs.ucla.edu>
2607         * tempname.c (S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
2608         [!_LIBC] Include "stat-macros.h" instead.
2610         * file-type.c: Include file-type.h first.
2611         * filetype.h: Don't assume <sys/stat.h> was included first.
2613         * modechange.c: Include stat-macros.h, xalloc.h.
2614         (S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
2615         (S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
2616         (S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
2617         Remove.  This is now stat-macros.h's job.
2618         (talloc): Remove.  All callers replaced by xalloc, so that
2619         our invokers don't have to worry about reporting memory failures.
2620         (make_node_op_equals): Remove.
2621         (MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
2622         New constants.
2623         (struct mode_change): Moved here from modechange.h.
2624         (mode_append_entry): Remove.
2625         (mode_compile): Remove MASKED_OPS arg, since it encouraged
2626         apps to have incorrect behavior.  Use simpler algorithm for head
2627         and tail.  Don't futz with umask; that's now the job of mode_adjust.
2628         Detect more invalid usages rather than having somewhat-random behavior.
2629         Don't insert an "a=" action, as that leads to incorrect behavior.
2630         (mode_compile, mode_create_from_ref): Return NULL on error instead
2631         of an enum, since now there's only one way to have an error.  All
2632         callers changed.
2633         (mode_adjust): Accept new arg UMASK_VALUE, and interpret it
2634         at the correct time.  Simplify calculation of "+u" and its ilk.
2635         Don't mishandle "+X".
2636         (mode_free): Remove "register" and localize decls.
2637         * modechange.h (MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
2638         (struct mode_change): Move to modechange.c; callers don't
2639         need to see this stuff.
2640         (MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
2641         (MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
2642         (mode_change, mode_adjust): Reflect the new signatures noted above.
2644 2005-04-18  Paul Eggert  <eggert@cs.ucla.edu>
2646         * Makefile.am (noinst_LIBRARIES): fetish -> coreutils.
2647         (libcoreutils_a_SOURCES): Renamed from libfetish_a_SOURCES.
2648         All uses changed.
2649         (libcoreutils_a_LIBADD): Renamed from libfetish_a_LIBADD.
2650         All uses changed.
2651         (libcoreutils_a_DEPENDENCIES): Renamed from libfetish_a_DEPENDENCIES.
2652         All uses changed.
2653         * chdir-long.c: fetish->coreutils in comment.
2654         * t-chdir-long: fetish->coreutils in compilation command.
2656 2005-04-13  Paul Eggert  <eggert@cs.ucla.edu>
2658         * getdate.y (zone): Allow relunit_snumber after tZONE, so
2659         that "UTC +1 second" continues to work.  Problem reported
2660         by Dmitry V. Levin.
2661         (relunit_snumber): New rule.
2662         (relunit): Use it.
2664 2005-04-12  Paul Eggert  <eggert@cs.ucla.edu>
2666         * getdate.y (universal_time_zone_table): New constant.
2667         (time_zone_table): Remove GMT, UT, UTC entries; they're now in
2668         universal_time_zone_table.
2669         (lookup_zone): Prefer universal_time_zone_table to
2670         local_time_zone_table, so that "GMT" time stamps are allowed in
2671         London during the summer.  Problem reported by Ian Abbott.
2673 2005-04-11  Paul Eggert  <eggert@cs.ucla.edu>
2675         Add bulletproofing for cases where stdin, stdout, or stderr are closed.
2676         * fcntl-safer.h, open-safer.c: Remove.
2677         * fd-safer.c: New file.
2678         * dup-safer.c: Include unistd-safer.h first, to test interface.
2679         (dup_safer) [!deefined F_DUPD]: Use new fd_safer function instead of
2680         rolling our own code.
2681         * fts.c: Include unistd-safer.h.
2682         (fts_safe_changedir): Use fd_safer.
2683         * getloadavg.c: Include unistd-safer.h.
2684         (getloadavg): Use fd_safer.
2685         * getusershell.c: Include stdio-safer.h.
2686         (getusershell): Use fopen_safer.
2687         * save-cwd.c: Include unistd-safer.h.
2688         (save_cwd): Use fd_safer.
2689         * unistd-safer.h (fd_safer): New decl.
2690         * Makefile.am (libfetish_a_SOURCES): Remove dup-safer.c,
2691         fcntl-safer.h, fopen-safer.c, open-safer.c, stdio-safer.h,
2692         unistd-safer.h.
2694 2005-04-09  Jim Meyering  <jim@meyering.net>
2696         * fts.c (__attribute__, ATTRIBUTE_UNUSED): Define.
2697         Mark parameter `sp' with ATTRIBUTE_UNUSED.
2699         Avoid warnings from gcc-4.
2700         * canon-host.c (canon_host) [HAVE_GETADDRINFO]: Use memset
2701         rather than `= { 0 };' to initialize local `hint'.
2702         * unicodeio.c (__attribute__, ATTRIBUTE_UNUSED): Define.
2703         (exit_failure_callback, fallback_failure_callback): Mark unused
2704         parameters with ATTRIBUTE_UNUSED.
2706         * posixtm.c (posixtime) [lint]: Avoid spurious warning from gcc-4's
2707         -Wuninitialized: initialize tm0.tm_year.
2709         * human.c (humblock): Set *options even when returning due to
2710         xstrtoumax conversion failure.  Thanks to a used-uninitialized
2711         warning from gcc-4.
2713 2005-04-08  Paul Eggert  <eggert@cs.ucla.edu>
2715         * nanosleep.c (rpl_nanosleep): Include "timespec.h" before macros
2716         that might redefine system include files.
2717         (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
2718         (my_usleep): Use NULL rather than (void *) 0.
2719         (rpl_nanosleep) [!defined SA_NOCLDSTOP]:
2720         Use siginterrupt to specify that system calls should be interrupted.
2721         (rpl_nanosleep): Move initialization of suspended closer to call of
2722         my_usleep.
2724 2005-04-04  Paul Eggert  <eggert@cs.ucla.edu>
2726         * getdate.y (parser_control): rels_seen is now a boolean, not a
2727         count, since there's no maximum.  All uses changed.
2728         Add member dsts_seen.
2729         (local_zone): Accumulate dsts_seen rather than relying on tm_isdst
2730         not being INT_MAX.
2731         (get_date): Initialize dsts_seen, and check that it doesn't go over 1.
2732         Use pc_rels_seen to decide whther a date is absolute.
2734         * getdate.y (number): Don't overwrite year.
2735         (get_date): Initialize pc.year.digits to 0, not 4, to enable above
2736         check.
2738 2005-03-30  Paul Eggert  <eggert@cs.ucla.edu>
2740         * readutmp.h (read_utmp): New arg OPTIONS.  All uses changed.
2741         * readutmp.c: Likewise.  Include signal.h, stdbool.h.
2742         (desirable_utmp_entry): New function.
2743         (read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
2744         using x2nrealloc, to simplify logic.
2745         (read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
2746         size calculation.  Do not assume utmp file is a regular file.
2747         * readutmp.h (UT_PID): Moved here from ../src/who.c.
2748         (READ_UTMP_CHECK_PIDS): New constant.
2750 2005-03-29  Jim Meyering  <jim@meyering.net>
2752         * long-options.c (long_options): Use NULL, not `0'.
2754 2005-03-27  Jim Meyering  <jim@meyering.net>
2756         * argmatch.c: Clarify comment: null-terminated -> NULL-terminated.
2758 2005-03-26  Paul Eggert  <eggert@cs.ucla.edu>
2760         * intprops.h (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND):
2761         "one's complement" -> "ones' complement" in comment, as per Knuth.
2762         "value of type" -> "type or expression" in comment.
2763         * mktime.c, strftime.c: Propagate intprops.h comment nits.
2765 2005-03-26  Jim Meyering  <jim@meyering.net>
2767         Comment nits.
2768         * intprops.h: Add the apostrophe in `(one|two)'s complement'.
2769         Correct typos: s/or/of/.
2771 2005-03-23  Jim Meyering  <jim@meyering.net>
2773         * canonicalize.c: Remove duplicate `#include "stat-macros.h"'.
2775 2005-03-21  Paul Eggert  <eggert@cs.ucla.edu>
2777         * Makefile.am (libfetish_a_SOURCES): Remove stat-macros.h, xstrtoul.c,
2778         as they are now done by Autoconf macros.
2780 2005-03-20  Paul Eggert  <eggert@cs.ucla.edu>
2782         * gettext.h, regex.c, setenv.c, vasprintf.c: Sync from gnulib.
2783         * vasnprintf.c (EOVERFLOW): Define if not already defined.
2784         This merges a change from gnulib.
2786 2005-03-18  Paul Eggert  <eggert@cs.ucla.edu>
2788         * strftime.c (my_strftime): If the underlying strftime returns 0
2789         (which shouldn't happen), generate nothing instead of returning 0
2790         immediately, so that nstrftime (NULL, ...) doesn't return 0.
2792 2005-03-15  Paul Eggert  <eggert@cs.ucla.edu>
2794         * strftime.c (my_strftime): Prepend space to format so that we can
2795         reliably distinguish strftime failure from empty output on POSIX
2796         hosts.
2798 2005-03-14  Paul Eggert  <eggert@cs.ucla.edu>
2800         * mktime.c (TYPE_TWOS_COMPLEMENT, TYPE_ONES_COMPLEMENT,
2801         TYPE_SIGNED_MAGNITUDE, TYPE_MINIMUM, TYPE_MAXIMUM): Sync from
2802         intprops.h.
2803         * strtol.c: Likewise.
2805 2005-03-14  Jim Meyering  <jim@meyering.net>
2807         * strftime.c (my_strftime) [HAVE_STRFTIME && ! (_NL_CURRENT
2808         && HAVE_STRUCT_ERA_ENTRY)]: Initialize the first byte of ubuf[]
2809         to be nonzero so that we (and caller) can detect the difference
2810         between a valid zero-length expansion and an error return, even
2811         when the underlying strftime fails before writing anything into
2812         that location.
2814 2005-03-11  Jim Meyering  <jim@meyering.net>
2816         * getdate.c: Regenerate using bison-2.0.
2818 2005-03-10  Jim Meyering  <jim@meyering.net>
2820         * save-cwd.c [!HAVE_FCHDIR]: Define open, fchdir, and chdir_long
2821         so that this module works on systems without fchdir.
2823         * Makefile.am (libfetish_a_SOURCES): Remove xstrtol.c and xstrtol.h.
2825 2005-03-09  Paul Eggert  <eggert@cs.ucla.edu>
2827         Factor int-properties macros into a single file, except for
2828         glibc-related files.
2829         * intprops.h: New file.
2830         * getloadavg.c: Include it instead of limits.h.
2831         (INT_STRLEN_BOUND): Remove.
2832         * human.c: Include intprops.h.
2833         (group_number): Use INT_STRLEN_BOUND instead of rolling it ourself.
2834         * human.h (LONGEST_HUMAN_READABLE): Use 146/485 rather than 302/1000.
2835         * inttostr.h: Include intprops.h instead of limits.h.
2836         (INT_STRLEN_BOUND, INT_BUFSIZE_BOUND): Remove.
2837         * mktime.c (TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT): New macros,
2838         for consistency with intprops.h.
2839         (time_t_is_integer, twos_complement_arithmetic): Use them.
2840         * sig2str.h: Include <signal.h>, intprops.h.
2841         (INT_STRLEN_BOUND): Remove.
2842         * strftime.c (TYPE_SIGNED): Remove.
2843         (INT_STRLEN_BOUND): Switch to same implementation as intprops.h.
2844         * strtol.c: Adjust comments to match intprops.h.
2845         * userspec.c: Include intprops.h.
2846         (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Remove.
2847         * utimecmp.c, xnanosleep.c, xstrtol.c: Likewise.
2848         * utimecmp.c (utimecmp): Use TYPE_IS_INTEGER, TYPE_TWOS_COMPLEMENT
2849         instead of rolling our own expressions.
2850         * xstrtol.c: Include xstrtol.h first, to test interface.
2851         * fts.c: Include intprops.h.
2852         (TYPE_SIGNED): Remove.
2854 2005-03-09  Jim Meyering  <jim@meyering.net>
2856         More migration to AC_LIBSOURCES/AC_LIBOBJ.
2857         * Makefile.am (libfetish_a_SOURCES): Remove two more pairs of files:
2858         cycle-check.c, cycle-check.h and argmatch.c, argmatch.h.
2860         * cycle-check.c: Don't include "xalloc.h".  It's not used.
2862 2005-03-01  Paul Eggert  <eggert@cs.ucla.edu>
2864         Remove workaround for bug in Linux kernel 2.6.8 or thereabouts.
2865         The workaround isn't strictly needed for POSIX conformance, and
2866         it's too much of a pain to configure and maintain.  We'll ask
2867         people to fix their kernels instead.
2868         * xnanosleep.c: Don't include gethrxtime.h or xtime.h.
2869         (NANOSLEEP_BUG_WORKAROUND): Remove.
2870         (xnanosleep): Remove the workaround.
2872 2005-02-27  Jim Meyering  <jim@meyering.net>
2874         * xnanosleep.c (xnanosleep): Work around bug in Linux-2.6.8.1's
2875         nanosleep whereby it fails without setting errno upon being resumed
2876         after being suspended.
2878 2005-02-25  Paul Eggert  <eggert@cs.ucla.edu>
2880         * vasnprintf.c (VASNPRINTF) [!USE_SNPRINTF]: Correct the test for
2881         integer overflow again.  Actually, neither this nor the 2005-01-23
2882         change fixes any bug on any plausible platform; it's more of a
2883         code-clarity thing.
2885         * config.charset, gettext.h, localcharset.c: Sync from gnulib.
2887 2005-02-23  Paul Eggert  <eggert@cs.ucla.edu>
2889         * strftime.c: Include <stdbool.h>.  Use bool where appropriate,
2890         instead of int.
2891         (my_strftime): Do not mishandle years close to INT_MAX, by doing
2892         the right thing even if adding 1900 would overflow.  Similarly
2893         for tm_mon + 1 and tm_yday + 1.
2894         Make %Y always equivalent to %C%y, and similarly for %G and %g.
2895         (DO_NUMBER, DO_NUMBER_SPACEPAD): Set digits to d, not a conditional.
2896         (DO_SIGNED_NUMBER): New macro.
2897         (my_strftime) [HAVE_TZNAME]: Don't dump core if tp->tm_dst > 1.
2899 2005-02-21  Paul Eggert  <eggert@cs.ucla.edu>
2901         * Makefile.am (libfetish_a_SOURCES): Remove xnanosleep.c,
2902         xnanosleep.h; now done by ../m4/xnanosleep.m4 automatically.
2904 2005-02-20  Paul Eggert  <eggert@cs.ucla.edu>
2906         * gethrxtime.h, gethrxtime.c, xtime.h: New files.
2907         * timespec.h (gettime): Return void, since it always
2908         succeeds now.  All uses changed.
2909         * gettime.c (gettime) Likewise.
2910         [HAVE_NANOTIME]: Prefer nanotime.
2911         Assume gettimeofday succeeds, as POSIX requires.
2912         Assime time () succeeds, since other code already does.
2913         * xnanosleep.c: Include xtime.h and gethrxtime.h, not xalloc.h.
2914         (timespec_subtract): Remove.
2915         (NANOSLEEP_BUG_WORKAROUND): New constant.
2916         (xnanosleep): Use gethrxtime rather than gettime; this simplifies
2917         things considerably.  Use it only on GNU/Linux hosts, since the
2918         workaround shouldn't be needed elsewhere.
2920 2005-02-20  Neil Conway  <neilc@samurai.com>
2922         * xgethostname.c (xgethostname): Check for ENOMEM, which is
2923         returned by OSX/Darwin if the specified buffer is not large
2924         enough for the hostname.
2926 2005-02-20  Jim Meyering  <jim@meyering.net>
2928         More of the same.
2929         * Makefile.am (libfetish_a_SOURCES): Remove
2930         linebuffer.[ch] and stripslash.c.
2932 2005-02-11  Jim Meyering  <jim@meyering.net>
2934         Remove names of files that are now mentioned in AC_LIBSOURCES
2935         and AC_LIBOBJ uses in inttostr.m4.
2936         * Makefile.am (libfetish_a_SOURCES): Remove imaxtostr.c,
2937         offtostr.c, and umaxtostr.c.
2938         (EXTRA_DIST): Remove inttostr.c and inttostr.h.
2940 2005-02-08  Jim Meyering  <jim@meyering.net>
2942         * Makefile.am (libfetish_a_SOURCES): Remove memcasecmp.c
2943         and memcasecmp.h.
2945 2005-02-07  Jim Meyering  <jim@meyering.net>
2947         * Makefile.am (libfetish_a_SOURCES): Remove fts.c, fts_.h, and
2948         getcwd.h now that they're mentioned in AC_LIBSOURCES and AC_LIBOBJ
2949         uses in the corresponding ../m4/*.m4.
2951 2005-02-03  Paul Eggert  <eggert@cs.ucla.edu>
2953         * memrchr.h: New file.
2954         * chdir-long.c: Include it.
2955         * memrchr.c [!defined _LIBC]: Include it rather than <string.h>.
2956         Don't bother including stddef.h.
2958 2005-02-01  Paul Eggert  <eggert@cs.ucla.edu>
2960         * mountlist.h (MOUNTLIST_H_): New macro, to protect against double
2961         inclusion.
2962         Include <sys/types.h>, for dev_t.
2963         (ME_DUMMY, ME_REMOTE): Move from here....
2964         * mountlist.c (ME_DUMMY, ME_REMOTE): To here.
2965         (ME_DUMMY): Count "subfs" as a dummy.  Problem reported by
2966         Dmitry V. Levin.
2967         Include mountlist.h first, to test the interface.
2969 2005-01-29  Jim Meyering  <jim@meyering.net>
2971         * Makefile.am (libfetish_a_SOURCES): Remove many files from this
2972         list, now that automake determines their names automatically,
2973         thanks to the new AC_LIBSOURCES and AC_LIBOBJ uses in the
2974         corresponding ../m4/*.m4 files.
2975         (EXTRA_DIST): Add getdate.c here, so that we continue to distribute it.
2977 2005-01-25  Jim Meyering  <jim@meyering.net>
2979         * path-concat.c: Don't include assert.h.
2980         (path_concat): Remove assertion that would have triggered
2981         for ABASE starting with more than one slash.
2982         Reported by Andreas Schwab.
2984         * path-concat.c (path_concat): Set *BASE_IN_RESULT
2985         properly when ABASE is an absolute file name.
2986         Correct the description of this function.
2987         Include <assert.h>.
2988         Add an assertion and a test driver.
2989         This fixes a bug introduced on 2004-07-02.
2990         Andreas Schwab reported the resulting failure of cp --parents:
2991         http://lists.gnu.org/archive/html/bug-coreutils/2005-01/msg00130.html
2993 2005-01-23  Jim Meyering  <jim@meyering.net>
2995         * vasnprintf.c (VASNPRINTF) [!USE_SNPRINTF]: Correct the test for
2996         integer overflow.
2998 2005-01-21  Paul Eggert  <eggert@cs.ucla.edu>
3000         Sync from gnulib.
3001         * error.c [!_LIBC && !ENABLE_NLS]: Do not include "gettext.h";
3002         not needed.  This removes a dependency on the gettext module.
3003         [defined _LIBC]: Do not include <libintl.h>; not needed.
3005 2005-01-20  Paul Eggert  <eggert@cs.ucla.edu>
3007         * save-cwd.c (save_cwd): Remove code to support the case
3008         where fchdir is missing or flaky.
3010         * Makefile.am (libfetish_a_SOURCES): Add version-etc-fsf.c.
3012 2005-01-20  Simon Josefsson  <jas@extundo.com>
3014         * version-etc-fsf.c: New file, with version_etc_copyright.
3015         * version-etc.c: Remove version_etc_copyright.
3016         * version-etc.h (version_etc_copyright): Use [] instead of * in
3017         prototype, suggested by Paul Eggert.
3019 2005-01-19  Jim Meyering  <jim@meyering.net>
3021         * openat.h (AT_SYMLINK_NOFOLLOW): Define to 4096, so it's the
3022         same value as for Solaris 9.
3024         * chdir-long.c (chdir_long): Rewrite to remove limitation on
3025         component length.  This included changing the parameter to be
3026         of type `char *' rather than `char const *'.
3027         * chdir-long.h (chdir_long): Update prototype.
3028         * t-chdir-long: A test harness to exercize chdir-long.c's
3029         sample main program.
3031         * openat.c (fdopendir, fstatat): New functions.
3032         * openat.h: Include headers required for use of DIR and struct stat.
3033         [AT_SYMLINK_NOFOLLOW]: Define.
3034         (fdopendir, fstatat): Add prototypes.
3036 2005-01-04  Paul Eggert  <eggert@cs.ucla.edu>
3038         * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
3039         definitions to be after all include files, to avoid collisions.
3040         Problem reported by Bob Proulx.
3042 2005-01-04  Bob Proulx  <bob@proulx.com>
3044         * obstack.c [DEFAULT_ALIGNMENT]: Use an intermediate type to simplify
3045         offsetof() macro construct to avoid compile failure with native HP-UX
3046         11.0 ANSI C compiler.
3048 2005-01-03  Paul Eggert  <eggert@cs.ucla.edu>
3050         * utimens.c (futimens): Robustify the previous patch, by checking
3051         for known valid error numbers rather than observed invalid ones.
3053 2005-01-03  Jim Meyering  <jim@meyering.net>
3055         * utimens.c (futimens): Account for the fact that futimes
3056         can also fail with errno == ENOSYS in that case.
3057         Patch from Dmitry V. Levin.
3059 2005-01-03  Paul Eggert  <eggert@cs.ucla.edu>
3061         * utimens.c (futimens) [HAVE_FUTIMES]: Fall back on utimes if
3062         futimes fails with errno == ENOENT.  Problem reported by
3063         Dmitry V. Levin.
3065 2005-01-02  Jim Meyering  <jim@meyering.net>
3067         * version-etc.c (version_etc_copyright): Update copyright date.
3069 2004-12-31  Jim Meyering  <jim@meyering.net>
3071         * openat.c (rpl_openat): Correct comment.
3072         Call free_cwd, to avoid leaking a file descriptor.
3074 2004-12-23  Paul Eggert  <eggert@cs.ucla.edu>
3076         * getdate.y (YYSTACK_USE_ALLOCA): Define to 0, since there's no
3077         need to extend the stack.
3078         (YYINITDEPTH): New macro, so that the initial stack isn't overly
3079         large.
3081 2004-12-19  Paul Eggert  <eggert@cs.ucla.edu>
3083         * c-strtod.c (STRTOD): Depend on HAVE_C99_STRTOLD, not
3084         HAVE_DECL_STRTOLD.
3086         * alloca_.h: Conditionalize on _GNULIB_ALLOCA_H, not _ALLOCA_H.
3087         Remove now-obsolete comment about AIX.
3088         * getdate.y: Include <alloca.h> only if HAVE_ALLOCA.
3089         (YYSTACK_USE_ALLOCA): Define to 0 if !HAVE_ALLOCA.
3090         (YYMAXDEPTH): New macro.
3092 2004-12-11  Jim Meyering  <jim@meyering.net>
3094         * chdir-long.c: Fail via #error if PATH_MAX is not defined, since
3095         this file is now compiled only on systems that define PATH_MAX.
3097 2004-12-08  Paul Eggert  <eggert@cs.ucla.edu>
3099         * getdate.y (textint): New member "negative".
3100         (time_zone_hhmm): New function.
3101         Expect 14 shift-reduce conflicts, not 13.
3102         (o_colon_minutes): New rule.
3103         (time, zone): Use it to add support for +HH:MM, UTC+HH:MM.
3104         (yylex): Set the "negative" member of signed numbers.
3106 2004-12-06  Jim Meyering  <jim@meyering.net>
3108         * Makefile.am (libfetish_a_SOURCES): Begin removing .c and .h file
3109         names, as they are added to AC_LIBSOURCES directives in the
3110         corresponding m4/*.m4 files.
3112 2004-12-05  Jim Meyering  <jim@meyering.net>
3114         Currently, fpending.m4 punts (by defining PENDING_OUTPUT_N_BYTES
3115         to 1) if it doesn't find a valid expression for the replacement
3116         function.  Before this change, that might have gone undetected
3117         for some time.  Now, we'll catch it close to the source.
3119         * t-fpending.c: New file.  Test the __fpending function.
3120         This ensures that if there is an error in the definition of the
3121         PENDING_OUTPUT_N_BYTES expression, we'll find about it right away;
3122         that value is used only in the rare event that close_stdout's
3123         fclose fails with EBADF.
3124         * Makefile.am (unit-test): New target.
3125         (check): Depend on it.
3126         (noinst_PROGRAMS): Define.
3127         (LDADD): Define.
3128         * Makefile.am (unit-test): Depend on t-fpending.
3129         Make the target .PHONY.
3131 2004-12-02  Paul Eggert  <eggert@cs.ucla.edu>
3133         * openat.c: Include "openat.h" before other include files.
3134         Include "exitfail.h".
3135         (openat): Remove #undef; no longer needed now that we include openat.h
3136         first.
3137         (rpl_openat): Add comment about mode_t promotion.  Simplify
3138         code a bit by moving initializations around.  Use exit_failure
3139         rather than EXIT_FAILURE.
3140         * openat.h: Add copyright and authorship notice.
3141         (AT_FDCWD): Use the same value Solaris 9 uses, except of type
3142         'int' not 'unsigned int'.
3144         * save-cwd.c: Include "save-cwd.h" before other include files.
3145         (O_DIRECTORY): Remove; not needed here, since "." must be
3146         a directory.  All uses removed.
3147         (save_cwd): Use __sgi || __sun, not sun || __sun.  __sun is
3148         universal on Suns, and we also need to test for IRIX.
3149         Revamp code to use 'if' rather than '#if'.
3150         Avoid unnecessary comparison of cwd->desc to 0.
3152 2004-12-01  Paul Eggert  <eggert@cs.ucla.edu>
3154         * hard-locale.c: Assume <locale.h> exists.
3155         Include "strdup.h".
3156         (GLIBC_VERSION): New macro.
3157         (hard_locale): Assume setlocale exists.
3158         Rewrite to avoid #ifdef.
3159         Use strdup rather than malloc + strcpy.
3160         * human.c: Assume <locale.h> exists.
3161         (human_readable): Assume localeconv exists.
3163 2004-11-30  Paul Eggert  <eggert@cs.ucla.edu>
3165         * getcwd.c (is_ENAMETOOLONG): New macro.
3166         (__getcwd.c): Don't restore errno; glibc doesn't.
3167         [HAVE_PARTLY_WORKING_GETCWD && !defined AT_FDCWD]: Try system getcwd
3168         first, falling back to our code only if its results look suspicious.
3169         Ensure that the resulting buffer is only as large as necessary.
3171         * readutmp.c: Include readutmp.h first.
3172         Include <errno.h>, since readutmp.h no longer does that.
3173         * readutmp.h: Don't include <errno.h>,
3174         <sys/param.h>, <time.h>; not needed to establish interface.
3175         (errno): Remove decl.
3176         (HAVE_STRUCT_XTMP_UT_TYPE): Remove; no longer needed.
3177         (UT_TYPE_EQ, UT_TYPE_NOT_DEFINED, UT_TYPE_BOOT_TIME,
3178         UT_TYPE_USER_PROCESS, IS_USER_PROCESS): New macros.
3180 2004-11-30  Jim Meyering  <jim@meyering.net>
3182         Change the name of the robust chdir function from chdir to chdir_long.
3183         * save-cwd.c: Include chdir-long.h rather than chdir.h.
3184         (restore_cwd): Use chdir_long, not chdir.
3185         * chdir-long.c: Renamed from chdir.c.
3186         * chdir-long.h: Renamed from chdir.h.
3187         [!defined PATH_MAX]: Define chdir_long to chdir on systems like the Hurd.
3188         * Makefile.am (libfetish_a_SOURCES): Reflect name changes.
3190         * chdir.c (O_DIRECTORY): Define, if necessary.
3191         (memchrcspn): Tiny wrapper around memchr.
3192         (rpl_chdir): Use memchrcspn rather than strcspn.
3194 2004-11-28  Jim Meyering  <jim@meyering.net>
3196         * openat.c (rpl_openat): Also accept optional mode parameter.
3197         * openat.h (rpl_openat): Adjust prototype.
3199         * save-cwd.c: Include "chdir.h", so that if save_cwd/getcwd
3200         saves a name longer than PATH_MAX, restore_cwd's chdir can use it.
3202         * Makefile.am (libfetish_a_SOURCES): Add chdir.h and openat.h.
3204         This is a robust version of chdir, in that it can handle directory
3205         names longer than PATH_MAX.
3206         * chdir.c, chdir.h: New file.
3207         * openat.c, openat.h: New files.
3209 2004-11-25  Paul Eggert  <eggert@cs.ucla.edu>
3211         Fix problems reported by Scott S. Tinsley for HP-UX 11.11 using
3212         HP's ANSI C compiler.
3213         * fsusage.c (statvfs) [HAVE_SYS_STATVFS_H]: Remove decl.
3214         Declaring int functions causes warnings on some modern systems and
3215         shouldn't be needed to compile on ancient ones.
3216         * same.c (MIN) [defined MIN]: Don't define, since it's already
3217         defined.
3219         * mempcpy.c, mempcpy.h: New files, taken from gnulib.
3220         * Makefile.am: (libfetish_a_SOURCES): Add getcwd.h, mempcpy.h.
3221         * getcwd.c: Replace by a copy of glibc/sysdeps/posix/getcwd.c, but
3222         with the following changes.
3223         (__set_errno): Parenthesize properly.
3224         Include <stdbool.h>.
3225         (MIN, MAX, MATCHING_INO): New macros.
3226         (__getcwd): Define with prototype, not K&R form.
3227         Use heuristics to allocate default buffer on stack if possible.
3228         If AT_FDCWD is defined, use openat and fstatat to avoid O(N**2)
3229         behavior, and to avoid the PATH_MAX limit when computing
3230         ../../../../...
3231         Use MATCHING_INO to compare inode number to file.
3232         Check for arithmetic overflow in size calculations.
3233         Fix bug in reallocation of dot array that caused getcwd to fail
3234         on directories nested deeper than 75.
3235         Be more careful about saving errno on error.
3236         Do not use realloc; use only free+malloc, as this is a bit
3237         more flexible and avoids a needless copy operation.
3238         Do not inspect st_dev and st_ino for symbolic links; POSIX
3239         doesn't specify the latter.
3240         Check for closedir errors.
3241         Avoid needless casts.
3242         Use "#ifdef weak_alias" around weak_alias, to be like other
3243         glibc code.
3244         The following changes to getcwd.c have effect only when used in
3245         gnulib; they have no effect inside glibc proper.
3246         (#pragma alloca) [defined _AIX && !defined __GNUC__]: Remove,
3247         as alloca isn't used.
3248         (alloca, __alloca): Likewise.
3249         [!_LIBC]: Include "getcwd.h", "mempcpy.h".
3250         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
3251         unconditionally, as gnulib assumes C89 or better.
3252         Do not include <sys/param.h>.
3253         (errno) [!defined __GNU_LIBRARY__ && !defined STDC_HEADERS]: Remove
3254         no-longer-necessary 'extern int errno' decl; gnulib assumes C89 or
3255         better.
3256         (NULL) [!defined NULL]: Remove; we assume C89 or better.
3257         Include <dirent.h> in a way that is compatible with modern Autoconf.
3258         (_D_ALLOC_NAMELEN, _D_EXACT_NAMLEN):
3259         New macros, if not already defined.
3260         Include <unistd.h> if _LIBC, not if __GNU_LIBRARY__.
3261         Use "_LIBC", not "defined _LIBC", for consistency.
3262         (HAVE_MEMPCPY): Remove; no longer needed now that gnulib has
3263         a mempcpy module.
3264         (__lstat, __closedir, __opendir, __readdir) [!_LIBC]: New macros.
3265         (GETCWD_RETURN_TYPE): Remove.  All uses replaced by char *.
3266         * xgetcwd.c: David MacKenzie's old code was removed, so give
3267         credit only to Jim Meyering and adjust the copyright dates.
3268         Do not include <limits.h>, <stdio.h>, <sys/types.h>,
3269         <stdlib.h>, <unistd.h>, "pathmax.h".
3270         Instead, include "xgetcwd.h" (first) and "getcwd.h".
3271         (INITIAL_BUFFER_SIZE): Remove.
3272         (xgetcwd): Rely on getcwd, since we now depend on a reliable one.
3274 2004-11-23  Paul Eggert  <eggert@cs.ucla.edu>
3276         * utimens.c (__attribute__, ATTRIBUTE_UNUSED): New macros.
3277         (futimens): New function, which uses futimes if available.
3278         (futimens, utimens): Support timespec==NULL, with same semantics
3279         as utime and utimens.
3280         * utimens.h (futimens): New decl.
3282 2004-11-23  Sergey Poznyakoff  <gray@Mirddin.farlep.net>
3284         * getopt_.h: Re-addition of __getopt_argv_const caused
3285         redefinition warnings. To avoid them, include the defines
3286         in `#if !defined __need_getopt ... #endif'. The only place
3287         where __getopt_argv_const is used is in definitions
3288         of getopt_long and getopt_long_only below, which are as well
3289         protected by `#ifndef __need_getopt'.
3290         [defined __GETOPT_PREFIX && !defined __need_getopt]: Undef
3291         __need_getopt after including <stdio.h> and <unistd.h> These
3292         headers might have defined it.
3294 2004-11-23  Jim Meyering  <jim@meyering.net>
3296         * closeout.c: Revert last change, since it seems EBADF is always
3297         defined.
3299 2004-11-22  Jim Meyering  <jim@meyering.net>
3301         * closeout.c (EBADF): Fail with `#error ...' if it's not defined,
3302         asking the user to report the problem.
3304 2004-11-17  Paul Eggert  <eggert@cs.ucla.edu>
3306         * realloc.c (rpl_realloc): Call 'free' if n==0, since realloc
3307         might fail.  Problem reported by Yoann Vandoorselaere.
3308         * calloc.c (rpl_calloc): Defend against buggy calloc implementations
3309         that mishandle size_t overflow.
3311 2004-11-16  Paul Eggert  <eggert@cs.ucla.edu>
3313         * xgetcwd.c: Include <limits.h>, for PATH_MAX.
3314         (xgetcwd): Set errno correctly when failing.
3315         Work around Solaris 9 bug: getcwd sets errno==ERANGE even though
3316         the failure is actually due to a PATH_MAX problem.
3318         Further getopt changes to make it more likely that glibc will
3319         buy the changes back.
3320         * getopt.c (POSIXLY_CORRECT): New constant.
3321         (getopt): Use it, so to preserve glibc semantic
3322         * getopt1.c (getopt_long, getopt_long_only): Arg is char * const *
3323         when compiling for libc.
3324         * getopt_.h (__getopt_argv_const): Bring it back.
3325         (getopt_long, getopt_long_only): Use it.
3327         * getopt.c (_getopt_initialize, _getopt_internal_r, _getopt_internal):
3328         New arg POSIXLY_CORRECT.  All callers changed.
3329         (getopt): Argv is now char * const *, as per standard.
3330         (_getopt_internal_r, _getopt_internal): Argv is now char **,
3331         not char *__getopt_argv_const *.
3332         * getopt1.c (getopt_long, _getopt_long_r, getopt_long_only,
3333         _getopt_long_only_r): Likewise.
3334         * getopt_.h (getopt, getopt_long, geopt_long_only): Likewise.
3335         * getopt_int.h (_getopt_internal, _getopt_internal_r,
3336         _getopt_long_r, _getopt_long_only_r): Likewise.
3337         * getopt_.h (__getopt_argv_const): Remove.
3338         (getopt): Argv is now char * const *, as per standard.
3340         * canon-host.c: Include "strdup.h".
3341         (canon_host): Use getaddrinfo if available, so that IPv6 works.
3342         Use strdup instead of malloc/strcpy to duplicate strings.
3344         * getdate.y (tORDINAL): New token.
3345         (day, relunit): Allow it for relative times.
3346         (relative_time_table): Use tORDINAL for ordinals.
3348 2004-11-15  Paul Eggert  <eggert@cs.ucla.edu>
3350         * human.h (LONGEST_HUMAN_READABLE): Add 1 for space before unit.
3351         (human_space_before_unit): New constant.
3352         * human.c (human_readable): Support it.
3354 2004-11-14  Jim Meyering  <jim@meyering.net>
3356         * closeout.c (close_stdout): Don't fail just because stdout was
3357         closed initially, since some programs don't write to stdout in the
3358         normal course of operation (other than --version and --help), and
3359         we don't want this function to make e.g. `cp 1 2 >&-' fail.
3360         But do fail if it was closed and someone has tried to write to it.
3361         E.g., printf foo >&-
3363         * __fpending.c, __fpending.h: Restore these files.
3364         They're useful after all.
3365         * Makefile.am (libfetish_a_SOURCES): Add __fpending.h.
3367 2004-11-11  Paul Eggert  <eggert@cs.ucla.edu>
3369         * getopt.c, getopt1.c, getopt_.h, getopt_int.h:
3370         Sync from gnulib.
3372 2004-11-10  Paul Eggert  <eggert@cs.ucla.edu>
3374         * allocsa.h, mbswidth.c, mktime.c, readlink.c, getdate.y,
3375         quotearg.c, strftime.c: Sync from gnulib.
3377 2004-11-06  Jim Meyering  <jim@meyering.net>
3379         * __fpending.c, __fpending.h: Remove files.
3381         * Makefile.am (libfetish_a_SOURCES): Remove __fpending.h, now
3382         that it's no longer used.
3384         Ensure that no close failure goes unreported.
3385         * closeout.c (close_stdout): Always close stdout.  I.e., don't
3386         return early when it seems there's nothing to flush.
3387         Don't include __fpending.h.
3389 2004-11-03  Paul Eggert  <eggert@cs.ucla.edu>
3391         * unsetenv.c: New file, from gnulib.  Needed for new getdate.y.
3392         * Makefile.am (libfetish_a_SOURCES): Remove setenv.c.
3393         * xreadlink.c: Sync from gnulib.
3395 2004-11-03  Jim Meyering  <jim@meyering.net>
3397         * Makefile.am (libfetish_a_SOURCES): Add setenv.c and setenv.h.
3399 2004-11-02  Paul Eggert  <eggert@cs.ucla.edu>
3401         * getdate.y, getpass.c, setenv.h: Sync from gnulib.
3403 2004-10-29  Paul Eggert  <eggert@cs.ucla.edu>
3405         * getdate.y, getpagesize.h, mktime.c: Sync from gnulib.
3407 2004-10-24  Paul Eggert  <eggert@cs.ucla.edu>
3409         * mktime.c (leapyear): Arg is long int, not int.
3410         Change imported from gnulib.
3412 2004-10-17  Paul Eggert  <eggert@cs.ucla.edu>
3414         Sync from gnulib.
3415         * diacrit.c, diacrit.h: Add copyright notice.
3416         * getpass.c (fflush_unlocked, flockfile, funlockfile)
3417         (fputs_unlocked, putc_unlocked) [!_LIBCS && !USE_UNLOCKED_IO]: Map
3418         to real functions.
3420 2004-10-13  Jim Meyering  <jim@meyering.net>
3422         * fts.c (fts_read): When about to fail (by returning NULL) due
3423         to a failed fchdir or failed fts_safe_changedir call, set
3424         `sp->fts_cur = p'.  Do this by removing the explicit `return NULL;'
3425         statements and setting p->fts_errno so execution falls through
3426         to the common-case code below.  Otherwise, after such a failure,
3427         calling fts_close would attempt to free an already-freed buffer.
3428         Reported by Luis Lopez Lopez in http://bugs.debian.org/276352.
3430 2004-10-04  Paul Eggert  <eggert@cs.ucla.edu>
3432         Sync from gnulib.
3434         * xalloc.h (xmemdup): Renamed from xclone.
3435         * xmalloc.c (xmemdup): Likewise.
3436         * xalloc.h (CCLONE, CLONE, NEW, XCALLOC, XMALLOC, XREALLOC,
3437         XFREE): Remove these long-obsolescent macros.
3438         * xmalloc.c (xstrdup): Implementation moved here from xstrdup.c
3439         * xstrdup.c: Remove.
3441         * argmatch.c, closeout.c, error.c, exclude.c, getdate.y,
3442         getndelim2.c, getpass.c, getusershell.c, linebuffer.c,
3443         md5.c, mountlist.c, posixtm.c, readtokens.c, readutmp.c,
3444         regex.c, sha1.c, version-etc.c, yesno.c:
3445         Include "unlocked-io.h" only if USE_UNLOCKED_IO.
3446         * unlocked-io.h: Don't worry about USE_UNLOCKED_IO; that's now
3447         the includer's responsibility.
3449 2004-10-03  Paul Eggert  <eggert@cs.ucla.edu>
3451         Sync from gnulib.
3452         * dirfd.h, getpagesize.h: Add copyright notice.
3453         * vasnprintf.c: (VASNPRINTF): Set errno=EOVERFLOW if the output is
3454         too long.
3455         * vasnprintf.h: Doc fix.
3456         * vasprintf.c: Don't include <limits.h>.
3457         (vasprintf): Rely on vasnprintf to set errno=EOVERFLOW.
3459 2004-09-23  Paul Eggert  <eggert@cs.ucla.edu>
3461         * modechange.c (mode_compile): Don't decrement a pointer that
3462         points to the start of a string, as the C Standard says the
3463         resulting behavior is undefined.
3465 2004-09-22  Jim Meyering  <jim@meyering.net>
3467         * getopt.c: Remove extraneous spaces before TAB.
3468         * getopt_.h: Likewise.
3470         * backupfile.c: Remove trailing blanks.
3471         * euidaccess.c: Likewise.
3473 2004-09-13  Paul Eggert  <eggert@cs.ucla.edu>
3475         * backupfile.h (enum backuptype): Rename none -> no_backups,
3476         simple -> simple_backups, numbered_existing ->
3477         numbered_existing_backups, numbered -> numbered_backups
3478         to avoid shadowing problems.  All uses changed.
3479         * argmatch.c (enum backuptype): Likewise.
3480         * backupfile.c (check_extension, numbered_backup):
3481         Rename locals to avoid shadowing 'basename'.
3482         * backupfile.h (VALID_BACKUP_TYPE): Don't evaluate arg more than
3483         once.
3485 2004-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3487         Port to diet libc.  Problem reported by Felix von Leitner in
3488         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00171.html>
3489         * fts.c (fts_stat, fts_open, fts_read): Use "unsigned short int"
3490         rather than the unportable "u_short", and similarly for u_int.
3491         * fts_.h (FTSENT): Likewise.
3493 2004-08-19  Paul Eggert  <eggert@cs.ucla.edu>
3495         * getopt.c, getopt1.c: Sync from gnulib.
3496         * getopt_.h: Renamed from getopt.h (this syncs from gnulib).
3497         * Makefile.am (libfetish_a_SOURCES): Remove getopt.c, getopt.h,
3498         getopt1.c, getopt_int.h.
3499         (BUILT_SOURCES, EXTRA_DIST, all-local, $(lib_OBJECTS), getopt.h,
3500         MOSTLYCLEANFILES): Add current gnulib snippet for getopt.
3501         * .cppi-disable: Add getopt_.h, getopt_int.h.
3502         * .cvsignore: Add getopt.h.
3504 2004-08-18  Paul Eggert  <eggert@cs.ucla.edu>
3506         * userspec.c: Don't use <alloca.h>, so that we don't use alloca on
3507         strings on unbounded length.  alloca's performance benefits aren't
3508         that important here.
3509         (V_STRDUP): Remove.
3510         (parse_with_separator): New function, with most of the internals
3511         of the old parse_user_spec.  Allow user to omit both user and group,
3512         for compatibility with FreeBSD.
3513         Clone only the user name, not the entire spec.
3514         Do not set *uid, *gid unless entirely successful.
3515         Avoid memory leak in some failing cases.
3516         Fix regression for USER.GROUP reported by Dmitry V. Levin in
3517         <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
3518         (parse_user_spec): Rewrite to use parse_with_separator.
3520 2004-08-11  Paul Eggert  <eggert@cs.ucla.edu>
3522         * fts.c (O_DIRECTORY): Define to 0 if the system doesn't define.
3524         * settime.c (settime): Recode to avoid warning with Sun Forte C 6U2.
3526         * obstack.c: Include <inttypes.h> and <stdint.h> if available.
3527         (union fooround): Use uintmax_t, not long int.
3528         The rest is a merge from libc:
3529         [defined _LIBC]: Include <shlib-compat.h>.
3530         (_obstack) [defined _LIBC]: Remove after 2.3.4.
3532         * xgethostname.c: Do not include error.h.  (merge from gnulib).
3534         * fnmatch.c (WIDE_CHAR_SUPPORT): Don't set to 1 if missing
3535         wmemchr or wmemcpy.  Problem reported by Robert Dahlem
3536         for Reliant Unix 5.43.
3538 2004-08-09  Paul Eggert  <eggert@cs.ucla.edu>
3540         * Makefile.am (libfetish_a_SOURCES): Add getpass.h.
3541         * getpass.h: New file.
3542         * .cpp-disable: Add it.
3543         * getpass.c [!_LIBC]: Include it.
3545         * obstack.h (obstack_empty_p):
3546         Don't assume that chunk->contents is suitably aligned.
3547         * obstack.c (_obstack_begin, _obstack_begin_1, _obstack_newchunk):
3548         Likewise. Problem reported by Benno in
3549         <http://sources.redhat.com/ml/libc-alpha/2004-08/msg00055.html>.
3551         * chown.c (rpl_chown): Work even if the file is writeable but not
3552         readable.  This could be improved further but it'd take some work.
3553         * fts.c (diropen): New function.
3554         (fts_open, fts_read, fts_children, fts_safe_changedir):
3555         Use it, so that the code works even if the directory
3556         is writeable but not readable.  We'd like it to work even if
3557         the directory is merely executable, but I don't know how to do
3558         that portably.
3560         * xalloc-die.c: New file.
3561         * xalloc.h (xalloc_fail_func, xalloc_msg_memory_exhausted): Remove.
3562         All uses removed.
3563         * xmalloc.c (xalloc_fail_func, xalloc_msg_memory_exhausted): Likewise.
3564         Move inclusions of gettext.h, error.h, exitfail.h to xalloc-die.c.
3565         (_, N_, xalloc_die): Move to xalloc-die.c.
3566         * userspec.c (parse_user_spaec): Use xstrdup rather than strdup,
3567         so that we needn't mess with xalloc_msg_memory_exhausted.
3569         * sha1.h (sha1_ctx): Renamed from sha_ctx.
3570         (sha1_init_ctx): Renamed from sha_init_ctx.
3571         (sha1_process_block): Renamed from sha_process_block.
3572         (sha1_process_bytes): Renamed from sha_process_bytes.
3573         (sha1_finish_ctx): Renamed from sha_finish_ctx.
3574         (sha1_read_ctx): Renamed from sha_read_ctx.
3575         (sha1_stream): Renamed from sha_stream.
3576         (sha1_buffer): Renamed from sha_buffer.
3577         * sha1.c: Likewise.
3579 2004-08-07  Paul Eggert  <eggert@cs.ucla.edu>
3581         * canonicalize.h, cycle-check.h, stat-macros.h, strdup.h,
3582         strftime.h, xnanosleep.c: Merge from gnulib.
3584 2004-08-05  Paul Eggert  <eggert@cs.ucla.edu>
3586         Merge with gnulib and deal with some minor cleanups resulting.
3588         * .cppi-disable: Change fnmatch.h to fnmatch_.h.
3589         * .cvsignore: Add fnmatch.h, poll.h, stdbool.h, sysexit.h.
3590         Remove safe-lstat.c, safe-lstat.h, safe-stat.c, safe-stat.h.
3592         * backupfile.h, closeout.h, full-write.h, mbswidth.h, xalloc.h:
3593         Add extern "C" wrappers for C++.
3595         * dirname.h (IS_ABSOLUTE_FILE_NAME): Port to DOS.
3597         * gettime.c (gettime): Fall back on `time' if `gettimeofday'
3598         doesn't work.
3599         * settime.c: Include <unistd.h>, for stime (on Solaris 8, anyway).
3600         (ENOSYS): Define if not defined.
3601         (settime): Fall back on stime if it exists and settimeofday fails.
3602         But don't bother with fallbacks if a method fails with errno == EPERM.
3604         * obstack.h: Add white space.
3606         * printf-parse.c, printf-parse.h, vasnprintf.c: Merge changes from
3607         gnulib, but rewrite to avoid "xsize.h".
3609 2004-08-04  Paul Eggert  <eggert@cs.ucla.edu>
3611         * mountlist.c (SIZE_MAX): Define after including files, to avoid
3612         a collision on OpenBSD 3.4.
3614         * fts.c (LONGEST_MODIFIER): New macro.
3615         (PRIuMAX) [!PRI_MACROS_BROKEN && !defined PRIuMAX]: New macro.
3616         (find_matching_ancestor): Use it for dev_t and ino_t.
3618         * getndelim2.c: Sync from gnulib.
3620         * error.c: Work around bug in OpenBSD 3.4 sterror_r: it
3621         sometimes returns a positive errno value even when it succeeds.
3622         (print_errno_message) [!LIBC]: Fall back on strerror if
3623         __strerror_r fails.
3625 2004-08-02  Paul Eggert  <eggert@cs.ucla.edu>
3627         * canonicalize.c (errno): Remove decl; we now assume C89 or better.
3628         * chown.c (errno): Likewise.
3629         * closeout.c (errno): Likewise.
3630         * dup-safer.c (errno): Likewise.
3631         * dup2.c (errno): Likewise.
3632         * exclude.c (errno): Likewise.
3633         * fopen-safer.c (errno): Likewise.
3634         * ftruncate.c (errno): Likewise.
3635         * full-write.c (errno): Likewise.
3636         * getcwd.c (errno): Likewise.
3637         * lchown.c (errno): Likewise.
3638         * memcoll.c (errno): Likewise.
3639         * nanosleep.c (errno): Likewise.
3640         * putenv.c (errno): Likewise.
3641         * rmdir.c (errno): Likewise.
3642         * same.c (errno): Likewise.
3643         * savedir.c (errno): Likewise.
3644         * setenv.c (errno): Likewise.
3645         * stat.c (errno): Likewise.
3646         * utime.c (errno): Likewise.
3647         * xgetcwd.c (errno): Likewise.
3648         * xmemcoll.c (errno): Likewise.
3649         * xreadlink.c (errno): Likewise.
3650         * xstrtol.c (errno): Likewise.
3651         * canonicalize.h (enum canonicalize_mode_t): Reformat comments to
3652         fit in 80 columns.
3653         * fileblocks.c (textutils_fileblocks_unused): Make it a typedef
3654         instead of an int, to save a few bytes in the object file.
3655         * getdate.y (lookup_word): Rewrite to avoid cast.
3656         * getloadavg.c: Include <stdbool.h>.
3657         (getloadavg_initialized): Use bool for booleans.
3658         * hard-locale.c (hard_locale): Return bool, not int.
3659         * hard-locale.h (hard_locale): Likewise.  Include <stdbool.h>.
3660         * hash.c (hash_string): Rewrite to avoid cast.
3661         * human.h: Use Autoconf-suggested pattern for inttypes and stdint.
3662         * strtiomax.c: Likewise.
3663         * xstrtol.h: Likewise.
3664         * nanosleep.c: Include stdbool.h.
3665         (rpl_nanosleep): Usee bool for booleans.
3666         * quotearg.c: Include stdbool.h.
3667         (quotearg_buffer_restyled): Use bool for booleans.
3668         * readtokens.c (readtoken): Rewrite to avoid casts.
3669         * same.c (same_name): Return bool, not int.
3670         * same.h (same_name): Likewise.  Include <stdbool.h>.
3671         * version-etc.c (version_etc_va): Use size_t for sizes.
3672         * xnanosleep.c: Include limits.h, stdbool.h.
3673         (CHAR_BIT): Remove.
3674         (timespec_subtract, xnanosleep): Use bool for booleans.
3675         * xstrtoimax.c: Just include xstrtol.h rather than rolling our
3676         own include pattern.
3677         * xstrtoumax.c: Likewise.
3678         * xstrtol.c (__xstrtol): Rewrite to avoid casts.
3679         * yesno.c: Include yesno.h first.
3680         (yesno): Return bool, not int.
3681         * yesno.h (yesno): Likewise.  Include <stdbool.h>.
3683         * xstrtod.h (xstrtod): Return bool, not int.  Invert the
3684         sense of the boolean.  All uses changed.
3685         * xstrtod.c (xstrtod): Likewise.
3686         * nanosleep.c: Include stdbool.h.  Use bool for booleans.
3688         * xgethostname.c: Don't include <sys/types.h> or "exit.h";
3689         no longer needed.
3690         (errno): Remove decl; we now assume C89 or better.
3691         Include unistd.h if available, for gethostname.
3692         (ENAMETOOLONG): Define to 0, not 9999, to avoid colliding with
3693         existing errno values if any.
3694         (gethostname): Remove decl, since unistd.h declares it (or doesn't,
3695         in which case it's an older system and it should just work).
3696         (xgethostname): Don't assume host name length is less than INT_MAX.
3697         Exit if malloc fails, just as the comment says.
3699         * save-cwd.c: Include <stdbool.h>.
3700         (errno): Remove decl; we now assume C89 or better.
3701         (save_cwd): Use bool for booleans.
3702         (save_cwd, restore_cwd): Return -1 on failure, not 1, since we set
3703         errno on failure.
3705         * readutmp.h (UT_USER): Parenthesize properly.
3706         (UT_USER_SIZE): New constant.
3707         (read_utmp): Don't assume that the number of users is less than
3708         INT_MAX.
3709         * readutmp.c (read_utmp): Likewise.
3710         Check for integer overflow in size calculations.
3711         Return -1 (not 1) on failure, since we set errno in that case.
3713         * posixtm.c (posix_time_parse): Don't assume that the length of
3714         the string being parsed is <= UINT_MAX.
3716         * mountlist.h (read_file_system_list): Accept bool flag, not int.
3717         * mountlist.c (read_file_system_list): Likewise.
3718         * mountlist.h: Include <stdbool.h>.
3719         * mountlist.c (errno): Remove decl; we now assume C89 or better.
3720         (xatoi): Remove; replaced by strtoul.  Hence device numbers can now
3721         go up to ULONG_MAX.
3723         * isdir.c: Remove; no longer needed.
3724         * Makefile.am (libfetish_a_SOURCES): Remove isdir.c.
3726         * fts_.h: Add an FSF copyright notice, since our changes are becoming
3727         nontrivial.
3728         * fts.c: Likewise.
3729         * fts_.h: Include stddef.h, for ptrdiff_t.
3730         (FTS.fts_nitems): Now size_t, not int, for hosts that allow more
3731         than INT_MAX entries in a directory.
3732         (FTS_ROOTPARENTLEVEL): Parenthesize properly.
3733         (FTSENT.fts_level): Now ptrdiff_t, not int, to allow recursing more
3734         than INT_MAX levels deep on 64-bit hosts.
3735         (FTSENT.fts_namelen): Now size_t, not u_short, to support hosts like
3736         the Hurd that don't have arbitrary limits on directory entry lengths.
3737         (FTSENT.fts_statp): Now an array, not a pointer, so that we don't
3738         have to play unportable games with pointer arithmetic.  Keep it array
3739         for the benefit of user code that assumes it is a pointer.
3740         * fts.c: Include stdint.h if available, as Autoconf suggests.
3741         (ALIGNBYTES, ALIGN): Remove; no longer needed now that fts_statp
3742         is an array.
3743         (fts_alloc, fts_palloc, fts_sort, fts_load, fts_build):
3744         Use size_t for sizes.
3745         (fts_stat, fts_safe_changedir, fts_debug, fts_read, fts_build,
3746         fts_palloc):
3747         Use bool when appropriate.
3748         (SIZE_MAX, TYPE_SIGNED): New macros.
3749         (fts_read): Use u_short for instructions.
3750         (fts_build): Use ptrdiff_t for levels.  Don't assume file name lengths
3751         fit into int.  Don't assume nlink_t is signed.
3752         (find_matching_ancestor): Don't assume dev, ino fit in int.
3753         (fts_stat): Use function prototype; required for bool arg.
3754         (fts_sort): Detect integer overflow in size calculations.
3755         (fts_alloc): Simplify allocation code, now that fts_statp is an array
3756         and not a pointer.
3758         * fsusage.h: Include <stdbool.h>.
3759         (struct fs_usage): Use uintmax_t for block sizes, so that they're
3760         not limited to INT_MAX.
3761         Use bool for booleans.
3762         * fsusage.c: Use Autoconf-suggested pattern for inttypes and stdint.
3763         Include unistd.h, for lseek.
3765         * fnmatch.c: Include <stdbool.h>.
3766         (errno): Remove decl; we now assume C89 or better.
3767         * fnmatch_loop.c (EXT, FCT): Use bool when appropriate.
3768         (FCT): Use size_t, not unsigned int, for sizes.
3769         (EXT): Use size_t, not int, for sizes.
3771         * stripslash.c (strip_trailing_slashes): Now returns bool.
3772         * dirname.h (strip_trailing_slashes): Likewise.
3773         Include <stdbool.h>.
3774         * dirname.c (dir_name): Use bool when appropriate.
3776         * argmatch.h (argmatch, __xargmatch_internal, argmatch_invalid):
3777         Use ptrdiff_t, not int, when counting arguments, to allow more
3778         than INT_MAX arguments.
3779         * argmatch.c: Likewise.  Use bool when appropriate.
3781 2004-08-01  Paul Eggert  <eggert@cs.ucla.edu>
3783         * safe-read.c (errno): Remove decl; we now assume C89 or better.
3784         (safe_rw): Don't work around Tru64 bug unless the bug symptoms
3785         manifest themselves.  This allows us to do proper reads and writes
3786         on other hosts, e.g., "dd" with a block size greater than 2**31.
3788         * md5.c (UNALIGNED_P): Use size_t; in practice, this is just as
3789         good as uintptr_t in checking for alignments, and has fewer
3790         configuration hassles.
3791         * sha1.c (UNALIGNED_P): Likewise.
3792         * md5.h: Don't include <limits.h>.  Include <inttypes.h> if available,
3793         as it defines symbols like UINT32_MAX on Solaris 8.
3794         (md5_uint32): Assume uint32_t exists; Autoconf will define it
3795         otherwise (if the host has a 32-bit unsigned type, anyway).
3796         * memchr.c: Don't include inttypes.h or stdint.h.
3797         (UNALIGNED_P): Remove.
3798         (__memchr): Use size_t, not uintptr_t, to test alignment.
3799         * memrchr.c: Likewise, for __memrchr.
3801 2004-07-30  Paul Eggert  <eggert@cs.ucla.edu>
3803         * makepath.h: Include <stdbool.h>.
3804         (make_path, make_dir): Use bool, not int, since we're not setting
3805         errno.
3806         Use mode_t for modes, not int.  All uses changed.
3807         * makepath.c: Likewise.
3808         (errno): Remove decl; no longer needed since we assume C89.
3810 2004-07-29  Paul Eggert  <eggert@cs.ucla.edu>
3812         * modechange.c: Include <stdbool.h>.
3813         (mode_compile): Use bool when appropriate.
3815         * memchr.c (UNALIGNED_P): Use sizeof, not alignof, for better
3816         performance on m68k-linux.  Reported by Andreas Schwab in
3817         <http://lists.gnu.org/archive/html/bug-coreutils/2004-07/msg00104.html>.
3818         * memrchr.c (UNALIGNED_P): Likewise.
3820 2004-07-28  Paul Eggert  <eggert@cs.ucla.edu>
3822         * userspec.c: Include <stdbool.h>, "inttostr.h".
3823         (V_STRDUP): Don't assume the string's length fits in int.
3824         (ISDIGIT): unsigned -> unsigned int
3825         (is_number): Define only ifdef __DJGPP__; not needed elsewhere.
3826         Use bool instead of int where appropriate.
3827         Do not allow empty strings.
3828         (parse_user_spec): Parse numbers as decimal integers, even if
3829         they have a leading 0.  Don't assume uids and gids fit in int.
3831         * memchr.c: Include <stddef.h>, not <stdlib.h> and <sys/types.h>.
3832         (LONG_MAX_32_BITS): Remove.
3833         Include <inttypes.h> and <stdint.h> if available.
3834         (alignof, UNALIGNEDP): New macro, portable to all C89 hosts.
3835         (__memchr): Don't assume unsigned long int is either 4 or 8 bytes;
3836         let it be any number of bytes greater than or equal to 4.
3837         * memrchr.c: Likewise, with __memrchr.
3839         * md5.h: Include <stdint.h> if HAVE_STDINT_H || _LIBC, not
3840         ifdef _LIBC.
3841         (md5_uint32): Use uint32_t if available.  Simplify fallback ifdefs.
3842         * md5.c: Don't include <sys/types.h> or <stdlib.h>; <stddef.h>
3843         suffices with C89 or better.
3844         (alignof): New macro, portable to all C89 hosts.
3845         (UNALIGNED): Use it.  Use uintptr_t if available, and assume
3846         everything is unaligned otherwise; this is more portable than
3847         assuming 'unsigned long int' will always work.
3848         * sha1.c: Likewise.
3850         * getugroups.c: Include <errno.h>.
3851         (EOVERFLOW): Define if not defined.
3852         (getgroups): Return -1 with errno=EOVERFLOW if an integer overflow
3853         occurs.
3855 2004-07-27  Paul Eggert  <eggert@cs.ucla.edu>
3857         * euidaccess.c [HAVE_LIBGEN_H]: Include <libgen.h>, for
3858         eaccess on Solaris and SVR4-like systems.
3859         (euidaccess): Use HAVE_EACCESS, not HAVE_DECL_EACCESS.
3861         cycle-check integer overflow fixup.
3863         * cycle-check.h: Remove now-inaccurate comment about the files
3864         you need to include first.  You don't need to include any files
3865         other than the usual config.h.
3866         Include <inttypes.h> and <stdint.h> if available, for uintmax_t.
3867         Remove 'struct stat;' not needed since we know sys/stat.h has
3868         been included by dev-ino.h.
3869         (struct cycle_check_state): Change chdir_counter to uintmax_t,
3870         not size_t, since it isn't limited by object sizes.
3871         Change magic from long unsigned int to int; that's good enough
3872         for our use.
3873         * cycle-check.c (is_zero_or_power_of_two): Renamed from
3874         is_power_of_two, to reflect better what it really does.
3875         All uses changed.  Arg is now uintmax_t, not unsigned int
3876         (it should have been unsigned long int -- that was a bug).
3877         (cycle_check): Check for integer overflow in cycle count,
3878         and report a cycle if that happens, as it must be a cycle
3879         by this point.
3881         backupfile.c rewrite to avoid arbitrary limits on lengths of
3882         numeric backup extensions.
3884         * addext.c: Remove; no longer needed.
3885         * Makefile.am (libfetish_a_SOURCES): Remove addext.c.
3886         * backupfile.h (addext): Remove decl.
3887         * backupfile.c: Include "backupfile.h" first.
3888         Include errno.h, stdbool.h, limits.h, unistd.h, xalloc.h.
3889         (CLOSEDIR, INT_STRLEN_BOUND): Remove.
3890         (pathconf) [! (HAVE_PATHCONF && defined _PC_NAME_MAX)]: New macro.
3891         (_POSIX_NAME_MAX) [!defined _POSIX_NAME_MAX]: New macro.
3892         (NAME_MAX_MAXIMUM): New macro.  Unlike the old addext.c, we
3893         also look at _XOPEN_NAME_MAX, for better performance on modern
3894         hosts that support only file names of length 255 or more.
3895         (ISDIGIT): unsigned -> unsigned int
3896         (max_backup_version, version_number): Remove.
3897         (check_extension): New function.  Similar to the old addext, but
3898         static, assumes that the extension has already been added,
3899         and a bit more careful on DOS hosts.
3900         (numbered_backup): New function.  It does what max_backup_version
3901         and version_number used to do, but it doesn't use integer arithmetic
3902         to calculate extensions so it doesn't overflow.
3903         (find_backup_file_name): Rewrite to use these new functions.
3904         This has a new optimization: we needn't call pathconf if the
3905         new numbered backup name has the same length as the old.
3906         Also, use xmalloc rather than malloc, so that the caller
3907         needn't worry about memory exhaustion.
3909 2004-07-25  Paul Eggert  <eggert@cs.ucla.edu>
3911         * euidaccess.c [!defined LIBC]: Included group-member.h, stat-macros.h.
3912         (S_IXUSR, S_IXGRP, S_IXOTH, S_IROTH, S_IWOTH, S_IXOTH):
3913         Remove; now done by stat-macros.h.
3914         (NGROUPS_MAX, group_member): Remove; now done by group-member.h.
3915         No need to include <limits.h>.
3916         (errno): Remove decl; we now assume C89 or better.
3917         (access, getuid, getgid, geteuid, getegid, stat) [defined _LIBC]:
3918         New macros.
3919         (uid, gid, have_ids): Remove these static variables.
3920         They weren't accurate for programs that also invoked setreuid etc.
3921         (euidaccess) [defined EFF_ONLY_OK || defined ACC_SELF ||
3922         HAVE_DECL_EACCSS]: Use builtin substitutes.
3923         [defined _LIBC]: Ignore __libc_enable_secure; it's not a
3924         correct optimization for programs run as root that later
3925         invoke setreuid.
3926         [no builtin substitutes && HAVE_DECL_SETREGID &&
3927         PREFER_NONREENTRANT_EUIDACCESS]:
3928         Use setreuid+setregid to get the correct answer.
3929         [no builtin substitutes && ! (HAVE_DECL_SETREGID &&
3930         PREFER_NONREENTRANT_EUIDACCESS)]:
3931         Don't assume that the stat macros have their historical values,
3932         as POSIX doesn't require this.
3933         [defined TEST]: Include <stdlib.h>; don't include errno.h
3934         twice; include <error.h> rather than "error.h".
3936 2004-07-23  Paul Eggert  <eggert@cs.ucla.edu>
3938         * Makefile.am (libfetish_a_SOURCES): Add fcntl-safer.h,
3939         open-safer.c.
3940         * fcntl-safer.h, open-safer.c: New files.
3942 2004-07-12  Paul Eggert  <eggert@cs.ucla.edu>
3944         * c-strtod.c (STRTOD_L): New macro.
3945         (C_STRTOD) [defined LC_ALL_MASK]: Use it, so that the
3946         code is reentrant on platforms that have strtod_l.
3948         * getloadavg.c: Include <errno.h>, <stdio.h>, <stdlib.h> even
3949         if HAVE_GETLOADAVG is defined, so that the test program can work.
3950         (errno): Remove declaration; not needed in C89 or later.
3951         Include "c-strtod.h".
3952         Do not include locale.h or define setlocale; no longer needed.
3953         Include <limits.h>.
3954         (INT_STRLEN_BOUND): New macro.
3955         (getloadavg): Use it to compute buffer size.
3956         Don't assume that buffer will be properly terminated by 'read'.
3957         Use c_strtod instead of setlocale.
3958         (main) [defined TEST]: Return int, not void.
3960 2004-07-11  Paul Eggert  <eggert@cs.ucla.edu>
3962         * Makefile.am (libfetish_a_SOURCES): Add c-strtold.c.
3963         * c-strtold.c: New file.
3964         * c-strtod.c: Include <config.h> first.
3965         (C_STRTOD, DOUBLE, STRTOD): New macros.
3966         (c_strtod): Use them.
3967         * c-strtod.h (c_strtold): New decl.
3969 2004-07-07  Jim Meyering  <jim@meyering.net>
3971         Don't infloop when MAXSYMLINKS is not defined.
3972         Detect symlink loops much earlier (albeit lazily) on systems
3973         with MAXSYMLINKS defined to a large value.
3975         * canonicalize.c: Include "cycle-check.h".
3976         (canonicalize_filename_mode): Don't try to detect loops by counting
3977         symlink-hops.  Instead, use the cycle-check module.
3979         * cycle-check.h: Include stdbool.h.
3980         Forward-declare `struct stat'.
3982         * canonicalize.c (canonicalize_filename_mode): Remove do-while(0) loop.
3983         Replace each corresponding `break' stmt with `continue'.
3985 2004-07-06  Jim Meyering  <jim@meyering.net>
3987         * canonicalize.c: Include "stat-macros.h".
3988         (canonicalize_filename_mode): Remove #ifdef S_ISLNK, now that
3989         S_ISLNK is guaranteed to be defined (via stat-macros.h).
3991 2004-04-03  Dmitry V. Levin  <ldv@altlinux.org>
3993         * Makefile.am (libfetish_a_SOURCES): Add canonicalize.c
3994         unconditionally.
3995         * canonicalize.h (canonicalize_mode_t): New type.
3996         * canonicalize.c: Include "file-type.h".
3997         (canonicalize_filename_mode): New function, based on
3998         canonicalize_file_name, supports three canonicalize modes.
3999         (canonicalize_file_name)
4000         [!HAVE_CANONICALIZE_FILE_NAME && !HAVE_RESOLVEPATH]: Use it.
4002 2004-07-05  Jim Meyering  <jim@meyering.net>
4004         * path-concat.c (path_concat): Improve comment.  From Paul Eggert.
4006 2004-07-02  Paul Eggert  <eggert@cs.ucla.edu>
4008         * canonicalize.c (canonicalize_file_name): Assume that path_concat
4009         never returns NULL.
4010         * path-concat.c (mempcpy): Don't define if a system header defines it.
4011         Don't include stdio.h, stdlib.h, unistd.h, strdup.h.
4012         (longest_relative_suffix): New function.
4013         (path_concat): Use it.  Assume first argument is not NULL.
4014         Port to DOS.  Omit redundant separators.
4015         Report an error instead of returning NULL.
4016         Use mempcpy instead of memcpy.
4017         (xpath_concat): Remove: not declared or used.
4019 2004-06-30  Paul Eggert  <eggert@cs.ucla.edu>
4021         * dirname.h (FILE_SYSTEM_PREFIX_LEN): Renamed from
4022         FILESYSTEM_PREFIX_LEN.  All uses changed.
4023         * mountlist.h (read_file_system_list): Renamed from
4024         read_filesystem_list.  All definitions and uses changed.
4026 2004-06-24  Jim Meyering  <jim@meyering.net>
4028         * obstack.h (obstack_base): Fix parentheses.  From Paul Eggert.
4030 2004-06-20  Jim Meyering  <jim@meyering.net>
4032         * obstack.h (obstack_base): Cast to (void *), per documentation.
4034         * yesno.h: New file.
4035         * yesno.c: Include "yesno.h".
4036         * Makefile.am (libfetish_a_SOURCES): Add yesno.h.
4038 2004-06-19  Jim Meyering  <jim@meyering.net>
4040         * filemode.c: Remove all S_IS* and S_IF* definitions.
4041         Instead, just include "stat-macros.h".
4042         * stat.c: Likewise.
4043         * rmdir.c: Likewise.
4044         * makepath.c: Likewise.
4045         * lchown.c: Likewise.
4046         * isdir.c: Likewise.
4047         * canonicalize.c: Likewise.
4049         Add S_IS* definitions from filemode.c.
4050         * stat-macros.h (S_ISCTG): Define to zero if not already defined.
4051         (S_ISOFD): Likewise.
4052         (S_ISOFL): Likewise.
4054 2004-06-11  Paul Eggert  <eggert@cs.ucla.edu>
4056         * readutmp.c (extract_trimmed_name): Don't apply strchr to a
4057         non-string; this leads to undefined behavior.
4059 2004-05-18  Paul Eggert  <eggert@cs.ucla.edu>
4061         * fts.c (fts_stat, fts_alloc): Always allocate and use a struct
4062         stat, even if the user isn't interested in the results.
4063         This prevents a core dump in cycle_check when FTS_NOSTAT is set.
4064         * lchown.c (lchown): Return EOPNOTSUPP if not supported; this
4065         is what POSIX-2004 specifies.
4066         * lchown.h (EOPNOTSUPP): Define if not defined.
4067         (ENOSYS): Remove.
4069 2004-06-06  Jim Meyering  <jim@meyering.net>
4071         * getdate.y: Update from gnulib.
4073 2004-05-25  Paul Eggert  <eggert@cs.ucla.edu>
4075         * xreadlink.c: Include xreadlink.h first, to catch .h file
4076         dependency problems.
4077         (xreadlink): Accept new arg SIZE, for efficiency.
4078         All decls and uses changed.
4079         * xreadlink.h: Include <stddef.h>, for size_t.
4080         * canonicalize.c (canonicalize_file_name): Update use of xreadlink.
4082 2004-06-01  Jim Meyering  <jim@meyering.net>
4084         * xmalloc.c: Update from gnulib.
4086 2004-05-30  Jim Meyering  <jim@meyering.net>
4088         * alloca_.h: Remove trailing blank.
4090 2004-05-29  Jim Meyering  <jim@meyering.net>
4092         * dirname.h (IS_ABSOLUTE_FILE_NAME, IS_RELATIVE_FILE_NAME): Define.
4094         * calloc.c: New file.
4096 2004-05-21  Jim Meyering  <jim@meyering.net>
4098         * alloca.c, alloca_.h, fnmatch.c: Update from gnulib.
4099         * localcharset.c, regex.c: Likewise.
4101 2004-05-20  Jim Meyering  <jim@meyering.net>
4103         * obstack.c, obstack.h: Update from gnulib.
4105 2004-05-16  Paul Eggert  <eggert@cs.ucla.edu>
4107         * getline.c, getndelim2.c, getndelim2.h: Sync with gnulib.
4109 2004-05-11  Jim Meyering  <jim@meyering.net>
4111         Prior to this change, rm required read access to the current
4112         directory on most systems (ones with the fchdir function).
4114         * save-cwd.c (save_cwd) [HAVE_FCHDIR]: If opening `.' read-only
4115         fails, try write-only, and finally, resort to using xgetcwd.
4117 2004-05-07  Jim Meyering  <jim@meyering.net>
4119         Update from gnulib.
4120         * obstack.c (_): Define only if not already defined.
4121         * obstack.h (obstack_finish): Rename local: s/value/__value/.
4123 2004-05-03  Jim Meyering  <jim@meyering.net>
4125         * lchown.c (lchown) [CHOWN_MODIFIES_SYMLINK]: Just call chown.
4127 2004-05-01  Jim Meyering  <jim@meyering.net>
4129         * chown.c (rpl_chown) [CHOWN_FAILS_TO_HONOR_ID_OF_NEGATIVE_ONE]:
4130         Wrap old code with this conditional.
4131         [CHOWN_MODIFIES_SYMLINK]: Try to work around a chown
4132         function that does not dereference symlinks.
4134 2004-04-18  Paul Eggert  <eggert@twinsun.com>
4136         * nanosleep.c (suspended): Change its type from int to
4137         sig_atomic_t volatile.
4138         (first_call): Make it private to rpl_nanosleep, and have it
4139         be zero initially as that's a bit faster.
4140         (my_usleep): Round up fractional times instead of truncating them,
4141         as this is the usual meaning for 'sleep'.
4143 2004-04-20  Jim Meyering  <jim@meyering.net>
4145         * getndelim2.c (getndelim2): Upon realloc failure, don't leak memory.
4147 2004-04-18  Jim Meyering  <jim@meyering.net>
4149         * readutmp.c (read_utmp) [UTMP_NAME_FUNCTION]: Upon realloc failure,
4150         don't leak memory and do call END_UTMP_ENT.
4152 2004-04-13  Jim Meyering  <jim@meyering.net>
4154         * quotearg.c, quotearg.h: Remove trailing blanks.
4156 2004-04-12  Jim Meyering  <jim@meyering.net>
4158         * inttostr.h: Update from gnulib.
4160 2004-03-27  Paul Eggert  <eggert@twinsun.com>
4162         * utimecmp.c, utimecmp.h: New files.
4163         * Makefile.am (libfetish_a_SOURCES): Add utimecmp.c, utimecmp.h.
4165 2004-04-09  Jim Meyering  <jim@meyering.net>
4167         * stat-macros.h: New file, with contents from file-type.h
4168         and coreutils' system.h.
4169         * Makefile.am (libfetish_a_SOURCES): Add stat-macros.h.
4170         * file-type.c: Include "stat-macros.h".
4171         * file-type.h (file_type): Move all macro defiitions to new file,
4172         stat-macros.h.
4174 2004-03-30  Paul Eggert  <eggert@twinsun.com>
4176         * cloexec.c, cloexec.h, config.charset, file-type.c, file-type.h:
4177         * getloadavg.c, getndelim2.c, getusershell.c, group-member.c:
4178         * human.c, path-concat.c, printf-args.c, printf-args.h:
4179         * quotearg.c, quotearg.h, setenv.c, strdup.c:
4180         * userspec.c, userspec.h, vasprintf.c: Sync from gnulib.
4182         * allocsa.c, allocsa.h, strdup.h: New files, from gnulib.
4183         * Makefile.am (libfetish_a_SOURCES): Add allocsa.c, allocsa.h,
4184         and strdup.h.
4186 2004-03-30  Jim Meyering  <jim@meyering.net>
4188         * getloadavg.c: Merge changes from emacs (via gnulib).
4190 2004-03-28  Paul Eggert  <eggert@twinsun.com>
4192         Fix some gotchas encountered when porting to Solaris 8, using
4193         the Forte 6u2 compiler.
4195         * canonicalize.c [HAVE_UNISTD_H]: Include <unistd.h>,
4196         for resolvepath declaration.
4197         * fts.c: Include dirfd.h, for dirfd.
4199 2004-02-25  Paul Eggert  <eggert@twinsun.com>
4201         * human.c (humblock): Support BLOCKSIZE as well as BLOCK_SIZE.
4203 2004-03-23  Paul Eggert  <eggert@twinsun.com>
4205         * readtokens0.c (readtokens0): Return true on success rather
4206         than on failure.  All callers changed.  This also happens to fix a
4207         portability bug on pre-C99 hosts, where (bool) INTEGER sometimes
4208         returns false even when INTEGER is nonzero.
4210 2004-03-23  Jim Meyering  <jim@meyering.net>
4212         * Makefile.am (libfetish_a_SOURCES): Add getopt_int.h.
4213         * getopt_int.h: New file, from gnulib.
4214         * getopt.c, getopt.h, getopt1.c: Sync from gnulib.
4215         * getopt.c, getopt.h: Remove space(s) before TAB.
4217         * mbswidth.c, mbswidth.h: Sync from gnulib.
4219 2004-03-21  Jim Meyering  <jim@meyering.net>
4221         * readtokens0.c, readtokens0.h: New files.
4222         * Makefile.am (libfetish_a_SOURCES): Add readtokens0.c and readtokens0.h
4224         * readtokens.c (readtoken): Don't leak 64 bytes when reading
4225         an empty input stream.
4227         * readtokens.c: Include <stdbool.h>.
4228         (readtoken): Use `size_t' rather than int/long.
4229         All callers adjusted.
4230         Use `bool' rather than `int' where appropriate.
4231         Use memset rather than an explicit loop.
4232         Use x2nrealloc rather than xrealloc.
4233         Allow the use of `\0' as a delimiter.
4234         (readtokens): Likewise.
4235         * readtokens.h (readtoken, readtokens): Update prototypes.
4237 2004-02-29  Paul Eggert  <eggert@twinsun.com>
4239         * getdate.h: Include stdbool.h, and timespec.h instead of
4240         the usual <time.h> dance.
4241         (get_date): Change signature to support fractional time stamps.
4242         All callers changed.
4243         * getdate.y: Include "getdate.h" first, as we can now
4244         assume C89 and don't need to worry about 'const'.
4245         Similarly, include "unlocked-io.h" near start, not in middle.
4246         Include <limits.h>.
4247         (textint.value): Use long int rather than int.
4248         (textint.digits): Use size_t rather than int.
4249         (BILLION, LOG10_BILLION): New constants.
4250         (parser_control): New member rel_ns.  Members day_ordinal,
4251         time_zone, month, day, hour, minutes, rel_year, rel_month,
4252         rel_day, rel_hour, rel_minutes, rel_seconds
4253         are now long int, not int.  Member seconds is now struct timespec,
4254         not int.  New member timespec_seen.  Members dates_seen, days_seen,
4255         local_zones_seen, rels_seen, times_seen, zones_seen are now size_t,
4256         not int.
4257         (%union.intval): Now long int, not int.
4258         New member timespec.
4259         (tSDECIMAL_NUMBER, tUDECIMAL_NUMBER): New tokens.
4260         (seconds, signed_seconds, unsigned_seconds): New nonterminals.
4261         (spec): Now is a timespec or an item list.
4262         (timespec, items): New nonterminals.
4263         (time, rel, relunit, number, get_date):
4264         Add support for fractional seconds.
4265         (time): Fix bug: seconds weren't cleared in "00:00 +0000" syntax.
4266         (gmtime, localtime, mktime): Remove decls; not needed with C89.
4267         (to_hour): First arg is now long int, not int.
4268         (to_year): Returns long int, not int.
4269         Don't treat year -70 like 70.
4270         (tm_diff): Returns long int, not int.
4271         (lookup_word): Use bool instead of int when appropriate.
4272         (yylex): Use size_t for count, not int.
4273         Detect overflow when parsing large integer constants.
4274         Add support for fractions.
4275         (get_date): Make pointers 'const' if possible.
4276         Use more-portable code to detect integer overflow.
4277         (main) [TEST]: Adjust to above changes.  Test for localtime failure.
4278         Don't use ctime; it's not reliable if the year has >4 digits.
4280 2004-03-15  Jim Meyering  <jim@meyering.net>
4282         `date --date="21:04 +0100" +%S' would print the seconds value
4283         from the current time, rather than `00'.
4284         * getdate.y: For a date string like `10:23 +0100',
4285         set the number of seconds to zero.  Reported by Marc Haber.
4287 2004-03-04  Jim Meyering  <jim@meyering.net>
4289         * cloexec.c (set_cloexec_flag) [ ! (F_GETFD && F_SETFD)]:
4290         Return true, not false.
4292 2004-03-03  Paul Eggert  <eggert@twinsun.com>
4294         * cloexec.c: Include "cloexec.h" first, and <unistd.h> before <fcntl.h>.
4295         (set_cloexec_flag): Use bool for booleans.  All uses changed.
4296         If F_GETFD returns a negative number (not just -1), report a
4297         failure.  Don't use F_SETFD if the flags are already right.
4298         Don't report a failure with F_SETFD unless it returns -1.
4299         * cloexec.h: Include <stdbool.h>.
4300         Adjust signature to use `bool' rather than `int'.
4301         * getloadavg.c (getloadavg): Use `true', not `1'.
4303 2004-03-02  Dmitry V. Levin  <ldv@altlinux.org>
4305         * cloexec.c: New file.
4306         The set_cloexec_flag implementation imported from GNU C Library
4307         Reference Manual.
4308         * cloexec.h: New file.
4309         * getloadavg.c: Include "cloexec.h".
4310         (getloadavg): Use set_cloexec_flag instead of manual fcntl call.
4311         * Makefile.am (libfetish_a_SOURCES): Add cloexec.c, cloexec.h.
4313 2004-02-23  Paul Eggert  <eggert@twinsun.com>
4315         * userspec.c: Don't include "posixver.h".
4316         (parse_user_spec): Fall back on USER.GROUP parsing, regardless
4317         of POSIX version, as POSIX 1003.1-2001 allows that behavior as a
4318         compatible extension.  Simplify code by removing a boolean int
4319         that was always nonzero if a string was nonnull.
4321 2004-02-05  Jim Meyering  <jim@meyering.net>
4323         * timespec.h (ST_TIME_CMP_NS, ST_TIME_CMP): Define.
4324         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
4325         From coreutils' system.h.
4327 2004-01-29  Jim Meyering  <jim@meyering.net>
4329         * mountlist.c [HAVE_SYS_UCRED_H]: Include grp.h before sys/ucred.h.
4331 2004-01-21  Paul Eggert  <eggert@twinsun.com>
4333         * argmatch.c (ARGMATCH_DIE) [! defined ARGMATCH_DIE]:
4334         Include "exitfail.h", and use exit_failure rather than EXIT_FAILURE.
4335         * argmatch.h: Comment fix to match the above.
4336         * long-options.c (parse_long_options): Use prototype
4337         for usage function arg.  Pass it EXIT_SUCCESS rather than 0,
4338         for clarity.
4339         * obstack.c (obstack_exit_failure) [!defined _LIBC]:
4340         Now a macro referring to exit_failure, instead of a separate
4341         variable.  Include "exitfail.h" to get it.
4342         * xstrtol.h: Include "exitfail.h".
4343         (STRTOL_FATAL_ERROR): Exit with status exit_failure, not 2.
4345 2004-01-21  Jim Meyering  <jim@meyering.net>
4347         * mktime.c (__mktime_internal) [!_LIBC]: Define to mktime_internal
4348         so as not to conflict with a different-sized __mktime_internal
4349         function in GNU libc.
4351 2004-01-16  Jim Meyering  <jim@meyering.net>
4353         Merge from gnulib.
4354         * localcharset.c: Test HAVE_DECL_GETC_UNLOCKED,
4355         rather than HAVE_GETC_UNLOCKED.
4357 2003-10-08  Paul Eggert  <eggert@twinsun.com>
4359         Merge from gnulib.
4361         * unlocked-io.h: Include <stdio.h>, so that the caller
4362         doesn't have to include <stdio.h> before us.
4363         (clearerr_unlocked, feof_unlocked, ferror_unlocked,
4364         fflush_unlocked, fgets_unlocked, fputc_unlocked, fputs_unlocked,
4365         fread_unlocked, fwrite_unlocked, getc_unlocked, getchar_unlocked,
4366         putc_unlocked, putchar_unlocked): Define to the unlocked counterpart
4367         if not declared, so that we can use getpass.c code from libc without
4368         rewriting it.
4369         (flockfile, ftrylockfile, funlockfile): New macros.
4371 2004-01-14  Paul Eggert  <eggert@twinsun.com>
4373         Merge from gnulib.
4375         * fnmatch_loop.c (ALLOCA_LIMIT): Remove macro, which collided
4376         with like-named macro in fnmatch.c.
4377         (EXT): Use an internal constant instead.
4379         Merge fnmatch patches from glibc.
4380         * fnmatch.c (mbsinit): Remove define.
4381         Add libc_hidden_ver (__fnmatch, fnmatch).
4382         * fnmatch_loop.c (FCT): Cast to int32_t and UCHAR when appropriate.
4383         Adjust to renaming of collseq_table_lookup to __collseq_table_lookup.
4385 2003-11-24  Paul Eggert  <eggert@twinsun.com>
4387         Merge from gnulib.
4389         * alloca.c: Remove dependency on xalloc module.
4390         (xalloc_die): Remove.
4391         (memory_full) [!defined emacs]: New macro.
4392         [!defined emacs]: Don't include xalloc.h.
4393         (alloca): Invoke memory_full, not xalloc_die, if malloc fails or
4394         address arithmetic overflows.  Change datatypes a bit to avoid
4395         unnecessary casts.
4397 2004-01-14  Paul Eggert  <eggert@twinsun.com>
4399         * posixver.c: Include posixver.h.
4401 2004-01-12  Jim Meyering  <jim@meyering.net>
4403         * posixver.c (DEFAULT_POSIX2_VERSION): Use definition of new,
4404         optional configure-time default.
4406 2004-01-10  Jim Meyering  <jim@meyering.net>
4408         * version-etc.c (version_etc_copyright): Update copyright date.
4410 2003-12-20  Jim Meyering  <jim@meyering.net>
4412         * fts.c [!_LIBC]: Undefine, then define-away __P.
4414 2003-12-19  Jim Meyering  <jim@meyering.net>
4416         Rewrite fts to use a hash table or O(1)-mem cycle-detection
4417         code rather than the tree-based tsearch functions.
4418         * fts_.h: Include hash.h and cycle-check.h.
4419         (FTS_TIGHT_CYCLE_CHECK): New value.
4420         (FTS_OPTIONMASK): Adjust to include the new value.
4421         (FTS_NAMEONLY, FTS_STOP): Increase to allow room for new value.
4422         (struct FTS) [active_dir_ht]: New member.  Replaces fts_dir_signatures.
4423         (struct FTS) [cycle_state]: New member.
4424         * fts.c: Don't include <search.h>.
4425         [HAVE_INTTYPES_H]: Include <inttypes.h>.
4426         (tdestroy, tfind, tsearch): Remove definitions.
4427         (struct Active_dir): Rename from `known_object'.
4428         (AD_compare, AD_hash): New functions.
4429         (enter_dir, leave_dir): Rewrite to manipulate a hash table
4430         rather than a tree.
4431         (fts_open): Initialize hash table or cycle_state buffer.
4432         (free_node): Remove function.
4433         (find_matching_ancestor): Renamed/rewritten from look_up_active_dir.
4434         (fts_cross_check): Adapt to use new data structure.
4436         * Makefile.am (libfetish_a_SOURCES): Remove search_.h.
4437         (DISTCLEANFILES): Remove definition.
4439 2003-12-18  Jim Meyering  <jim@meyering.net>
4441         Rewrite cycle detection code to work properly.
4442         Add some framework (compiled out by default) to test it.
4443         * fts.c (Dprintf, ENTER_DIR, LEAVE_DIR): Define.
4444         (add_object): Remove function.  Rewritten as...
4445         (enter_dir): New function.
4446         (leave_dir, free_node): New functions.
4447         (fts_read): Ensure that we call ENTER_DIR or LEAVE_DIR,
4448         as appropriate, before returning.
4449         (look_up_active_dir, fts_cross_check) [FTS_DEBUG]: New functions.
4450         (fts_stat): Don't perform the cycle check here.
4451         Now it's done via enter_dir.
4453 2003-12-12  Jim Meyering  <jim@meyering.net>
4455         * fts_.h (FTS) [fts_dir_signatures]: Add comment.
4457 2003-12-03  Paul Eggert  <eggert@twinsun.com>
4459         * getgroups.c (getgroups): xmalloc takes one argument, not two.
4460         Bug reported by Alfred M. Szmidt.
4462 2003-12-02  Jim Meyering  <jim@meyering.net>
4464         * Makefile.am (libfetish_a_SOURCES): Reflect sha -> sha1 renaming.
4466         * sha1.c: File renamed from sha.c.
4467         * sha1.h: File renamed from sha.h.
4468         Use SHA1_H, not _SHA_H in #ifndef condition.
4470         * sha.c: Add FSF Copyright.
4471         * sha.h: Correct stale references to MD5 and `16 bytes'.
4472         Patch by Ulrich Drepper.
4474         * sha.h: Add FSF Copyright.  Remove reference to Scott Miller,
4475         since this file is now nearly identical to md5.h.
4477         * md5.h (rol) [__GNUC__ && __i386__]: Don't use `asm' code.  These
4478         days, gcc-3.x does better all by itself.  Patch from Dean Gaudet:
4479         http://mail.gnu.org/archive/html/bug-coreutils/2003-11/msg00144.html
4481 2003-11-29  Jim Meyering  <jim@meyering.net>
4483         * c-strtod.c (c_strtod): Save and restore original LC_NUMERIC setting,
4484         in case it was different from the environment-derived value.
4485         Patch by Paul Eggert.
4486         Include "xalloc.h" for declaration of xstrdup.
4488 2003-11-24  Paul Eggert  <eggert@twinsun.com>
4490         Parse floating-point operands and options in the C locale.
4491         POSIX requires this for printf, and we might as well be
4492         consistent elsewhere (tail, sleep, seq).
4494         * Makefile.am (libfetish_a_SOURCES): Add c-strtod.c, c-strtod.h.
4495         * c-strtod.c, c-strtod.h: New files.
4496         * xstrtod.h (xstrtod): Accept an extra arg, specifying the
4497         conversion function.
4498         * xstrtod.c (xstrtod): Likewise.  All callers changed to
4499         include c-strtod.h and use c_strtod.  Don't include stdlib.h; no
4500         longer needed.
4502         * xnanosleep.c: Don't include xstrtod.h; it's not needed.
4504 2003-11-22  Jim Meyering  <jim@meyering.net>
4506         * xmalloc.c (x2nrealloc_inline): Fix typos in comments: s/size/size_t/.
4508 2003-11-21  Jim Meyering  <jim@meyering.net>
4510         * xreadlink.c (xreadlink): Correct outdated comment.
4512 2003-11-17  Jim Meyering  <jim@meyering.net>
4514         On systems without utime and without a utimes function capable of
4515         dealing with a NULL struct utimbuf* argument, this utime replacement
4516         could -- in unusual circumstances -- leak a file descriptor.
4517         * utime.c: Include <unistd.h> and <errno.h>.
4518         (utime_null): Be sure to close `fd' and to preserve errno.
4519         Reported by Geoff Collyer via Arnold Robbins.
4521 2003-11-13  Jim Meyering  <jim@meyering.net>
4523         * xalloc.h, xstrtol.c: Update from gnulib.
4525 2003-11-11  Jim Meyering  <jim@meyering.net>
4527         * ftw.c, ftw_.h: Remove files.  No longer used.
4529 2003-11-09  Jim Meyering  <jim@meyering.net>
4531         * root-dev-ino.c, root-dev-ino.h: New files.
4532         * Makefile.am (libfetish_a_SOURCES): Add root-dev-ino.c root-dev-ino.h.
4534         * dev-ino.h: Include <sys/types.h> and <sys/stat.h>.
4536 2003-11-06  Jim Meyering  <jim@meyering.net>
4538         * free.c: New file, from gnulib.
4540 2003-10-31  Paul Eggert  <eggert@twinsun.com>
4542         * mountlist.h (struct mount_entry.me_type_malloced): New member.
4543         * mountlist.c (SIZE_MAX): Define if not defined already.
4544         (read_filesystem_list): Set and use me_type_malloced.
4545         Use "sizeof *me" rather than "sizeof (struct mount_entry)" (or
4546         whatever the type happens to be), for brevity and consistency.
4547         Check for size calculation overflow on Alphas running OSF/1.
4549 2003-10-31  Jim Meyering  <jim@meyering.net>
4551         * hash.c: Include "xalloc.h" for use of xalloc_oversized.
4553         * linebuffer.c: Include <string.h> for declaration of memset.
4555         * alloca.c, linebuffer.c, xmalloc.c, xalloc.h: Update from gnulib.
4556         * exclude.c, getgroups.c, quotearg.c, stdbool_.h: Update from gnulib.
4557         * hash.c, hash-pjw.h: Update from gnulib.
4559 2003-10-25  Jim Meyering  <jim@meyering.net>
4561         * hash.c, hash.h: Update from gnulib.
4562         * hash-pjw.c, hash-pjw.h: Likewise.
4563         * obstack.c, obstack.h: Likewise.
4565 2003-10-25  Jim Meyering  <meyering@lucent.com>
4567         * fts_.h: Include <features.h> only if _LIBC.
4568         [!_LIBC]: Define-away __THROW, __BEGIN_DECLS, __END_DECLS.
4570 2003-10-19  Jim Meyering  <jim@meyering.net>
4572         * vasnprintf.c (vasnprintf): Work around losing snprintf on
4573         e.g. HPUX 10.20.
4575 2003-09-25  Jim Meyering  <jim@meyering.net>
4576             Bruno Haible  <bruno@clisp.org>
4578         [Update from gnulib]
4579         This lets translators provide better translations for the
4580         "Written by ..." part of --version output.
4581         * version-etc.h: Include stdarg.h.
4582         (version_etc_copyright): Declare as readonly.
4583         (version_etc): Make this function variadic with a NULL-terminated list
4584         of author name strings.
4585         (version_etc_va): New declaration.
4586         * version-etc.c: Include stdarg.h, stdlib.h.
4587         (version_etc_copyright): Declare as readonly.
4588         (version_etc_va): New function. Provide a different translatable string
4589         for each possible number of authors < 10. Abbreviate when there are 10
4590         authors or more.
4591         (version_etc): Make this function variadic. Call version_etc_va.
4592         Suggestion from Gary V. Vaughan.
4594         * long-options.h (parse_long_options): Change prototype: the authors
4595         string is moved to the end and becomes variadic.
4596         * long-options.c: Include stdarg.h.
4597         (parse_long_options): Make this function variadic, too.
4598         Call version_etc_va, not version_etc.
4600 2003-10-17  Jim Meyering  <jim@meyering.net>
4602         * xfts.c, xfts.h: New files.
4603         This factors out code used by du.c, chmod.c, and chown-core.c.
4604         * Makefile.am (libfetish_a_SOURCES): Add xfts.c and xfts.h.
4606         * error.h: Update from gnulib.
4607         * getpass.c: Likewise.
4608         * fnmatch.c: Likewise.
4609         * fnmatch_loop.c: Likewise.
4611 2003-10-16  Jim Meyering  <jim@meyering.net>
4613         * xmalloc.c: Include <string.h>, for declarations of memset and memcpy.
4615         * getgroups.c: Update from gnulib.
4616         * readutmp.c: Fix indentation, from gnulib.
4617         * exclude.c: Update from gnulib.
4618         * xgethostname.c: Include xgethostname.h.
4619         * xgethostname.h: New file, from gnulib.
4620         * Makefile.am (libfetish_a_SOURCES): Add xgethostname.h.
4622 2003-10-15  Jim Meyering  <jim@meyering.net>
4624         * userspec.h: New file.
4625         * userspec.c: Include "userspec.h".
4626         * Makefile.am (libfetish_a_SOURCES): Add userspec.h.
4628 2003-10-14  Paul Eggert  <eggert@twinsun.com>
4630         Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
4631         properly diagnosed.
4632         * human.c, xstrtoimax.c, xstrtol.c, xstrtol.h, xstrtoul.c, xstrtoumax.c:
4633         Sync with gnulib.
4635 2003-10-13  Paul Eggert  <eggert@twinsun.com>
4637         * xalloc.h, xmalloc.c, xstrdup.c: Import latest version from gnulib.
4639 2003-09-29  Paul Eggert  <eggert@twinsun.com>
4641         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
4643 2003-10-02  Jim Meyering  <jim@meyering.net>
4645         Don't require that the maximum length of a file name
4646         encountered in a traversal fit in an `unsigned short',
4647         and fix some portability bugs (don't depend on gcc).
4649         * fts.c: Include "fts_.h", not <fts.h>.
4650         (ALIGNBYTES) [!(__GNUC__ >= 2)]: Add a definition that works with
4651         compilers that don't have __alignof__.
4652         (MAX): Use a definition that doesn't depend on gcc.
4653         (fts_build): Make `len' and `maxlen' be of type size_t, not int.
4654         Test for overflow in a less type-dependent manner.
4655         Test HAVE_STRUCT_DIRENT_D_TYPE, rather than
4656         defined DT_DIR && defined _DIRENT_HAVE_D_TYPE.
4657         (fts_palloc): Test for overflow in a less type-dependent manner.
4658         (fts_safe_changedir): Use stat, not stat64.
4659         Use fstat, not __fxstat64(_STAT_VER.
4661         * fts_.h [FTS] (fts_pathlen): Change type from int to size_t.
4662         [FTSENT] (fts_pathlen): Change type from u_short to size_t.
4663         (fts_level): Change type from u_short to int.
4665         * Makefile.am (libfetish_a_SOURCES): Add fts.c fts_.h.
4666         Remove ftw_.h.
4668 2003-09-29  Paul Eggert  <eggert@twinsun.com>
4670         * strftime.c (tm_diff) [! HAVE_TM_GMTOFF]:
4671         Fix arg typo in previous patch.
4673 2003-09-28  Jim Meyering  <jim@meyering.net>
4675         * error.c: Update from gnulib.
4677 2003-09-19  Jim Meyering  <jim@meyering.net>
4679         * version-etc.h: (version_etc): Rename parameter, authors,
4680         to written_by.
4681         * version-etc.c: (version_etc): Likewise.
4682         Combine fprintf and following putc('\n'.
4684         * version-etc.c, version-etc.h: Revert yesterday's changes.
4685         * long-options.c, long-options.h: Likewise.
4687 2003-09-18  Jim Meyering  <jim@meyering.net>
4689         This lets translators provide better translations for the
4690         `Written by ...' part of --version output.
4691         * version-etc.c: Include stdarg.h, stdlib.h, string.h, and xalloc.h.
4692         (version_etc): Make this function variadic,
4693         with a NULL-terminated list of author name strings.
4694         (version_etc_va): New function.
4695         Suggestion from Gary V. Vaughan.
4696         * version-etc.h (version_etc_va): Declare it.
4698         * long-options.c: Include stdarg.h.
4699         (parse_long_options): Make this function variadic (authors), too.
4700         Call version_etc_va, not version_etc.
4701         * long-options.h (parse_long_options): Update prototype.
4703 2003-09-16  Paul Eggert  <eggert@twinsun.com>
4705         * linebuffer.c (readlinebuffer): Return NULL immediately upon
4706         input error, instead of returning NULL the next time we are called
4707         (and therefore losing track of errno).
4709 2003-09-15  Paul Eggert  <eggert@twinsun.com>
4711         * getndelim2.c (getndelim2): Don't trash errno when a read
4712         fails, so that the caller gets the proper errno.
4714         * readutmp.c (read_utmp): Likewise.
4715         Check for fstat error.  Close stream and free storage
4716         when failing.
4718 2003-09-14  Jim Meyering  <jim@meyering.net>
4720         * argmatch.c: Update from gnulib.
4722         * Makefile.am (libfetish_a_SOURCES): Add exit.h, strndup.h,
4723         time_r.c, time_r.h.
4725 2003-09-13  Jim Meyering  <jim@meyering.net>
4727         * setenv.c, strcspn.c, strdup.c, strndup.c, strnlen.c, strpbrk.c:
4728         * strstr.c, strtod.c, strtoimax.c, tempname.c, unicodeio.c, userspec.c:
4729         * vasprintf.h, xgethostname.c, xreadlink.c, xstrdup.c, xstrndup.c:
4730         * xstrndup.h, xstrtod.c, xstrtol.c, yesno.c: Update from gnulib.
4731         * strndup.h: New file, from gnulib.
4732         * exit.h: New file, from GNU gettext, via gnulib.
4734 2003-09-06  Paul Eggert  <eggert@twinsun.com>
4736         * time_r.c, time_r.h: New files.
4738         * mktime.c (my_mktime_localtime_r): Remove; all uses changed to
4739         __localtime_r.
4740         (__localtime_r) [!defined _LIBC]: New macro.  Include <time_r.h>.
4741         (__mktime_internal) [!defined _LIBC]: Now extern, not static.
4743         * strftime.c (my_strftime_gmtime_r): Remove; all uses changed to
4744         __gmtime_r.
4745         (my_strftime_localtime_r): Remove; all uses changed to __localtime_r.
4746         (__gtime_r, __localtime_r) [!HAVE_TM_GMTOFF]: New macros.
4747         Include <time_r.h>.
4749 2003-09-13  Jim Meyering  <jim@meyering.net>
4751         * strtol.c: Update from gnulib.
4753 2003-09-12  Paul Eggert  <eggert@twinsun.com>
4755         * argmatch.c, xgethostname.c, xmalloc.c: Include exit.h.
4756         * obstack.c [!defined _LIBC]: Likewise.
4757         * argmatch.c (EXIT_FAILURE): Remove; now done by exit.h
4758         * exitfail.c, fatal.c, xgethostname.c, xmalloc.c: Likewise.
4759         * exitfail.c: Don't include stdlib.h; no longer needed.
4761 2003-09-12  Paul Eggert  <eggert@twinsun.com>
4763         * error.c (error_tail): Assume vprintf.
4765 2003-09-09  Paul Eggert  <eggert@twinsun.com>
4767         More K&R removal.
4769         * getloadavg.c (getloadavg, main): Define via prototypes.
4771         * getopt.h (struct option.name): Assume C89, and use 'const'.
4772         (getopt, etopt_long, getopt_long_only, _getopt_internal)
4773         [defined __GNU_LIBRARY__]: Assume C89, so we can always declare
4774         with a prototype.
4775         * getopt.c (const): Remove macro.
4776         Include <string.h> unconditionally.
4777         (my_index): Remove; all uses changed to strchr.
4778         (strlen): Remove decl.
4779         (exchange): Remove forward decl; no longer needed.
4780         (exchange, _getopt_initialize, _getopt_internal, getopt, main):
4781         Define with prototype.
4782         * getopt1.c (const): Remove macro.
4783         (getopt_long, getopt_long_only, main): Define with prototype.
4785         * getugroups.c: Include <string.h> unconditionally.
4787         * getusershell.c: Include <stdlib.h> unconditionally.
4788         (getusershell, setusershell, endusershell, readname, main):
4789         Define with prototypes.
4791         * group-member.c: Include group-member.h first.
4792         Include <stdlib.h> unconditionally.
4794         * hard-locale.c: Include hard-locale.h first.
4795         Include <stdlib.h>, <string.h> unconditionally.
4797         * hash.c (free, malloc): Remove decls.
4798         Include <stdlib.h> unconditionally.
4800         * human.c: Include <stdlib.h>, <string.h> unconditionally.
4801         (getenv): Do not declare.
4803         * idcache.c: Include <string.h> unconditionally.
4805         * long-options.c: Include long-options.h first, to test interface.
4806         Include <stdlib.h> unconditionally.
4808         * makepath.c: Include makepath.h first, to test interface.
4809         Include <stdlib.h> and <string.h> unconditionally.
4811         * linebuffer.c: Include <stdlib.h>.
4812         (free): Remove decl.
4814         * malloc.c: Include <stdlib.h>, for malloc; don't bother with stddef.h.
4815         rpl_malloc returns void *, not char *.
4816         * realloc.c (rpl_realloc): Likewise.  Also, define with a prototype.
4818         * md5.h: Include <limits.h> unconditionally.
4819         (UINT_MAX_32_BITS): Don't worry about non-__STDC__ case.
4820         (__P): Remove; all uses removed.
4821         * md5.c: Include "md5.h" first.
4822         (md5_init_ctx, md5_read_ctx, md5_finish_ctx, md5_stream,
4823         md5_buffer, md5_process_bytes, md5_process_block):
4824         Define with prototypes.
4825         * sha.h (__P): Remove all uses.  (It wasn't defined??)
4826         * sha.c: Include "sha.h" first.
4827         Include <stdlib.h>, <string.h> unconditionally.
4829         * memchr.c (__ptr_t): Remove; all uses changed to void *.
4830         * memcmp.c (__ptr_t): Likewise.
4831         * memrchr.c (__ptr_t): Likewise.
4832         * memchr.c, memcmp.c, memcoll.c, memrchr.c:
4833         Include <string.h> unconditionally.
4834         * memchr.c, memrchr.c: Include <limits.h> unconditionally.
4835         * memchr.c: Include <stdlib.h> unconditionally.
4836         * memchr.c (LONG_MAX): Remove.
4837         * memrchr.c (LONG_MAX): Likewise.
4838         * memchr.c (__memchr): Define via a prototype.
4839         * memrchr.c (__memrchr): Likewise.
4840         * memcmp.c (__P): Remove, and remove all uses.
4841         (memcmp_bytes, memcmp_common_alignment, memcmp_not_common_alignment):
4842         Remove forward decls; no longer needed.
4843         * memcpy.c, memmove.c, memset.c: Include <stddef.h>.
4844         Use types required by C89 in prototype.
4846         * mkdir.c: Include <stdlib.h>, <string.h> unconditionally.
4847         * savedir.c: Likewise.
4848         * mkdir.c (free): Remove decl.
4849         * rmdir.c (rmdir): Define with a prototype.
4850         * savedir.c: Include savedir.h first, to test interface.
4852         * mktime.c (STDC_HEADERS): Remove.
4853         Include <stdlib.h>, <string.h> unconditionally.
4855         * modechange.c: Include <stdlib.h> unconditionally.
4856         (malloc): Remove decl.
4858         * mountlist.c: Include <stdlib.h>, <string.h> unconditionally.
4859         (free): Remove decl.
4861         * obstack.h (PTR_INT_TYPE) [!defined __PTRDIFF_TYPE__]:
4862         Define to ptrdiff_t, without bothering to check HAVE_STDDEF_H.
4863         (This type really should be intptr_t, but that's a C99ism.)
4864         (_obstack_memcpy): Remove: all uses changed to memcpy.
4865         Include <string.h> unconditionally.
4866         (struct obstack): Assume __STDC__ for types of members
4867         chunkfun, freefun, extra_arg.
4868         (_obstack_newchunk, _obstack_free, _obstack_begin, _obstack_begin_1,
4869         _obstack_memory_used, obstack_alloc_failed_handler, obstack_init,
4870         obstack_begin, obstack_specify_allocation,
4871         obstack_specify_allocation_with_arg, obstack_chunkfun,
4872         obstack_freefun, obstack_free) [! (defined __STDC__ && __STDC__)]:
4873         Remove unprototyped decls and the macros that use them.
4874         * obstack.c (POINTER): Remove.  All uses changed to void *.
4875         (obstack_alloc_failed_handler, CALL_CHUNKFUN, CALL_FREEFUN,
4876         _obstack_begin, _obstack_begin_1, _obstack_allocated_p)
4877         (defined __STDC__ && __STDC__)]:
4878         Remove nonprototyped code.
4879         Include <stdlib.h> unconditionally.
4880         (_obstack_begin, _obstack_begin_1, _obstack_newchunk,
4881         _obstack_allocated_p, _obstack_free, obstack_free,
4882         _obstack_memory_used, print_and_abort):
4883         Define using prototypes.
4884         (obstack_1grow, obstack_1grow_fast, obstack_alloc, obstack_base,
4885         obstack_blank, obstack_blank_fast, obstack_copy, obstack_copy0,
4886         obstack_finish, obstack_grow, obstack_grow0, obstack_make_room,
4887         obstack_next_free, obstack_object_size, obstack_room) [0]:
4888         Remove unused, unprototyped code.
4890         * path-concat.c: Include <stdlib.h>, <string.h> unconditionally.
4892         * physmem.c (physmem_total, physmem_available, main): Define
4893         with prototypes.
4895         * posixtm.c: Include <stdlib.h>, <string.h> unconditionally.
4896         (main): Define with a prototype.
4898         * posixver.c (getenv): Remove decl.
4900         * putenv.c (malloc): Returns void *, not char *.
4901         Include <string.h> unconditionally.
4902         (strchr, memcpy, NULL): Do not define.
4904         * readtokens.c: Include readtokens.h first, to test interface.
4905         Include <stdlib.h>, <string.h> unconditionally.
4906         (init_tokenbuffer): Define with a prototype.
4908         * regex.c (PARAMS): Remove.  All uses removed.
4909         All uses of _RE_ARGS removed, too.
4910         Include <stddef.h>, <stdlib.h>, <string.h>, <limits.h>
4911         unconditionally.
4912         (bzero): Assume memset exists.
4913         (memcmp, memcpy, NULL): Remove.
4914         (SIGN_EXTEND_CHAR): Remove; all uses replaced by casts to signed
4915         char, or assignments to local vars of type signed char.
4916         (init_syntax_once, PREFIX(extract_number_and_incr),
4917         PREFIX(print_partial_compiled_pattern),
4918         PREFIX(print_compiled_pattern), PREFIX(print_double_string),
4919         convert_mbs_to_wcs, print_fastmap, re_set_syntax,
4920         PREFIX(regex_grow_registers), PREFIX(regex_compile),
4921         PREFIX(store_op1), PREFIX(store_op2), PREFIX(insert_op1),
4922         PREFIX(insert_op2), PREFIX(at_begline_loc_p),
4923         PREFIX(at_endline_loc_p), group_in_compile_stack, insert_space,
4924         wcs_compile_range, byte_compile_range, truncate_wchar,
4925         PREFIX(re_compile_fastmap), re_compile_fastmap, re_set_registers,
4926         re_search, re_search_2, PREFIX(re_search_2), re_match, re_match_2,
4927         count_mbs_length, wcs_re_match_2_internal,
4928         byte_re_match_2_internal, PREFIX(group_match_null_string_p),
4929         PREFIX(alt_match_null_string_p),
4930         PREFIX(common_op_match_null_string_p), PREFIX(bcmp_translate),
4931         re_compile_pattern, re_comp, re_exec, regcomp, regexec, regerror,
4932         regfree, PREFIX(extract_number)): Define with prototype.  Remove
4933         now-unnecessary declaration, if any.
4934         (byte_compile_range, PREFIX(regex_compile), re_comp, re_exec,
4935         regcomp, regexec):
4936         Remove now-unnecessary casts among pointer types.
4937         * regex.h (_RE_ARGS): Remove.  All uses removed.
4939         * rename.c: Include <stdlib.h>, <string.h> unconditionally.
4940         (free): Remove decl.
4942         * rpmatch.c: Include <stdlib.h> unconditionally.
4944         * save-cwd.c: Include <stdlib.h> unconditionally.
4945         * xgetcwd.c: Likewise.
4947         * stat.c: Include <stdlib.h>, <string.h> unconditionally.
4948         (free): Remove decl.
4950         The following changes are not K&R related:
4952         * group-member.h: Include <sys/types.h>, so that this file is
4953         self-contained.
4954         * makepath.h: Likewise.
4956         * getusershell.c (readname, default_index, line_size, readname):
4957         Use size_t, not int, for sizes.
4958         (readname): If the size overflows, report an error instead of
4959         looping forever.
4961 2003-09-09  Derek Robert Price  <derek@ximbiot.com>
4963         * getndelim2.c: Assume stdlib.h per the C89 spec.
4965 2003-09-08  Paul Eggert  <eggert@twinsun.com>
4967         Assume C89 or better; remove K&R cruft.
4968         A few of these changes were first proposed by Derek Robert Price
4969         in <http://mail.gnu.org/archive/html/bug-gnulib/2003-07/msg00105.html>.
4971         * addext.c: Include <string.h> unconditionally.
4972         * backupfile.c: Include <string.h>, <stdlib.h> unconditionally.
4973         Don't declare getenv or malloc.
4975         * alloca.c: Include <string.h>, <stdlib.h> unconditionally.
4976         (POINTER_TYPE, pointer): Remove; all uses changed to void *.
4977         (NULL): Remove.
4978         (find_stack_direction, alloca): Use prototypes.
4980         * atexit.c (atexit): Define using a prototype.
4982         * basename.c, dirname.c, stripslash.c:
4983         Include <string.h> unconditionally.
4985         * bcopy.c: Include <stddef.h>.
4986         (bcopy): Define with prototype, using 'const' and 'void' and 'size_t'.
4988         * canon-host.c: Include <stdlib.h>, <string.h> unconditionally.
4990         * error.h (error, error_at_line, error_print_progname)
4991         [! (defined (__STDC__) && __STDC__)]: Remove decls.
4992         * error.c: Include error.h first, to check interface.
4993         Include <stdarg.h>, <stdlib.h>, <string.h> unconditionally.
4994         (VA_START): Remove; all uses changeed to va_start.
4995         (exit, strerror): Remove decls.
4996         (error_print_progname): Prototype uncondionally.
4997         Don't include <errno.h>; no longer needed.
4998         (private_strerror): Remove.
4999         (error_tail): Always define.
5000         (error, error_at_line): Assume C89 or better; always use prototypes.
5002         * euidaccess.c (main): Define with a prototype.
5004         * exclude.c: Include <stdlib.h>, <string.h> unconditionally.
5006         * exitfail.c: Include <stdlib.h> unconditionally.
5008         * fnmatch_.h (__P): Remove.  All uses changed to assume prototypes.
5009         * fnmatch.c: Include fnmatch.h first, to test interface.
5010         Include <string.h>, <stddef.h>, <stdlib.h> unconditionally.
5011         (getenv): Remove decl.
5012         (fnmatch): Define using a prototype.
5013         * fnmatch_loop.c (FCT): Remove forward decl; no longer needed.
5014         (FCT): Define using a prototype.
5016         * getdate.y: Include <stdlib.h>, <string.h> unconditionally.
5018         * gethostname.c: Include <stddef.h>.
5019         (gethostname): Define with prototype.  Length is size_t, not int.
5021 2003-09-08  Paul Eggert  <eggert@twinsun.com>
5023         * utime.c [!HAVE_UTIMES_NULL]: Include <sys/stat.h>, <fcntl.h>.
5024         (utime_null): Fix typo: 'st' was sometimes called 'sb'.
5026 2003-09-09  Jim Meyering  <jim@meyering.net>
5028         * getversion.c: Remove unused file.  Reported by Paul Eggert.
5030 2003-09-03  Paul Eggert  <eggert@twinsun.com>
5032         * human.c (human_readable): Fix bug that rounded 10501 to 10k.
5033         Bug reported by Lute Kamstra in
5034         <http://mail.gnu.org/archive/html/bug-gnulib/2003-09/msg00003.html>.
5036         * getdate.y (relative_time_table): Use tDAY_UNIT for "tomorrow",
5037         "yesterday", "today", and "now" rather than tMINUTE_UNIT.  Of
5038         course with correspondingly smaller numbers for tomorrow and
5039         yesterday.  From Tadayoshi Funaba.  Originally installed into
5040         sh-utils on 1999-08-07, but the patch was mistakenly reverted by
5041         the next change to that shared file (but this time in fileutils)
5042         on 1999-08-29.
5044 2003-08-18  Paul Eggert <eggert@twinsun.com>
5046         * same.c: Include <stdlib.h> and <string.h> unconditionally,
5047         as we're now assuming that part of hosted C89.
5048         (free) [!HAVE_DECL_FREE]: Remove decl; no longer needed.
5049         (same_name): Invoke pathconf on destination, not source, as
5050         that's a bit clearer even if they are the same dir.
5052 2003-08-18  Jim Meyering  <jim@meyering.net>
5054         * getopt.h: Remove space before TAB.
5056 2003-08-17  Paul Eggert  <eggert@twinsun.com>
5058         * same.c: Include <stdbool.h>, <limits.h>.
5059         (_POSIX_NAME_MAX): Define if not defined.
5060         (MIN): New macro.
5061         (same_name): If file names are silently truncated, report
5062         that the file names are the same if they are the same after
5063         the silent truncation.
5065 2003-08-16  Paul Eggert  <eggert@twinsun.com>
5067         Merge from gnulib.
5068         * Makefile.am (libfetish_a_SOURCES): Remove getndelim2.c,
5069         getndelim2.h, xstrtoimax.c.  Add localcharset.h.
5070         (CLEANFILES, SUFFIXES): Initialize to empty.
5071         (EXTRA_DIST): Add getndelim2.c, getndelim2.h.
5072         (install-exec-local): Use $(GLIBC21), not @GLIBC21@.
5073         Do not mkdir libdir if not glibc21.
5074         (charset.alias): @host@ -> $(host).
5075         (SUFFIXES, .sin.sed, CLEANFILES): Reorder rules
5076         to match gnulib module suggestions.
5077         * localcharset.h, readlink.c: New files, from gnulib.
5078         * asnprintf.c, asnprintf.c, asprintf.c, backupfile.h,
5079         canon-host.c, config.charset, dirname.h, euidaccess.c, exclude.c,
5080         fsusage.h, full-write.c, getloadavg.c, getndelim2.h, gettext.h,
5081         group-member.h, hard-locale.h, hash.c, hash.h, hash-pjw.c,
5082         localcharset.c, long-options.h, makepath.h, malloc.c, mbswidth.c,
5083         mbswidth.h, md5.h, memcasecmp.c, memcasecmp.h, memcoll.h,
5084         mkstemp.c, modechange.h, mountlist.h, path-concat.h, pathmax.h,
5085         physmem.h, posixtm.h, printf-args.c, printf-args.h,
5086         printf-parse.c, printf-parse.h, putenv.c, quote.h, readutmp.h,
5087         ref-add.sin, ref-del.sin, safe-read.c, savedir.h, setenv.c,
5088         setenv.h, stdbool_.h, strnlen.c, strpbrk.c, strtoimax.c,
5089         strverscmp.h, tempname.c, unicodeio.c, unicodeio.h,
5090         unistd-safer.h, unlocked-io.h, vasnprintf.c, vasnprintf.h,
5091         vasprintf.c, vasprintf.h, version-etc.h, xgethostname.c,
5092         xmemcoll.c, xstrtoimax.c, xstrtoumax.c: Sync with gnulib.
5094 2003-08-15  Paul Eggert  <eggert@twinsun.com>
5096         * physmem.c: Include "physmem.h" before system includes.
5098 2003-08-10  Jim Meyering  <jim@meyering.net>
5100         * utimens.c (utimens): Revert most of last change.
5101         Test HAVE_WORKING_UTIMES instead of HAVE_UTIMES.
5103 2003-08-09  Jim Meyering  <jim@meyering.net>
5105         * utimens.c (utimens): Test HAVE_UTIME, not HAVE_UTIMES.
5106         Prefer utime, since it works and utimes doesn't on some systems.
5107         FIXME: Revert the above change once we have a working utimes
5108         replacement function.
5110 2003-08-06  Paul Eggert  <eggert@twinsun.com>
5112         * Makefile.am (libeftish_a_SOURCES): Add utimens.c, utimens.h.
5113         * utimens.c, utimens.h: New files.
5115 2003-08-09  Jim Meyering  <jim@meyering.net>
5117         * unicodeio.c (unicode_to_mb): Change to `Solaris 5.7' in comment.
5118         * putenv.c: Likewise.
5120         * fatal.c, fatal.h: Remove unused files.
5122         * Makefile.am: Use the e.g., `$(FNMATCH_H)' notation for AC_SUBST'd
5123         variable names, rather than @FNMATCH_H@.
5124         Likewise for $(ALLOCA_H).
5125         (fnmatch.h): Use `$@' in the commands, in place of the three copies
5126         of the literal target, `fnmatch.h'.
5127         (alloca.h): Likewise.
5129 2003-08-08  Paul Eggert  <eggert@twinsun.com>
5131         * Makefile.am (libfetish_a_SOURCES): Remove fnmatch_.h.
5132         (lib_OBJECTS): New macro, for convenience when cutting and
5133         pasting Makefile.am templates from gnulib.
5134         (EXTRA_DIST): Remove fnmatch_loop.c.
5135         (BUILT_SOURCES): Append $(FNMATCH_H).
5136         * Makefile.am: Import the following changes from gnulib templates
5137         for alloca and fnmatch):
5138         (all-local $(lib_OBJECTS)): New dependencies.
5139         (alloca.h): Use alloca.h-t for temporary.
5140         (EXTRA_DIST): Append fnmatch_.h, fnmatch_loop.c.
5141         (fnmatch.h): New rule.
5142         (MOSTLYCLEANFILES): Add fnmatch.h, fnmatch.h-t.
5143         (DISTCLEANFILES): Remove fnmatch.h
5145 2003-08-08  Jim Meyering  <jim@meyering.net>
5147         * mountlist.c (read_filesystem_list) [MOUNTED_GETFSSTAT]:
5148         Use MNT_NOWAIT, rather than MNT_WAIT.  Otherwise, `df DIR' could
5149         hang on OSF/1 5.1 for DIR on both local and remote file systems.
5150         Reported by (and fix confirmed by) Nelson H. F. Beebe.
5152 2003-08-07  Jim Meyering  <jim@meyering.net>
5154         * regex.h (RE_SYNTAX_POSIX_AWK): Remove SPACE in SPACE-TAB sequence.
5156 2003-08-05  Paul Eggert  <eggert@twinsun.com>
5158         Merge getline from gnulib.
5159         * getline.h, getline.c: Merge from gnulib.
5160         * getndelim2.h, getndelim2.c: New files, from gnulib.
5161         * getdelim2.c, getdelim2.h: Remove.
5162         * Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
5163         getdelim2.h to getndelim2.c and getndelim2.h.
5165 2003-08-04  Paul Eggert  <eggert@twinsun.com>
5167         * regex.c, regex.h: Sync with gnulib.
5169 2003-08-03  Paul Eggert  <eggert@twinsun.com>
5171         * stdbool_.h (_Bool): Use a #define, not a typedef.
5173 2003-07-31  Paul Eggert  <eggert@twinsun.com>
5175         * bumpalloc.h: Remove.
5176         * Makefile.am (libfetish_a_SOURCES): Remove bumpalloc.h.
5178 2003-07-28  Jim Meyering  <jim@meyering.net>
5180         * stdbool_.h: Renamed from stdbool.hin.
5181         * Makefile.am: Reflect renaming: stdbool.hin -> stdbool_.h.
5182         * stdbool.hin: Remove file.
5184 2003-07-28  Paul Eggert  <eggert@twinsun.com>
5186         * stdbool.hin (_Bool): Make it signed char, instead of
5187         an enum type, so that it's guaranteed to promote to int.
5189 2003-07-23  Jim Meyering  <jim@meyering.net>
5191         * xstrndup.h: New file.
5192         * xstrndup.c: New file, factored out of dircolors.c from coreutils.
5193         * Makefile.am (libfetish_a_SOURCES): Add xstrndup.c and xstrndup.h.
5195 2003-07-23  Jim Meyering  <jim@meyering.net>
5197         * lstat.c, save-cwd.c, stat.c, utime.c, xgethostname.c: Normalize
5198         naming of Sun operating systems in comments, e.g., SunOS4 -> SunOS 4,
5199         Solaris5.9 -> Solaris 9.  From Paul Eggert.
5201 2003-07-22  Paul Eggert  <eggert@twinsun.com>
5203         * xalloc.h (XCALLOC, XREALLOC, CCLONE): Fix under- and
5204         over-parenthesization in macros.
5206 2003-07-18  Paul Eggert  <eggert@twinsun.com>
5208         * closeout.h (close_stdout_set_status, close_stdout_status): Remove.
5209         * closeout.c: Likewise.  Include "closeout.h" right after config.h,
5210         to test that it can stand by itself.  Include "exitfail.h".
5211         Clients should set exit_failure instead.
5212         (EXIT_FAILURE): Remove; no longer needed.  Do not include <stdlib.h>.
5214 2003-07-18  Andreas Schwab  <schwab@suse.de>
5216         * memcoll.c (memcoll) [!HAVE_STRCOLL]: Clear errno.
5218 2003-07-17  Paul Eggert  <eggert@twinsun.com>
5220         * xalloca.h, xmalloc.c, xmemcoll.c, xmemcoll.h:
5221         Merge with gnulib.  Use a single exit_failure variable rather
5222         than a separate one for each module.
5224 2003-07-16  Jim Meyering  <jim@meyering.net>
5226         * Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
5227         warning from automake -Wall.
5229 2003-07-14  Jim Meyering  <jim@meyering.net>
5231         * save-cwd.h: Add copyright.
5233 2003-07-13  Jim Meyering  <jim@meyering.net>
5235         * xgethostname.c: Include <stdlib.h> for declaration of free.
5236         (xgethostname): Return NULL, rather than exiting, upon any
5237         non-malloc/realloc error.
5239 2003-07-12  Jim Meyering  <jim@meyering.net>
5241         * Makefile.am (BUILT_SOURCES): Use `BUILT_SOURCES += $(STDBOOL_H)'
5242         rather than `all-local: $(STDBOOL_H)'.  The latter didn't force
5243         creation of stdbool.h before most other targets.
5244         Likewise for $(ALLOCA_H).
5246         Don't emit diagnostics.  Let callers do that.
5247         * save-cwd.c: Don't include "error.h".
5248         (save_cwd): Don't call error.  Ensure that errno is valid
5249         when returning nonzero.
5251         * obstack.h: Update from gnulib.
5253         * makepath.c (make_path): Enclose diagnostic in _(...).
5255 2003-07-10  Jim Meyering  <jim@meyering.net>
5257         * userspec.c: Include "posixver.h".
5258         (parse_user_spec): Accept `.' as a separator only
5259         in pre-POSIX-200112 mode.
5261         * Makefile.am (libfetish_a_SOURCES): Add these:
5262         printf-args.h, printf-parse.h, vasprintf.h, vasnprintf.h.
5264         Now that a program (`who') uses asprintf, we need all of these:
5265         * asnprintf.c, asprintf.c, printf-args.c, printf-args.h, printf-parse.c:
5266         * printf-parse.h, vasnprintf.c, vasnprintf.h, vasprintf.c, vasprintf.h:
5267         New files, from gnulib.
5269         * alloca_.h, getpass.c, memrchr.c, obstack.h, posixver.c,
5270         strftime.c, strnlen.c, strverscmp.c: Switch from LGPL to GPL.
5272 2003-07-09  Jim Meyering  <jim@meyering.net>
5274         * mktime.c: Update from gnulib.
5275         FIXME: but still need to adjust m4/mktime.c so that this fixed
5276         version is used when needed.
5278         Fix the bug that would make `du /' omit the `/' on the last line.
5279         E.g., `du --exclude '[^/]*' -x /' would print only "4\t\n" for me.
5280         * ftw.c (ftw_dir): Don't clobber the leading `/'.
5281         Reported by Chris Lesniewski as http://bugs.debian.org/200542.
5283 2003-07-04  Jim Meyering  <jim@meyering.net>
5285         Update from gnulib.
5286         * xreadlink.c: Include <sys/types.h> unconditionally, instead of
5287         having it depend on HAVE_SYS_TYPES_H.
5289 2003-06-18  Jim Meyering  <jim@meyering.net>
5291         * inttostr.h (PARAMS): Remove.  All uses removed.
5293         Merge in change from gnulib.
5294         * makepath.c: Remove block of alloca-related code in favor
5295         of an unconditional `#include <alloca.h>'.
5297         * xalloc.h: Include <stddef.h>.
5298         Remove unnecessary parentheses.
5299         Use `1990-2000' notation in Copyright line until Emacs'
5300         copyright-update function learns how to handle a comma-separated
5301         list of years that spans a line boundary.
5303         * Makefile.am (libfetish_a_SOURCES): Add getdelim2.c and getdelim2.h.
5305         * getline.c (getdelim2): Move this function into its own file.
5306         * getdelim2.c: Extracted from getline.c.
5308         * linebuffer.c, linebuffer.h: Update from gnulib.
5310         * getdelim2.c, getdelim2.h: New files.
5311         * getstr.c, getstr.h: Remove files.
5313         * same.h: Update from gnulib.
5314         * xstrtol.h: Update from gnulib.
5316 2003-06-17  Paul Eggert  <eggert@twinsun.com>
5318         Assume C89, so PARAMS isn't needed.
5319         * backupfile.h (PARAMS): Remove.  All uses removed.
5320         * closeout.h, dirname.h, filemode.h, fsusage.h, getdate.h, getline.h,
5321         group-member.h, hard-locale.h, hash.h, linebuffer.h, long-options.h,
5322         makepath.h, memcasecmp.h, memcoll.h, modechange.h, mountlist.h,
5323         path-concat.h, physmem.h, posixtm.h, quote.h, readutmp.h, same.h,
5324         save-cwd.h, savedir.h, stdio-safer.h, strtoimax.c, strverscmp.h,
5325         unistd-safer.h, version-etc.h, xalloc.h, xreadlink.h, xstrtod.h,
5326         xstrtol.h: Likewise.
5327         * filemode.h, hard-locale.h, memcoll.h, modechange.h, physmem.h, same.h,
5328         * strverscmp.h: Do not include config.h; no longer needed.
5329         Anyway, config.h should always be included before any other file.
5331 2003-06-17  Jim Meyering  <jim@meyering.net>
5333         * getline.c: Update from gnulib.
5335         Merge in changes from gnulib.
5336         * hash.c: Include <stdbool.h> unconditionally.
5337         Include <limits.h>.
5338         (CHAR_BIT): Don't define.
5340 2003-06-09  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
5342         * acl.c: Include <sys/types.h> before <sys/stat.h>.
5343         Required on Ultrix 4.3.
5345 2003-05-20  Derek Price  <derek@ximbiot.com>
5347         * stat.c [LSTAT]: Compile/use slash_aware_lstat only if it is necessary.
5349 2003-06-10  Jim Meyering  <jim@meyering.net>
5351         * getdate.y: Also accept dates of the form May-23-2003.
5352         Suggestion from Karl Berry.
5354 2003-06-09  Jim Meyering  <jim@meyering.net>
5356         * gettimeofday.c: Also undefine gmtime.
5357         (rpl_gmtime): New function.  Suggestion from Paul Eggert.
5359 2003-06-08  Jim Meyering  <jim@meyering.net>
5361         * getline.h: Update from gnulib.
5363         Clean up, as part of merge with emacs version of strftime.c.
5364         * strftime.c (my_strftime) [!_LIBC && HAVE_TZNAME && HAVE_TZSET]:
5365         Remove function, now that we can rely on a working tzset function.
5366         [!_LIBC]: Ensure that the required autoconf test has been run.
5367         * gettimeofday.c: Also undef tzset.
5368         (rpl_tzset): New function, for use by new macro, gl_FUNC_TZSET_CLOBBER.
5370 2003-06-07  Jim Meyering  <jim@meyering.net>
5372         * readtokens.h: Add copyright notice.
5373         Include <stdio.h>.
5374         Remove definition and uses of __P.
5376         * readtokens.c: Put `Free Software Foundation, Inc.' in place of
5377         my name in the copyright comment.
5378         (init_tokenbuffer): Remove unnecessary parentheses around malloc.
5380         Update from gnulib.
5381         * getdate.y: Include alloca.h unconditionally.
5382         * xmemcoll.h: Include <stddef.h>.
5384         * Makefile.am (MOSTLYCLEANFILES): Add alloca.h and alloca.ht.
5385         (MOSTLYCLEANFILES): Add stdbool.ht.
5387         * human.c: Include <stdio.h>, once again, for declaration of sprintf.
5389         Update from gnulib.
5390         * tempname.c: Include <stddef.h> unconditionally.
5391         Include <inttypes.h> as an alternative to <stdint.h>.
5392         * strtoimax.c: Include <stdint.h> as an alternative to <inttypes.h>.
5393         * xstrtol.h: Likewise.
5394         * xstrtoimax.c: Likewise.
5395         * xstrtoumax.c: Likewise.
5397         Update from gnulib.
5398         * strcasecmp.c: Include <stddef.h>, not <sys/types.h>.
5399         * savedir.c: Include <stddef.h>.
5400         (NULL): Don't define, since <stddef.h> does that.
5402 2003-06-06  Jim Meyering  <jim@meyering.net>
5404         Update from gnulib.
5405         * rpmatch.c: Include <limits.h> without checking for HAVE_LIMITS_H.
5406         Include <stddefs.h> unconditionally.
5407         (NULL): Don't define, since <stddef.h> does that.
5408         * rename.c: #undef rename before defining rpl_rename.
5409         [HAVE_CONFIG_H]: Guard inclusion of config.h.
5410         * putenv.c: Include <stddef.h> rather than <sys/types.h>,
5411         as we merely need size_t.
5412         * realloc.c: Likewise.
5413         * quote.c: Don't include <stddef.h> or <sys/types.h>; not needed.
5414         * modechange.c: Include <stddef.h>.
5415         (NULL): Don't define, since <stddef.h> does that.
5416         * memcoll.h: Include <stddef.h>, to get size_t.
5417         * memcoll.c: Include "memcoll.h", which gets us size_t and checks
5418         our interface, instead of including <sys/types.h>
5419         (memcoll): Fall back on a simple algorithm using
5420         memcmp if strcoll doesn't work.
5421         * memcasecmp.h: Include <stddef.h>.
5422         * memcasecmp.c: Don't include <sys/types.h>.
5424         From gnulib.
5425         * alloca_.h: New file.
5426         * Makefile.am (EXTRA_DIST): Add alloca_.h.
5427         (all-local $(lib_OBJECTS)): Depend on $(ALLOCA_H).
5428         (alloca.h): New rule.
5430         * addext.c: Update from gnulib.
5431         * backupfile.c: Likewise.
5432         * config.charset: Likewise.
5433         * dirname.h: Likewise.
5434         * fsusage.c: Likewise.
5435         * userspec.c: Likewise.
5436         * xreadlink.c: Likewise.
5437         * xstrtol.c: Likewise.
5438         * __fpending.h: Likewise.
5440         * md5.c: Include <string.h> and <stdlib.h> unconditionally.
5441         (memcpy): Remove definition.
5443         * posixtm.c: Include <stdbool.h> unconditionally.
5445 2003-06-05  Jim Meyering  <jim@meyering.net>
5447         From gnulib.
5448         * mktime.c: Assume freestanding C89 or better.
5449         (HAVE_LIMITS_H): Remove.  Assume it's 1.
5450         (__P): Remove; not used.
5451         (CHAR_BIT, INT_MIN, INT_MAX): Remove; <limits.h> defines them.
5452         (mktime, not_equal_tm, print_tm, check_result,
5453         main): Use prototypes.  Use const * where appropriate.
5454         (main): Fix typo in testing code that uncovered by above changes.
5455         (Local Variables): Remove -DHAVE_LIMITS_H from compile-command.
5457 2003-06-04  Paul Eggert  <eggert@twinsun.com>
5459         Merge human.c etc. from gnulib.
5460         * exclude.c, human.c, human.h: Merge from gnulib.
5461         * cycle-check.c, cycle-check.h, src/system.h:
5462         Include <stdbool.h> unconditionally.
5464 2003-06-02  Jim Meyering  <jim@meyering.net>
5466         * stdbool.hin: New file.  From gnulib.
5467         * Makefile.am (MOSTLYCLEANFILES): Initialize.
5468         (stdbool.h): New rule.
5469         (all-local $(lib_OBJECTS)): Depend on $(STDBOOL_H)
5470         (MOSTLYCLEANFILES): Add stdbool.h.
5471         (EXTRA_DIST): Add stdbool.h.
5473 2003-05-30  Jim Meyering  <jim@meyering.net>
5475         * addext.c: Update from gnulib.
5476         * mktime.c: Likewise.
5478 2003-05-29  Jim Meyering  <jim@meyering.net>
5480         Make the %r format directive honor any locale setting.
5481         * strftime.c: (my_strftime) [!defined _NL_CURRENT && HAVE_STRFTIME]:
5482         Use underlying_strftime for %r.
5484 2003-05-15  Jim Meyering  <jim@meyering.net>
5486         * getopt.h: Remove a space before a TAB.
5488 2003-05-13  Jim Meyering  <jim@meyering.net>
5490         * setenv.c (setenv): Don't apply cast to argument of free.
5491         * putenv.c (rpl_putenv): Likewise.
5492         * alloca.c (alloca): Likewise.
5494 2003-05-12  Jim Meyering  <jim@meyering.net>
5496         * ftw.c (ftw_startup): Always call free_cwd after restore_cwd.
5497         Reported by Matti Aarnio as
5498         https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=90563.
5499         Forwarded by Tim Waugh.
5501         * strftime.c (my_strftime): Let the `-' (no-pad) flag affect
5502         the space-padded-by-default conversion specifiers, %e, %k, %l.
5504 2003-05-07  Paul Eggert  <eggert@twinsun.com>
5506         * xnanosleep.c (timespec_subtract): Don't modify the 2nd arg.
5507         Work even if X-Y overflows when subtracting.  Make explicit the
5508         assumption that tv_nsec must be in range.
5509         (clock_get_realtime): Remove.  All callers changed to invoke gettime,
5510         for simplicity.
5511         (xnanosleep): Check for gettime failure every time.
5513 2003-05-06  Jim Meyering  <jim@meyering.net>
5515         * xnanosleep.c (clock_get_realtime): Use gettime.c's gettime function,
5516         rather than an inferior, open-coded version that would fail on
5517         AIX systems due to clock_gettime failing with errno == ENOSYS.
5518         Reported by Jérôme Zago.
5520 2003-05-05  Jim Meyering  <jim@meyering.net>
5522         Avoid array overrun.
5523         * ftw.c (nftw_arr): Update to reflect complete list of members.
5524         (ftw_arr): Likewise
5525         Reported by Olatunji Oluwabukunmi Ruwase.
5527         Make it less likely that the above can happen again.
5528         * ftw.c (struct dummy): Ensure that at least the number of
5529         initializers matches the number of members in the corresponding enum.
5530         * ftw_.h (enum Ftw_option): Name this previously-anonymous enum.
5531         (enum Ftw_option) [FTW_N_MEMBERS]: New member.
5533 2003-05-04  Jim Meyering  <jim@meyering.net>
5535         * setenv.c (__set_errno, LOCK, UNLOCK): Define.
5536         (unsetenv): Update from GNU libc.
5537         Ifdef-out this function, since the only caller
5538         is putenv.c and that file now has its own copy.
5540         This avoids a core dump on systems without GNU putenv,
5541         when running `env -u SOME_ALREADY_UNSET_VARIABLE'.
5542         * putenv.c (__set_errno, LOCK, UNLOCK): Define.
5543         (unsetenv): New static function, from GNU libc.
5544         (rpl_putenv): Use it.
5546 2003-05-02  Jim Meyering  <jim@meyering.net>
5548         * canonicalize.c (canonicalize_file_name) [!HAVE_RESOLVEPATH]:
5549         A memory-allocation error could result in heap corruption.  Fix it
5550         by also updating `dest' when rpath may be changed by xrealloc.
5552 2003-04-15  Jim Meyering  <jim@meyering.net>
5554         * getloadavg.c: Remove (or replace-with-TAB(s) to retain alignment)
5555         each sequence of spaces before a TAB character.
5556         * md5.c, getopt.c, getopt.h, obstack.h, strftime.c: Likewise.
5558 2003-04-11  Jim Meyering  <jim@meyering.net>
5560         * readutmp.c: Include <string.h> and <stdlib.h> unconditionally.
5562         * canonicalize.c, exclude.c, getgroups.c, getusershell.c:
5563         * group-member.c, idcache.c, mountlist.c, readtokens.c, readutmp.c:
5564         * bumpalloc.h: Remove anachronistic casts of xmalloc, xrealloc,
5565         and xcalloc return values.
5567         * xalloc.h (PARAMS): Remove definitions and uses.
5568         (XMALLOC, XCALLOC, XREALLOC): Remove unnecessary casts.
5570         * xmalloc.c: Remove use of PARAMS.
5572 2003-04-10  Jim Meyering  <jim@meyering.net>
5574         * canonicalize.c (canonicalize_file_name) [HAVE_RESOLVEPATH]: Remove
5575         stray semicolon that caused `readlink --canonical RELATIVE_NAME' to
5576         fail on e.g., Solaris systems.  Reported by Bruce Korb.
5577         (canonicalize_file_name): Return NULL immediately if resolvepath fails.
5578         Otherwise, `readlink --canonical /no-such-file' would exhaust
5579         virtual memory on some systems (e.g. Solaris).
5580         (canonicalize_file_name): Always free `extra_buf' before returning.
5581         (canonicalize_file_name): NUL-terminate the result.
5583 2003-04-05  Jim Meyering  <jim@meyering.net>
5585         * Makefile.am (DEFS): Use += notation rather than `DEFS = ... @DEFS@'.
5586         Use $(VAR) rather than @VAR@, now that we can rely on automake to
5587         emit a definition for each substituted variable.
5589 2003-03-26  Richard Dawe  <rich@phekda.freeserve.co.uk>
5591         * dirname.c [TEST_DIRNAME]: Update build instructions for test.
5592         Add test-cases for DOS filenames. Declare program_name.
5593         (main): Set up program_name.
5595 2003-03-22  Jim Meyering  <jim@meyering.net>
5597         * strftime.c (widen): Cast alloca return value to proper type.
5599         * fnmatch_loop.c
5600         (NEW_PATTERN): Cast alloca return value to proper type.
5601         Otherwise, it wouldn't compile with at least /bin/cc on
5602         ymp-cray-unicos9.0.2.X.
5603         Combine two mostly-identical uses of alloca into one.
5604         Thanks to the Cray-Cyber project for access to a Cray Y-MP.
5606 2003-03-19  Jim Meyering  <jim@meyering.net>
5608         DJGPP doesn't have S_ISLNK, so provide a replacement.
5609         * ftw.c (S_IFMT): Define, if necessary.
5610         [STAT_MACROS_BROKEN]: Undefine S_ISLNK.
5611         (S_ISLNK): Define, if necessary.
5612         Based on a patch from Rich Dawe.
5614         * exclude.h (PARAMS): Remove definition and uses.
5615         * exclude.c: Remove uses of `PARAMS'.
5617         * fnmatch_.h: Don't define __const.
5618         (fnmatch): Use const, not __const in prototype.
5619         From Paul Eggert.
5621 2003-03-17  Richard Dawe  <rich@phekda.freeserve.co.uk>
5623         * fchdir-stub.c: New file: trivial stub for fchdir.
5625 2003-03-18  Jim Meyering  <jim@meyering.net>
5627         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
5628         error from mntctl.
5629         Use mntctl's return value to drive the entry-processing loop, since
5630         we can't rely on the value of the vmt_length member in the last
5631         entry.  On some systems doing so could result in exhausting
5632         virtual memory.  Based in part on a patch from Mike Jetzer.
5634         * quote.c (quote_n): Fix typo in comment.
5636 2003-03-17  Jim Meyering  <jim@meyering.net>
5638         * raise.c (raise): Rename from rpl_raise.
5639         Without that change, systems lacking raise (SunOS 4) would not be
5640         able to link programs using raise.  Reported by Volker Borchert.
5642         * ftw.c (FTW_STAT): Rename from `STAT', to avoid conflict
5643         with STAT definition from <sys/dir.h> on AIX 5.1.
5644         Suggestion from Mike Jetzer and Petter Reinholdtsen.
5646         * fchown-stub.c (fchown): Put function type on its own line.
5647         * readlink-stub.c (readlink): Likewise.
5648         * lstat-stub.c (lstat): Likewise.
5650 2003-03-14  Jim Meyering  <jim@meyering.net>
5652         * Makefile.am (AUTOMAKE_OPTIONS): Remove definition --
5653         before it pointed to ../src/ansi2knr.  Some of these files
5654         have required an ANSI (c89) compiler for a year or two.
5655         (libfetish_a_SOURCES): Remove unused files: c-stack.c, c-stack.h.
5657 2003-02-04  Dmitry V. Levin  <ldv@altlinux.org>
5659         * stat.c: Include "xalloc.h".
5661 2003-03-13  Paul Eggert  <eggert@twinsun.com>
5663         Merge changes from Bison.
5664         * obstack.h: (__INT_TO_PTR) [__STDC__]: Cast result to
5665         (void *) to avoid diagnostic with native c89 on SGI IRIX 6.5
5666         when compiling Bison 1.875's `bitset bset = obstack_alloc
5667         (bobstack, bytes);'.  Problem reported by Nelson H. F. Beebe.
5669 2003-01-30  Richard Dawe  <rich@phekda.freeserve.co.uk>
5671         * fchown-stub.c: New file: trivial stub for fchown.
5672         * lstat-stub.c: New file: trivial stub for lstat.
5673         * readlink-stub.c: New file: trivial stub for readlink.
5675 2003-03-09  Paul Eggert  <eggert@twinsun.com>
5677         * argmatch.c (EXIT_FAILURE): Define if the system doesn't.
5678         Reported by Bruce Becker; see:
5679         http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00017.html
5681 2003-03-03  Paul Eggert  <eggert@twinsun.com>
5682             Bruno Haible  <bruno@clisp.org>
5684         * mbswidth.h: Include <wchar.h>. Needed for UnixWare 7.1.1.
5685         Reported by John Hughes, see
5686         http://mail.gnu.org/archive/html/bug-bison/2003-02/msg00030.html
5688 2003-03-09  Jim Meyering  <jim@meyering.net>
5690         * ftw.c: Include "save-cwd.h".
5691         (ftw_startup): Avoid use of getcwd, if possible.
5692         Instead, use fopen/fchdir via save_cwd/restore_cwd.
5694 2003-03-08  Jim Meyering  <jim@meyering.net>
5696         * xnanosleep.c: Don't use `defined' in a #define directive.
5698 2003-03-07  Jim Meyering  <jim@meyering.net>
5700         * Makefile.am (libfetish_a_SOURCES): Remove mmap-stack.h.
5702         * mmap-stack.c, mmap-stack.h: Remove files.
5704         * getcwd.c: #undef getcwd only after *all* included header files.
5705         Declare getcwd unconditionally.  The problem was that same.h
5706         included config.h, and that defined getcwd to rpl_getcwd a second
5707         time (after the original #undef), and led to the rpl_getcwd
5708         function calling itself endlessly.  This was the cause of at least
5709         the `du' test failures on IRIX 6.5, reported by Nelson Beebe.
5711         * same.h (same_name): Remove unnecessary inclusion of config.h.
5712         It also happened to lead to infinite recursion in getcwd.c.
5713         (PARAMS): Remove definition and use.
5715 2003-03-06  Jim Meyering  <jim@meyering.net>
5717         * ftw.c (ftw_startup): Declare `func' parameter to be of type
5718         NFTW_FUNC_T, not void* which may be smaller on 64-bit systems.
5719         Remove now-unnecessary cast.
5720         (FTW_NAME): Cast func argument to type `NFTW_FUNC_T'.
5722 2003-03-05  Jim Meyering  <jim@meyering.net>
5724         * physmem.c (ARRAY_SIZE): Define it.
5726 2003-03-04  Jim Meyering  <jim@meyering.net>
5728         * makepath.c (CLEANUP_CWD): Call error here, now that restore_cwd
5729         no longer does it.
5731         * save-cwd.h (restore_cwd): Update prototype.
5732         * save-cwd.c (restore_cwd): Remove two parameters.
5733         Simplify.  Don't call error upon failure.  Let callers do that.
5734         (save_cwd): Mention that Irix 5.3 has the same problem as SunOS 4
5735         when auditing is enabled.  But don't bother updating the #if.
5737         * xgetcwd.c (xgetcwd): Improve comment.
5739         * getcwd.c: New file.
5741 2003-02-28  Jim Meyering  <jim@meyering.net>
5743         * ftw.c (ftw_startup): Return -1 if alloca fails.
5745 2003-02-28  Jim Meyering  <jim@meyering.net>
5747         * fts.c (fts_children): If opening `.' fails, set the fts_child
5748         member to NULL before returning.  From NetBSD.
5750         * fts.c (fts_children): If fchdir fails, close file descriptor
5751         before returning.  From NetBSD.
5753 2003-02-27  Jim Meyering  <jim@meyering.net>
5755         * physmem.c (physmem_total, physmem_available): Add comments.
5756         From Kaveh Ghazi.
5758         * physmem.c: Merge in portability changes from gcc/libiberty
5759         to support AIX, Tru64, and Windows.  See the ChangeLog there
5760         for credits and details.  Thanks to Kaveh Ghazi for helping
5761         to keep these files in sync.
5763 2003-02-24  Jim Meyering  <jim@meyering.net>
5765         * fts_.h [__USE_FILE_OFFSET64]: Remove #error directive.
5767         (fts_open): Initialize local, tmp, to pacify gcc.
5769         * fts_.h [struct FTS] (fts_dir_signatures): New, opaque member.
5770         * fts.c: Include <search.h>.
5771         (struct known_object): Define.
5772         (object_compare, add_object, find_object): New functions, like
5773         those in ftw.c.
5774         (fts_open): Initialize new member.
5775         (fts_close): Free memory allocated for new member.
5776         (fts_stat): Detect a cycle in O(logN) time per directory processed.
5778         * fts.c [HAVE_CONFIG_H]: Include <config.h>.
5779         Conditionalize inclusion of <sys/param.h>.
5780         Conditionalize inclusion of <include/sys/stat.h> vs <sys/stat.h>.
5781         Include autoconf-recommended block of dirent/NAMELEN-related
5782         definitions and includes.  Use NAMLEN throughout, rather than
5783         _D_EXACT_NAMLEN.
5784         [_LIBC] (close, closedir, fchdir, open, opendir): Define.
5785         [_LIBC] (readdir, tdestroy, tfind, tsearch): Define.
5786         Remove `__' prefix from all uses of the above.  This will help
5787         to merge *BSD changes.
5788         [!_LIBC] (internal_function): Define.
5789         [! _LIBC && ! LSTAT_FOLLOWS_SLASHED_SYMLINK]: Define lstat.
5790         (__set_errno): Define if not already defined.
5792         * fts.c: (fts_open): If fts_alloc returns NULL, don't dereference it.
5793         (fts_read): If fts_safe_changedir fails because it is not
5794         able to chdir into a subdirectory, then inform the caller.
5796         * fts.c, fts_.h: New files, directly from glibc.
5798 2003-02-23  Jim Meyering  <jim@meyering.net>
5800         * fts_.h (struct _ftsent) [fts_level]: Change type from short to int,
5801         so it can handle a root-relative file name longer than 32K bytes.
5802         [fts_pathlen, fts_namelen]: Rearrange members to decrease size of
5803         this struct from 84 to 80 bytes.
5805 2003-02-21  Jim Meyering  <jim@meyering.net>
5807         * mmap-stack.h: Undefine HAVE_MMAP_STACK, thus disabling
5808         this code on all systems.
5810         Merge in some changes from GNU libc.
5811         * md5.h (md5_uintptr): Define.
5813         * ftw.c: Include <sys/types.h> before <dirent.h>.
5814         This is required for Apple Darwin 6.3 (MacOS 10.2.3).
5815         Patch by Nelson Beebe.
5817 2003-02-19  Jim Meyering  <jim@meyering.net>
5819         * md5.c: Merge in some clean-up and optimization changes from glibc.
5820         * sha.c: Apply those same changes here, too.
5822 2003-02-18  Jim Meyering  <jim@meyering.net>
5824         * md5.c (md5_stream) [BLOCKSIZE]: Move definition to top of file.
5825         Ensure that it is a multiple of 64.
5826         Rearrange loop exit tests so as to avoid performing an
5827         additional fread after encountering an error or EOF.
5828         * sha.c (sha_stream): Likewise.
5829         Reported by Michael Bacarella.
5831         * Makefile.am (CLEANFILES): Remove ftw.h and search.h.
5832         (DISTCLEANFILES): Add them here.
5833         Add fnmatch.h, too.
5835         * sha.c (sha_stream): Rearrange loop exit tests so as to avoid
5836         performing an additional fread after encountering an error or EOF.
5838 2003-02-17  Jim Meyering  <jim@meyering.net>
5840         * mmap-stack.h (RUN_WITH_BIG_STACK_4): Define.
5842         * physmem.c: Undo most of last change.
5843         Use sysmp instead, since it provides a cleaner interface.
5844         From Kaveh Ghazi.
5846 2003-02-16  Jim Meyering  <jim@meyering.net>
5848         * Makefile.am (libfetish_a_SOURCES): Add mmap-stack.h.
5850         * mmap-stack.c (MAP_ANONYMOUS): Use MAP_ANON, if possible.
5851         Initialize `fd' to -1, so Solaris' mmap works with MAP_ANON.
5853 2003-02-15  Jim Meyering  <jim@meyering.net>
5855         * mmap-stack.c, mmap-stack.h: New files.
5856         Let the caller run a function with a larger (mmap'd) stack.
5858         Add Irix6 support to physmem.c.
5859         * physmem.c (irix_sysget): New function.
5860         (IRIX_SYSGET_TOTAL, IRIX_SYSGET_AVAILABLE): New macros.
5861         (physmem_total, physmem_available): Use them.
5862         (main) [DEBUG]: New function.
5864 2003-02-11  Jim Meyering  <jim@meyering.net>
5866         * Makefile.am (libfetish_a_SOURCES): Add euidaccess.h.
5867         * euidaccess.c: Include "euidaccess.h".
5868         * euidaccess.h: New file.
5870 2003-02-08  Jim Meyering  <jim@meyering.net>
5872         * ftw.c (ftw_startup): Don't shadow outer declaration of save_err.
5873         Merge inconsequential changes from libc.
5875         * ftw.c (ftw_startup): When using FTW_CHDIR, always remember
5876         the current directory, not just when DIR contains a slash.
5877         Reported by Manoj Srivastava via Michael Stone as Debian bug #180228.
5879 2003-02-07  Jim Meyering  <jim@meyering.net>
5881         Merge inconsequential changes from libc.
5882         * ftw.c: Include limits.h earlier.
5883         Move PATH_MAX definition `down' a little; add comment.
5884         Rename local, saved_errno to save_err.
5886 2003-02-06  Jim Meyering  <jim@meyering.net>
5888         Support for pruning.
5889         * ftw_.h (FTW_DPRE) [enum]: New member and definition.
5890         (struct FTW) [skip]: New member.
5892         * search_.h (__restrict): Define to `restrict' or to nothing.
5894         * fsusage.c: Remove declaration of statfs.
5895         It conflicted with one from OSF/1 5.1 in <sys/mount.h>.
5896         Reported by Nelson Beebe.
5898 2003-02-05  Jim Meyering  <jim@meyering.net>
5900         Fix a heap-corruption bug that affected Solaris systems.
5901         * ftw.c: Include <limits.h>.
5902         (PATH_MAX): Define to 1024, if not already defined.
5903         (process_entry): Allocate enough space to hold the resulting
5904         file name.  Don't presume that 2*dirbufsize is enough.
5905         (ftw_startup): Always use PATH_MAX to compute buffer size, now that
5906         it is guaranteed to be defined.
5907         Nelson Beebe reported that du would sometimes segfault on Solaris.
5909         * ftw.c (process_entry): When using FTW_DEPTH, call `func', the
5910         user-supplied callback, once for the current directory before calling
5911         ftw_dir, in case that part of the hierarchy should be pruned.
5912         `func' does that by setting `data->skip'.
5913         (ftw_startup): Likewise.
5915 2003-02-02  Jim Meyering  <jim@meyering.net>
5917         * ftw.c (lstat) [!_LIBC && !LSTAT_FOLLOWS_SLASHED_SYMLINK]:
5918         Define to rpl_lstat.
5920 2003-01-25  Jim Meyering  <jim@meyering.net>
5922         * ftw.c (ISSLASH, FILESYSTEM_PREFIX_LEN) [_LIBC]: Define.
5923         (base_name): New function.
5924         (ftw_startup): Don't strip trailing slashes.
5925         Use base_name to find the offset of the basename.
5927 2003-01-25  Jim Meyering  <jim@meyering.net>
5929         * ftw.c (object_compare): Compare inode numbers before device numbers.
5930         The former is much more likely to differ for any two given file objects.
5932 2003-01-23  Jim Meyering  <jim@meyering.net>
5934         * tsearch.c [HAVE_CONFIG_H]: Include <config.h>.
5935         Add autoconf-recommended block of alloca-related code.
5936         Cast each use of alloca to the required type, (node**).
5938         * ftw.c: Add autoconf-recommended block of alloca-related code.
5939         [!_LIBC] (__getcwd): Define to xgetcwd and declare xgetcwd.
5941 2003-01-22  Jim Meyering  <jim@meyering.net>
5943         * ftw.c (find_object): Don't use c99-style struct initializer.
5945         * ftw_.h: Change all uses of __const to const.
5946         * search_.h: Likewise.
5948         * Makefile.am (CLEANFILES): Add generated files: ftw.h search.h.
5950         * ftw.c (process_entry): Handle FTW_DCHP.
5951         (ftw_dir): Handle FTW_DCH.
5953         * ftw_.h [!_LIBC && !__USE_XOPEN_EXTENDED]: Define __USE_XOPEN_EXTENDED
5954         and FTW_H_STANDALONE.
5955         [anon enum] (FTW_DCH, FTW_DCHP): New members.
5956         (FTW_DCH, FTW_DCHP): Define.
5958         * ftw.c: Include autoconf-recommended block of dirent/NAMELEN
5959         related definitions and includes.  Use NAMELEN throughout,
5960         rather than _D_EXACT_NAMLEN.
5961         [_LIBC]: Define NAMELEN to _D_EXACT_NAMLEN.
5962         (stpcpy): Declare, if necessary.
5963         (mempcpy): Define, if necessary.
5964         [!_LIBC] (__stpcpy, __mempcpy): Define.
5965         [!_LIBC] (LXSTAT, XSTAT): Define.
5967 2003-01-21  Jim Meyering  <jim@meyering.net>
5969         * tsearch.c: New file, from GNU libc.
5970         [! weak_alias]: Define __-prefixed names to publicized ones.
5971         [! defined _LIBC] (weak_alias, internal_function): Define-away.
5972         [defined weak_alias]: Guard each use of weak_alias.
5974 2003-01-20  Jim Meyering  <jim@meyering.net>
5976         * canonicalize.c: Include "path-concat.h".
5978         * search_.h: New file, from GNU libc.
5980         * Makefile.am (libfetish_a_SOURCES): Use ftw_.h here, too.
5981         (libfetish_a_SOURCES): Add search_.h.
5982         * ftw_.h: Rename from ftw.h.
5984         * obstack.h (obstack_object_size): Declare temporary, __o,
5985         to be const, in order to avoid warnings.
5986         (obstack_room): Likewise.
5987         (obstack_empty_p): Likewise.
5989         Merge in changes from GNU libc
5990         * error.c: Eliminate many `#ifdef USE_IN_LIBIO' conditionals.
5992 2003-01-19  Ulrich Drepper  <drepper@redhat.com>
5994         From GNU libc.
5995         * strftime.c (my_strftime): Handle very large width
5996         specifications for numeric values correctly.  Improve checks for
5997         overflow.
5999 2003-01-19  Jim Meyering  <jim@meyering.net>
6001         * strftime.c (widen) [COMPILE_WIDE]: Merge nearly-identical definitions.
6002         (nl_get_alt_digit) [! defined my_strftime]: Define.
6003         (my_strftime) [_NL_CURRENT]: Merge nearly-identical uses of
6004         _nl_get_alt_digit and _nl_get_walt_digit.
6006         * strftime.c (my_strftime): Merge in locale-related changes from libc.
6007         These changes have no effect outside of _LIBC.
6009 2003-01-14  Jim Meyering  <jim@meyering.net>
6011         * same.c (same_name): Declare *_basename locals to be `const'.
6012         Consolidate declarations and initializations of *_base* locals.
6014 2003-01-11  Bruno Haible  <bruno@clisp.org>
6016         * same.c (same_name): Reorder tests so as to avoid calling stat()
6017         when a string comparison is sufficient.
6019 2003-01-11  Bruno Haible  <bruno@clisp.org>
6021         * readtokens.c (readtoken): Cast character to 'unsigned char', not
6022         'unsigned int'.
6024 2003-01-14  Jim Meyering  <jim@meyering.net>
6026         * ftw.c: Merge in Ulrich's and my changes from libc.
6028 2003-01-12  Jim Meyering  <jim@meyering.net>
6030         * ftw.c (ftw_startup): Rename local-shadowing local to pacify gcc.
6031         Also work on systems that have `struct direct', using autoconf's
6032         AC_HEADER_DIRENT.
6033         Tweak comments.
6035         * ftw.h, ftw.c: New files, from glibc/io.
6037         * Makefile.am (libfetish_a_SOURCES): Add ftw.h.
6039 2003-01-11  Jim Meyering  <jim@meyering.net>
6041         * makepath.c: Don't test HAVE_ERRNO_H.  It's not necessary.
6043         * canonicalize.c: Don't test HAVE_ERRNO_H.  It's not necessary.
6044         Don't test HAVE_STDDEF_H.  It's not necessary.
6045         Use definition of PTR_INT_TYPE from obstack.h.
6047 2002-12-01  Dmitry V. Levin  <ldv@altlinux.org>
6049         * canonicalize.c: New file.
6050         The readlink-based implementation imported from GNU C Library.
6051         The resolveip-based implementation imported from src/df.c (show_point).
6052         * canonicalize.h: New file.
6053         * Makefile.am (libfetish_a_SOURCES): Add canonicalize.h.
6055 2003-01-10  Jim Meyering  <jim@meyering.net>
6057         * save-cwd.h: Remove uses of PARAMS.
6059 2002-11-30  Dmitry V. Levin  <ldv@altlinux.org>
6061         * xgetcwd.h: New file.
6062         * Makefile.am (libfetish_a_SOURCES): Add xgetcwd.h.
6063         * save-cwd.c: Include "xgetcwd.h".
6064         * xgetcwd.c: Likewise.
6066 2002-11-30  Dmitry V. Levin  <ldv@altlinux.org>
6068         * getgroups.c: Don't declare functions declared by xalloc.h.
6069         Include "xalloc.h" instead.
6070         * group-member.c: Likewise.
6071         * idcache.c: Likewise.
6072         * readutmp.c: Likewise.
6074 2003-01-08  Jim Meyering  <jim@meyering.net>
6076         * full-write.c: Undefine and define-away `const' after inclusion
6077         of errno.h, not before.  Suggestion from Bruno Haible.
6079 2003-01-06  Jim Meyering  <jim@meyering.net>
6081         * full-write.c: Rework so that it may serve to define full_read, too.
6082         * full-read.c: Simply #define FULL_READ and include full-write.c.
6084         * Makefile.am (libfetish_a_SOURCES): Add full-read.c and full-read.h.
6085         * full-read.c, full-read.h: New files.
6087         Update from gnulib.
6089         2002-12-10  Paul Eggert  <eggert@twinsun.com>
6090         Port exclude.c and exclude.h to more non-GNU systems, e.g. Solaris 7.
6091         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE, EXCLUDE_WILDCARDS):
6092         Choose values that are less likely to collide with system fnmatch
6093         options.
6094         * exclude.c (FNM_CASEFOLD, FNM_LEADING_DIR): Define to 0 if not
6095         defined (e.g., a pure POSIX system).
6096         (EXCLUDE_macros_do_not_collide_with_FNM_macros): Use FNM_PATHNAME
6097         instead of FNM_FILE_NAME, for compatibility with pure POSIX systems.
6099         Update from gnulib.
6101         * utime.c (utime_null): Use SAFE_READ_ERROR.
6102         (utime_null): No need to call ftruncate if the file was nonempty.
6103         * getdate.y (get_date): Test HAVE_STRUCT_TM_TM_ZONE, not HAVE_TM_ZONE.
6104         * canon-host.c (strdup): Remove unused declaration.
6105         * fsusage.c: Include full_read.h.
6106         (get_fs_usage): Use full_read instead of safe_read.
6107         Patches by Bruno Haible.
6109 2003-01-04  Jim Meyering  <jim@meyering.net>
6111         * version-etc.c: Update copyright date.
6113 2002-12-31  Jim Meyering  <meyering@lucent.com>
6115         * dev-ino.h: New file.
6116         * cycle-check.c: New file.
6117         * cycle-check.h: New file.
6118         * Makefile.am (libfetish_a_SOURCES): Add cycle-check.c, cycle-check.h,
6119         and dev-ino.h.
6121 2002-12-21  Jim Meyering  <jim@meyering.net>
6123         * stime.c: Remove file (for real, this time).
6125 2002-12-15  Jim Meyering  <jim@meyering.net>
6127         * strftime.h: New file, for declaration of nstrftime.
6128         * Makefile.am (libfetish_a_SOURCES): Add strftime.h.
6130 2002-12-09  Jim Meyering  <jim@meyering.net>
6132         * unlocked-io.h: Sync from gnulib.
6134 2002-12-06  Jim Meyering  <jim@meyering.net>
6136         * unlocked-io.h: New file, but with proper copyright notice and
6137         attribution.  Note: this is *not* the same as the file in gnulib.
6138         This uses #if HAVE_FUNC_UNLOCKED for each `FUNC', rather than
6139         HAVE_DECL_FUNC_UNLOCKED.  This usage is consistent with the autoconf
6140         macro in ../m4/jm-glibc-io.m4.  Modulo comments, this file still
6141         contains exactly what was generated by gen-uio.
6143 2002-12-04  Paul Eggert  <eggert@twinsun.com>
6145         Do not generate unlocked-io.h automatically, since it's easier to
6146         maintain it by hand.
6148         * gen-uio: Remove.
6149         * Makefile.am: Add copyright notice.
6150         (libfetish_a_SOURCES): Add unlocked-io.h.
6151         (BUILT_SOURCES, all-local): Remove unlocked-io.h.
6152         (DISTCLEANFILES, io_functions): Remove macros.
6153         (EXTRA_DIST): Remove gen_uio.
6154         (unlocked-io.h): Remove rule.
6156 2002-12-05  Paul Eggert  <eggert@twinsun.com>
6158         * alloca.c [defined emacs]: Include "lisp.h".
6159         (xalloc_die) [defined emacs]: New macro.
6160         (free) [defined emacs && defined EMACS_FREE]: Define to EMACS_FREE.
6161         [! defined emacs]: Include <xalloc.h>.
6162         (POINTER_TYPE) [!defined POINTER_TYPE]: New macro.
6163         (pointer): Typedef to POINTER_TYPE *.
6164         (malloc): Remove decl; we now always use xmalloc.
6165         (alloca): Use old-style definition, since Emacs needs this.
6166         Check for arithmetic overflow when computing combined size.
6168 2002-12-04  Jim Meyering  <jim@meyering.net>
6170         Reflect the fact that stat.c and lstat.c are no longer generated.
6171         * Makefile.am (BUILT_SOURCES): Remove stat.c and lstat.c.
6172         (DISTCLEANFILES): Likewise.
6173         (EXTRA_DIST): Likewise.
6174         (all_local): Don't depend on stat.c or lstat.c.
6175         (stat.c, lstat.c): Remove rules.
6176         (EXTRA_DIST): Remove xstat.in.
6178         * xstat.in: Remove file.  Contents moved into stat.c.
6179         * stat.c: Rework so that it may serve to define rpl_lstat, too.
6180         * lstat.c: Simply #define LSTAT and include stat.c.
6182         * safe-read.c: Rework so that it may serve to define safe_write, too.
6183         * safe-write.c: Simply #define SAFE_WRITE and include safe-read.c.
6185 2002-12-03  Jim Meyering  <jim@meyering.net>
6187         * safe-read.h: Update from gnulib (add comments, include stddef.h).
6189 2002-12-02  Jim Meyering  <jim@meyering.net>
6191         * safe-read.c (EINTR): Define.
6192         (safe_read): Rewrite to iterate IFF the read fails with EINTR.
6194 2002-12-01  Jim Meyering  <jim@meyering.net>
6196         * safe-read.c: Merge from gnulib.
6197         (safe_read): Also exit the loop when read returns zero.
6198         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX): Define.
6200         * Makefile.am (libfetish_a_SOURCES): Add safe-write.c and safe-write.h.
6202         * strtoll.c: Update from gnulib (trivial changes).
6203         * strdup.c: Likewise.
6204         * strpbrk.c: Likewise.
6205         * strstr.c: Likewise.
6206         * tempname.c: Likewise.
6207         * obstack.c: Likewise.
6208         * getopt.c: Likewise.
6209         * getopt1.c: Likewise.
6210         * getopt.h: Likewise.
6211         * quote.h: Update from gnulib: add Copyright comment.
6212         * quote.c: Likewise.
6214 2002-11-28  Jim Meyering  <jim@meyering.net>
6216         * mktime.c: Merge from gnulib/libc, for a slightly uglier solution.
6218         Merge some more, in preparation for merge back into libc.
6219         * error.c (_): Define only if not already defined.
6220         Move definition to follow all #include directives.
6221         Include unlocked-io.h only if !_LIBC.
6223         Merge in changes from libc.
6224         * error.c [_LIBC]: Include <libio/libioP.h>.
6225         [USE_IN_LIBIO]: Include <libio/iolibio.h>
6226         (fflush): Tweak definition to use INTUSE.
6227         (putc): Define.
6229 2002-11-23  Jim Meyering  <jim@meyering.net>
6231         From gnulib, by Bruno Haible
6232         * closeout.c: Include gettext.h instead of <libintl.h>.
6233         * makepath.c: Likewise.
6234         * rpmatch.c: Likewise.
6235         * userspec.c: Likewise.
6236         * version-etc.c: Likewise.
6237         * xmemcoll.c: Likewise.
6238         * error.c [!_LIBC]: Include gettext.h instead of <libintl.h>.
6240         * mbswidth.h: Update from gnulib.
6241         * mbswidth.c: Likewise.
6242         * localcharset.c: Likewise.
6243         * config.charset: Likewise.
6244         * unicodeio.c: Likewise.
6246 2002-11-22  Paul Eggert  <eggert@twinsun.com>
6248         * quotearg.h: Allow multiple inclusion by surrounding with
6249         "#ifndef QUOTEARG_H_".  Include <stddef.h>, for size_t,
6250         so that we can be included first.
6251         (PARAMS): Remove; we now assume C89 or later.  All uses removed.
6252         * quotearg.c: Include quotearg.h immediately after config.h.
6253         No need to include stddef.h or sys/types.h any more.
6254         Surround local include files with "", not "<>".
6255         Assume HAVE_LIMITS_H unconditionally, as we assume C89.
6256         Similarly, assume HAVE_C_BACKSLASH_A, CHAR_BIT, UCHAR_MAX, UINT_MAX,
6257         HAVE_STDLIB_H, HAVE_STRING_H, STDC_HEADERS.
6258         (HAVE_MBSINIT): Undef if !HAVE_MBRTOWC.
6259         (mbsinit): Define to 1 if !defined mbsinit && !HAVE_MBSINIT.
6260         (ISPRINT): Remove; no longer needed now that we assume C89.
6262         (clone_quoting_options, quotearg_buffer, quotearg_n_options):
6263         Preserve errno.
6265         (quotearg_buffer_restyled, quotearg_n, quotearg_n_style,
6266         quotearg_char): Use SIZE_MAX rather than
6267         (size_t) -1 when we are talking about "infinity".
6269         (quotearg_buffer_restyled): Fix bug when quoting trigraphs.
6271 2002-11-22  Jim Meyering  <jim@meyering.net>
6273         From gnulib.
6274         * strstr.c: Don't include <sys/types.h>.  It's unnecessary.
6276 2002-11-21  Bruno Haible  <bruno@clisp.org>
6278         Remove case insensitive option matching.
6279         * argmatch.h (argcasematch): Remove declaration.
6280         (ARGCASEMATCH): Remove macro.
6281         (__xargmatch_internal): Remove case_sensitive argument.
6282         (XARGMATCH): Update.
6283         (XARGCASEMATCH): Remove macro.
6284         * argmatch.c (argmatch): Renamed from __argmatch_internal. Remove
6285         case_sensitive argument.
6286         (argcasematch): Remove function.
6287         (__xargmatch_internal): Remove case_sensitive argument.
6288         (main): Use XARGMATCH instead of XARGCASEMATCH.
6290         * argmatch.c: Include gettext.h instead of <locale.h> and <libintl.h>.
6292 2002-11-21  Bruno Haible  <bruno@clisp.org>
6294         * xmalloc.c: Change compile-time error message. Add comment about
6295         required autoconf version.
6296         * xmalloc.c: Include gettext.h instead of <libintl.h>.
6297         (textdomain): Remove definition.
6299 2002-11-21  Jim Meyering  <jim@meyering.net>
6301         * strdup.c (strdup): Merge in changes from gnulib; mainly to
6302         use memcpy rather than strcpy.
6304         * strcspn.c: Update from gnulib.
6306         * sig2str.c (str2signum): Use unsigned, not size_t, for type of index.
6308         * quotearg.c: Use `"'s when including quotearg.h and xalloc.h,
6309         not the `<...>' notation.
6310         Include <errno.h> and declare errno if necessary.
6312         * README: Update from gnulib.
6314 2002-11-20  Paul Eggert  <eggert@twinsun.com>
6316         Merge argmatch cleanups from Bison.  Assume C89.
6318         * argmatch.c: Include config.h here, not in argmatch.h.
6319         Include stdlib.h, for EXIT_FAILURE.
6320         Always include <string.h>, since we assume C89.
6321         (EXIT_FAILURE): Remove pre-C89 bug workaround.
6322         * argmatch.h: Do not include <config.h> or <sys/types.h>.
6323         Include <stddef.h> instead, since it's all we need for size_t.
6324         (PARAMS): Remove.  All uses removed.
6325         (ARRAY_CARDINALITY): Do not bother to #undef.
6326         (ARRAY_CARDINALITY, ARGMATCH, ARGCASEMATCH, invalid_arg,
6327         ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6328         Remove unnecessary parentheses.
6329         (ARGMATCH_VALID, XARGMATCH, XARGCASEMATCH):
6330         Insert necessary parentheses.
6331         (ARGMATCH_CONSTRAINT, ARGMATCH_VERIFY): New macros.
6332         (ARGMATCH_ASSERT): Use ARGMATCH_CONSTRAINT.
6334 2002-11-19  Jim Meyering  <jim@meyering.net>
6336         Be careful not to clobber errno.
6337         * quotearg.c (quotearg_buffer_restyled): If mbrtowc returns
6338         `(size_t) -1' (at which point it would also set errno to EILSEQ),
6339         then restore errno to its previous value.
6340         Reported by Phillip Jones via Tim Waugh as
6341         https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=76334.
6343         Avoid a link-time failure on some Linux systems.
6344         * mktime.c (STATIC): Define to be empty (_LIBC) or `static' (otherwise).
6345         (__mon_yday): Declare with the STATIC attribute.
6346         (__mktime_internal): Likewise.
6347         Based on a report from Greg Schafer.
6349 2002-11-14  Jim Meyering  <jim@meyering.net>
6351         * long-options.c: Don't include libintl.h, and don't define `_' --
6352         they're not used.
6353         * same.c: Likewise.
6355 2002-11-10  Jim Meyering  <jim@meyering.net>
6357         * raise.c: New file.
6359 2002-11-08  Paul Eggert  <eggert@twinsun.com>
6361         * human.c (human_readable): Revamp to avoid warning about unused
6362         variable 'amt'.  Unfortunately this means using some gotos.
6364 2002-11-08  Jim Meyering  <jim@meyering.net>
6366         * human.c (human_readable): Avoid warnings from gcc -Wshadow.
6368 2002-11-06  Jim Meyering  <jim@meyering.net>
6370         * Makefile.am (EXTRA_DIST): Add inttostr.h.
6372 2002-10-07  Paul Eggert  <eggert@twinsun.com>
6374         * Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
6375         umaxtostr.c.
6376         (EXTRA_DIST): Add inttostr.c.
6377         * inttostr.c, inttostr.h, imaxtostr.c, offtostr.c, umaxtostr.c:
6378         New files, taken from GNU tar.
6380         * human.c, human.h: Rewrite to support locale-specific
6381         notations like thousands separators.
6382         Specify what includer of include.h must include beforehand.
6383         (human_group_digits, human_suppress_point_zero, human_autoscale,
6384         human_base_1024, human_SI, human_B): New enum values.
6385         (human_readable): Rename from human_readable_inexact; put the
6386         options before the sizes.  All uses changed.  The old human_readable
6387         function has been removed; use inttostr.h instead.
6388         (human_options): Renamed from human_block_size, with new signature
6389         that allows block sizes up to UINTMAX_MAX.  All callers changed.
6391 2002-10-13  Jim Meyering  <jim@meyering.net>
6393         * xnanosleep.c (initialized): Remove declaration now that it's unused.
6395 2002-10-12  Paul Eggert  <eggert@twinsun.com>
6397         * xnanosleep.c: There's no need to futz with the rounding mode,
6398         since the code should work properly even in the default rounding mode.
6399         (<fenv.h>): Do not include.
6400         (#pragma STDC FENV_ACCESS ON): Remove.
6401         (xnanosleep): Don't futz with rounding state.
6403 2002-10-06  Jim Meyering  <jim@meyering.net>
6405         * safe-read.c (safe_read): Change type of function
6406         from ssize_t to size_t.
6407         * safe-read.h: Update prototype.
6408         (SAFE_READ_ERROR): Define.
6410 2002-09-28  Jim Meyering  <jim@meyering.net>
6412         * makepath.c (make_path): Restore umask *before* creating the final
6413         component.
6415 2002-09-25  Paul Eggert  <eggert@twinsun.com>
6417         * fsusage.c [! HAVE_INTTYPES_H && HAVE_STDINT_H] Include <stdint.h>.
6418         (UINTMAX_MAX) [!defined UINTMAX_MAX]: New macro.
6419         (PROPAGATE_ALL_ONES): Work even if X is unsigned and narrower than
6420         int.  Work more efficiently if X is the same width as uintmax_t.
6421         Do not compare X to -1, to avoid bogus compiler warning.
6422         (get_fs_usage): (uintmax_t) -1 -> UINTMAX_MAX to avoid a cast.
6423         Don't assume that f_frsize and f_bsize are the same type.
6425 2002-09-25  Jim Meyering  <jim@meyering.net>
6427         * fsusage.c: Remove unneeded parentheses around operands of `defined'.
6429         * safe-read.c (safe_read): Make comment more precise:
6430         upon error, it returns -1.
6432 2002-09-22  Jim Meyering  <jim@meyering.net>
6434         * makepath.c (make_path): Minor reformatting.
6436 2002-09-14  Paul Eggert  <eggert@twinsun.com>
6438         * xnanosleep (xnanosleep): Return -1 on failure, not 1,
6439         for consistency with nanosleep.  Check errno after nanosleep
6440         returns -1.
6442 2002-09-11  Jim Meyering  <jim@meyering.net>
6444         * xnanosleep.c, xnanosleep.h: New files, factored out of sleep.c.
6445         * Makefile.am (libfetish_a_SOURCES): Add them.
6447 2002-09-04  Jim Meyering  <jim@meyering.net>
6449         * addext.c (addext): Add a cast to avoid gcc's warning about
6450         `comparison between signed and unsigned'.
6452         * sig2str.c (str2signum, sig2str): Declare loop index variables to be
6453         of type size_t so that they match type of upper bound, thus avoiding
6454         warning about `comparison between signed and unsigned'.
6456 2002-08-31  Jim Meyering  <jim@meyering.net>
6458         * mktime.c: Update from GNU libc.
6459         * obstack.c: Likewise.
6460         * getopt.c: Likewise.
6461         * getopt1.c: Likewise.
6463 2002-08-05  Paul Eggert  <eggert@twinsun.com>
6465         Fix some minor time-related bugs with POSIX time arguments.
6466         Some valid time stamps were being rejected (notably -1, and
6467         time stamps before 1900 on 64-bit hosts).  And some invalid
6468         time stamps were being accepted, e.g. September 31.
6470         * posixtm.h (posixtime): Return bool instead of time_t, so
6471         that we can return (time_t) -1 successfully.
6472         * posixtm.c: Likewise.
6473         [HAVE_STDBOOL_H]: Include <stdbool.h>.
6474         (bool, false, true) [!HAVE_STDBOOL_H]: New type.
6475         (t): Remove static var.
6476         (year, posix_time_parse): Now takes struct tm * arg to modify, instead
6477         of static var.  All uses changed.
6478         (year): Do not reject years before 1900; they can occur with
6479         64-bit time_t.
6480         (posix_time_parse): Do not check for out-of-range components;
6481         that is now the caller's responsibility, since our checks were
6482         only approximations.
6483         (posixtime): Use mktime to check for out-of-range components,
6484         since it knows them exactly.
6485         If mktime returns (time_t) -1, check whether an error actually occurred
6486         by invoking localtime on -1.
6487         (main) [TEST_POSIXTIME]: Check for input data errors, and report
6488         posixtime failures better.
6489         Improve the test data (in comments only).
6491 2002-07-27  Jim Meyering  <jim@meyering.net>
6493         * readutmp.h: If we have both utmpx.h and utmp.h, and there exists
6494         the utmp.ut_exit member, but not the utmpx.ut_exit member, then
6495         undefine HAVE_UTMPX_H.  For AIX 4.3.3.  Doing all this in cpp is
6496         a big kludge; someday we'll put the brains in an autoconf macro.
6497         (UT_EXIT_E_TERMINATION, UT_EXIT_E_EXIT): Define.
6499 2002-07-20  Jim Meyering  <jim@meyering.net>
6501         * xmalloc.c: Adjust to work with new autoconf macros, AC_FUNC_MALLOC
6502         and AC_FUNC_REALLOC: test #ifndef HAVE_MALLOC/HAVE_REALLOC.
6504         * gettext.h: Upgrade to gettext-0.11.3.
6506 2002-07-13  Bruno Haible  <bruno@clisp.org>
6508         * xstat.in: Include <string.h>.
6509         * mountlist.c: #undef MNT_IGNORE before defining it, to avoid warning
6510         on FreeBSD.
6512 2002-07-09  Jim Meyering  <jim@meyering.net>
6514         * mountlist.h (ME_DUMMY): Don't count entries of type `auto' as dummy
6515         ones.  At least on GNU/Linux systems, `auto' means something else.
6516         From Michael Stone.
6518 2002-07-01  Jim Meyering  <jim@meyering.net>
6520         * c-stack.c: Include sys/time.h.
6521         From Volker Borchert.
6523 2002-06-11  Paul Eggert  <eggert@twinsun.com>
6525         * fnmatch.c, fnmatch_loop.c (WIDE_CHAR_SUPPORT):
6526         New macro.  Use it uniformly instead of
6527         (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H).
6528         It also uses HAVE_BTOWC, to fix a porting bug on Solaris 2.5.1
6529         reported by Vin Shelton.
6531 2002-06-22  Jim Meyering  <jim@meyering.net>
6533         * fnmatch.c (ISASCII, ISPRINT): Undefine, to avoid warning about
6534         redefinition due to Solaris 2.6's definition in /usr/include/sys/euc.h.
6536 2002-06-22  Paul Eggert  <eggert@twinsun.com>
6538         * c-stack.h (segv_handler, c_stack_action) [! defined SA_SIGINFO]:
6539         Do not assume SA_SIGINFO behavior.
6540         Bug reported by Jim Meyering on NetBSD 1.5.2.
6542 2002-06-22  Jim Meyering  <jim@meyering.net>
6544         * c-stack.c, c-stack.h: New files, from diffutils-2.8.2.
6546         * exitfail.c, exitfail.h: Likewise.
6547         * Makefile.am (libfetish_a_SOURCES): Add exitfail.c and exitfail.h.
6549         * Makefile.am (libfetish_a_SOURCES): Add fnmatch_.h in place
6550         of fnmatch.h.
6551         (EXTRA_DIST): Add fnmatch_loop.c.
6552         (libfetish_a_SOURCES): Add c-stack.c and c-stack.h.
6554         * fnmatch_loop.c: New file, from diffutils-2.8.2.
6555         * fnmatch.c: Update from diffutils-2.8.2.
6556         * fnmatch_.h: New file.  From diffutils-2.8.2.
6557         * fnmatch.h: Remove file.
6559 2002-06-18  Paul Eggert  <eggert@twinsun.com>
6561         * file-type.h: Report an error if neither S_ISREG nor
6562         S_IFREG is defined, instead of using a test specific to glibc
6563         2.2.  This should be safe, since POSIX requires S_ISREG and
6564         Unix Version 7 had S_IFREG.  We don't need to check for
6565         <sys/types.h> since we don't use any symbols that it defines.
6567 2002-06-15  Jim Meyering  <jim@meyering.net>
6569         * file-type.h (FILE_TYPE_H): Guard entire contents with #ifndef.
6570         For GNU libc 2.2 and newer, ensure that <sys/types.h> and <sys/stat.h>
6571         have been included before this file.
6573 2002-06-13  Richard Dawe  <richdawe@bigfoot.com>
6575         * Makefile.am (lstat.c, stat.c, .sin.sed): Use t-$@, rather than $@-t,
6576         so that each temporary file name is unique and valid in the first
6577         8 characters, for operation under DOS.
6579 2002-06-15  Jim Meyering  <jim@meyering.net>
6581         Work even with DJGPP 2.03, which lacks support for symlinks.
6582         From Richard Dawe.
6583         * xstat.in (S_ISLNK): Define to 0 if neither S_ISLNK nor S_IFLNK
6584         is defined.
6585         * lchown.c (S_ISLNK): Likewise.
6587 2002-06-14  Jim Meyering  <jim@meyering.net>
6589         * file-type.h: Use the version from diffutils-2.8.2.
6590         * file-type.c: Likewise.
6592 2002-05-27  Jim Meyering  <jim@meyering.net>
6594         Fix a problem seen only on nonconforming systems whereby ls.c's
6595         use of localtime, and then of gettimeofday would cause trouble:
6596         the localtime call used to initialize rpl_gettimeofday's save
6597         mechanism would clobber ls's current local time information so
6598         that in any long listing the first file would always be listed
6599         with date 1970-01-01.  Analysis by Volker Borchert.
6601         * gettimeofday.c (localtime): Undefine.
6602         (rpl_localtime): New function.
6604 2002-05-22  Jim Meyering  <jim@meyering.net>
6606         * Makefile.am (libfetish_a_SOURCES): Add file-type.c and file-type.h.
6607         * file-type.h: New file.
6608         * file-type.c (file_type): New file/function.  Extracted from diffutils.
6610 2002-04-29  Paul Eggert  <eggert@twinsun.com>
6612         * hard-locale.c: Upgrade to version used in GNU Diffutils 2.8.1.
6614 2002-04-28  Paul Eggert  <eggert@twinsun.com>
6616         * sig2str.h (SIGNUM_BOUND): Do not use WTERMSIG, to avoid
6617         depending on <sys/wait.h> and WTERMSIG.  Default to 64 instead
6618         of 127, since 64 is the largest conceivable number for ancient
6619         nonstandard hosts.
6620         * sig2str.c: Do not include <sys/wait.h>; no longer needed.
6622 2002-04-28  Jim Meyering  <jim@meyering.net>
6624         * sig2str.c (WTERMSIG): Remove definition (unused).
6626 2002-04-28  Paul Eggert  <eggert@twinsun.com>
6628         * sig2str.h, sig2str.c: New files.
6629         * Makefile.am (libfetish_a_SOURCES): Add sig2str.h.
6631 2002-04-24  Jim Meyering  <jim@meyering.net>
6633         * gettext.h: New file, from Gettext.
6634         * Makefile.am (INCLUDES): Remove -I../intl.
6635         (libfetish_a_SOURCES): Add gettext.h.
6637 2002-04-16  Jim Meyering  <jim@meyering.net>
6639         * readutmp.h (UT_TYPE): Remove definition (now in who.c).
6640         (HAVE_STRUCT_XTMP_UT_EXIT, HAVE_STRUCT_XTMP_UT_ID): Define.
6641         (HAVE_STRUCT_XTMP_UT_PID, HAVE_STRUCT_XTMP_UT_TYPE): Define.
6643 2002-04-12  Jim Meyering  <jim@meyering.net>
6645         * dirfd.h (dirfd): Elide prototype if dirfd is a macro.
6647 2002-03-10  Jim Meyering  <jim@meyering.net>
6649         * makepath.c (make_path): Remove a comma from a diagnostic.
6650         Suggestion from Santiago Vila.
6652 2002-03-08  Jim Meyering  <jim@meyering.net>
6654         * rename.c: Mention that this wrapper is needed also on
6655         mips-dec-ultrix4.4 systems.
6657 2002-03-02  Jim Meyering  <jim@meyering.net>
6659         * gettime.c (gettime): Test HAVE_CLOCK_GETTIME,
6660         not HAVE_CLOCK_SETTIME.
6662 2002-02-27  Paul Eggert  <eggert@twinsun.com>
6664         * nanosleep.h: Rename to....
6665         * timespec.h: New name for nanosleep.h.  All uses changed.
6667         * gettime.c: New file.
6668         * settime.c: New file.
6669         * stime.c: Remove.
6671         * Makefile.am (libfetish_a_SOURCES): Add gettime.c, settime.c,
6672         timespec.h.  Remove nanosleep.h.
6674 2002-02-25  Paul Eggert  <eggert@twinsun.com>
6676         * acl.c, acl.h: New files.
6677         * Makefile.am (libfetish_a_SOURCES): Add acl.h, acl.c.
6679 2002-02-24  Jim Meyering  <jim@meyering.net>
6681         * strnlen.c (strnlen): Define-away/undef so that an inconsistent
6682         prototype in string.h (on at least AIX4.3.2.0 w/gcc-2.95.3) doesn't
6683         cause trouble.  Reported by Nelson Beebe.
6685 2002-02-23  Paul Eggert  <eggert@twinsun.com>
6687         * path-concat.c (xpath_concat): Reorder code to pacify
6688         compilers that don't know that xalloc_die never returns.
6690 2002-02-20  Jim Meyering  <jim@meyering.net>
6692         * getdate.c: Regenerate using bison-1.33.
6694 2002-02-15  Paul Eggert  <eggert@twinsun.com>
6696         * posixver.c, posixver.h: New files.
6697         * Makefile.am (libfetish_a_SOURCES): Add them.
6699 2002-02-02  Paul Eggert  <eggert@twinsun.com>
6700             Bruno Haible  <bruno@clisp.org>
6702         * unicodeio.h (print_unicode_char): Add exit_on_error argument.
6703         (fwrite_success_callback): New declaration.
6704         * unicodeio.c (unicode_to_mb): New function, extracted from
6705         print_unicode_char. Call failure callback instead of error.
6706         (fwrite_success_callback): New function.
6707         (exit_failure_callback): New function.
6708         (fallback_failure_callback): New function.
6709         (print_unicode_char): Call unicode_to_mb.
6711 2002-01-26  Jim Meyering  <jim@meyering.net>
6713         * Makefile.am (getdate$U.o): Depend on unlocked-io.h.
6715 2002-01-22  Jim Meyering  <jim@meyering.net>
6717         * Makefile.am (Makefile): Don't depend on $(BUILT_SOURCES).
6718         Otherwise, some versions of automake would omit the rule that makes
6719         Makefile from Makefile.in.
6721 2001-01-21  Paul Eggert  <eggert@twinsun.com>
6723         * xmemcoll.h, xmemcoll.c: New files.
6724         * Makefile.am (libfetish_a_SOURCES): Add them.
6725         * memcoll.c: Include errno.h, and declare errno if not defined.
6726         (memcoll): Set errno to zero if there is no error.
6728         * quotearg.c (quotearg_buffer_restyled):
6729         Fix bug with quoting buffers containing NUL when backslashing escapes.
6730         This bug was exposed by the other changes in this patch.
6731         (quotearg_n_options): New arg ARGSIZE.
6732         All callers changed.
6733         (quoting_options_from_style): New function.
6734         (quotearg_n_style): Use it.
6735         (quotearg_n_style_mem): New function.
6737         * quotearg.h (quotearg_n_style_mem): New function.
6739 2002-01-16  Jim Meyering  <jim@meyering.net>
6741         * getdate.y: Add three semicolons, each just before a closing brace.
6742         Bison (as of version 1.31) no longer papers over that mistake.
6744 2002-02-14  Paul Eggert  <eggert@twinsun.com>
6746         * backupfile.c (ISDIGIT): Comment fix.
6747         * getdate.y (ISDIGIT): Likewise.
6748         * posixtm.c (ISDIGIT, year): Likewise.
6749         * strverscmp.c (ISDIGIT): Likewise.
6750         * userspec.c (ISDIGIT): Likewise.
6752 2002-01-05  Jim Meyering  <jim@meyering.net>
6754         * version-etc.c (version_etc_copyright): Update copyright year.
6756 2001-01-19  Paul Eggert  <eggert@twinsun.com>
6758         * closeout.c (close_stdout_status): If ferror (stdout), do
6759         not silently exit merely because the output buffer happens to
6760         have nothing pending.
6762 2001-12-18  Paul Eggert  <eggert@twinsun.com>
6764         See the big note in ../ChangeLog.
6765         * human.c (suffixes): Prefer K to k for 1024.
6766         (generate_suffix_backwards): New function.
6767         (human_readable_inexact): Use it.
6768         * xstrtol.c (__xstrtol): If there is no number but there
6769         is a valid suffix, assume 1.  "MB" now means decimal, "MiB" binary.
6770         Accept 'K' as well as 'k'.
6772 2001-12-15  Jim Meyering  <jim@meyering.net>
6774         * regex.h (__restrict_arr): Update from libc.
6776         * mountlist.h (ME_REMOTE): Recognize file systems of type smbfs
6777         as `remote' if the name starts with `//'.  Suggested by Michael Stone.
6778         (STREQ): Define.
6780 2001-12-10  Jim Meyering  <jim@meyering.net>
6782         * linebuffer.c: Remove explicit declarations of xmalloc and xrealloc,
6783         Instead, include "xalloc.h".
6784         (initbuffer): Don't cast xmalloc return value to char*.
6785         (readline): Reword comment.
6786         Don't cast xrealloc return value to char*
6787         Return NULL, not 0.
6789 2001-12-09  Jim Meyering  <jim@meyering.net>
6791         * modechange.c (mode_compile): Add cast to avoid pedantic warning about
6792         `signed and unsigned type in conditional expression'.
6793         * posixtm.c (posix_time_parse): Likewise.
6795         * xreadlink.c (xreadlink): Add cast to avoid a pedantic warning.
6797         * readtokens.c (readtoken): Declare an index to be of type unsigned
6798         to avoid a pedantic warning.
6800         * getstr.c: Don't include assert.h.
6801         (getstr): Remove warning-evoking assertions.
6802         Return -1 if offset parameter is out of bounds.
6803         Change the type of a local from int to size_t.
6805         * strftime.c (my_strftime_localtime_r): Include this function
6806         definition in the `#if ! HAVE_TM_GMTOFF' block.
6808         * xgethostname.c: Remove declarations of xmalloc and xrealloc.
6809         Include xalloc.h instead.
6811 2001-12-02  Jim Meyering  <jim@meyering.net>
6813         * tempname.c: Don't declare getenv, thus reverting the change of
6814         2001-11-18.  It's no longer necessary, now that stdlib.h is always
6815         included.
6817         * regex.c [!__BOUNDED_POINTERS__]: Define away __bounded,
6818         __unbounded, and __ptrvalue.  Reported by Uwe H. Steinfeld.
6820 2001-11-30  Akim Demaille  <akim@epita.fr>
6822         * xstrdup.c: Include xalloc.h, so that xstrdup is declared
6823         before being defined.
6825 2001-11-27  Paul Eggert  <eggert@twinsun.com>
6827         * quotearg.h (quotearg_n, quotearg_n_style):
6828         First arg is int, not unsigned.
6829         * quotearg.c (quotearg_n, quotearg_n_style): Likewise.
6830         (SIZE_MAX, UINT_MAX): New macros.
6831         (quotearg_n_options): Abort if N is negative.
6832         Avoid overflow check on hosts where size_t is 64 bits and int
6833         is 32 bits, as overflow is impossible there.
6834         Fix off-by-one typo that caused unnecessary reallocation.
6836 2001-11-27  Jim Meyering  <jim@meyering.net>
6838         * tempname.c: Merge with version from libc.
6839         * regex.c: Likewise.
6841         * tempname.c: Include stdlib.h unconditionally.  On some old systems
6842         for which STDC_HEADERS is 0, it was not included, resulting in a
6843         warning about an integer-to-pointer conversion problem with getenv.
6844         Reported by Volker Borchert.
6846 2001-11-26  Jim Meyering  <jim@meyering.net>
6848         * gtod.h: Remove file.
6849         * Makefile.am (libfetish_a_SOURCES): Remove gtod.h.
6850         * gettimeofday.c: Don't include gtod.h.
6851         (GTOD_init): Remove function.
6852         (rpl_gettimeofday): Do its job here instead, rather than aborting.
6853         Suggestion from Volker Borchert.
6855 2001-11-23  Jim Meyering  <jim@meyering.net>
6857         * hash.h (struct hash_table): Don't define here.  Merely declare it.
6858         * hash.c (struct hash_table): Define it here instead.
6860 2001-11-22  Jim Meyering  <jim@meyering.net>
6862         * hash.h: Bracket contents of file with #ifndef HASH_H_ ... #endif.
6864 2001-11-18  Paul Eggert  <eggert@twinsun.com>
6866         * tempname.c (TMP_MAX): Remove; no longer needed.
6867         (TEMPORARIES): New macro.
6868         (__gen_tempname): Use TEMPORARIES rather than TMP_MAX.  This
6869         removes an artificial limitation (e.g. HP-UX 10.20, where
6870         TMP_MAX is 17576).
6872 2001-11-18  Jim Meyering  <jim@meyering.net>
6874         * tempname.c [!HAVE_DECL_GETENV]: Declare getenv to avoid warning
6875         on SunOS 4.
6877         * Makefile.am (Makefile): Depend on $(BUILT_SOURCES), so those
6878         files will be created before anything else.
6880 2001-11-17  Jim Meyering  <jim@meyering.net>
6882         * modechange.c (mode_adjust): Fix error introduced on 1999-04-26
6883         that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
6884         rather than group writable.  Patch by Juan F. Codagnone.
6886         * readtokens.c: Remove explicit declarations of xmalloc and xrealloc,
6887         Instead, include "xalloc.h".
6889         * mountlist.c: Include unlocked-io.h after all system headers.
6890         Remove explicit declarations of xmalloc, xrealloc,
6891         and xstrdup.  Instead, include "xalloc.h".
6893         * argmatch.c, closeout.c, error.c, exclude.c: Include unlocked-io.h.
6894         * fatal.c, getdate.y, getpass.c, getstr.c, getusershell.c: Likewise.
6895         * mountlist.c, posixtm.c, readtokens.c, readutmp.c: Likewise.
6897         * regex.c, sha.c, version-etc.c, yesno.c: Likewise.
6898         Reported by Padraig Brady.
6900         * mkstemp.c: #undef mkstemp.
6901         Include config.h.
6902         (rpl_mkstemp): Rename from mkstemp.
6903         Protoize.
6905 2001-11-16  Jim Meyering  <jim@meyering.net>
6907         * physmem.c [HAVE_SYS_PSTAT_H]: Include <sys/pstat.h>.
6908         (physmem_total) [HAVE_PSTAT_GETSTATIC]: If sysconf couldn't be used to
6909         determine the amount of total physical memory, use pstat_getstatic.
6910         HPUX-11 doesn't define _SC_PHYS_PAGES.
6911         (physmem_available) [HAVE_PSTAT_GETSTATIC && HAVE_PSTAT_GETDYNAMIC]:
6912         If sysconf couldn't be used to determine the amount of available
6913         physical memory, use both pstat_getstatic and pstat_getdynamic.
6914         Based on a patch from Bob Proulx.
6916 2001-11-05  Jim Meyering  <jim@meyering.net>
6918         * xstat.in (slash_aware_lstat): Correct a misleading comment.
6920 2001-11-03  Jim Meyering  <jim@meyering.net>
6922         * argmatch.h (ARGMATCH_TO_ARGUMENT): Remove casts of first two args
6923         in argmatch_to_argument call.
6925         * dirfd.c (dirfd): Reflect the fact that DIR_TO_FD now takes an
6926         argument.
6928         * hash.c (hash_clear): Fix a bug that could lead to an infloop or
6929         e.g., a fault due to an attempt to free a NULL pointer.
6931 2001-11-01  Jim Meyering  <jim@meyering.net>
6933         * dirfd.c, dirfd.h: New files.
6934         * Makefile.am (libfetish_a_SOURCES): Add dirfd.h.
6936         * hash.c (hash_print) [TESTING]: Clean up.
6938 2001-10-22  Paul Eggert  <eggert@twinsun.com>
6940         * hard-locale.c (alloca): Define to __builtin_alloca if __GNUC__,
6941         to avoid a warning if -Wall.
6943 2001-10-21  Paul Eggert  <eggert@twinsun.com>
6945         * regex.c (uintptr_t): Remove macro and decl; it's config.h's job.
6947 2001-10-21  Jim Meyering  <jim@meyering.net>
6949         * obstack.c (_): Honor the setting of ENABLE_NLS.  Otherwise,
6950         this code would end up calling gettext even in packages built
6951         with --disable-nls.
6952         * getopt.c (_): Likewise.
6953         * regex.c (_): Likewise.
6955 2001-10-20  Paul Eggert  <eggert@twinsun.com>
6957         * error.c (strerror_r): Do not declare unless !_LIBC.
6958         Do not check for HAVE_DECL_STRERROR_R missing unless STRERROR_R_CHAR_P.
6959         Use strerror_r that is only a macro, even if it is not a function.
6960         (strerror): Check for HAVE_DECL_STRERROR before declaring.
6961         (private_strerror): Use prototypes, not old-style function definition.
6962         (print_errno_message): New function.
6963         Support the POSIX 'int'-flavored strerror_r, as well as the traditional
6964         char*-flavored one.
6965         (error_tail, error, error_at_line): Use it.
6967 2001-10-11  Jim Meyering  <jim@meyering.net>
6969         * argmatch.c (argmatch_invalid): Use quotearg_n_style (0, ...
6970         and quote_n (1, ... to avoid clobbering a buffer.
6972 2001-10-05  Jim Meyering  <jim@meyering.net>
6974         * Makefile.am: (libfetish_a_SOURCES): Add hash-pjw.c and hash-pjw.h.
6975         * hash-pjw.c: New file (factored out of fileutils' remove.c).
6976         * hash-pjw.h: New file.
6978 2001-09-30  Jim Meyering  <jim@meyering.net>
6980         * mountlist.c [MOUNTED_GETFSSTAT]:
6981         Include <sys/ucred.h>, for Apple Darwin.
6982         Include sys/mount.h and sys/fs_types.h only if available.
6983         (FS_TYPE): Define.
6984         (read_filesystem_list): Use FS_TYPE.
6986 2001-09-29  Paul Eggert  <eggert@twinsun.com>
6988         * exclude.c (excluded_filename): 0 -> false, since it's
6989         a boolean context.
6991 2001-09-28  Paul Eggert  <eggert@twinsun.com>
6993         Fix bug reported by Petter Reinholdtsen for HP-UX 10.20, which
6994         #defines strtoimax.  Also treat the other strto* functions
6995         like strtoimax.
6997         * xstrtol.c (strtol): Do not declare if HAVE_DECL_STRTOL.
6998         (strtoul): Do not declare if HAVE_DECL_STRTOUL.
6999         (strtoimax, strtoumax): Do not declare if already defined as a macro.
7001 2001-09-26  Jim Meyering  <jim@meyering.net>
7003         Most macros in unlocked-io.h had the wrong number of arguments.
7004         * gen-uio: New script.
7005         (USE_UNLOCKED_IO): Define to 1 if not already defined.
7006         * unlocked-io.hin: Remove file.
7007         * Makefile.am (unlocked-io.h): Rewrite to use a separate script,
7008         rather than trying to embed it here.
7009         (EXTRA_DIST): Add gen-uio.  Remove unlocked-io.hin
7010         Reported by Padraig Brady.
7012 2001-09-25  Volker Borchert  <bt@teknon.de>
7014         * gettimeofday.c (rpl_gettimeofday): Declare local variable `result'.
7016 2001-09-23  Jim Meyering  <jim@meyering.net>
7018         * mountlist.c: Remove useless parentheses in #if directives.
7019         (MOUNTED) [!defined MOUNTED]: Define to _PATH_MOUNTED, for when
7020         the deprecated MOUNTED symbol is no longer defined in mntent.h.
7022 2001-09-22  Jim Meyering  <jim@meyering.net>
7024         * localcharset.c: Update from latest gettext.
7025         * config.charset: Likewise.
7027 2001-09-20  Jim Meyering  <jim@meyering.net>
7029         * xstrtol.c (strtoimax): Guard declaration with
7030         `#if !HAVE_DECL_STRTOIMAX', rather than just `#ifndef strtoimax'.
7031         The latter fails because some systems (at least rs6000-ibm-aix4.3.3.0)
7032         have their own, conflicting declaration of strtoimax in sys/inttypes.h.
7033         (strtoumax): Likewise, for completeness (it wasn't necessary).
7035 2001-09-06  Paul Eggert  <eggert@twinsun.com>
7037         * strtoimax.c (HAVE_LONG_LONG):
7038         Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
7039         (strtoimax): Use sizeof (long), not sizeof strtol (ptr, endptr, base),
7040         to work around bug in IBM C compiler.
7042 2001-09-16  Jim Meyering  <jim@meyering.net>
7044         * mkdir.c: New file.
7046 2001-09-04  Paul Eggert  <eggert@twinsun.com>
7048         * xgetcwd.c: Revert some of the previous change; intead,
7049         fix the HAVE_GETCWD_NULL code to behave more like the
7050         !HAVE_GETCWD_NULL code used to.
7052         Include "xalloc.h".
7053         (xgetcwd): Do not return NULL when memory is exhausted; instead,
7054         invoke xalloc_die.
7056 2001-09-04  Paul Eggert  <eggert@twinsun.com>
7058         * xreadlink.c (xreadlink): Omit size_t* arg.  All uses changed.
7059         Use ssize_t, not int, to store result of readlink.
7060         Check for ssize_t overflow as well as size_t overflow,
7061         as POSIX says the result of readlink is implementation-defined
7062         when ssize_t overflows.
7063         Remove unnecessary cast to char*.
7064         Use free+malloc instead of realloc, as the storage doesn't need
7065         to be preserved and it's clearer and can be more efficient that way.
7066         (SIZE_MAX, SSIZE_MAX): New macros, if <limits.h> doesn't declare.
7067         * xreadlink.h (xreadlink): Update prototype.
7069 2001-09-03  Paul Eggert  <eggert@twinsun.com>
7071         * exclude.c (fnmatch_no_wildcards): Fix confusion between
7072         usage of FNM_CASEFOLD and FNM_LEADING_DIR.  The bug was
7073         spotted by Jim Meyering.
7075 2001-09-03  Jim Meyering  <jim@meyering.net>
7077         * xreadlink.c (xreadlink): Preserve errno around `free' during failure.
7079 2001-09-03  Paul Eggert  <eggert@twinsun.com>
7081         * xgetcwd.c: Fix the !HAVE_GETCWD_NULL code to behave more
7082         like the HAVE_GETCWD_NULL code.
7083         Include pathmax.h if not HAVE_GETCWD.
7084         Do not include xalloc.h.
7085         (INITIAL_BUFFER_SIZE): New symbol.
7086         Do not use xmalloc / xrealloc, since the caller is responsible for
7087         handling errors.  Preserve errno around `free' during failure.
7088         Do not overrun buffer when using getwd.
7090 2001-09-03  Paul Eggert  <eggert@twinsun.com>
7092         * xgetcwd.c (xgetcwd): Use HAVE_GETCWD_NULL, not (defined
7093         __GLIBC__ && __GLIBC__ >= 2), to decide whether to use getcwd (NULL, 0).
7095 2001-09-02  Jim Meyering  <jim@meyering.net>
7097         * error.c: Update from GNU libc.
7099 2001-09-01  Jim Meyering  <jim@meyering.net>
7101         * xreadlink.c: New file.
7102         * xreadlink.h: New file.
7103         * Makefile.am (libfetish_a_SOURCES): Add xreadlink.c and xreadlink.h.
7105         * regex.c (uintptr_t) [!_LIBC]: Define to private_uintptr_t, so it
7106         doesn't conflict with sparc Solaris 7's definition in
7107         /usr/include/sys/int_types.h.
7109         * exclude.c: Use `""', not `<>' to #include non-system header files.
7110         (fnmatch_no_wildcards): Rewrite not to use function names, strcasecmp
7111         and strncasecmp as r-values.  Unixware didn't have declarations.
7113 2001-08-31  Jim Meyering  <jim@meyering.net>
7115         * xgetcwd.c (xgetcwd): Reorganize to avoid some duplication.
7116         Use an initial, malloc'd, buffer of length 128 rather than
7117         a statically allocated one of length 1024.
7119 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7121         * xgetcwd.c: Don't include pathmax.h.
7122         Include stdlib.h and unistd.h if available.
7123         Include xalloc.h.
7124         (xmalloc, xstrdup, free): Remove decls.
7125         (xgetcwd): Don't assume sizes fit in unsigned.
7126         Check for overflow when computing sizes.
7127         Simplify reallocation code.
7129 2001-08-28  Paul Eggert  <eggert@twinsun.com>
7131         * Makefile.am (libfetish_a_SOURCES): Remove strtoxmax.c.
7133         * strtoimax.c: Renamed from strtoxmax.c, removing the
7134         old strtoimax.c.
7136         Also, make the following further changes to make this file's
7137         configuration more similar to that of strtol.c:
7138         (UNSIGNED): Renamed from STRTOUXMAX_UNSIGNED.  All uses changed.
7139         (strtoumax, uintmax_t, strtoull, strtol): Remove.
7140         (intmax_t, strtoimax, strtol, strtoll): New macros, if UNSIGNED.
7141         (strtoimax): Renamed from strtoumax.  All uses of unsigned values
7142         changed to signed values.
7144         And make the following changes as well:
7145         Fix copyright notice, as 1999 was missing.
7146         (verify): New macro.
7147         (strtoimax): Check sizes at compile-time, not run-time.
7148         Prefer strtol to strtoll if both work.
7149         (main): Remove; it was not that useful and was a pain to maintain.
7151         * strtoumax.c: Include strtoimax.c, not strtouxmax.c.
7153 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7155         * savedir.c (savedir): Remove size parameter, as POSIX says that
7156         a directory's st_size can have an arbitrary value, so the old
7157         usage could waste an arbitrary amount of memory.  All uses
7158         changed.
7159         * savedir.h: Update prototype.
7161 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7163         * xstrtol.c (strtoimax): New decl.
7165 2001-08-28  Paul Eggert  <eggert@twinsun.com>
7167         * xstrtol.h: Add copyright notice.
7168         (_DECLARE_XSTRTOL): Improve quality of diagnostic for
7169         LONGINT_INVALID_SUFFIX_CHAR.
7171 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7173         * quotearg.c: BSD/OS 4.1 wchar.h requires FILE and struct
7174         tm to be declared.
7176 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7178         * hash.c: Remove '2001' from copyright notice.
7180 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7182         * full-write.h: New file.
7183         * Makefile.am (libfetish_a_SOURCES): Add full-write.h.
7184         * full-write.c: Correct credits, as cccp.c no longer
7185         exists and anyway it was so heavily changed from the old cccp
7186         code as to be unrecognizable.  Include full-write.h.
7187         (full_write) Return size_t, with short writes meaning failure.
7188         All callers changed.  This fixes a bug with large buffers
7189         on 64-bit hosts.
7190         * utime.c: Include full-write.h.
7192 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7194         Merge 'exclude' changes from tar 1.13.22.
7195         This fixes one or two unlikely storage allocation overflow bugs,
7196         but doesn't change user-visible behavior otherwise.
7198 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7200         * exclude.c (bool): Declare, perhaps by including stdbool.h.
7201         (<sys/types.h>): Include only if HAVE_SYS_TYPES_H.
7202         (<stdlib.h>, <string.h>, <strings.h>, <inttypes.h>, <stdint.h>):
7203         Include if available.
7204         (<xalloc.h>): Include
7205         (SIZE_MAX): Define if <stdint.h> or <inttypes.h> doesn't.
7206         (verify): New macro.  Use it to verify that EXCLUDE macros do not
7207         collide with FNM macros.
7208         (struct patopts): New struct.
7209         (struct exclude): Use it, as exclude patterns now come with options.
7210         (new_exclude): Support above changes.
7211         (new_exclude, add_exclude_file):
7212         Initial size must now be a power of two to simplify overflow checking.
7213         (free_exclude, fnmatch_no_wildcards): New function.
7214         (excluded_filename): No longer requires options arg, as the options
7215         are determined by add_exclude.  Now returns bool, not int.
7216         (excluded_filename, add_exclude):
7217         Add support for the fancy new exclusion options.
7218         (add_exclude, add_exclude_file): Now takes int options arg.
7219         Check for arithmetic overflow when computing sizes.
7220         (add_exclude_file): xrealloc might modify errno, so don't
7221         realloc until after errno might be used.
7223         * exclude.h (EXCLUDE_ANCHORED, EXCLUDE_INCLUDE,EXCLUDE_WILDCARDS):
7224         New macros.
7225         (free_exclude): New decl.
7226         (add_exclude, add_exclude_file): Now takes int options arg.
7227         (excluded_filename): No longer requires options arg, as the options
7228         are determined by add_exclude.  Now returns bool, not int.
7230 2001-08-30  Paul Eggert  <eggert@twinsun.com>
7232         * alloca.c (alloca): Arg is of type size_t, not unsigned.
7234 2001-08-27  Jim Meyering  <jim@meyering.net>
7236         * Makefile.am (libfetish_a_SOURCES): Add strtoxmax.c
7238         * version-etc.c (N_): Remove definition.
7239         Revert most of last change.
7240         Instead, simply don't mark the `Copyright...' string for translation.
7241         Based on advice from Paul Eggert.
7243         * strtoxmax.c: Tweak comment.
7245 2001-08-26  Jim Meyering  <jim@meyering.net>
7247         * version-etc.c (version_etc_copyright_fmt): Replace literal year
7248         of copyright with `%s' so translators don't get an untranslated
7249         message in 2002.
7250         (COPYRIGHT_YEAR): Define.
7251         (version_etc): Use fprintf rather than fputs.
7252         Suggestion from Ulrich Drepper.
7254         * Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
7256         * strtoll.c: New file, from GNU libc.
7257         * xstrtoimax.c: New file.
7259         * xstrtol.h: Add xstrtoimax.
7260         * strtoumax.c: New file.  Simply include "strtoumax.c".
7261         * strtoimax.c: New file.  Likewise, but first define STRTOUXMAX_SIGNED.
7263         * strtoumax.c: Factor to work both for unsigned and signed types, ...
7264         * strtoxmax.c: ... then renamed to this.
7266 2001-08-13  Paul Eggert  <eggert@twinsun.com>
7268         * Makefile.am (unlocked-io.h): Do not append "_unlocked" twice.
7269         Port to Solaris 8, where 'sed' requires a space after the 'r'
7270         command, and where sh dislikes "$/".  Clean up the spacing a bit.
7271         Redirect output to $tmp just once.
7273 2001-08-12  Paul Eggert  <eggert@sic.twinsun.com>
7275         * addext.c (<errno.h>): Include.
7276         (errno): Declare if not defined.
7277         (addext): Work correctly when pathconf returns -1 and leaves
7278         errno alone because there is no limit.  Also, work even if
7279         pathconf returns a value greater than SIZE_MAX.
7281 2001-08-12  Jim Meyering  <jim@meyering.net>
7283         * xgetcwd.c (xgetcwd) [defined __GLIBC__ && __GLIBC__ >= 2]:
7284         Simply `return getcwd (NULL, 0);'.
7285         [! (defined __GLIBC__ && __GLIBC__ >= 2)]:
7286         Use 1300 as initial value for length, not PATH_MAX.
7288         * pathmax.h: Clean up cpp syntax.
7290 2001-08-12  Jim Meyering  <jim@meyering.net>
7292         * gettimeofday.c: New file.
7293         * gtod.h: New file.
7294         * Makefile.am (libfetish_a_SOURCES): Add gtod.h.
7296 2001-08-04  Jim Meyering  <jim@meyering.net>
7298         * error.h (__attribute__): Remove `|| __STRICT_ANSI__' from #if stmt,
7299         to get in sync with glibc.
7301 2001-08-03  Paul Eggert  <eggert@twinsun.com>
7303         The following changes are from gettext 0.10.39 as maintained by
7304         Bruno Haible.
7306         * mbswidth.h (MBSW_REJECT_UNPRINTABLE, MBSW_REJECT_INVALID):
7307         Renamed from MBSW_ACCEPT_UNPRINTABLE and MBSW_ACCEPT_INVALID
7308         with inverted sense.  All uses changed.
7310         * mbswidth.c: Don't include <limits.h>.
7311         Include <stdlib.h> and <string.h> unconditionally.
7312         (iswcntrl, mbsinit, ISCNTRL): New macros.
7313         (mbsnwidth): Use K&R style function declarations.
7314         Don't bother checking for MB_LEN_MAX == 1, since the compiler
7315         can optimize it when MB_CUR_MAX == 1.
7316         The width of control characters is zero, not 1.
7318 2001-07-15  Jim Meyering  <jim@meyering.net>
7320         * Makefile.am (EXTRA_DIST): Add unlocked-io.hin.
7321         (BUILT_SOURCES): Add unlocked-io.h.
7322         (io_functions): Define.
7323         (unlocked-io.h): New rule.
7324         (DISTCLEANFILES): Add unlocked-io.h.
7325         (all-local): Depend on unlocked-io.h, to ensure it is created.
7327         * unlocked-io.hin: New file
7329         * regex.c: Update from glibc.
7331 2001-07-05  Jim Meyering  <jim@meyering.net>
7333         * Makefile.am (noinst_HEADERS): Remove definition, per new automake
7334         recommendation.
7335         (libfetish_a_SOURCES): Put all .h files here instead.
7336         Remove a thus-exposed (better checks in automake) duplicate and
7337         two unnecessary .h files.
7339 2001-06-11  Jim Meyering  <jim@meyering.net>
7341         * regex.c: Update from GNU libc.
7343 2001-05-27  Jim Meyering  <jim@meyering.net>
7345         * readutmp.h (UT_TYPE): Define.
7347 2001-05-24  Jim Meyering  <jim@meyering.net>
7349         * argmatch.c: Include "quote.h".
7350         (argmatch_invalid): Remove explicit `' quotes.  Instead, use the
7351         quote function.  Reported by Göran Uddeborg.
7353 2001-05-20  Alexandre Duret-Lutz  <duret_g@epita.fr>
7355         * dirname.c (dir_name): Compute append_dot using path, not newpath
7356         which is not yet declared.
7358 2001-05-11  Paul Eggert  <eggert@twinsun.com>
7360         * Makefile.am (libfetish_a_SOURCES):
7361         Add strftime.c, since we now compile it on all hosts.
7363         * strftime.c (my_strftime):
7364         Define to nstrftime if emacs, but only if my_strftime is not defined.
7365         (extra_args, extra_args_spec, extra_args_spec_iso): Rename from
7366         ut_argument, ut_argument_spec, ut_argument_spec_iso, respectively.
7367         Add one more extra argument: a nanoseconds value.
7368         All uses changed.
7369         (ns): New macro.
7370         (my_strftime function): Add %N format.
7371         (emacs_strftimeu): Renamed from emacs_strftime,
7372         with extra ut argument.
7374 2001-05-11  Paul Eggert  <eggert@twinsun.com>
7376         dirname code cleanup.  base_name now behaves more compatibly
7377         with POSIX basename when given file names that have trailing
7378         slashes, and similarly for dir_name.  Add new primitives
7379         base_len and dir_len.  Put the directory-name-related decls
7380         into dirname.h.
7382         * addext.c (ISSLASH, base_name): Remove; now in dirname.h.
7383         * backupfile.c (base_name): Likewise.
7384         * basename.c (FILESYSTEM_PREFIX_LEN, PARAMS, ISSLASH): Likewise.
7385         * dirname.c (FILESYSTEM_PREFIX_LEN, ISSLASH): Likewise.
7386         * makepath.c (strip_trailing_slashes): Likewise.
7387         * path-concat.c (DIRECTORY_SEPARATOR, FILESYSTEM_PREFIX_LEN, ISSLASH):
7388         Likewise.
7389         * rename.c (strip_trailing_slashes): Likewise.
7390         * same.c (base_name): Likewise.
7391         * stripslash.c (ISSLASH): Likewise.
7393         * addext.c: Include <dirname.h> after size_t is defined.
7394         * backupfile.c: Likewise.
7396         * addext.c (addext): Use base_len to trim redundant
7397         trailing slashes instead of doing it ourselves.
7398         But do not trim the last slash if it is not redundant.
7400         * backupfile.c (find_backup_file_name,
7401         max_backup_version): Use base_len instead of rolling it ourselves.
7402         Handle the case of "" and (on DOS) "C:" correctly.
7404         * basename.c: Do not include <stdio.h>, <assert.h>; no longer needed.
7405         Include <string.h>, <dirname.h>.
7406         (base_name): Allow file names ending in slashes, other than names
7407         that are all slashes.  In this case, return the basename followed
7408         by the slashes.  This is more general, and can be used in places
7409         where the original base_name purposely had an assertion failure.
7410         (base_len): New function.
7412         * dirname.c: Include <string.h> instead of <stdlib.h>.
7413         Do not include <assert.h>; no longer needed.
7414         Include xalloc.h.
7415         (memrchr): Remove decl.
7416         (dir_name_r): Remove.
7417         (dir_len): Renamed from dirlen.  All callers changed.
7418         Rewrite in terms of base_name, for simplicity and consistency.
7419         (dir_name): Never return NULL.  All callers changed.
7420         Do not include <stdlib.h> in test program; no longer needed.
7421         return 0; is fine for test program.
7423         * dirname.h (DIRECTORY_SEPARATOR, ISSLASH, FILESYSTEM_PREFIX_LEN):
7424         New macros.
7425         (base_name, base_len, dir_len, strip_trailing_slashes): New decls.
7427         * path-concat.c (path_concat): Use base_len to compute
7428         base length, not strlen; this means we cannot rely on memcpy
7429         to null-terminate.
7431         * same.c (STREQ): Remove.
7432         (same_name): Handle the case where the basename ends in trailing '/'.
7434         * stripslash.c (strip_trailing_slashes): Return nonzero if
7435         a slash was stripped.  Do not strip the last slash after a
7436         file system prefix.
7438 2001-04-08  Jim Meyering  <jim@meyering.net>
7440         * getdate.y (get_date): Set tm_isdst to -1 to ensure that it is
7441         recomputed; that's necessary when the offset spans a DST transition.
7442         Patch by David J. MacKenzie.  Reported by Hon-Yin Kok.
7444 2001-04-02  Jim Meyering  <jim@meyering.net>
7446         * regex.h, regex.c: Update from GNU libc.
7448 2001-03-19  Paul Eggert  <eggert@twinsun.com>
7450         * version-etc.c (version_etc_copyright): Update to 2001.
7452 2001-03-16  Paul Eggert  <eggert@twinsun.com>
7454         * tempname.c (uint64_t): Define to uintmax_t if
7455         not defined, and if UINT64_MAX is not defined.
7456         Required at least for Vax Ultrix4.3, which doesn't define uint64_t.
7457         Reported by John David Anglin.
7459 2001-03-10  Bruno Haible  <haible@clisp.cons.org>
7461         * localcharset.c (locale_charset): Allow wildcard syntax. Also resolve
7462         alias if codeset is empty.
7463         * config.charset (BeOS): Use wildcard syntax.
7465 2001-03-13  Jim Meyering  <jim@meyering.net>
7467         * path-concat.c (path_concat) [FILESYSTEM_ACCEPTS_DRIVE_LETTER_PREFIX]:
7468         Don't insert a backslash when concatenating e.g., `C:' and `foo'.
7469         From Bruno Haible.
7471 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
7473         * localcharset.c (locale_charset): Don't use setlocale(LC_CTYPE,NULL).
7474         Don't return NULL.
7475         * unicodeio.c (print_unicode_char): Simplify accordingly.
7477 2001-03-06  Bruno Haible  <haible@clisp.cons.org>
7479         * config.charset: Update for FreeBSD 4.2 and OSF/1 5.1. Add
7480         support for DOS/DJGPP.
7482 2001-02-28  Paul Eggert  <eggert@twinsun.com>
7484         * Makefile.am (libfetish_a_SOURCES):
7485         Add dup-safer.c, fopen-safer.c.
7486         (noinst_HEADERS): Add stdio-safer.h, unistd-safer.h.
7488         * dup-safer.c, fopen-safer.c, stdio-safer.h, unistd-safer.h: New files.
7490 2001-02-25  Paul Eggert  <eggert@twinsun.com>
7492         The mkstemp replacement is taken from glibc 2.2.2, with some
7493         portability fixes for use outside glibc, as follows:
7495         * tempname.c (struct_stat64): New macro.
7496         (direxists, __gen_tempname): Use it.
7497         This avoids a portability problem with Solaris 8.
7499         * tempname.c (<config.h>): Include if HAVE_CONFIG_H.
7500         (<stddef.h>, <stdint.h>, <string.h>):
7501         Include only if STDC_HEADERS || _LIBC.
7502         (<fcntl.h>): Include only if HAVE_FCNTL_H || _LIBC.
7503         (<unistd.h>): Include only if HAVE_UNISTD_H || _LIBC.
7504         (<sys/time.h>): Include only if HAVE_SYS_TIME_H || _LIBC.
7505         (__set_errno): Define this macro if <errno.h> doesn't.
7506         (P_tmpdir, TMP_MAX, __GT_FILE, __GT_BIGFILE, __GT_DIR, __GT_NOCREATE):
7507         Define these macros if <stdio.h> doesn't.
7508         (S_ISDIR, S_IRUSR, S_IWUSR, S_IXUSR):
7509         Define these macros if <sys/stat.h>
7510         doesn't.  Ignore <sys/stat.h> S_ISDIR if STAT_MACROS_BROKEN.
7511         (stat64, __getpid, __gettimeofday, __mkdir, __open, __open64, lxstat64,
7512         __xstat64): Define if not _LIBC.
7513         (__secure_getenv): Define if ! (HAVE___SECURE_GETENV || _LIBC).
7514         (__gen_tempname): Invoke gettimeofday only if
7515         HAVE_GETTIMEOFDAY || _LIBC;
7516         otherwise, fall back on plain "time".
7517         Use macros like S_IRUSR | S_IWUSR rather than octal values like 0600.
7519         * mkstemp.c (__GT_FILE): Define to zero if not defined.
7521         * mkstemp.c, tempname.c: New files, taken from glibc 2.2.2.
7523 2001-02-17  Jim Meyering  <jim@meyering.net>
7525         * strtoul.c: Sync from GNU libc.  Use double quotes, not <...>
7526         around included file name.
7528         * strnlen.c (__strnlen): Merge in a change from GNU libc.
7530         * strftime.c: Update from GNU libc (the only changes were to comments).
7532 2001-02-13  Bruno Haible  <haible@clisp.cons.org>
7534         * mbswidth.h (mbswidth): Also define as macro, to avoid prototype clash.
7536 2001-02-17  Paul Eggert  <eggert@twinsun.com>
7538         * mbswidth.c, quotearg.c (mbrtowc, mbsinit):
7539         Remove workaround macros for hosts that have mbrtowc but not
7540         mbstate_t, as we now insist on proper declarations for both
7541         before using mbrtowc.
7543 2001-02-17  Jim Meyering  <jim@meyering.net>
7545         * regex.c: Update from libc.
7547 2001-02-16  Paul Eggert  <eggert@twinsun.com>
7549         * alloca.c (malloc): Undef before defining, since stdlib.h
7550         may have defined it.  Needed for Encore Umax-3.0.9.16b systems.
7551         Reported by Mark Hounschell via Paul Eggert.
7553 2001-01-30  Bruno Haible  <haible@clisp.cons.org>
7555         * config.charset: Update for FreeBSD 4.2.
7557 2001-01-26  Jim Meyering  <jim@meyering.net>
7559         * quotearg.c: Include stddef.h.
7560         * quote.c: Include stddef.h.
7561         Reported by Axel Kittenberger.
7563         * xmalloc.c [HAVE_DONE_WORKING_MALLOC_CHECK]: Enclose error-evoking
7564         line in double quotes so that it evokes a better diagnostic.
7565         [HAVE_DONE_WORKING_REALLOC_CHECK]: Likewise.
7566         Reported by Axel Kittenberger.
7568 2001-01-15  Bruno Haible  <haible@clisp.cons.org>
7570         * unicodeio.c (print_unicode_char): Cast the second iconv() arg,
7571         to avoid a warning.  Add back 'const' to inptr.
7573 2001-01-16  Jim Meyering  <jim@meyering.net>
7575         * basename.c: Include <stdio.h>, needed by assert on SunOS 4.
7576         From Bruno Haible.
7578 2001-01-14  Jim Meyering  <jim@meyering.net>
7580         * rename.c: New file.  From Volker Borchert.
7581         Include stdlib.h, string.h or strings.h, and xalloc.h.
7582         Use strip_trailing_slashes rather than open-coding it.
7584 2001-01-03  Paul Eggert  <eggert@twinsun.com>
7586         * strftime.c: Sync with glibc time/strftime.c 1.81.
7588 2001-01-03  Jim Meyering  <jim@meyering.net>
7590         * unicodeio.c (print_unicode_char): Remove `const' from declaration of
7591         local `inptr' to avoid warning with some system declarations of iconv.
7593 2000-12-29  Paul Eggert  <eggert@twinsun.com>
7595         * modechange.c: Do not assume that mode_t uses the
7596         traditional octal encoding.  E.g. "chmod 1 FOO" should set
7597         the other-execute bit of FOO even if S_IXOTH != 1.
7599         (SUID, SGID, SVTX, RUSR, WUSR, XUSR, RGRP, WGRP, XGRP, ROTH,
7600         WOTH, XOTH, ALLM): New macros.
7601         (S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR,
7602          S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH):
7603         Use them.
7604         (S_ISGID): Fix typo; it was defaulting to the same value as S_ISUID.
7605         (S_IRWXU, S_IRWXG, S_IRWXO): Specify defaults in terms of the above.
7606         (mode_compile):
7607         No need to use uintmax_t; unsigned long is long enough.
7608         Don't bother to get suffix since we don't use it.
7610 2000-12-24  Jim Meyering  <jim@meyering.net>
7612         * hash.c (is_prime): Return explicit boolean values.
7613         (hash_get_first): Return NULL to appease Irix5.6's 89.
7614         Reported by Nelson Beebe.
7616 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
7618         * localcharset.c (locale_charset): Add support for Win32.
7620 2000-12-18  Paul Eggert  <eggert@twinsun.com>
7622         * physmem.h, physmem.c: New files.
7624         * Makefile.am (libfetish_a_SOURCES): Add physmem.c.
7625         (noinst_HEADERS): Add physmem.h.
7627         * xstrtol.c (__xstrtol): Add undocumented suffixes 'g' and
7628         't' for compatibility with Solaris 8 sort.
7630 2000-12-18  Bruno Haible  <haible@clisp.cons.org>
7632         * config.charset: Add support for BeOS.
7634 2000-12-16  Jim Meyering  <jim@meyering.net>
7636         * getusershell.c [!SHELLS_FILE && __DJGPP__]: Define
7637         SHELLS_FILE to a file name that's useful on djgpp systems.
7638         Include stdlib.h.
7639         (ADDITIONAL_DEFAULT_SHELLS): Define.
7640         (default_shells): Prepend ADDITIONAL_DEFAULT_SHELLS.
7641         Based mostly on a patch from Prashant TR.
7643 2000-12-16  Jim Meyering  <jim@meyering.net>
7645         This bug had a serious impact on chown: `chown N:M FILE' (for integer
7646         N and M) would have treated it like `chown N:N FILE'.
7648         * userspec.c (parse_user_spec): Fix typo: s/u/g/.
7650 2000-10-31  Bruno Haible  <haible@clisp.cons.org>
7652         * config.charset: Add ISO-8859-3, BIG5HKSCS, GB18030, JOHAB, VISCII,
7653         CP874, CP949, CP950, CP1250, CP1253, CP1254, CP1255, CP1256, CP1257
7654         to the list of canonical encodings. Rename EUC-CN to GB2312.
7656 2000-12-08  Andreas Schwab  <schwab@suse.de>
7658         * mbswidth.c (mbsnwidth): Don't loop endlessly when called with an
7659         invalid mulitbyte sequence and with the MBSW_ACCEPT_INVALID flag set.
7661 2000-12-07  Jim Meyering  <jim@meyering.net>
7663         * stripslash.c (ISSLASH): Define.
7664         (strip_trailing_slashes): Use ISSLASH rather than comparing against `/'.
7665         From Prashant TR.
7667         * dirname.c (FILESYSTEM_PREFIX_LEN): Define.
7668         (dir_name_r): Declare this function as static.
7669         [BACKSLASH_IS_PATH_SEPARATOR]: Fix a bug that'd
7670         manifest itself on a name containing a mix of slashes and
7671         backslashes.
7672         Make this function work with names starting with a DOS-style
7673         drive letter and colon prefix.
7674         (dir_name): Append `.' if necessary.
7675         Based mostly on patches from Prashant TR and Eli Zaretskii.
7677         * dirname.h (dir_name_r): Remove prototype.
7679 2000-12-05  Jim Meyering  <jim@meyering.net>
7681         * dirname.c (dir_name_r): Add `const' in a few local declarations.
7683 2000-12-04  Jim Meyering  <jim@meyering.net>
7685         * path-concat.c: [!HAVE_DECL_MALLOC]: Declare malloc.
7686         Also include memory.h, stdlib.h, unistd.h if appropriate.
7687         Reported by Andreas Jaeger (conflicting declaration of malloc).
7689 2000-12-02  Jim Meyering  <jim@meyering.net>
7691         * closeout.h: Make idempotent, to avoid some obscure warnings.
7693 2000-12-01  Paul Eggert  <eggert@twinsun.com>
7695         * memrchr.c: Include <config.h> before any system include file.
7697 2000-11-29  Paul Eggert  <eggert@twinsun.com>
7699         * dirname.c (dir_name_r): Fix typo: int -> size_t.
7701 2000-11-26  Jim Meyering  <jim@meyering.net>
7703         * memcoll.c: Include sys/types.h.  From Werner Almesberger.
7705 2000-11-22  Paul Eggert  <eggert@twinsun.com>
7707         * strftime.c (my_strftime): Do not invoke mbrlen with a
7708         size of (size_t) -1; it's not portable.
7710 2000-11-17  Akim Demaille  <akim@epita.fr>
7712         * obstack.h: Formatting changes.
7713         (obstack_grow, obstack_grow0): Don't cast WHERE at all: that would
7714         prevent type checking.
7715         (obstack_ptr_grow, obstack_ptr_grow_fast): When assigning, don't
7716         cast the value to (void *): assigning a `foo *' to a `void *'
7717         variable is valid.
7718         (obstack_int_grow, obstack_int_grow_fast): Don't cast AINT to int.
7720 2000-11-17  Jim Meyering  <jim@meyering.net>
7722         * strstr.c: Update from GNU libc.
7724 2000-11-16  Jim Meyering  <jim@meyering.net>
7726         * strverscmp.c: Incorporate weak-alias-related changes from glibc.
7728 2000-11-11  Jim Meyering  <jim@meyering.net>
7730         * error.c: Add a couple #includes, merging from GNU libc version.
7732 2000-11-10  Jim Meyering  <jim@meyering.net>
7734         * obstack.h: Update from GNU libc.
7735         * obstack.c: Likewise.
7737 2000-11-06  Paul Eggert  <eggert@twinsun.com>
7739         * getusershell.c (setusershell): Use rewind rather than
7740         fseek/fseeko, to avoid configuration hassles with fseeko.
7741         Don't bother opening SHELLS_FILE if shellstream is NULL;
7742         it's not necessary.
7744 2000-11-05  Jim Meyering  <jim@meyering.net>
7746         * makepath.h (make_dir): Declare.
7747         * makepath.c (make_dir): Remove `static' attribute.
7748         Tweak a comment.
7750 2000-11-04  Alexandre Duret-Lutz  <duret_g@epita.fr>
7752         * hash.c (hash_get_next): Fix a thinko:  when ENTRY is the
7753         last one in a bucket, advance to the next bucket.
7755 2000-11-02  Vesselin Atanasov  <vesselin@bgnet.bg>
7757         * fnmatch.c: Do not comment out all the code if we are using
7758         the GNU C library, because in some cases we are replacing buggy
7759         code in the GNU C library itself.
7761 2000-10-30  Paul Eggert  <eggert@twinsun.com>
7763         * error.h, getline.h, modechange.h:
7764         Remove "2000" from Copyright line, as the file hasn't been
7765         changed this year other than in the copyright notice.
7767         * xalloc.h: Add "2000" to Copyright line, as this file
7768         was changed this year.
7770 2000-10-30  Paul Eggert  <eggert@twinsun.com>
7772         * fnmatch.c (FOLD): Do not assume that characters are unsigned.
7773         (fnmatch): Fix some FNM_FILE_NAME and FNM_LEADING_DIR bugs,
7774         e.g. fnmatch("d*/*1", "d/s/1", FNM_FILE_NAME) incorrectly yielded zero.
7776 2000-10-29  Greg Louis  <glouis@dynamicro.on.ca>
7778         * regex.h (__restrict_arr): Move definition out of #ifndef block.
7779         Required because egcs-2.91.66 (aka 1.1.2) defines __restrict, but
7780         doesn't define __restrict_arr.
7782 2000-10-29  Jim Meyering  <jim@meyering.net>
7784         * xstat.in: Fix grammar in comment.
7786 2000-10-28  Jim Meyering  <jim@meyering.net>
7788         * memchr.c: Update from libc.
7789         Adjust for portability:
7790         [HAVE_STDLIB_H]: Include stdlib.h.
7791         [HAVE_BP_SYM_H || _LIBC]: Guard inclusion of bp-sym.h.
7792         Undef __memchr, too.
7793         [!weak_alias]: Define __memchr to memchr.
7795         * regex.c: Update from libc.
7796         * regex.h: Likewise.
7797         * getopt1.c: Likewise.
7798         * memcmp.c: Likewise.
7800         * getusershell.c (setusershell) [HAVE_FSEEKO]: Use fseeko.
7801         Avoid using fseek, when possible -- it's broken by design.
7802         Patch by Ulrich Drepper.
7804 2000-10-26  Jim Meyering  <jim@meyering.net>
7806         * strftime.c: Update from libc.
7808 2000-10-25  Jim Meyering  <jim@meyering.net>
7810         * obstack.c: Update from libc.
7812 2000-10-23  Jim Meyering  <jim@meyering.net>
7814         * hard-locale.c (hard_locale): Revert last change -- it was simply
7815         wrong.  That set_locale call must not have any side effects.
7816         From Paul Eggert.
7818 2000-10-22  Jim Meyering  <jim@meyering.net>
7820         * md5.c (md5_process_block) [OP]: Use `rol', not CYCLIC.
7821         [CYCLIC]: Remove now-unused definition.
7823         * save-cwd.c (O_DIRECTORY): Define, if needed.
7824         (save_cwd) [HAVE_FCHDIR]: Use O_DIRECTORY when opening ".".
7825         Suggestion from Ulrich Drepper.
7827 2000-10-21  Jim Meyering  <jim@meyering.net>
7829         * dirname.c (dir_name_r): New function, factored out of dir_name.
7830         (dir_name): Use dir_name_r.
7831         * dirname.h (dir_name_r): Declare it.
7833 2000-10-21  Jim Meyering  <jim@meyering.net>
7835         * dirname.c (memrchr): Declare if necessary.
7836         (dir_name): Remove the restriction that there be no
7837         trailing slashes.  Now, this code skips past them, effectively
7838         ignoring them.
7839         [TEST_DIRNAME] (main): New unit tests.
7841         * memrchr.c: New file from GNU libc.
7842         Undef __memrchr, too.
7843         [!weak_alias]: Define __memrchr to memrchr.
7844         Guard weak_alias use with `#ifdef weak_alias'.
7846 2000-10-17  Jim Meyering  <jim@meyering.net>
7848         * quote.h (PARAMS): Define and use.
7849         Reported by Akim Demaille.
7851         * getopt.c: Update from libc.
7853 2000-10-16  Jim Meyering  <jim@meyering.net>
7855         * hard-locale.c (hard_locale): Use "", not 0 as 2nd arg to setlocale.
7856         From Jan Fedak.
7858 2000-09-25  Jim Meyering  <jim@meyering.net>
7860         * md5.h (rol): Define (from GnuPG).
7862         * sha.c: Give credit (GnuPG) where due.
7863         (M): Use rol rather than open-coding it.
7864         Add a FIXME comment.
7866 2000-09-21  Jim Meyering  <jim@meyering.net>
7868         * userspec.c (parse_user_spec): Remove debugging printf I'd added.
7869         Reported by Michael Stone.
7871 2000-09-20  Jim Meyering  <jim@meyering.net>
7873         * Makefile.am (libfetish_a_SOURCES): Add sha.c.
7874         (noinst_HEADERS): Add sha.h.
7875         Based on code from Scott G. Miller and from GnuPG.
7877 2000-09-15  Jim Meyering  <jim@meyering.net>
7879         * regex.c: Update from libc.
7881 2000-09-10  Jim Meyering  <jim@meyering.net>
7883         * getopt.c (_getopt_internal): Update from glibc.
7885 2000-09-09  Jim Meyering  <jim@meyering.net>
7887         * quotearg.c: Rename ISASCII to IN_CTYPE_DOMAIN, so people don't
7888         think it should be used as a general replacement for isascii.
7889         * fnmatch.c: Likewise.
7890         * mbswidth.c: Likewise
7891         * regex.c: Likewise.
7893         Don't use atoi.
7894         * userspec.c: Include sys/param.h and limits.h.
7895         Include xstrtol.h.
7896         (CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM): Define.
7897         (UID_T_MAX, GID_T_MAX, MAXUID, MAXGID): Define.
7898         (parse_user_spec): Use xstrtoul, not atoi when converting numeric
7899         UID, GID.  Check range.
7901 2000-09-06  Jim Meyering  <jim@meyering.net>
7903         * getopt.c (_getopt_internal): Update from glibc.
7905 2000-08-30  Jim Meyering  <jim@meyering.net>
7907         * strftime.c: Merge in changes from GNU libc.
7909 2000-08-26  Jim Meyering  <jim@meyering.net>
7911         * closeout.c: Include "__fpending.h".
7912         (close_stdout_status): Return right away if there's nothing to flush.
7914         * Makefile.am (noinst_HEADERS): Add __fpending.h.
7915         * __fpending.c: New file.
7916         * __fpending.h: New file.
7918 2000-08-07  Paul Eggert  <eggert@twinsun.com>
7920         Standardize on "memory exhausted" instead of "Memory exhausted"
7921         or "virtual memory exhausted".
7922         * obstack.c (print_and_abort): Use "memory exhausted", not
7923         "virtual memory exhausted".
7924         * same.c (same_name): Invoke xalloc_die instead of printing
7925         our own message.
7926         * userspec.c (parse_user_spec): Likewise.
7927         * bumpalloc.h: comment fix
7928         * same.c, userspec.c: Include xalloc.h.
7930         * xalloc.h (xalloc_msg_memory_exhausted): Now char const[],
7931         not char *const and pointing to a constant array.
7932         * xmalloc.c (xalloc_msg_memory_exhausted): Likewise.
7933         (xrealloc): Comment fix.
7935         * userspec.c (parse_user_spec):
7936         Don't translate a message until just before returning,
7937         to avoid unnecessary translation.
7939 2000-08-07  Jim Meyering  <jim@meyering.net>
7941         * addext.c, argmatch.c, argmatch.h, backupfile.h, bumpalloc.h,
7942         chown.c, diacrit.h, dirname.h, dup2.c, exclude.h, fileblocks.c,
7943         fnmatch.c, fnmatch.h, fsusage.c, fsusage.h, getdate.h,
7944         getgroups.c, gethostname.c, getopt.h, group-member.c,
7945         hard-locale.c, hash.h, isdir.c, lchown.c, linebuffer.c,
7946         linebuffer.h, long-options.h, malloc.c, md5.c, md5.h, memchr.c,
7947         memcmp.c, memcoll.c, memset.c, mktime.c, modechange.h, obstack.h,
7948         pathmax.h, realloc.c, rmdir.c, safe-read.c, save-cwd.c, stime.c,
7949         stpcpy.c, strcasecmp.c, strcspn.c, strdup.c, stripslash.c,
7950         strstr.c, strtod.c, strtol.c, strtoul.c, strtoull.c, strtoumax.c,
7951         utime.c, version-etc.h, xalloc.h, xstrdup.c, xstrtoumax.c,
7952         yesno.c: Back out Copyright date changes for each file with no change
7953         this year.  This eases coordination with other programs using the same
7954         source code modules.  From Paul Eggert.
7956 2000-08-03  Greg McGary  <greg@mcgary.org>
7958         * regex.c (SET_HIGH_BOUND, MOVE_BUFFER_POINTER,
7959         ELSE_EXTEND_BUFFER_HIGH_BOUND): New macros.
7960         (EXTEND_BUFFER): Use them.
7962 2000-08-01  Jim Meyering  <jim@meyering.net>
7964         * dirname.c (ISSLASH): Define.
7965         (BACKSLASH_IS_PATH_SEPARATOR): Define.
7966         (dir_name) [BACKSLASH_IS_PATH_SEPARATOR]: Handle the case in which
7967         both `\' and `/' may be use as path separators.
7968         Based on a patch from Prashant TR.
7970 2000-07-31  Paul Eggert  <eggert@twinsun.com>
7972         * quotearg.c (quotearg_n_options): Don't make the initial
7973         slot vector a constant, since it might get modified.
7975 2000-07-31  Jim Meyering  <jim@meyering.net>
7977         * xmalloc.c: Use `virtual memory exhausted', not `Memory exhausted'.
7978         * obstack.c (print_and_abort): Likewise.
7980 2000-07-30  Paul Eggert  <eggert@twinsun.com>
7982         * quotearg.c (quotearg_n_options): Preallocate a slot 0
7983         buffer, so that the caller can always quote one small
7984         component of a "memory exhausted" message in slot 0.
7985         From a suggestion by Jim Meyering.
7987 2000-07-30  Jim Meyering  <jim@meyering.net>
7989         * makepath.c (make_path): Quote the other instance, too.
7991         * quotearg.c (N_STATIC_SLOTVECS): Define.
7992         (STATIC_BUF_SIZE): Define.
7993         (quotearg_n_options): Use only statically allocated storage when
7994         N < N_STATIC_SLOTVECS and the length of the quoted result is smaller
7995         than STATIC_BUF_SIZE.
7997 2000-07-29  Jim Meyering  <jim@meyering.net>
7999         * diacrit.c (diacrit_diac): Use __MSDOS__ in favor of MSDOS.
8000         * dirname.c (dir_name): Likewise.
8002         * basename.c (base_name): Use ISSLASH rather than comparing against `/'.
8004         * dirname.c (dir_name) [MSDOS]: Declare `lim' to be const.
8005         (dir_name): Assert that there are no trailing slashes.
8007 2000-07-18  Bruno Haible  <haible@clisp.cons.org>
8009         * mbswidth.h (mbswidth): Add a flags argument.
8010         (mbswidth): New declaration.
8011         (MBSW_ACCEPT_INVALID, MBSW_ACCEPT_UNPRINTABLE): New macros.
8012         * mbswidth.c (mbswidth): Add a flags argument.
8013         (mbsnwidth): New function.
8015 2000-07-24  Jim Meyering  <jim@meyering.net>
8017         * mbswidth.c: Remove useless #else.  From Bruno Haible.
8019 2000-07-23  Paul Eggert  <eggert@twinsun.com>
8021         * mbswidth.c (_XOPEN_SOURCE):
8022         Don't define; this causes problems on Solaris 7.
8023         (wcwidth) [!HAVE_DECL_WCWIDTH]: Declare.
8025 2000-07-23  Paul Eggert  <eggert@twinsun.com>
8027         * quotearg.c:
8028         Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
8029         so that mbstate_t is always defined.
8031         Do not inspect MB_LEN_MAX, since it's incorrectly defined to
8032         be 1 in at least one GCC installation, and this configuration
8033         error is likely to be common.  Ignoring MB_LEN_MAX hurts
8034         performance on hosts that have mbrtowc but have only unibyte
8035         locales, but I assume these hosts are rare.
8037 2000-07-23  Paul Eggert  <eggert@twinsun.com>
8039         * quotearg.c: Streamline by invoking multibyte code only if needed.
8040         <wchar.h>: Include only if HAVE_MBRTOWC && 1 < MB_LEN_MAX.
8041         (MB_CUR_MAX): Redefine to 1 if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX).
8042         (quotearg_buffer_restyled): If a unibyte locale, don't bother to
8043         invoke multibyte primitives.
8045 2000-07-23  Jim Meyering  <jim@meyering.net>
8047         * basename.c (base_name): Add an assertion.
8049 2000-07-15  Bruno Haible  <clisp.cons.org>
8051         * quotearg.c: When the system forces us to redefine mbstate_t,
8052         shadow its mbsinit function.
8054 2000-07-16  Bruno Haible  <haible@clisp.cons.org>
8056         * mbswidth.h: New file.
8057         * mbswidth.c: New file.
8058         * Makefile.am (libfetish_a_SOURCES): Add mbswidth.c.
8059         (noinst_HEADERS): Add mbswidth.h.
8061 2000-07-17  Bruno Haible  <haible@clisp.cons.org>
8063         * config.charset: Add support for FreeBSD. Improve support for HP-UX
8064         and IRIX 6.
8066 2000-07-15  Jim Meyering  <jim@meyering.net>
8068         * makepath.c: Include quote.h.
8069         (make_path): Convert "`%s'" in format strings to "%s", and wrap each
8070         corresponding argument in a `quote (...)' call.
8071         Give better diagnostics.
8073         * Makefile.am (libfetish_a_SOURCES): Add quote.c.
8074         (noinst_HEADERS): Add quote.h.
8076         * quote.c (quote, quote_n): New file.  Two functions taken verbatim
8077         from tar's src/misc.c.
8078         * quote.h: New file.  Prototypes for same.
8080 2000-07-10  Paul Eggert  <eggert@twinsun.com>
8082         From a suggestion by Bruno Haible.
8083         * quotearg.c (mbrtowc): Do not use HAVE_WCHAR_H in the definition.
8084         Use defined mbstate_t, not HAVE_MBSTATE_T_OBJECT,
8085         to decide whether to define the BeOS workaround macro;
8086         this adjusts to the change to AC_MBSTATE_T.
8088 2000-07-13  Paul Eggert  <eggert@twinsun.com>
8090         * quotearg.h (enum quoting style): New enum clocale_quoting_style.
8092         * quotearg.c (quoting_style_args, quoting_style_vals,
8093         quotearg_buffer_restyled): Add support for
8094         clocale_quoting_style.  Undo previous change to
8095         locale_quoting_style behavior, and undo the "{LEFT QUOTATION MARK}"
8096         and "{RIGHT QUOTATION MARK}" msgids.
8098 2000-07-05  Paul Eggert  <eggert@twinsun.com>
8100         The old behavior of quoting `like this' doesn't look good with
8101         newer, ISO-style fonts.  See:
8102         http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html
8104         Instead, quote "like this" by default.  Let the translator
8105         tailor the locale-specific quoting behavior by providing
8106         translations for {LEFT QUOTATION MARK} and {RIGHT QUOTATION MARK}.
8108         * quotearg.c (N_): New macro.
8109         (gettext_default): New function.
8110         (quotearg_buffer_restyled): Use
8111         gettext_default ("{LEFT QUOTATION MARK}", "\"") for left quote, and
8112         gettext_default ("{RIGHT QUOTATION MARK}", "\"") for right quote.
8114 2000-07-09  Jim Meyering  <jim@meyering.net>
8116         * Most files: Update copyright dates to include 2000.
8118 2000-07-08  Jim Meyering  <jim@meyering.net>
8120         * xgethostname.c (ENAMETOOLONG): Define to an unlikely value
8121         if not defined.
8122         (xgethostname): Remove now-unnecessary #ifdef.
8123         Move declaration of `err' into loop where it's used.
8125 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
8127         * xgethostname.c (xgethostname): Protect against the SunOS 5.5 bug
8128         by allocating a larger buffer. Test the gethostname return value for
8129         being >= 0, not == 0, for BeOS.  Don't exhaust memory if gethostname
8130         returns an error and ENAMETOOLONG isn't defined.
8132 2000-07-05  Paul Eggert  <eggert@twinsun.com>
8133         and Bruno Haible  <haible@clisp.cons.org>
8135         * quotearg.c (mbrtowc): Declare returned type, since BeOS doesn't.
8137 2000-07-05  Bruno Haible  <haible@clisp.cons.org>
8139         * quotearg.c (struct quoting_options): Simplify quote_these_too
8140         dimension.
8142 2000-07-03  Jim Meyering  <jim@meyering.net>
8144         * strndup.c: [!HAVE_DECL_STRNLEN]: Declare strnlen.
8145         Reported by Bruno Haible.
8147 2000-07-04  Jim Meyering  <jim@meyering.net>
8149         * quotearg.c: Make inclusion of <wchar.h> independent of whether
8150         HAVE_MBRTOWC is set.  Required at least for irix-5.6, which
8151         lacks mbrtowc.
8153 2000-07-03  Paul Eggert  <eggert@twinsun.com>
8154         and Bruno Haible  <haible@clisp.cons.org>
8156         * quotearg.c (mbrtowc):
8157         Assign to *pwc, and return 1 only if result is nonzero.
8158         (iswprint): Use ISPRINT when substituting our own mbrtowc.
8160 2000-07-03  Jim Meyering  <jim@meyering.net>
8162         * readutmp.h: [HAVE_UTMPX_H]: Include <utmp.h> if HAVE_UTMP_H.
8163         This is necessary to get a definition of e.g., UTMP_FILE on HP-UX 10.20.
8164         From Bob Proulx.
8166 2000-07-02  Jim Meyering  <jim@meyering.net>
8168         * quotearg.c (mbstate_t): Don't define here.
8170 2000-07-02  Jim Meyering  <jim@meyering.net>
8172         * nanosleep.c (SIGCONT): Define if not already defined.
8174 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
8176         * mountlist.c: Use MOUNTED_FS_STAT_DEV instead of MOUNTED_NEXT_DEV,
8177         per change in ../m4/ls-mntd-fs.m4.
8178         (read_filesystem_list): Ignore symbolic links.
8180 2000-06-29  Jim Meyering  <jim@meyering.net>
8182         * same.c: Include <string.h> or <strings.h>, as appropriate,
8183         for declaration of strcmp.
8185         * long-options.c: Include <stdlib.h>, for declaration of exit.
8187         * mountlist.c (fsp_to_string) [HAVE_F_FSTYPENAME_IN_STATFS]:
8188         Avoid warning by casting result to `char *' to remove `const'.
8190 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
8192         * Makefile.am (libfetish_a_SOURCES): Remove readutmp.c.
8194 2000-06-26  Paul Eggert  <eggert@twinsun.com>
8196         savedir now sets errno on failure and invokes xmalloc to get memory.
8197         Fix a couple of other minor bugs while we're at it.
8199         * savedir.c (<unistd.h>): Do not include; there's no need.
8200         (NAMLEN): Remove macro.
8201         (malloc, realloc): Remove decls.
8202         (stpcpy): Likewise.
8203         ("xalloc.h"): Include.
8204         (NAME_SIZE_DEFAULT): New macro.
8205         (savedir): Use xmalloc / xrealloc to allocate memory.
8206         Use NAME_SIZE_DEFAULT if name_size is negative or overflows to zero.
8207         Skip "" directory entries.
8208         Use strlen to calculate directory entry length, since the old method
8209         is rarely used these days and isn't worth supporting.
8210         Don't use a pointer after freeing it.
8211         Check for integer overflow when calculating allocation size.
8212         Use memcpy to copy entries, instead of stpcpy.
8213         Set errno properly when returning NULL.
8214         Check for readdir error.
8216 2000-06-26  Jim Meyering  <jim@meyering.net>
8218         * posixtm.c [HAVE_STDLIB_H]: Include stdlib.h, for decl of abort.
8220 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
8222         * getusershell.c (xmalloc, xrealloc): Remove functions.
8223         Include xalloc.h.
8224         Don't include <stdlib.h>.  Don't declare malloc, realloc.
8226 2000-06-23  Bruno Haible  <haible@clisp.cons.org>
8228         * unicodeio.c (print_unicode_char): Work around ansi2knr deficiency.
8230 2000-06-24  Jim Meyering  <jim@meyering.net>
8232         * error.c [!HAVE_DECL_STRERROR_R]: Declare strerror_r.
8234 2000-06-21  Jim Meyering  <jim@meyering.net>
8236         * getpass.c: New file, from Bruno Haible.  Required for BeOS.
8238 2000-06-19  Paul Eggert  <eggert@twinsun.com>
8240         * quotearg.c: Include <wctype.h> after <wchar.h>, for Solaris 2.5.
8241         (mbrtowc, mbstate_t): Define substitutes if
8242         HAVE_MBRTOWC && HAVE_WCHAR_H && !HAVE_MBSTATE_T_OBJECT.
8243         (iswprint): Define to 1 if !defined iswprint && !HAVE_ISWPRINT,
8244         not if ! (HAVE_MBRTOWC && HAVE_WCHAR_H).
8246 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
8248         * xgetcwd.c (xgetcwd): If the required pathname length is smaller
8249         than 1024, return a memory chunk of least possible size, instead
8250         of size PATH_MAX + 2. In the loop, increment the size proportionally.
8251         Use free/xmalloc instead of xrealloc to avoid copying for very long
8252         paths.
8254 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
8256         * canon-host.c (canon_host): Use malloc and memcpy to copy an
8257         address, not strdup.  Include <stdlib.h> and don't declare free().
8259 2000-06-17  Bruno Haible  <haible@clisp.cons.org>
8261         * path-concat.c (path_concat): Don't access dir[-1] if dir is
8262         the empty string.
8264 2000-06-21  Jim Meyering  <jim@meyering.net>
8266         * Makefile.am (libfetish_a_SOURCES): Add getstr.c.
8267         (noinst_HEADERS): Add getstr.h.
8269         * getline.c (getstr): Move into a separate file.
8270         * getstr.c (getstr): New file, extracted from getline.c, with
8271         the following changes: new parameter, delim2; both delim[12]
8272         parameters have type `int', not `char'.  The latter would lose
8273         with 8-bit delimiters.
8274         * getstr.h: New file.
8276 2000-06-19  Jim Meyering  <jim@meyering.net>
8278         * getloadavg.c [HAVE_NLIST_H] (NLIST_STRUCT): Define.
8280 2000-06-18  Jim Meyering  <jim@meyering.net>
8282         * mkdir.c: Remove file, due mainly to copyright incompatibility.
8283         Besides, these days every porting target provides a mkdir function.
8285         * strnlen.c: Include memory.h, string.h, and/or strings.h as needed.
8286         (this snippet comes from src/system.h).
8288 2000-06-15  Paul Eggert  <eggert@twinsun.com>
8290         * human.c (adjust_value): New function.
8291         (human_readable_inexact): Apply rounding style even when
8292         printing approximate values.
8294 2000-06-14  Paul Eggert  <eggert@twinsun.com>
8296         * human.c (human_readable_inexact): Allow an input block
8297         size that is not a multiple of the output block size, and vice versa.
8298         Reported by Piergiorgio Sartor.
8300 2000-06-14  Paul Eggert  <eggert@twinsun.com>
8302         * getdate.y (get_date): Apply relative times after time
8303         zone indicator, not before.  Reported by Todd A. Jacobs.
8305 2000-06-13  Jim Meyering  <jim@meyering.net>
8307         * Makefile.am (all-local): Depend on lstat.c and stat.c.
8309         * xstat.in [!HAVE_DECL_FREE]: Declare free in lstat.c.
8311 2000-06-12  Paul Eggert  <eggert@twinsun.com>
8313         * xstat.in: Include <stdlib.h> in lstat, to declare "free".
8315 2000-06-04  Paul Eggert  <eggert@twinsun.com>
8317         * strnlen.c: Include <config.h> if HAVE_CONFIG_H.
8319 2000-06-04  Jim Meyering  <jim@meyering.net>
8321         * getugroups.c (getugroups): Cast -1 to gid_t, for systems like
8322         SunOS 4.1.4 for which gid_t is an unsigned type.
8324 2000-06-03  Jim Meyering  <jim@meyering.net>
8326         * strnlen.c [!HAVE_DECL_MEMCHR]: Declare memchr.
8328 2000-05-26  Bruno Haible  <haible@clisp.cons.org>
8330         * Makefile.am (install-exec-local): On systems with glibc-2.1 or
8331         newer, don't install charset.alias.
8332         * config.charset: Change the Linux/glibc rules so they become empty
8333         on glibc-2.1 or newer.
8335 2000-06-02  Jim Meyering  <jim@meyering.net>
8337         * mountlist.c: Back out last change.  Instead, do this...
8338         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Set the me_dummy
8339         member using the same `ignore'-testing code.
8340         * mountlist.h (ME_DUMMY): Add `autofs' to the list of ignored
8341         fs_type strings.
8342         From Mark D. Roth.
8344 2000-05-29  Jim Meyering  <jim@meyering.net>
8346         * mountlist.c (read_filesystem_list) [MOUNTED_VMOUNT]: Ignore mounts
8347         with the `ignore' attribute.  Based on a patch from Mark D. Roth.
8349 2000-05-22  Jim Meyering  <jim@meyering.net>
8351         * makepath.c: Remove old, now-unnecessary `#ifdef __MSDOS__' block.
8353 2000-05-18  Jim Meyering  <jim@meyering.net>
8355         * hash.c (hash_rehash): Fix a nasty bug: copy the free entry list
8356         back, too, since it may have been modified by allocate_entry.
8357         (hash_delete): Rewrite to use neither the assignment operator
8358         nor the comma operator in an if-expression.
8360 2000-05-15  Paul Eggert  <eggert@twinsun.com>
8362         * closeout.c:
8363         <sys/stat.h>, <sys/types.h>, <unistd.h>, (STDOUT_FILENO):
8364         Remove; no longer needed.
8365         "quotearg.h": Add include.
8366         (file_name): Do not bother to explicitly initialize to NULL; it's less
8367         efficient on some hosts.
8368         (close_stdout_status): Remove test as to whether stdout was already
8369         closed; it breaks for the case "echo x | sort >&-".
8370         Quote file name colons.
8371         Do not assume that _("write error") lacks format strings.
8373 2000-05-15  Jim Meyering  <jim@meyering.net>
8375         * version-etc.c (version_etc_copyright): Update the copyright string
8376         used in all --version output.
8378 2000-05-14  Jim Meyering  <jim@meyering.net>
8380         * closeout.c (close_stdout_set_file_name): New function.
8381         (close_stdout_status): Use new file-scoped global.
8382         Return right away if fstat says the stdout file descriptor is invalid.
8383         * closeout.h (close_stdout_set_file_name): Declare.
8385 2000-05-10  Jim Meyering  <jim@meyering.net>
8387         * closeout.c [default_exit_status]: New file-scoped variable.
8388         (close_stdout_set_status): New function.
8389         * closeout.h (close_stdout_set_status): Declare.
8391 2000-05-08  Jim Meyering  <jim@meyering.net>
8393         * long-options.c: Don't include closeout.h.
8394         (parse_long_options): Don't call close_stdout for --version.
8396 2000-05-06  Jim Meyering  <jim@meyering.net>
8398         * strnlen.c: Undefine __strnlen and strnlen.
8399         [!weak_alias]: Define __strnlen to strnlen.
8401         * atexit.c: New file, from libiberty.
8403 2000-05-06  Jim Meyering  <jim@meyering.net>
8405         * closeout.c (close_stdout_status): Also check for errors on the
8406         stderr stream.
8408 2000-05-05  Bruno Haible  <haible@clisp.cons.org>
8410         * localcharset.c (get_charset_aliases): Use malloc, realloc and memcpy
8411         instead of xmalloc, xrealloc, path_concat.
8412         (locale_charset): Treat empty environment variables as absent.
8413         (DIRECTORY_SEPARATOR, ISSLASH): New macros.
8415 2000-05-04  Jim Meyering  <jim@meyering.net>
8417         * getopt.c: Update from glibc.
8418         * obstack.c: Likewise.
8419         * obstack.h: Likewise.
8420         * regex.c: Likewise.  NB: K&R compiler support is dropped for this file
8422         * regex.h: Likewise.
8423         * strndup.c: Likewise.
8424         * strnlen.c: New file, from glibc.
8426 2000-05-01  Jim Meyering  <jim@meyering.net>
8428         * full-write.c (full_write): Remove `FIXME' part of comment.
8430 2000-04-29  Jim Meyering  <jim@meyering.net>
8432         * path-concat.c: Declare strdup only if it's not defined.
8433         * canon-host.c: Likewise.
8435 2000-04-28  Jim Meyering  <jim@meyering.net>
8437         * rpmatch.c [HAVE_LIMITS_H]: Include limits.h before regex.h to avoid
8438         redefinition warning on some systems (HPUX).  Otherwise, regex.h is
8439         included first, then limits.h is included by locale.h by libintl.h.
8440         From John David Anglin.
8442 2000-04-25  Jim Meyering  <jim@meyering.net>
8444         * makepath.c (S_IRWXUGO): Define.
8445         (make_path): Always perform explicit chmod if MODE specifies any
8446         of the `special' permission bits.  Prompted by a bug report against
8447         install from Mate Wierdl and Joost van Baal.
8449 2000-04-18  Jim Meyering  <jim@meyering.net>
8451         * README: New file.
8453         * getpagesize.h [!getpagesize && HAVE_OS_H && B_PAGE_SIZE]: Define
8454         getpagesize.  For BeOS.  Based on a patch from Bruno Haible.
8456 2000-04-17  Jim Meyering  <jim@meyering.net>
8458         * strftime.c (my_strftime) [strftime]: Declare strftime here, since
8459         the definition of it to rpl_strftime also defined-away the system's
8460         declaration.
8462 2000-04-15  Jim Meyering  <jim@meyering.net>
8464         Use `C' to denote so-called `contiguous' files, the same way
8465         that tar does.
8466         * filemode.c (S_ISCTG) [!S_ISCTG && S_IFCTG]: Define.
8467         (ftypelet): Use S_ISCTG.
8468         From Michael Deutschmann.
8470 2000-04-14  Jim Meyering  <jim@meyering.net>
8472         * strftime.c (my_strftime) [#ifdef strftime]: Declare strftime.
8474 2000-04-08  Jim Meyering  <jim@meyering.net>
8476         * Makefile.am (charset.alias): Use t-$@, not $@-t so the DOS 8.3
8477         names don't conflict.  Reported by Eli Zaretskii.
8479 2000-03-28  Bruno Haible  <haible@clisp.cons.org>
8481         * unicodeio.c (print_unicode_char): Avoid triggering Solaris iconv
8482         bug.  Deal with the different error behavior of Irix iconv.
8484 2000-04-07  Jim Meyering  <jim@meyering.net>
8486         * putenv.c: Move inclusion of errno.h so it follows that of sys/types.h,
8487         to work around system header problems on AIX 3.2.5.  From Bruno Haible.
8489 2000-04-05  Jim Meyering  <jim@meyering.net>
8491         Portability tweaks required for ultrix4.3.
8492         * readutmp.h [HAVE_UTMPX_H && !HAVE_DECL_GETUTENT]: Declare getutent.
8493         * readutmp.c: Include sys/types.h before sys/stat.h.
8494         * canon-host.c: Declare strdup.
8495         * path-concat.c: Likewise.
8496         From John David Anglin.
8498 2000-04-04  Jim Meyering  <jim@meyering.net>
8500         Be more DOS 8.3-friendly.
8501         * ref-add.sin: Renamed from ref-add.sed.in.
8502         * ref-del.sin: Renamed from ref-del.sed.in.
8503         * Makefile.am: Reflect renaming.
8504         Reported by Eli Zaretskii.
8506         Use a temporary file name that won't clash with `charset.alias'
8507         in the DOS 8.3 name space.
8508         * Makefile.am (charset_tmp): Define.
8509         (install-exec-local): Use $(charset_tmp) instead of $(charset_alias)-t.
8510         (uninstall-local): Likewise.
8511         Reported by Eli Zaretskii.
8513 2000-03-29  Paul Eggert  <eggert@twinsun.com>
8515         * time/strftime.c (my_strftime): Make sure we call the system
8516         strftime, not ourselves, when invoking the underlying strftime.
8518 2000-03-24  Jim Meyering  <jim@meyering.net>
8520         * Makefile.am (EXTRA_DIST): Add ref-add.sed.in and ref-del.sed.in.
8521         (charset_alias): Define.
8522         (install-exec-local): Factor out common code.
8523         (uninstall-local): Split lines longer than 80.
8524         (ref-add.sed, ref-del.sed): Remove rules... (do the following instead)
8525         (SUFFIXES): Define.
8526         (.sed.in.sed): New rule.  Don't redirect directly to $@.
8527         (CLEANFILES): Add ref-add.sed and ref-del.sed.
8529 2000-03-19  Bruno Haible  <haible@clisp.cons.org>
8531         * config.charset: Output a line containing "Packages using this file".
8532         * ref-add.sed.in, ref-del.sed.in: New files.
8533         * Makefile.am (install-exec-local, uninstall-local, ref-add.sed,
8534         ref-del.sed): New rules.
8536 2000-03-17  Jim Meyering  <jim@meyering.net>
8538         * unicodeio.c (<string.h>): Include only #if HAVE_STRING_H.
8539         Otherwise, include <strings.h>
8541 2000-03-17  Bruno Haible  <haible@clisp.cons.org>
8543         * unicodeio.c (utf8_wctomb): New function.
8544         (print_unicode_char): Pass the Unicode character to iconv in UTF-8
8545         format instead of in UCS-4 with platform dependent endianness.
8547 2000-03-07  Paul Eggert  <eggert@twinsun.com>
8549         * savedir.c (savedir): Work even if directory size is
8550         negative; this can happen with some screwy NFS configurations.
8552 2000-03-06  Jim Meyering  <jim@meyering.net>
8554         * localcharset.c (get_charset_aliases): Don't try to free file_name
8555         if it's NULL (because we ran out of memory).  From Bruno Haible.
8557 2000-03-05  Jim Meyering  <jim@meyering.net>
8559         * localcharset.c ("path-concat.h"): Include.
8560         (get_charset_aliases): Use path_concat instead of ANSI string
8561         concatenation.
8563         * unicodeio.h (PARAMS): Define.
8564         Use it to guard prototype.
8566 2000-03-04  Jim Meyering  <jim@meyering.net>
8568         * Makefile.am (install-exec-local): Create $(libdir) before installing
8569         into it.
8570         (uninstall-local): Uncomment this rule so `make distcheck' works
8571         once again.
8573         * unicodeio.c (<errno.h>): Include it.
8574         (errno): Declare if not defined.
8576         * localcharset.c: Add Bruno's comment justifying use of volatile.
8578         * config.charset: New version, incorporating remarks from a linux
8579         i18n mailing list.  From Bruno Haible.
8581 2000-03-02  Jim Meyering  <jim@meyering.net>
8583         * Makefile.am (EXTRA_DIST): Add config.charset.
8585 2000-03-01  Jim Meyering  <jim@meyering.net>
8587         * localcharset.c: Guard some #includes with `#if HAVE_...'.
8588         * unicodeio.c: Likewise.
8590 2000-02-02  Bruno Haible  <haible@clisp.cons.org>
8592         * config.charset: New file.
8593         * localcharset.c: New file.
8594         * unicodeio.h, unicodeio.c: New files.
8595         * Makefile.am (DEFS): Add -DLIBDIR=...
8596         (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
8597         (noinst_HEADERS): Add unicodeio.h.
8598         (all-local, install-exec-local, charset.alias): New targets.
8600 2000-02-28  Paul Eggert  <eggert@twinsun.com>
8602         * quotearg.c (ALERT_CHAR): New macro.
8603         (quotearg_buffer_restyled): Use it.
8605 2000-02-27  Jim Meyering  <jim@meyering.net>
8607         * strtoumax.c: Fix typo in decl of strtoul: s/long long/long/.
8608         Guard declaration of strtoull also with `&& HAVE_UNSIGNED_LONG_LONG'.
8610         * backupfile.c: Guard inclusion of stdlib.h with `#if HAVE_STDLIB_H',
8611         not `#if STDC_HEADERS'.
8612         Declare malloc if needed.
8614         * backupfile.c: Use `#if !HAVE_DECL...' instead of `#ifndef HAVE_DECL..'
8615         now that autoconf always defines the HAVE_DECL_ symbols.
8616         * human.c: Likewise.
8617         * same.c: Likewise.
8618         * strtoumax.c: Likewise.
8620         * backupfile.c: Arrange for cpp to fail if the configure-time
8621         declaration check was not run.
8622         * hash.c: Likewise.
8623         * human.c: Likewise.
8624         * same.c: Likewise.
8625         * strtoumax.c: Likewise.
8627         * userspec.c (parse_user_spec): If there is no `:' but there is a `.',
8628         then first look up the entire `.'-containing string as a login name.
8630 2000-02-18  Paul Eggert  <eggert@twinsun.com>
8632         * getdate.y: Handle two-digit years with leading zeros correctly.
8633         (textint): New typedef.
8634         (parser_control): Member year changed from int to textint.
8635         All uses changed.
8636         (YYSTYPE): Removed; replaced by %union with int and textint members.
8637         (tDAY, tDAY_UNIT, tDAYZONE, tHOUR_UNIT, tID, tLOCAL_ZONE, tMERIDIAN,
8638         tMINUTE_UNIT, tMONTH, tMONTH_UNIT tSEC_UNIT, tSNUMBER, tUNUMBER,
8639         tYEAR_UNIT, tZONE, o_merid): Now of type <intval>.
8640         (tSNUMBER, tUNUMBER): Now of type <textintval>.
8641         (date, number, to_year): Use width of number in digits, not its value,
8642         to determine whether it's a 2-digit year, or a 2-digit time.
8643         (yylex): Store number of digits of numeric tokens.
8644         Reported by John Kendall.
8646         (parser_control): Changed from struct parser_control to typedef (for
8647         consistency).  All uses changed.
8649         (tID): Removed; not used.
8650         (yylex): Return '?' for unknown identifiers, rather than (unused) tID.
8652 2000-02-14  Paul Eggert  <eggert@twinsun.com>
8654         * getpagesize.h (getpagesize): Port to VMS for Alpha;
8655         adapted from changes to grep getpagesize.h by Martin P.J. Zinser.
8657 2000-02-12  Jim Meyering  <jim@meyering.net>
8659         * userspec.c (ISDIGIT): Define it.
8660         (isdigit): Remove definition.
8661         (is_number): Use ISDIGIT, not isdigit.
8662         <libintl.h>: Include.
8663         (_ and N_): Define.
8664         (parse_user_spec): Mark translatable strings.
8666 2000-02-10  Jim Meyering  <jim@meyering.net>
8668         With these changes, nanosleep.[ch] are finally enough like the other
8669         lib/* replacement files to compile on a few more losing systems.
8671         * nanosleep.h: Don't include config.h.
8672         Remove prototype from declaration of nanosleep.
8673         (PARAMS): Remove now-unneeded definition.
8674         * nanosleep.c: #undef nanosleep.
8675         (rpl_nanosleep): Rename from nanosleep.
8677 2000-02-03  Jim Meyering  <jim@meyering.net>
8679         * readutmp.c (read_utmp): Guard with `#ifdef UTMP_NAME_FUNCTION',
8680         rather than with `#if HAVE_UTMPNAME'.
8682 2000-02-01  Jim Meyering  <jim@meyering.net>
8684         * readutmp.h (UT_USER): Add parens.  From Andreas Schwab.
8686 2000-01-31  Jim Meyering  <jim@meyering.net>
8688         * nanosleep.h (nanosleep): Guard declaration with
8689         `#if ! HAVE_DECL_NANOSLEEP'.
8690         Without this, OFS gets a redeclaration error for rpl_nanosleep, due to
8691         the declaration in that vendor's sys/timers.h.
8692         Reported by Christian Krackowizer.
8694         * quotearg.c (ISASCII): Add #undef and move definition to follow
8695         inclusion of wctype.h to work around Solaris 2.6 namespace pollution.
8696         (ISPRINT): Likewise.
8697         Reported by Tom Tromey.
8699 2000-01-30  Jim Meyering  <jim@meyering.net>
8701         * readutmp.c (extract_trimmed_name): Use UT_USER instead of hard-coding
8702         uses of ->ut_name.  The latter doesn't work with new Linux header files
8703         where only utmpx.ut_user is declared.
8705         * readutmp.h (UT_USER): Define.
8707 2000-01-23  Jim Meyering  <jim@meyering.net>
8709         * Makefile.am (libfetish_a_SOURCES): Remove explicit mention of
8710         obstack.c.
8712 2000-01-22  Jim Meyering  <jim@meyering.net>
8714         * strtoumax.c: [! HAVE_DECL_STRTOUL]: Declare strtoul.
8715         [! HAVE_DECL_STRTOULL]: Declare strtoull.
8716         Required for some AIX systems.  Reported by Christian Krackowizer.
8717         [TESTING] (main): New function.
8719         1997-10-17  Eli Zaretskii  <eliz@is.elta.co.il>
8720         * dirname.c (dir_name): Support for DOS-style file names with drive
8721         letters.
8723         * quotearg.c [HAVE_WCTYPE_H]: Include <wctype.h> for decl of iswprint.
8725         * strverscmp.c (ISDIGIT): Define.
8726         (strverscmp): Use ISDIGIT, not isdigit.
8728 2000-01-17  Paul Eggert  <eggert@twinsun.com>
8730         * nanosleep.c (nanosleep):
8731         Don't use SA_INTERRUPT to decide whether to call sigaction, as
8732         POSIX.1 doesn't require SA_INTERRUPT and some systems
8733         (e.g. Solaris 7) don't define it.  Use SA_NOCLDSTOP instead;
8734         it's been part of POSIX.1 since day 1 (in 1988).
8736 2000-01-17  Jim Meyering  <jim@meyering.net>
8738         * interlock: Remove unused file.  Reported by François Pinard.
8740 2000-01-16  Paul Eggert  <eggert@twinsun.com>
8742         * quotearg.c (quotearg_buffer_restyled): Do not quote
8743         alert, backslash, formfeed, and vertical tab unnecessarily in
8744         shell quoting style.
8747         -----
8749         Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free
8750         Software Foundation, Inc.
8752         Copying and distribution of this file, with or without
8753         modification, are permitted provided the copyright notice
8754         and this notice are preserved.