*** empty log message ***
[coreutils.git] / ChangeLog
blob7836f77340ccfed9adaf699b5e252081c9ce9e50
1 2004-03-12  Jim Meyering  <jim@meyering.net>
3         * Version 5.2.1.
5         Sometimes, when source and destination partition are different,
6         mv mistakenly fails to preserve a hard link.  Reported by IIDA Yosiaki.
8         * src/copy.c: When moving a set of N hard-linked files between
9         partitions, via two or more command line arguments where the
10         command line argument containing the Nth link contains no other
11         link to that same file, mv would mistakenly copy the file, rather
12         than hard-linking it to the other(s).  That happens because when the
13         final link is processed, its link count has been reduced to 1 since
14         the other links have been `copied' to the destination partition
15         and the source links have been removed.
16         (copy_internal): When in move mode, use the source dev/inode
17         pair to look up destination name even when st_nlink == 1.
18         * src/cp-hash.c (src_to_dest_lookup): New function.
19         * src/cp-hash.h (src_to_dest_lookup): Add prototype.
20         * tests/mv/part-hardlink: New file.  Test for the above fix.
21         * tests/mv/Makefile.am (TESTS): Add part-hardlink.
23         * announce-gen: Sync with autoconf.
25         * tests/ls/time-1: Exit 77 (not 1) if we can't set up for the test.
26         This was triggered on a Linux-2.2.19 system using a file system
27         NFS-mounted from some sort of Sun.
29 2004-03-11  Jim Meyering  <jim@meyering.net>
31         * Use automake-1.8.3.  Regenerate dependent files.
33 2004-03-10  Jim Meyering  <jim@meyering.net>
35         * tests/du/deref-args: Also convert sizes in the 70-79 kB range,
36         so that this test works with SELinux-enabled systems.
37         Based on a patch from Tim Waugh.
39         `join -1 x' would give a misleading diagnostic
40         * src/join.c (string_to_join_field): Report that a non-numeric field
41         number is invalid, rather than `so large that it is not representable'.
42         * tests/join/Test.pm (invalid-j): New partial test for the above fix.
44 2004-03-06  Jim Meyering  <jim@meyering.net>
46         cp --sparse=always sparse-image-file.img /dev/hda1 could
47         produce an invalid copy on the destination device.
49         * src/copy.c (copy_reg): Even with --sparse=always, try to
50         make `holes' only if the destination is a regular file.
51         Reported by Szakacsits Szabolcs.
53 2004-03-03  Paul Eggert  <eggert@twinsun.com>
55         * src/nohup.c (main): Don't invoke set_cloexec_flag with
56         a file descriptor of -1.
58 2004-03-02  Dmitry V. Levin  <ldv@altlinux.org>
60         * src/nohup.c: Include "cloexec.h".
61         (main): Set the copy of stderr to close on exec.
63 2004-03-01  Paul Eggert  <eggert@twinsun.com>
65         * configure.ac: Include <signal.h> when checking for strsignal,
66         sys_siglist, and friends.  Problem reported by Tony Leneis in
67         <http://mail.gnu.org/archive/html/bug-coreutils/2004-02/msg00136.html>.
69 2004-02-25  Paul Eggert  <eggert@twinsun.com>
71         * tests/du/deref-args, tests/du/exclude, tests/du/slash:
72         * tests/du/trailing-slash: Run envvar-check in case BLOCK_SIZE
73         etc. are set.
75 2004-02-23  Paul Eggert  <eggert@twinsun.com>
77         * NEWS: Document how chown's USER.GROUP argument is now parsed.
79 2004-02-23  Jim Meyering  <jim@meyering.net>
81         * src/seq.c (usage): Remove stray space after \n in --help output.
83 2004-02-22  Jim Meyering  <jim@meyering.net>
85         * src/du.c (usage): Separate -H and --si.  Say that the meaning
86         of -H will soon change to that of --dereference-args (-D).
88 2004-02-21  Jim Meyering  <jim@meyering.net>
90         * src/comm.c (usage): Tell what comm does when there are no options.
91         Reword in terms of FILE1 and FILE2 rather than `left file' and
92         `right file'.  Suggestion from Dan Jacobson.
94 2004-02-15  Paul Eggert  <eggert@twinsun.com>
96         Fix some POSIX-conformance bugs in expr.
98         * NEWS: document the following changes to src/expr.c.
99         * doc/coreutils.texi (expr invocation): Likewise.
100         Document what forms integers may take, and say "integer"
101         consistently instead of "number".  Warn about operands
102         that "expr" can misinterpret, and how to work around the
103         problem.
104         * src/expr.c (eval, eval7, eval6, eval5, eval4, eval3, eval2, eval1):
105         Accept a bool argument specifying whether to evaluate the
106         expression.  This is to allow short-circuit evaluation.  All
107         callers changed.
108         (null): Report that a string is zero even if it has
109         a form like "-0" or "00".
110         (eval1, eval): Use short-circuit evaluation for | and &.
111         (eval): Return 0 if both arguments are null or zero, instead
112         of returning the first argument.
113         * tests/expr/basic: Add some tests for the above.
115 2004-02-17  Jim Meyering  <jim@meyering.net>
117         * Version 5.2.0.
119         `make check' from a build inside a chroot environment would fail
120         * tests/help-version: Specify an argument (`/') for df, in the
121         unusual event that there is no valid entry in /etc/mtab.
122         Likewise for id: add the -u option, so we don't get spurious
123         failures when there are no user or group names.
124         Patch by Tim Waugh.
126         * src/sort.c (usage) [-u]: Add punctuation so that the description in
127         the help2man-generated (line-joined) man page is more readable.
128         Reported by Tim Waugh.
129         [-T]: Add a semicolon, for the same reason.
131 2004-02-15  Jim Meyering  <jim@meyering.net>
133         * Makefile.am (dist-hook): Qualify target with $(srcdir)/ prefix.
135 2004-02-11  Jim Meyering  <jim@meyering.net>
137         * tests/Makefile.am.in ($(srcdir)/Makefile.am): Use more portable
138         $(srcdir)/../Makefile.am.in, rather than $<.
139         Suggestion from Michael Elizabeth Chastain.
141 2004-02-10  Jim Meyering  <jim@meyering.net>
143         * config/install-sh: Make this script executable.
144         * Makefile.am (dist-hook): New target, to ensure that config/install-sh
145         is executable.  Otherwise, on systems that lack a suitable install
146         binary, `make install' would fail, because of the way this script
147         is invoked (without `$SHELL ' prefix).
148         Reported by Bob Proulx.
150 2004-02-08  Jim Meyering  <jim@meyering.net>
152         * Version 5.1.3.
154         * tests/rm/rm5: Avoid triggering a bug in OSF/Tru64's sed
155         that would cause an unwarranted test failure.
156         * tests/rm/rm3: Likewise.
158 2004-02-07  Jim Meyering  <jim@meyering.net>
160         Remove xstat function pointer member.  The way it was used was not
161         portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
162         inline `stat' and `lstat' functions, thus making the tests of
163         `xstat == lstat' in copy.c always fail.
164         * src/copy.h (struct cp_options) [xstat]: Remove member.
165         (XSTAT): New macro.
166         * src/copy.c (copy_dir): Set `.dereference' member, not .xstat.
167         (copy_internal): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.
168         Use `x->dereference == DEREF_NEVER' in place of `x->xstat == lstat'.
169         (valid_options): Remove now-obsolete FIXME comments.
171         * src/cp.c (re_protect): Use `XSTAT (x, ...)' in place of
172         `*(x->xstat) (...)'.
173         (do_copy): Declare/use local xstat rather than x->xstat.
174         (main): Remove code that set x.xstat.
175         * src/mv.c (cp_option_init): Don't initialize xstat member.
176         * src/install.c (cp_option_init): Likewise.
178         * Makefile.cfg (gnu_ftp_host-alpha, etc.): Un-factor .gnu.org suffix,
179         so that emit_upload_commands can use these variables, too.
181 2004-02-06  Jim Meyering  <jim@meyering.net>
183         * tests/rm/deep-1: Remove `du' stack space test.
184         Apparently, `ulimit -s N' isn't portable enough.
185         This test will be restored (with a guard against losing ulimit)
186         in its own file later.
188         * tests/rm/deep-1 (deep): Remove progress-style diagnostics,
189         since this test doesn't take long enough to merit them.
190         Run du on $tmp (the containing dir), not $deep, the full path to leaf.
192         * Makefile.maint (signatures): Remove definition.
193         Now, automake's gnupload handles this.
194         (%.sig: %): Remove now-unused rule.
195         (rel-files): Use automake's $(DIST_ARCHIVES), rather than
196         `$(distdir).tar.bz2 $(distdir).tar.gz'.
197         (emit-upload-commands): Adjust to use gnupload.
199 2004-02-05  Jim Meyering  <jim@meyering.net>
201         * src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP): Remove definitions.
202         (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
203         Now, those are all defined in timespec.h.
204         Include timespec.h.
206         * src/date.c: Don't include timespec.h, now that system.h does it.
208 2004-02-02  Paul Eggert  <eggert@twinsun.com>
210         Don't dump core if localtime returns NULL (possible on
211         hosts with 64-bit time_t and 32-bit int).
212         * src/date.c: Include "inttostr.h".
213         (batch_convert, main):
214         If time conversion fails, exit with nonzero status.
215         (show_date): Return int to report conversion failure.
216         Print the time as an int if localtime fails.
217         * src/uptime.c: Print "??" if the current clock can't
218         be converted by localtime.  This won't happen until the year
219         2*31 + 1900, but we don't want to dump core even if the current
220         clock has the wrong value.
222         * src/stat.c: Include "inttostr.h".
223         (human_time): Print the date/time as a number of seconds since the
224         epoch if it can't be converted by localtime.  This is better than
225         just saying "invalid", and is consistent with what "ls" does.
226         Don't dump core if the year has more than 48 digits; this isn't
227         possible on any contemporary host, but we might as well do it right.
229 2004-01-31  Paul Eggert  <eggert@twinsun.com>
231         * src/stat.c (human_time): Accept time rather than
232         pointer-to-const-time parameter, for clarity.  All callers changed.
234 2004-02-02  Jim Meyering  <jim@meyering.net>
236         * src/stat.c (do_stat): Remove extra trailing newline from
237         default formats.  Reported by Nelson H. F. Beebe.
239         Print actual fractional seconds in time stamps, not just `.00000000'.
240         * src/stat.c (human_time): Add and use new parameter, t_ns.
241         (print_stat): Update callers.
242         * src/ls.c (TIMESPEC_NS): Remove definition.
243         * src/system.h (TIMESPEC_NS): Define here, instead, now that stat.c
244         also uses this macro.
245         Nelson H. F. Beebe noticed that ls --full-time printed nonzero
246         fractional seconds for files on an XFS file system, but that stat's
247         fractional seconds were always zero.
249 2004-01-28  Paul Eggert  <eggert@twinsun.com>
251         * src/seq.c (print_numbers): Use 'double' for loop index, not
252         'int', to avoid problems with integer overflow.  On almost all
253         machines 'double' works in every case where 'int' works, and
254         it works on other cases besides.
256 2004-01-27  Jim Meyering  <jim@meyering.net>
258         * src/seq.c (usage): Mention that if INCREMENT is omitted,
259         it defaults to 1, even when FIRST is larger than LAST.
260         Reword so as not to exclude the possibility that INCREMENT be zero.
262 2004-01-25  Jim Meyering  <jim@meyering.net>
264         * Version 5.1.2.
266         * Makefile.maint (signatures): Comment out definition.
268 2004-01-23  Jim Meyering  <jim@meyering.net>
270         * Makefile.maint (header_regexp): Add exitfail.
272         * man/Makefile.am (EXTRA_DIST): Add help2man.
273         Reported by Nelson H. F. Beebe.
275         * man/Makefile.am (.x.1): Prefix help2man invocation with `$(PERL) --'
276         so it works on systems with Perl installed somewhere other than in
277         /usr/bin.
279         * src/paste.c (paste_parallel): Declare local, chr, to be of type
280         `int', not `char', since it must hold EOF.  This bug would make
281         paste infloop on some systems.  Test failures reported by
282         Nelson H. F. Beebe and Christian Krackowizer.
284 2004-01-22  Jim Meyering  <jim@meyering.net>
286         * tests/rmdir/fail-perm: New file.  Test for just-fixed rmdir bug.
287         * tests/rmdir/Makefile.am (TESTS): Add fail-perm.
289         * man/help2man: Fix it so using --info-page='coreutils PROG' works.
290         * man/Makefile.am (.x.1): Invoke our own (tweaked) copy of help2man.
291         Use --info-page='coreutils PROG' option.
292         Now, readlink.1 refers the user to `info coreutils readlink'
293         rather than to `info readlink'.  Reported by Matt Swift.
295 2004-01-21  Paul Eggert  <eggert@twinsun.com>
297         Exit status cleanup.
299         * src/basename.c (usage): Use EXIT_SUCCESS, not 0, for clarity.
300         * src/cat.c, src/chgrp.c, src/chmod.c, src/chown.c, src/chroot.c,
301         * src/cksum.c, src/comm.c, src/cp.c, src/csplit.c, src/cut.c,
302         * src/date.c, src/dd.c, src/df.c, src/dircolors.c, src/dirname.c,
303         * src/du.c, src/echo.c, src/env.c, src/expand.c, src/expr.c,
304         * src/factor.c, src/fmt.c, src/fold.c, src/head.c, src/hostid.c,
305         * src/hostname.c, src/id.c, src/install.c, src/join.c, src/kill.c,
306         * src/link.c, src/ln.c, src/logname.c, src/ls.c, src/md5sum.c,
307         * src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c,
308         * src/nl.c, src/nohup.c, src/od.c, src/paste.c, src/pathchk.c,
309         * src/pinky.c, src/pr.c, src/printenv.c, src/printf.c, src/pwd.c,
310         * src/rm.c, src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c,
311         * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c,
312         * src/su.c, src/sum.c, src/sync.c, src/tac.c, src/tail.c, src/tee.c,
313         * src/test.c, src/touch.c, src/tr.c, src/tsort.c, src/tty.c,
314         * src/uname.c, src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c,
315         * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c: Likewise.
317         * src/cat.c (usage): Don't bother normalizing exit status
318         since the arg is already the correct exit status now.
319         * src/cksum.c, src/comm.c, src/csplit.c, src/cut.c,
320         * src/dircolors.c, src/expand.c, src/fmt.c, src/fold.c, src/head.c,
321         * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c,
322         * src/pr.c, src/split.c, src/sum.c, src/tac.c, src/tail.c, src/tr.c,
323         * src/tsort.c, unexpand.c, src/src/uniq.c, src/src/wc.c: Likewise.
325         * src/chown.c (main): Removed unused local 'fail'.
327         * src/chroot.c (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE):
328         Remove.
330         * src/chroot.c (main): Initialize exit_failure to EXIT_FAIL.
331         * src/env.c, src/nice.c, src/su.c: Likewise.
332         * src/nohup.c (main): Likewise, to NOHUP_FAILURE.
333         * src/setuidgid.c (main): Likewise, to SETUIDGID_FAILURE.
334         * src/expr.c (main): Use initialize_exit_failure rather than
335         setting exit_failure directly; this optimizes away redundant
336         assignments.
337         * src/printenv.c, src/sort.c, src/test.c, src/tty.c: Likewise.
339         * src/chroot.c (main): Exit with status 1 rather than 127
340         if chroot itself fails, as per documentation.
342         * src/chroot.c (main): Use EXIT_ENOENT and EXIT_CANNOT_INVOKE
343         rather than roll-your-own symbols or integers.
344         * src/env.c (main): Likewise.
345         * src/nohup.c (main): Likewise.
346         * src/su.c (run_shell): Likewise.
348         * src/cp.c (exit_status): Remove static var....
349         (main): Making it local here instead.  Use =, not |=, to set it.
351         * src/cut.c (FATAL_ERROR, main): Exit with status EXIT_FAILURE,
352         not 2, on errors.
353         * src/date.c (batch_convert, main): Likewise.
354         * src/dd.c (dd_copy): Likewise.
355         * src/pr.c (first_last_page, main, getoptarg): Likewise.
356         * src/tr.c (main): Likewise.
357         * src/date.c (main): Don't assume EXIT_FAILURE == 1, as
358         POSIX doesn't require it.
359         * src/dd.c (write_output, skip, dd_copy): Likewise.
360         * src/df.c (main): Likewise.
361         * src/id.c (main): Likewise.
362         * src/install.c (main): Likewise.
363         * src/ln.c (main): Likewise.
364         * src/ls.c (main): Likewise.
365         * src/mv.c (main): Likewise.
366         * src/shred.c (main): Likewise.
368         * src/env.c (main): Exit with status 1, not 2, on errors detected
369         by env proper.
370         * src/hostname.c (main): Likewise.
371         * src/nl.c (main): Likewise.
372         * src/stty.c (main): Likewise.
374         * src/expr.c (EXPR_FAILURE): Renamed from EXPR_ERROR, for
375         consistency with the other programs' naming conventions.
376         All uses changed.
378         * src/factor.c (main): Do not report a usage error simply
379         because stdin has bad numbers.
381         * src/id.c (problems): Now a boolean int, not a counter,
382         so that we don't have to worry about int overflow.  All uses changed.
383         * src/touch.c (err): Likewise.
385         * src/md5sum.c (main): Use int, not size_t, to store boolean int.
387         * src/mkfifo.c (main): Exit with status 1, not 4, if not implemented.
388         * src/mknod.c: Likewise.
390         * src/nice.c (main): Exit with status EXIT_FAIL, not EXIT_FAILURE,
391         on error; this is in case EXIT_FAILURE is unusual.
392         * src/su.c (main): Likewise.
394         * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE): Remove; all uses
395         changed to EXIT_CANNOT_INVOKE.
397         * src/printenv.c (PRINTENV_FAILURE): New constant.
398         (main): Exit with status PRINTENV_FAILURE, not EXIT_FAILURE, on
399         command-line syntax problems.
401         * src/rmdir.c (remove_parents): Don't set 'fail' to a negative number.
402         (main): Avoid integer overflow when seeing whether errors occurred.
404         * src/seq.c (print_numbers): Now returns void, not (zero) int.
405         All callers changed.
406         (main): Remove unused local variable 'errs'.  Always exit successfully
407         if we reach the end.
409         * src/setuidgid.c (SETUIDGID_FAILURE): Renamed from FAIL_STATUS,
410         for consistency with other programs here.  All uses changed.
411         (main): Use 'error' to exit rather than invoking 'exit' here.
413         * src/sort.c: Don't include <assert.h>.
414         (SORT_OUT_OF_ORDER,  SORT_FAILURE): Now enums, not macros.
415         (usage): Don't use 'assert'.
416         (main): Remove redundant assignment to exit_failure.
418         * src/system.h (EXIT_FAIL, EXIT_CANNOT_INVOKE, EXIT_ENOENT):
419         New enum values.
420         (initialize_exit_failure): New inline function.
421         Include exitfail.h here, since we refer to exit_failure.
422         All callers changed to not include exitfail.h.
424         * src/tty.c (TTY_FAILURE, TTY_WRITE_ERROR): New enum values;
425         substitute them for the corresponding integer constants.
427         * tests/help-version (expected_failure_status_date): Remove, as
428         'date' is now normal.
429         (expected_failure_status_nohup): New var.
431 2004-01-21  Jim Meyering  <jim@meyering.net>
433         * tests/touch/relative: Remove `command' syntax.
434         Thanks to Nelson H. F. Beebe and Paul Eggert.
436         * tests/touch/relative: Test only year/month/day, not hours/min/sec,
437         so as to avoid problems with systems using TAI clocks.
438         Although it's no longer necessary, set TZ=UTC0 also for the
439         initial touch command.  Reported by Paul Jarc here:
440         http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/1504
442 2004-01-20  Diego Biurrun  <diego@biurrun.de>
444         * src/dircolors.hin: Add .mov to the list of media files.
446 2004-01-19  Paul Eggert  <eggert@twinsun.com>
448         * tests/touch/relative: Use TZ=UTC0, not TZ=utc (which isn't
449         portable).  Problem reported by Christian Krackowizer.  Also, use
450         +0000 rather than +0 to specify a time zone, as the documentation
451         requires four digits.
453 2004-01-19  Jim Meyering  <jim@meyering.net>
455         * tests/mv/hard-4: Run envvar-check in case SIMPLE_BACKUP_SUFFIX is set.
456         * tests/mv/backup-is-src: Likewise.
457         Problem reported by Peter Horst
459 2004-01-17  Jim Meyering  <jim@meyering.net>
461         * announce-gen (print_changelog_deltas): Use .sig suffix, not .asc.
463         * Version 5.1.1.
465 2003-12-15  Paul Eggert  <eggert@twinsun.com>
467         * NEWS, doc/coreutils.texi: touch -r and -d can now both be specified,
468         with -r specifying the origin for -d.
469         * src/touch.c (flexible_date): Remove static var.
470         (get_reldate): New function.
471         (main): Use it, to implement this new behavior.
473 2004-01-16  Jim Meyering  <jim@meyering.net>
475         * tests/touch/relative: New test for the above.
476         * tests/touch/Makefile.am (TESTS): Add relative.
478 2004-01-13  Jim Meyering  <jim@meyering.net>
480         * src/system.h: Include contents of sys2.h.
481         * src/sys2.h: Remove file.
482         * src/Makefile.am (noinst_HEADERS): Remove sys2.h.
484         * Use automake-1.8.2.  Regenerate dependent files.
486         * Update to gettext-0.13.1.
487         * configure.ac: Use gettext-0.13.1.
488         * .x-sc_space_tab: Add m4/po.m4 to the list of exceptions.
490 2004-01-12  Jim Meyering  <jim@meyering.net>
492         * Makefile.maint (%.sig): Use .sig suffix rather than .asc.
494         * Makefile.maint (po-check): Ensure that cvsu works before using it.
495         Reported by Alexandre Duret-Lutz.
497         * src/tail.c (main): Warn about following stdin only when it's a tty.
499         * configure.ac: Use gl_DEFAULT_POSIX2_VERSION.
501 2004-01-10  Jim Meyering  <jim@meyering.net>
503         * tests/misc/stat-fmt: Use backticks, not `$()' notation.
505 2004-01-09  Jim Meyering  <jim@meyering.net>
507         * configure.ac: Quote underquoted `jm_DUMMY_1' to avoid new warning.
509 2004-01-08  Jim Meyering  <jim@meyering.net>
511         * src/stat.c (human_fstype): Use %lx, not %x format for `unsigned long'.
512         From Andreas Schwab.
514         * tests/Makefile.am (TESTS_ENVIRONMENT): Remove `/vg' (prerelease test
515         remnant) from PATH component.  That would cause tests in this directory
516         not to run the just-built binaries, but rather whatever happened
517         to be in one's PATH.  Reported by Christian Krackowizer.
519 2004-01-04  Jim Meyering  <jim@meyering.net>
521         * src/csplit.c (new_control_record): Use x2nrealloc
522         rather than xrealloc.
524         * src/cp.c (re_protect): Use ASSIGN_STRDUPA rather than
525         alloca and strcpy.
526         (make_path_private): Likewise.
528 2004-01-03  Jim Meyering  <jim@meyering.net>
530         * src/paste.c: Use `bool' (not int) as the type for a few
531         global variables.
532         (collapse_escapes): Rewrite to set globals rather than modifying
533         its parameter.
534         Use size_t (not int) for all counters and related index variables.
535         (paste_parallel): Remove needless complexity of
536         using xrealloc in the loop;  just allocate the buffers up front.
537         Free the two temporary buffers.
538         Move declarations of locals `down' into scope where used.
539         (paste_serial): Remove `register' attributes.
540         (main): Simplify delim-related code.
541         Free `delims', now that it's malloc'd.
543 2004-01-02  Jim Meyering  <jim@meyering.net>
545         * src/chroot.c: Include "quote.h".
546         (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): Define.
547         (main): Exit with status of 127, not 1, for too-few-args,
548         chroot failure, or chdir failure.
549         Give a better diagnostic upon execvp failure.
551         * src/du.c (usage): Mention that, with its current meaning,
552         -H is deprecated.
554         * src/tail.c (main): Warn about following stdin when it's a tty.
555         Fail when following by name but no names are specified.
557 2003-12-30  Jim Meyering  <jim@meyering.net>
559         * src/fold.c (main): Use memcpy, not strcpy.
561         * src/copy.c (copy_internal): Use ASSIGN_STRDUPA rather than
562         alloca and strcpy.
564 2003-12-28  Jim Meyering  <jim@meyering.net>
566         * src/unexpand.c (n_tabs_allocated): New global.
567         (add_tabstop): Use x2nrealloc rather than xrealloc.
568         * src/expand.c: Likewise.
570         * tests/misc/expand: New file.
571         * tests/misc/Makefile.am (TESTS): Add expand.
573         * src/sort.c (add_temp_dir): Use x2nrealloc rather than xrealloc.
574         (fillbuf): Use x2nrealloc rather than xrealloc.
575         (sort): Use xnmalloc rather than xmalloc.
576         (main): Likewise.
578 2003-12-27  Jim Meyering  <jim@meyering.net>
580         * src/tee.c (tee): Use xnmalloc rather than xmalloc.
582 2003-12-29  Paul Eggert  <eggert@twinsun.com>
584         * NEWS: Remove support for join -j1 FIELD, -j2 FIELD, and -o LIST1
585         LIST2 in POSIX 1003.1-2001 hosts, as required by POSIX.
587         * doc/coreutils.texi (join invocation): Remove documentation
588         accordingly.  Document that -t makes all separators significant.
590         * src/join.c: Include posixver.h.
591         (obsolete_usage): New var.
592         (longopts): Put obsolete options first.
593         (OBSOLETE_LONG_OPTIONS): New constant.
594         (get_option, add_file_name): New functions.
595         (main): Use them to support new behavior.
596         (usage): Remove documentation for -j1 FIELD and -j2 FIELD.
597         Do not mark -j FIELD as obsolescent; it is longstanding
598         UNIX tradition and is a valid extension to POSIX.
600         * tests/join/Test.pm (tv): Avoid obsolete -o usage.
602 2003-12-28  Paul Eggert  <eggert@twinsun.com>
604         * src/join.c (add_field_list): Don't use alloca with unbounded
605         size; just modify the argument, which is no longer const *.
607         Various other minor cleanups, mostly to avoid the need for casts.
609         (extract_field): Renamed from ADD_FIELD, as it's now a function.
611         (struct field.beg): Now char *, not unsigned char const *.  All
612         uses changed.  It shouldn't be const since xmemcoll writes on its
613         arguments.
614         (extract_field): Likewise, for 2nd arg.
615         (keycmp): Remove now-unnecessary cast of xmemcoll args.
617         (is_blank): New function, to avoid need to cast arg to unsigned char.
618         (extract_field): Use it.
620         (xfields): Rewrite pretty much from scratch.
622         (hard_LC_COLLATE): Now bool, not int.
623         (get_line, getseq, add_field_list): Now returns bool, not int.
624         (decode_field_spec, add_field_list): Return true on success (not
625         false), for consistency with the rest of the code.  All uses changed.
627         (tab): Now char, not unsigned char.  This wasn't 100% necessary
628         but is slightly cleaner.
629         (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler.
631         (empty_filler): Now const *.
633         (make_blank): Remove; wasn't needed.  Remove all calls.
634         (main): Don't set uni_blank.nfields; zero is fine.
636 2003-12-27  Jim Meyering  <jim@meyering.net>
638         * src/join.c: Include "quote.h".
639         (min, max): Remove definitions.
640         Make a few function parameters and corresponding
641         locals `const'.  Use bool for boolean variables.
642         Use size_t (not int) for all counters and related index variables.
643         (prjoin): Remove now-useless assertion.
644         (string_to_join_field): New function.
645         (main): Accept join fields as large as SIZE_MAX.
646         (keycmp): Rename `min' to MIN and max to MAX.
648 2003-12-26  Jim Meyering  <jim@meyering.net>
650         fold -s didn't work on e.g., alpha-based systems.
651         * src/fold.c (fold_file): Adjust types (int->size_t) so that using
652         x2nrealloc works properly on systems with differing sizes for int
653         and size_t.  Reported by Nelson Beebe.
655         * src/fold.c: Use `bool' (not int) as the type for a few
656         global variables.
658 2003-12-23  Paul Eggert  <eggert@twinsun.com>
660         * src/ls.c (length_of_file_names_and_frills):
661         Remove forward decl; not needed.
662         (print_file_name_and_frills, length_of_file_name_and_frills):
663         With -m, don't output spaces before inum or size.
664         (print_with_commas): Don't output space just before newline.
666 2003-12-24  Jim Meyering  <jim@meyering.net>
668         * tests/ls/Makefile.am (TESTS): Add m-option.
669         * tests/ls/m-option: New file.  Test for above fixes.
671 2003-12-20  Jim Meyering  <jim@meyering.net>
673         * Version 5.1.0.
675         * src/pr.c: Change type of global, buff_allocated, to size_t.
677         * src/join.c [struct seq]: Change types of members count and alloc
678         from `int' to `size_t'.
680         * tests/Makefile.am (root-hint): Tweak wording.
682         * src/du.c: Accept new option (-0, --null) that makes it so each
683         output line is NUL-terminated rather than newline-terminated.
685         * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync.
686         Reported by Volker Paul.
687         * tests/dd/Makefile.am (TESTS): Add unblock-sync.
688         * tests/dd/unblock-sync: New test for the above.
690 2003-12-19  Jim Meyering  <jim@meyering.net>
692         * tests/misc/nohup: Double quote back-ticked expression,
693         in case it ends up having an unexpected value.
695         * tests/ls/no-arg: Use ls's -1 option in both runs.
697         * src/du.c (fts_debug): New global.
698         (FTS_CROSS_CHECK, DEBUG_OPT): Define.
699         (main): Make fts use FTS_TIGHT_CYCLE_CHECK.
700         (main) [DU_DEBUG]: Accept -d option.
702 2003-12-18  Jim Meyering  <jim@meyering.net>
704         * src/ls.c (format_user): Increment dired_pos via two statements,
705         `dired_pos += width; dired_pos++;' rather than one,
706         `dired_pos += width + 1;' since the latter could conceivably overflow.
707         (format_group): Likewise.
708         From Paul Eggert.
710         * configure.ac: Require automake-1.8.
712 2003-12-12  Jim Meyering  <jim@meyering.net>
714         * Use automake-1.8.  Regenerate dependent files.
716 2003-12-08  Jim Meyering  <jim@meyering.net>
718         * Makefile.maint (news-date-check): New rule.
719         (alpha beta major): Depend on it.
721 2003-12-03  Paul Eggert  <eggert@twinsun.com>
723         * NEWS: ls -l (and similar options) now adjust all columns to
724         fit the data.  Generalized from a suggestion by Leah Q for file sizes.
725         * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
726         (format_user_width, format_group_width, unsigned_file_size,
727         format_group): New functions.
728         (block_size_width): Renamed from block_size_size.
729         (inode_number_width, nlink_width, owner_width, group_width,
730         author_width, major_device_number_width, minor_device_number_width,
731         file_size_width): New vars.
732         (clear_files): Initialize them.
733         (gobble_file): Set them.  Don't ceiling block_size_width to 7.
734         (print_long_file): Use them.
735         (gobble_file): Use a new local variable 'f' to make the code
736         smaller and more consistent with other functions.
737         (format_user): Output to stdout, not to a buffer, so that we
738         don't have to worry about buffer overrun.  Update dired_pos.
739         (print_long_file): Don't put owner, group, author into buffer;
740         just print them directly.  Don't assume link counts and
741         major and minor numbers fit into unsigned long int.
742         * tests/cp/same-file, tests/mv/part-symlink: Don't assume that
743         'ls' output is fixed-width.
745 2003-12-02  Jim Meyering  <jim@meyering.net>
747         * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h.
749 2003-11-27  Jim Meyering  <jim@meyering.net>
751         * Use automake-1.7f.  Regenerate dependent files.
753 2003-11-24  Paul Eggert  <eggert@twinsun.com>
755         Parse floating-point operands and options in the C locale.
756         POSIX requires this for printf, and we might as well be
757         consistent elsewhere (tail, sleep, seq).
759         * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer
760         needed now that we assume C89.  Include "c-strtod.h".
761         (xstrtod): Call c_strtod, not strtod.
762         * src/sleep.c: Include "c-strtod.h".
763         (main): Update xstrtod call to include new argument, c_strtod.
764         * src/seq.c (scan_double_arg): Likewise.
765         * src/tail.c (parse_options): Likewise.
767 2003-11-24  Jim Meyering  <jim@meyering.net>
769         * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM).
770         Reported by Mark Conty.
772 2003-11-22  Jim Meyering  <jim@meyering.net>
774         * Makefile.maint (sc_xalloc_h_in_src): Remove rule.  Subsumed by...
775         (sc_system_h_headers): Do this test only if sys2.h exists.
777 2003-11-20  Jim Meyering  <jim@meyering.net>
779         * tests/help-version: Ensure that the bug-reporting address is
780         included in the --help output for every program.
781         * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.
783         * src/ptx.c (usage): Output bug-reporting address.
784         Reported by Dan Jacobson.
786 2003-11-19  Jim Meyering  <jim@meyering.net>
788         * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted
789         on the join fields.  Suggestion from Bruce Robertson.
791 2003-11-18  Jim Meyering  <jim@meyering.net>
793         `od -c -w9999999' could segfault
794         * src/od.c (dump): Use xnmalloc/free, not alloca.
796 2003-11-16  Jim Meyering  <jim@meyering.net>
798         * Use autoconf-2.59.  Regenerate dependent files.
800         * tests/du/hard-link: Minor tweak: use mkdir -p.
802         Fix read-from-free'd-buffer error detected by valgrind.
803         * src/csplit.c (remove_line): Don't return a pointer to data in
804         a freed buffer.  Instead, arrange to free the buffer on the
805         subsequent call.
807         * tests/misc/csplit: New test for above fix.
809 2003-11-11  Jim Meyering  <jim@meyering.net>
811         * src/ls.c (extract_dirs_from_files): Avoid useless copy operations.
812         This avoids a warning from valgrind about memcpy with overlapping
813         source and destination.
815         * configure.ac: Require automake-1.7.8.
817 2003-11-09  Jim Meyering  <jim@meyering.net>
819         * Use automake-1.7.9.  Regenerate dependent files.
821         * src/rm.c: Support new options: --preserve-root and --no-preserve-root.
822         * src/chown.c: Likewise.
824         * src/chown-core.c: Include "root-dev-ino.h".
825         (chopt_init): Initialize new member.
826         (change_file_owner): Support rm's new --preserve-root option.
828         * src/remove.c: Include "root-dev-ino.h".
829         (remove_cwd_entries): Remove now-obsolete FIXME comment.
830         (remove_dir): Support rm's new --preserve-root option.
832         * src/chown.c: Include "root-dev-ino.h".
833         Add new options: --preserve-root and --no-preserve-root.
835         * src/chmod.c: Include "root-dev-ino.h".
836         (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
837         ROOT_DEV_INO_WARN macros.
838         (get_root_dev_ino): Remove function definition, now that it's
839         been moved to a separate file.
840         (usage): Describe new options.
842         * src/mv.c (rm_option_init): Initialized new member.
844         * src/remove.h: Include "dev-ino.h".
845         (struct rm_options): Add new member: root_dev_ino.
846         * src/chown-core.h: Include "dev-ino.h".
847         (struct Chown_option): Add new member: root_dev_ino.
849 2003-11-06  Jim Meyering  <jim@meyering.net>
851         * src/paste.c (paste_parallel): Use `sizeof *var' rather than
852         hard-coding `sizeof FILE*'.
854 2003-11-05  Dennis Smit  <ds@nerds-incorporated.org>
856         * src/wc.c (main): Free `fstatus' so there is no confusion about
857         whether it's leaked or not.
858         * src/who.c (who): Likewise for `utmp_buf'.
860 2003-11-05  Paul Eggert  <eggert@twinsun.com>
862         Fix 'cut' problems with size_t overflow and unsigned int.
863         More generally, resize integer variables to fit use more precisely.
864         * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens.
865         (struct range_pair): Make members to be of type size_t, not unsigned.
866         (max_range_endpoint, eol_range_start): Now size_t, not unsigned.
867         (suppress_non_delimited, output_delimiter_specified,
868         have_read_stdin, print_kth, set_fields): Now bool, nt int.
869         (delim): Now unsigned char, not int.
870         (mark_printable_field, is_printable_field, is_range_start_index,
871         set_fields, set_fields, cut_bytes, cut_fields):
872         Use size_t, not unsigned, for field and byte counts.
873         (hash_int): Use uintptr_t, not unsigned, for pointers converted
874         to integers.  This squeezes more info out of them.
875         (set_fields, cut_bytes, cut_fields, main):
876         Use bool, not int, for booleans.
877         (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc.
879 2003-11-05  Paul Eggert  <eggert@twinsun.com>
881         * man/Makefile.am (check-programs-vs-x):
882         Work even if $(programs) contains '$'.
883         Work even if 'missing=1' in environment.
884         Don't report an error simply because $(programs) outputs nothing.
886 2003-11-05  Jim Meyering  <jim@meyering.net>
888         * Use autoconf-2.58.  Regenerate dependent files.
890         * src/tr.c (spec_init): Fix typo in last change.
892         * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in
893         call to variadic version_etc function, so that it works even on systems
894         for which sizeof char* != sizeof int.
895         * src/true.c (main): Likewise.
896         * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c:
897         * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c:
898         * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c:
899         * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c:
900         Similarly, cast NULL to `(char *)' in call to variadic function,
901         parse_long_options, so that it works even on systems for which
902         sizeof char* != sizeof int.
903         A similar problem was reported by Harti Brandt in
904         http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html.
906         * src/users.c (users): Free `utmp_buf' explicitly so that people
907         don't mistake this for a real leak.
908         Patch by Dennis Smit <ds@nerds-incorporated.org.
910 2003-11-04  Paul Eggert  <eggert@twinsun.com>
912         * README: Document _POSIX2_VERSION.
914 2003-11-04  Jim Meyering  <jim@meyering.net>
916         * src/tac.c (memrchr): Remove #if-0'd function.
917         (tac_stdin_to_mem): Clean up #if-0'd code.
919         * src/od.c (decode_format_string): Remove unnecessary casts.
920         Use more maintainable `sizeof *var'.
921         (main): Call decode_format_string rather than decode_one_format,
922         now that `spec' may be NULL.
924         * src/chmod.c (AUTHORS): Add my name.
926         * src/split.c (next_file_name): Use `sizeof *var' rather than
927         hard-coding `sizeof size_t'.
929         * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...).
931         * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc,
932         to avoid potential overflow in pointer arithmetic.
933         (set_fields): Use not `1', but rather `sizeof *printable_field' as
934         second argument to xcalloc.
935         * src/od.c (decode_format_string, dump_strings): Use x2nrealloc
936         rather than xrealloc.
937         * src/date.c (show_date): Likewise.
938         * src/join.c (ADD_FIELD, initseq, getseq): Likewise.
939         * src/pr.c (store_char): Likewise.
940         * src/fold.c (fold_file): Likewise.
942         * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
943         type changes (unsigned int -> size_t) in hash.c.
944         * src/cp-hash.c (src_to_dest_hash): Likewise.
945         * src/du.c (entry_hash): Likewise.
946         * src/ls.c (dev_ino_hash): Likewise.
947         * src/cut.c (hash_int): Likewise.  Declare function as static.
949 2003-11-03  Jim Meyering  <jim@meyering.net>
951         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
952         * tests/misc/fold: Fail the test immediately if we're not running
953         the expected version of fold.
955 2003-11-02  Jim Meyering  <jim@meyering.net>
957         * src/tr.c (append_normal_char, append_range, append_char_class)
958         (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var'
959         rather than `sizeof EXPLICIT_TYPE'.  The former is more maintainable
960         and usually shorter.
961         * src/copy.c (copy_internal): Likewise.
962         * src/join.c (initseq, add_field, make_blank): Likewise.
963         * src/od.c (main): Likewise.
964         * src/cp.c (make_path_private): Likewise.
965         * src/tsort.c (new_item, record_relation): Likewise.
967         * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise.
968         (main): Also remove anachronistic cast of xmalloc return value.
969         * src/ptx.c (alloc_and_compile_regex, main): Likewise.
970         (main): Also remove anachronistic cast of xmalloc return value.
971         * src/sort.c (inittables): Likewise.
972         (sort): Also Split a long line.
974 2003-10-25  Jim Meyering  <jim@meyering.net>
976         * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
977         type changes (unsigned int -> size_t) in hash.c.
978         * src/cp-hash.c (src_to_dest_hash): Likewise.
979         * src/du.c (entry_hash): Likewise.
980         * src/ls.c (dev_ino_hash): Likewise.
981         * src/cut.c (hash_int): Likewise.  Declare function as static.
983 2003-10-21  Jim Meyering  <jim@meyering.net>
985         Don't fail when run with VERBOSE=yes.
986         * tests/chgrp/basic: Do `set +x' before starting the subshell
987         from which we invoke chgrp.  Otherwise, the output from the
988         VERBOSE=yes-induced `set -x' would result in spurious differences.
989         Reported by Russel Coker via Michael Stone.
991 2003-10-19  Jim Meyering  <jim@meyering.net>
993         chmod now uses fts to perform a directory traversal when -R is
994         specified.  Before, it operated on full path names, and as such
995         would encounter the PATH_MAX (often 4096) limit.
997         * src/chmod.c: Include "xfts.h".
998         (process_file): Rename from change_file_mode.
999         Adapt to be used with fts.
1000         (process_files): New function.
1002 2003-10-18  Jim Meyering  <jim@meyering.net>
1004         * tests/du/deref-args: Ensure that du -D now dereferences all
1005         symlinks specified on the command line, not just those that
1006         reference directories.
1008         * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1009         * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1010         * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1011         * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1012         * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1013         * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1014         * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1015         * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
1016         of 2003-09-19.  Now, AUTHORS is a comma-separated list of strings.
1017         Update the call to parse_long_options so that `AUTHORS, NULL' are the
1018         last parameters.
1019         * src/true.c (main): Append NULL to version_etc argument list.
1020         * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
1022 2003-10-17  Andreas Schwab  <schwab@suse.de>
1024         * tests/mk-script: Get $srcdir from first parameter instead of
1025         hardcoding it.
1026         (main): Update usage.
1028         * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as
1029         first argument of mk-script.
1030         ($(srcdir)/Makefile.am): Likewise.  Prepend $(srcdir) to target.
1032 2003-10-17  Jim Meyering  <jim@meyering.net>
1034         * src/mv.c (usage): Tweak descriptions of -i and -f so that the
1035         generated `man' page is more readable.  Suggestion from Dan Jacobson.
1037         * src/chown-core.c (change_file_owner): Handle the cases in
1038         which fts_info indicates an error with the given entry.
1040         * src/du.c (main): Simply assign to bit_flags.
1041         Don't bother with bit arithmetic.
1043         * tests/chmod/no-x: New file.
1044         * tests/chgrp/no-x: New file.
1045         * tests/chmod/Makefile.am (TESTS): Add no-x.
1046         * tests/chgrp/Makefile.am (TESTS): Likewise.
1048         * src/du.c: Include "xfts.h".
1049         (du_files): Use xfts_open, rather than fts_open.
1050         * src/chown-core.c (chown_files): Likewise.
1052 2003-10-16  Jim Meyering  <jim@meyering.net>
1054         * src/chgrp.c (main): Simply assign to bit_flags.
1055         Don't bother with bit arithmetic.
1056         * src/chown.c (main): Likewise.
1057         Rename a couple of local variables.
1058         Remove unnecessary casts.
1060         * src/tail.c (start_bytes): Rename local, remainder, to avoid
1061         gcc's warning about shadowing a global.
1063 2003-10-15  Jim Meyering  <jim@meyering.net>
1065         chown and chgrp now accept POSIX-mandated -H, -L, -P options and
1066         use fts to perform a directory traversal when -R is specified.
1067         Before, they operated on full path names, and as such would
1068         encounter the PATH_MAX (often 4096) limit.
1069         They are more efficient.  For example, before, chgrp -R would
1070         take almost 5 seconds to change about 2000 directories and fail
1071         (with `File name too long'), while now it succeeds on a hierarchy
1072         of depth 20,000 in 1/10 the time.
1074         * src/chown.c: Include "userspec.h" and "fts_.h".
1075         (WRITTEN_BY): Add my name.
1076         (getpwnam, getgrnam, getgrgid): Remove declarations.
1077         (endpwent): Remove definition.
1078         (usage): Update.
1079         (main): Handle new options.
1080         Call new function, chown_files rather than change_file_owner.
1082         * src/chgrp.c: Include "fts_.h".
1083         (WRITTEN_BY): Add my name.
1084         (MAXUID, MAXGID): Remove definitions.  Use GID_T_MAX instead of
1085         the latter.
1086         (usage): Update.
1087         (main): Handle new options.
1088         Call new function, chown_files rather than change_file_owner.
1090         Rewrite to iterate through hierarchies using fts rather than
1091         via explicit recursion.
1092         * src/chown-core.c: Include "fts_.h"
1093         (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
1094         on a single file at a time.
1095         (chown_files): New function.
1096         * src/chown-core.h [enum Dereference_symlink]: Remove declaration.
1097         [struct Chown_option] (recurse, force_silent): Change type to `bool'.
1098         [struct Chown_option] (dereference): Remove member with ambiguous name.
1099         [struct Chown_option] (affect_symlink_referent): New member.
1100         (chown_files): New prototype.
1102         * tests/chgrp/recurse: Update tests accordingly.
1103         * tests/chgrp/posix-H: New tests for the above.
1104         * tests/chgrp/Makefile.am (TESTS): Add posix-H.
1106         * src/ln.c (usage): Clarify that --directory, -d, -F probably won't
1107         work even for superuser.  Suggestion from Dan Jacobson.
1109 2003-10-14  Paul Eggert  <eggert@twinsun.com>
1111         Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
1112         properly diagnosed.
1113         * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h,
1114         lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib.
1115         * src/sort.c (parse_field_count): Handle the case where overflow
1116         and invalid suffix char are both reported.
1118 2003-10-14  Jim Meyering  <jim@meyering.net>
1120         * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the
1121         warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
1122         true on Linux.
1124 2003-10-13  Paul Eggert  <eggert@twinsun.com>
1126         Fix to avoid a denial-of-service attack if the display width is
1127         enormous.  Also, clean up the code a bit by removing duplicate code.
1129         * src/ls.c (init_column_info): Remove forward decl; no longer needed.
1130         (calculate_columns): New function, that contains code that used
1131         to be common to print_many_per_line and print_horizontal.
1132         (print_many_per_line, print_horizontal): Use it.
1133         (decode_switches): Set max_idx here, not in calculate_columns.
1134         (print_current_files): Don't call init_column_info; calculate_columns
1135         now does that.
1136         (init_column_info): Don't allocate a lot more space than is needed
1137         to represent the current set of files.  Allocate all the new
1138         size_t cells in one call to xnmalloc, rather than a row at a time.
1140 2003-10-13  Jim Meyering  <jim@meyering.net>
1142         * src/ls.c (init_column_info): Add another FIXME comment.
1144 2003-10-13  Paul Eggert  <eggert@twinsun.com>
1146         Fix address-arithmetic bug in 'ls', reported by Georgi Guninski.
1147         Remove several arbitrary limits on hosts where int cannot represent
1148         all size_t values.
1150         * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent,
1151         nfiles, files_index, tabsize, line_length, struct column_info.line_len,
1152         struct column_info.col_arr[0], max_idx):
1153         Now size_t, not int.
1154         (get_funky_string): Return bool indicating success, instead of
1155         a negative count to indicate failure.  Store number of columns
1156         through new parameter OUTPUT_COUNT; that way, they can never
1157         go negative.  Change equals_end from int to bool.  All uses
1158         changed.
1159         (struct column_info.valid_len): Now bool, not int.  All uses changed.
1160         (dired_dump_obstack, get_funky_string, clear_files,
1161         extract_dirs_from_files, print_current_files,
1162         print_many_per_line, print_horizontal, init_column_info,
1163         put_indicator, length_of_file_name_and_frills,
1164         print_with_commas): Use size_t, not int, for local variables
1165         that count sizes.
1166         (decode_switches): Decode sizes using xstrtoul, not xstrtol.
1167         Check for TIOCGWINSZ returing negative values (or values greater
1168         than SIZE_MAX!).
1169         (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
1170         init_column_info):
1171         Use xmalloc and xnmalloc, not XMALLOC.
1172         (gobble_file): Use xnrealloc, not XREALLOC.
1173         (print_color_indicator): Remove now-unnecessary cast to size_t.
1175 2003-10-12  Paul Eggert  <eggert@twinsun.com>
1177         * tests/du/no-x: Change wording of diagnostic to match latest du.c.
1178         * tests/sort/sort-tests: Remove from CVS; assume that people
1179         brave enough to check coreutils out from CVS can rebuild it.
1181 2003-10-12  Jim Meyering  <jim@meyering.net>
1183         New options: --preserve-root and --no-preserve-root.
1184         * src/chmod.c (change_file_mode): Honor new option.
1185         (change_file_mode): Strip trailing slashes on directory
1186         argument passed to change_dir_mode.
1187         (get_root_dev_ino): New function.
1188         (main): Initialize global, root_dev_ino.
1190         * src/copy.c (copy_internal): Don't #ifdef-out simple uses of
1191         S_ISLNK or S_ISSOCK.  The S_IS* macros are guaranteed to be defined
1192         via system.h.
1193         * src/chmod.c (change_file_mode): Likewise.
1195 2003-10-08  Jim Meyering  <jim@meyering.net>
1197         * src/csplit.c (main): Remove obsolete FIXME.
1199 2003-10-07  Jim Meyering  <jim@meyering.net>
1201         * Use automake-1.7.8.  Regenerate dependent files.
1203 2003-09-29  Paul Eggert  <eggert@twinsun.com>
1205         csplit cleanup.
1207         * doc/coreutils.texi (csplit invocation):
1208         The regexp offset need not have a sign; POSIX requires support
1209         for signless offets.
1211         Be more careful about int widths.  For example, remove some
1212         arbitrary limits by replacing 'unsigned' with 'size_t',
1213         'uintmax_t', etc.  Use standard bool rather than a homegrown type.
1214         * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
1215         * src/csplit.c (FALSE, TRUE, boolean): Remove.  All uses changed
1216         to <stdbool.h> usage.
1217         (struct control): offset is now intmax_t, not int.
1218         repeat_forever is now bool, not int.
1219         (struct cstring): len is now size_t, not unsigned int.
1220         (struct buffer_record): bytes_alloc, bytes_used, num_lines are now
1221         size_t, not unsigned.  start_line, first_available are now
1222         uintmax_t, not unsigned.
1223         (hold_count, control_used): Now size_t, not unsigned.
1224         (last_line_number, current_line, bytes_written):
1225         Now uintmax_t, not unsigned.
1226         (save_to_hold_area, red_input, keep_new_line, record_line_starts,
1227         create_new_buffer, get_new_buffer, load_buffer, find_line,
1228         process_regexp, split_file, new_control_record, extract_regexp,
1229         get_format_width, get_format_prec, max_out):
1230         size args, locals, and returned values are now size_t, not unsigned
1231         or int.
1232         (get_first_line_in_buffer, find_line, write_to_file,
1233         handle_line_error, process_line_count, regexp_error, process_regexp,
1234         split_file):
1235         File line, byte, and repetition counts are now uintmax_t, not unsigned.
1236         (check_for_offset): Don't require a sign before the offset.
1237         Use xstrtoimax to do the real work.
1238         (extract_regexp): Remove harmful cast of size to unsigned.
1239         256 -> 1<<CHAR_BIT, for clarity.
1240         (get_format_flags): Return at most 3, to avoid worries about overflow.
1242         (bytes_to_octal_digits): Remove.
1244         (cleanup): Don't check whether output_stream is NULL, since
1245         close_output_file does that for us.
1247         (new_line_control, create_new_buffer): Use "foo *p = xmalloc
1248         (sizeof *p);" instead of the more long-winded alternatives.
1250         (get_new_buffer): Use O(1) algorithm for resizing a buffer
1251         to a much larger size, instead of an O(N) algorithm.
1253         (process_regexp): Use plain NULL rather than casted 0.
1255         (make_filename): Use %u, not %d, to format unsigned file number.
1257         (new_control_record): Use xrealloc exclusively, since it handles
1258         NULL reliably.
1260         (extract_regexp): Change misspelled word in diagnostic.
1262         (get_format_width): Even if a minimum field width is specified,
1263         allow room for enough octal digits to represent the value of
1264         the maximum representible integer.  This fixes a potential
1265         buffer overrun.  Calculate this room at compile-time, not
1266         at run-time; this removes the need for bytes_to_octal_digits.
1267         Check for overflow; this removes a FIXME.
1269         (get_format_prec): Don't allow precision to be signed; it's
1270         not ANSI.  Check for overflow.  Remove hardcoded "11" as
1271         default precision; this fixes a potential buffer overrun
1272         on hosts with wider size_t.
1274         (get_format_conv_type): Change local variable to be of type
1275         unsigned char, not int; this removes a potential subscript
1276         violation on hosts where char is signed.
1278         (max_out): Replace "for (;*p;)" with more-standard "while (*p)".
1279         Allow "%%" in format.  Don't overflow when
1280         counting lots of percents.
1282         (usage): Default sprintf format is %02u, not %d.
1284 2003-10-05  Jim Meyering  <jim@meyering.net>
1286         * src/chown-core.c (change_file_owner): Remove set-but-not-used local.
1288         * src/du.c (du_files): Mark diagnostic for translation.
1290 2003-10-04  Jim Meyering  <jim@meyering.net>
1292         * src/du.c (du_files): Ignore any failure of fts_close.
1293         Give better diagnostics for failed fts_open.
1295         * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition.
1297         Deprecate existing use of -H (aka --si).
1298         * src/du.c (enum) [HUMAN_SI_OPTION]: New member.
1299         [long_options]: Use HUMAN_SI_OPTION, not 'H'.
1300         (main): Warn that the meaning of -H will soon change to be
1301         POSIX compliant.
1303 2003-10-03  Jim Meyering  <jim@meyering.net>
1305         * src/du.c: Accept --no-dereference (-P).
1307 2003-10-02  Jim Meyering  <jim@meyering.net>
1309         * tests/du/trailing-slash: Adjust for slightly different output.
1311         Rewrite du.c to use fts.
1312         * src/du.c: Include "fts_.h", not ftw.h.
1313         (opt_dereference_arguments, arg_length, suffix_length): Remove globals.
1314         (IS_FTW_DIR_TYPE): Remove definition.
1315         (IS_DIR_TYPE): Define.
1316         (is_symlink_to_dir): Remove now-unnecessary function.
1317         (process_file, du_files): Rewrite to use fts.
1319         * tests/du/inaccessible-cwd: Ensure that even when run from an
1320         inaccessible directory, du can still operate on accessible
1321         directories elsewhere.
1322         * tests/du/Makefile.am (TESTS): Add inaccessible-cwd.
1324         * tests/rm/deep-1: Ensure that du can process a hierarchy
1325         of depth 400 while using no more than 50KB of stack space.
1327 2003-10-01  Akim Demaille  <akim@epita.fr>
1329         * announce-gen (print_news_deltas): New function, extracted from main.
1330         (main): Make `news_file' an array.
1331         Use '...=s' => \@var for --news and --url-directory specs.
1332         Before there were a couple of portability problems.
1334 2003-09-28  Jim Meyering  <jim@meyering.net>
1336         * Makefile.maint (sc_cast_of_alloca_return_value): New rule.
1337         (syntax-check-rules): Add it.
1339         * src/copy.c: Remove unnecessary cast of alloca, since now it's
1340         guaranteed to be (void *).
1341         * src/cp.c: Likewise.
1342         * src/join.c: Likewise.
1343         * src/ln.c: Likewise.
1344         * src/ls.c: Likewise.
1345         * src/od.c: Likewise.
1346         * src/sys2.h (ASSIGN_STRDUPA): Likewise.
1348 2003-09-27  Jim Meyering  <jim@meyering.net>
1350         Don't exhaust virtual memory when processing large inputs.
1351         Fix this by removing csplit's internal free-list management;
1352         instead rely on malloc for that.
1354         * src/csplit.c (free_list): Remove global.
1355         (clear_all_line_control): Remove function.
1356         (get_new_buffer): Always use create_new_buffer to obtain a
1357         new buffer, rather than searching free_list.
1358         (free_buffer): Just call free.
1359         Reported by Nikola Milutinovic.
1361 2003-09-26  Jim Meyering  <jim@meyering.net>
1363         * man/rm.x: Also list `chattr' in SEE ALSO section.
1364         Suggestion from Mark Hubbart.
1366 2003-09-25  Jim Meyering  <jim@meyering.net>
1368         * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now
1369         that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them.
1371         * Use autoconf-2.57d.  Regenerate dependent files.
1373 2003-09-24  Jim Meyering  <jim@meyering.net>
1375         Minor efficiency tweak.
1376         * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
1377         (do_link): Likewise.
1379 2003-09-23  Jim Meyering  <jim@meyering.net>
1381         * src/paste.c (paste_serial): Save errno after input error,
1382         to report proper errno value.
1383         Based on a patch from Paul Eggert.
1385         * src/tee.c (tee): Adjust fwrite arguments so that the return
1386         value is the number of bytes written.
1388 2003-09-16  Paul Eggert  <eggert@twinsun.com>
1390         Don't assume ferror sets errno.  Bug reported by Bruno Haible.
1392         * src/comm.c (compare_files): Save errno after input error,
1393         to report proper errno value.
1394         * src/fold.c (fold_file): Likewise.
1395         * src/od.c (check_and_close, skip, read_char, read_block): Likewise.
1396         * src/unexpand.c (unexpand): Likewise.
1398         * src/csplit.c (close_output_file): Don't report bogus errno value
1399         after ferror discovers an output error.  We don't know the proper
1400         errno value, since it might have been caused by any of a whole
1401         bunch of calls, and it might have been trashed in the meantime.
1402         Fixing this problem will require much more extensive changes;
1403         in the meantime just say "write error".
1404         * src/od.c (check_and_close, dump, dump_strings): Likewise.
1405         * src/uniq.c (check_file): Likewise.
1407         * src/join.c (get_line): Report error right away if I/O fails,
1408         so that the proper errno value is used.
1409         * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise.
1410         * src/tee.c (tee): Likewise.
1411         * src/uniq.c (check_file): Likewise.
1413         * src/od.c (skip): If a read fails, don't retry it later, so
1414         that we report the proper errno.
1416         * src/tac.c (tac_mem): Don't return a value; nobody uses it.
1418         * src/tee.c (tee): Once a write failure has occurred, don't bother
1419         writing anything more to that stream.
1421         * src/uniq.c (check_file): Check for ferror (stdout) even if
1422         ostream == stdout.
1424         * src/yes.c (UNROLL): Remove.
1425         (main): Exit immediately when write failure is detected.
1426         Simplify code by assigning to argv when argc == 1.
1428 2003-09-21  Paul Eggert  <eggert@twinsun.com>
1430         * src/ptx.c: Switch encoding from Latin-1 to UTF-8.
1431         (WRITTEN_BY): Change "Franc,ois" (actually using
1432         c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
1433         xgettext requires.
1435 2003-09-19  Jim Meyering  <jim@meyering.net>
1437         `du -D symlink-to-dir' would mistakenly omit the slash in
1438         lines like this: 24     symlink-to-dir/subdir
1439         * src/du.c (process_file): Fix offset calculation.
1440         Reported by Jeff Sheinberg as Debian bug #211591;
1441         http://bugs.debian.org/205251
1443         * tests/du/deref-args: New file/test for the above.
1444         * tests/du/Makefile.am (TESTS): Add deref-args.
1446         * src/du.c (process_file): Remove useless disjunct.
1448         * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
1449         to Written_by.
1450         * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
1451         Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
1452         Mark each WRITTEN_BY string as translatable.
1454         * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1455         * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1456         * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1457         * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1458         * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1459         * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1460         * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1461         * who.c, whoami.c, yes.c: Revert yesterday's changes.
1462         Instead, a subsequent change will embed `Written by ' in
1463         each string along with the author names.
1465         * src/true.c: Revert yesterday's changes.
1466         * src/sys2.h: Likewise.
1468 2003-09-18  Jim Meyering  <jim@meyering.net>
1470         * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1471         * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1472         * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1473         * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1474         * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1475         * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1476         * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1477         * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
1478         comma-separated list of strings and/or update the call to
1479         parse_long_options so that `AUTHORS, NULL' are the last parameters.
1480         * src/true.c (main): Append NULL to version_etc argument list.
1481         * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
1483         * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
1484         shadowing the math function name.  Also rename loga to log_a.
1486 2003-09-14  Jim Meyering  <jim@meyering.net>
1488         * src/factor.c (print_factors): Give a separate diagnostic
1489         for numbers that are too large, but otherwise valid.
1490         Reported by Dániel Varga.
1492 2003-09-10  Jim Meyering  <jim@meyering.net>
1494         * Use automake-1.7.7.  Regenerate dependent files.
1496         * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
1497         of `fmt -1'.  Using the just-built tr is a little cleaner.
1498         Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
1499         * man/Makefile.am (programs, check-x-vs-1): Likewise.
1501 2003-09-09  Jim Meyering  <jim@meyering.net>
1503         * src/copy.c: Alphabetize includes.
1504         Remove duplicate inclusion of "same.h".
1506 2003-09-08  Jim Meyering  <jim@meyering.net>
1508         * Makefile.maint (GZIP_ENV): Remove --rsyncable.
1509         Didn't give enough of a benefit, mainly because it's not yet
1510         in wide enough use.
1512         * Version 5.0.91.
1514         * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
1515         (check-programs-vs-x): Fail if $(programs) is empty.
1517         * src/remove.c: Add a comment.
1519 2003-09-07  Jim Meyering  <jim@meyering.net>
1521         * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
1522         Don't define.  These symbols are no longer used.
1524         * tests/misc/tty-eof: Write ^D as \cD.
1525         Complete the change of 2003-08-02.
1527         * Makefile.maint (po-check): Use cvsu, so that a temporary source
1528         file in lib/ or src/ doesn't induce an unwarranted failure.
1529         Add a kludge to filter out the sole generated source file that
1530         also has translatable messages: src/false.c.
1532 2003-09-06  Jim Meyering  <jim@meyering.net>
1534         * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
1535         (parse_options): Give a diagnostic for (but still accept) the
1536         deprecated --allow-missing option.
1538 2003-09-04  Paul Eggert  <eggert@twinsun.com>
1540         Don't ignore -S if input is a pipe.  Bug report by Michael McFarland in
1541         <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
1543         * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg.  Compute the
1544         size_bound ourselves. if an input file is a pipe and the user
1545         specified a size, use that size instead of trying to guess the
1546         pipe size.  This has the beneficial side effect of avoiding the
1547         overhead of default_sort_size in that case.  All callers changed.
1548         (sort): Remove static var size; now done by sort_buffer_size.
1550 2003-09-05  Jim Meyering  <jim@meyering.net>
1552         * Use automake-1.7.6b and autoconf-2.57b.  Regenerate dependent files.
1554         * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
1555         to start, rather than just .1.  Upon failure, print unexpected state.
1557 2003-09-04  Paul Eggert  <eggert@twinsun.com>
1559         * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
1560         SAFE_READ_ERROR to tmp->nbytes.
1561         * src/tail.c (pipe_lines, pipe_bytes): Likewise.
1563         * src/head.c (struct linebuffer): Change nbytes and nlines
1564         from unsigned int to size_t.  unsigned int is safe (after the
1565         2003-09-03 patch) but size_t is cleaner.
1566         * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
1567         (pipe_bytes): Likewise for local variable 'i', which was 'int'.
1569         Standardize on BUFSIZ as opposed to other macro names and values.
1570         * src/head.c (BUFSIZE): Remove.  All uses changed to BUFSIZ.
1571         * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
1572         stdio.h has always defined it,
1573         and other code already assumes it's defined.
1574         * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
1575         (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
1576         (io_buf): IO_BUF_SIZE -> BUFSIZ.
1578 2003-09-04  Paul Eggert  <eggert@twinsun.com>
1580         * src/seq.c (step): Default to 1.
1581         (print_numbers): Allow the output to be empty.
1582         (main): The default step is 1, even if LAST < FIRST;
1583         as per documentation.
1584         * tests/seq/basic (onearg-2): Output should be empty.
1586 2003-09-05  Jim Meyering  <jim@meyering.net>
1588         * Makefile.cfg (wget_files): Temporarily disable, until master
1589         versions are restored to ftp.gnu.org.
1591         * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
1593         Make seq's --width (-w) option work properly even when the
1594         endpoint requiring the larger width is negative and smaller than
1595         the other endpoint.
1596         * src/seq.c (get_width_format): Include `-' in the set of bytes
1597         allowed in a `simple' number (no decimal point, no exponent).
1598         Reported by Patrick Mauritz.
1600 2003-09-02  Paul Eggert  <eggert@twinsun.com>
1602         * NEWS: sort -t '\0' now uses a NUL tab.
1603         sort option order no longer matters, unless POSIX requires it.
1604         * src/sort.c (usage): Say "blanks" instead of "whitespace",
1605         Similar fixes for many comments.
1606         (TAB_DEFAULT): New constant, so that we can support NUL as
1607         the field separator.
1608         (tab): Now int, not char.  Initialize to TAB_DEFAULT.
1609         (specify_sort_size): If multiple sizes are specified, use the largest.
1610         (begfield, limfield): Support NUL tab char.
1611         (set_ordering): Do not let -i override -d.
1612         (main): Report an error if incompatible -o or -t options are given.
1613         Report an error for "-t ''".  Allow "-t '\0'" to specify a NUL tab.
1615 2003-09-05  Jim Meyering  <jim@meyering.net>
1617         * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
1619 2003-09-03  Andreas Schwab  <schwab@suse.de>
1621         Bug report and patch here:
1622         <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
1623         * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
1624         * src/head.c (elide_tail_lines_pipe): Likewise.
1626 2003-09-03  Jim Meyering  <jim@meyering.net>
1628         * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
1629         small amount of code from him was first moved to lib/human.c, and was
1630         subsequently rewritten entirely.
1631         * src/df.c (AUTHORS): Likewise.
1633 2003-08-22  Lawrence Teo  <lcteo@uncc.edu>
1635         * src/md5sum.c (split_3): Accept the BSD format for generic
1636         message digest modes.  Currently works with BSD's MD5 and SHA1
1637         formats since these are the two algorithms presently used in
1638         coreutils.  Updated comments to reflect this change.
1639         (bsd_split_3): Updated comments.
1641         * tests/md5sum/basic-1: New test to make sure that
1642         `md5sum --check' doesn't accept the BSD SHA1 format (adapted
1643         from `check-bsd' test in tests/sha1sum/basic-1).
1645         * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
1646         --check exit status and BSD SHA1 format (adapted from tests
1647         in tests/md5sum/basic-1).
1649 2003-08-30  Jim Meyering  <jim@meyering.net>
1651         * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
1653         When source and destination arguments refer to the same file, reside
1654         on a partition (e.g. VFAT) on which distinct names may refer to the
1655         same directory entry (often due to variations in case), and when the
1656         link count for the file is 1, mv no longer unlinks the file.  Instead,
1657         it gives the expected diagnostic that the source and destination are
1658         the same.  WARNING: this is an incomplete fix.  If the file happens
1659         to have a link count of 2 or greater, such an erroneous mv command
1660         will still unlink it.
1661         Although that is not possible on vfat or umsdos, it is possible on
1662         other file system types, e.g., ntfs, and hpfs.
1663         * src/copy.c (same_file_ok): Invoke same_name (which might still
1664         return false for names that refer to the same directory entry)
1665         only if the link count is 2 or more.
1666         * tests/mv/vfat: Show how to demonstrate the above problem.
1667         This test is not run.
1668         * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
1670 2003-08-27  Jim Meyering  <jim@meyering.net>
1672         * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
1673         who's -l option has been eliciting an unconditional warning about
1674         this impending change since sh-utils-2.0.12 (April 2002).
1676         * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
1677         This would happen for nonempty files not ending with a newline.
1678         Reported by Dan Jacobson.
1679         * tests/misc/paste-no-nl: New file.  Test for above-fixed bug.
1680         * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
1682         * src/stat.c (print_it): Avoid buffer overrun that would
1683         occur when the user-specified format string ends with `%'.
1684         Patch by Tommi Kyntola.
1685         * tests/misc/stat-fmt: New file.  Test for above-fixed bug.
1686         * tests/misc/Makefile.am (TESTS): Add stat-fmt.
1688 2003-08-26  Jim Meyering  <jim@meyering.net>
1690         Apply changes from bison.
1691         * GNUmakefile (SHELL): Define to `sh', if necessary.
1692         Add copyright.
1693         * Makefile.maint (WGETFLAGS): Define to `-C off'.
1694         Update all uses of $(WGET).
1696 2003-08-22  Akim Demaille  <akim@epita.fr>
1698         * Makefile.cfg (local-checks-to-skip): New.
1699         * Makefile.maint (local-check): Rename as...
1700         (local-checks-available): this.
1701         (local-check): New.
1703 2003-08-26  Akim Demaille  <akim@epita.fr>
1705         * announce-gen (print_changelog_deltas): Neutralize "<#" as
1706         "<\#" to avoid magic from Gnus when posting parts of this script.
1708 2003-08-25  Jim Meyering  <jim@meyering.net>
1710         * src/stat.c (main): Warn about use of deprecated `-l' option.
1712 2003-08-22  Jim Meyering  <jim@meyering.net>
1714         * src/stat.c (do_stat): For link count at end of line, use %h format,
1715         instead of %-5h.  The latter would make stat emit trailing spaces.
1716         Reported by Dan Jacobson.
1718 2003-08-20  Jim Meyering  <jim@meyering.net>
1720         * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
1722 2003-08-19  Jim Meyering  <jim@meyering.net>
1724         * src/system.h: Include stdlib.h unconditionally,
1725         as we're now assuming that part of hosted C89.
1727 2003-08-18  Jim Meyering  <jim@meyering.net>
1729         * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
1730         to avoid warnings from gcc.
1732 2003-08-17  Jim Meyering  <jim@meyering.net>
1734         Avoid unnecessary and sometimes time-consuming hostname lookups.
1735         * src/who.c (print_user): Use strchr, not strrchr.
1736         * src/pinky.c (print_entry): Likewise.
1737         Patch by Michael Stone.
1738         This fixes a typo I introduced in who-users.c on 1996-02-23.
1740         * Makefile.maint (makefile-check): Add 0-9 to the range of characters
1741         disallowed between `@...@'.
1743 2003-08-16  Paul Eggert  <eggert@twinsun.com>
1745         * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
1746         done by gnulib .m4 files.
1747         (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
1748         * src/sys2.h (strtoull): Remove unused declaration.
1750 2003-08-16  Jim Meyering  <jim@meyering.net>
1752         * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
1753         are read-only.
1755         * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
1756         race condition bug.  The bug would be triggered when tailing a file
1757         with file pointer not at beginning of file, and where the file was
1758         truncated to have a length of less than the initial offset at just
1759         the right moment (between the two lseek calls in this function).
1761         An invalid initial value for *read_pos would result in
1762         `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
1763         busy-wait rather than sleeping between iterations.  The bug manifests
1764         itself only when tailing regular files that are initially nonempty.
1765         * src/tail.c (tail_bytes): Set *read_pos to new file offset after
1766         each xlseek call.
1767         (tail_lines): Likewise, after lseek calls.
1768         Reported by Nick Estes.  See http://bugs.debian.org/205251 for details.
1769         * tests/tail-2/tail-n0f: New file.  Test for above fix.
1770         * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
1772 2003-08-15  Jim Meyering  <jim@meyering.net>
1774         * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
1775         (sc_sun_os_names): Likewise.
1776         * .x-sc_space_tab, .x-sc_sun_os_names: New files.
1778         * man/help2man: Remove some SPACEs before TAB.
1780 2003-08-14  Paul Eggert  <eggert@twinsun.com>
1782         * Makefile.maint (LC_ALL): Set to C.
1783         * man/Makefile.am (ASSORT): New var.
1784         (check-x-vs-1, programs): Use it.
1785         * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
1786         * tests/Makefile.am (ASSORT, all_programs): Likewise.
1788 2003-08-11  Jim Meyering  <jim@meyering.net>
1790         fold -s -wN would infloop for N < 8 with TABs in the input.
1791         E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
1792         * src/fold.c (fold_file): Move contents of `else'-block
1793         out of conditional so it's used also for --spaces (-s).
1794         * tests/misc/fold: Test for the above fix.
1795         * tests/misc/Makefile.am (TESTS): Add fold.
1797 2003-08-10  Jim Meyering  <jim@meyering.net>
1799         * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
1800         system.h so the types from time.h and sys/time.h are available.
1801         It appears that this is necessary for OpenBSD, NetBSD, and
1802         Darwin 6.5 (MacOS 10.2.5).  Reported by Nelson Beebe.
1804 2003-08-06  Paul Eggert  <eggert@twinsun.com>
1806         * NEWS: Add support for setting file timestamps to microsecond
1807         resolution, on hosts that support this.
1808         * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
1809         * src/copy.c (copy_internal):
1810         Set file timestamps with utimens, not utime.
1811         * src/cp.c (re_protect): Likewise.
1812         * src/install.c (change_timestamps): Likewise.
1813         * src/touch.c (newtime, touch, main): Likewise.
1815 2003-08-09  Jim Meyering  <jim@meyering.net>
1817         * Makefile.maint (sc_sun_os_names): New rule based on a regexp
1818         from Paul Eggert.
1819         (syntax-check-rules): Add it.
1821         * src/tail.c (main): Tweak Solaris OS version number in comment.
1822         * src/wc.c (wc): Likewise
1823         * tests/tail-2/fflush: Likewise.
1825         * src/tail.c: Add new undocumented option, --presume-input-pipe.
1826         (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
1828 2003-08-08  Paul Eggert  <eggert@twinsun.com>
1830         Use new gnulib 'extensions' module.
1831         * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
1832         AC_GNU_SOURCE.
1834 2003-08-08  Paul Eggert  <eggert@twinsun.com>
1836         * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
1838 2003-08-09  Jim Meyering  <jim@meyering.net>
1840         * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
1841         For tests of obsolete behavior, don't presume that unsetting
1842         _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
1844 2003-08-07  Paul Eggert  <eggert@twinsun.com>
1846         * doc/coreutils.texi (split invocation):
1847         Add -d or --numeric-suffixes option to 'split'.
1848         From a suggestion by Jesse Kornblum.
1849         * src/split.c (suffix_alphabet): New var.
1850         (longopts, usage, next_file_name, main): Support -d.
1851         (next_file_name, main): Allow -a0, as POSIX requires.
1852         (next_file_name): Don't assume ASCII-like encoding;
1853         'a' through 'z' are not contiguous in EBCDIC.
1855 2003-08-05  Paul Eggert  <eggert@twinsun.com>
1857         Merge getline from gnulib.
1858         * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
1859         * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
1860         New files, from gnulib.
1861         * lib/getdelim2.c, lib/getdelim2.h: Remove.
1862         * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
1863         getdelim2.h to getndelim2.c and getndelim2.h.
1864         * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
1865         checking for getdelim.
1866         (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
1867         than rolling our own.
1868         * src/cut.c: Include getndelim2.h rather than getdelim2.h.
1869         (cut_fields): Invoke getndelim2 rather than getdelim2.
1871 2003-08-04  Jim Meyering  <jim@meyering.net>
1873         * src/sort.c (main): Use unsigned int instead of int for `nsigs'
1874         and for the indices to iterate through nsigs.
1876 2003-08-02  Paul Eggert  <eggert@twinsun.com>
1878         * src/sort.c: Minor code cleanups, mostly to use more accurate
1879         types and to remove unnecessary casts.
1880         (min, max): Remove.  All uses changed to MIN and MAX.
1881         (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
1882         keyfield.skipsblanks, struct keyfield.skipeblanks, struct
1883         keyfield.numeric, struct keyfield.general_numeric, struct
1884         keyfield.month, struct keyfield.reverse, reverse, unique,
1885         have_read_stdin): Now bool, not int.  All uses changed.
1886         (eolchar): Now char, not int.
1887         (struct keyfield.ignore): Now bool const *, not int *.
1888         (struct keyfield.translate): Now char const *, not char *.
1889         (struct month.name): Likewise.
1890         (blanks, nonprinting, nondictionary): Now bool[], not int[].
1891         (cleanup, inittables, keycompare, check, mergefps, first_same_file,
1892         check, sort, main): Use const * pointers when possible.
1893         (month_cmp): Rewrite to avoid casts.
1894         (inittables): Initialize tables unconditionally, to avoid branches.
1895         (fillbuf): Return bool, not int.  All uses changed.
1896         (fillbuf, keycompare, new_key, main):
1897         Use SIZE_MAX rather than (size_t) -1.
1898         (trailing_blanks): Renamed from trim_trailing_blanks.
1899         Return the number of blanks to trim.  All uses changed.
1900         (getmonth): Use trailing_blanks rather than open code.
1901         (keycompare): Do not cast char * to unsigned char *; not needed.
1902         CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
1903         ourselves.
1904         (compare, main): Use | rather than || to avoid jumps.
1905         Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
1906         be nonzero there.
1907         (check, first_same_file, sort, main):
1908         Use bool instead of int local vars when possible.
1909         (check): Merge the old 'checkfp' and 'check' into a single function,
1910         that returns a boolean (true if the file was ordered).
1911         All uses changed.
1912         (main): Use int instead of unsigned for iterating through nsigs.
1913         Rename local var "posix_pedantic" to "posixly_correct".
1915 2003-08-02  Jim Meyering  <jim@meyering.net>
1917         * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
1918         to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
1920         * src/cut.c (cut_fields): Don't read again after encountering an
1921         initial EOF.  E.g., `cut -f2' would do so.
1922         * tests/misc/tty-eof: Add a test for the above fix.
1924         * src/sort.c (sortlines): Add description and references.
1925         From Paul Eggert.
1927         * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
1928         the tests in help-version will use the just-built binaries.
1929         Reported by Christian Krackowizer.
1931 2003-07-31  Paul Eggert  <eggert@twinsun.com>
1933         * NEWS: Add --rfc-2822 option to GNU date.
1934         * doc/coreutils.texi (Time directives, Options for date, Examples
1935         of date): Likewise.
1936         * src/date.c (long_options, usage, main): Likewise.
1937         * doc/getdate.texi (General date syntax): Likewise.
1938         * doc/coreutils.texi (Options for date): Fix a typo in format:
1939         it's now %d not %_d.  Add URLs.
1941 2003-08-01  Jim Meyering  <jim@meyering.net>
1943         * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
1944         Otherwise, with at least the /bin/sh from HPUX 10.20,
1945         the trap code would end up converting that to exit 1 and thus an
1946         unexpected test failure.  Reported by Christian Krackowizer.
1948 2003-07-31  Paul Eggert  <eggert@twinsun.com>
1950         * src/ptx.c: Do not include bumpalloc.h.
1951         (WORD_TABLE): New member alloc.
1952         (ALLOC_NEW_WORD): Remove.
1953         (occurs_alloc): New var.
1954         (digest_word_file, find_occurs_in_text): Check for arithmetic
1955         overflow when computing table size.  Use xrealloc rather than
1956         bumpalloc primitives.
1958 2003-07-29  Jim Meyering  <jim@meyering.net>
1960         * Version 5.0.90.
1962         * README: When running tests as root, suggest using
1963         sudo with NON_ROOT_USERNAME=$USER.
1965         * tests/Makefile.am (all_programs): Makefile is in ../src, not
1966         $(srcdir)/../src.
1968 2003-07-28  Jim Meyering  <jim@meyering.net>
1970         * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
1972 2003-07-28  Paul Eggert  <eggert@twinsun.com>
1974         * lib/stdbool.hin (_Bool): Make it signed char, instead of
1975         an enum type, so that it's guaranteed to promote to int.
1976         * src/sort.c (sortlines_temp): Undo previous change.
1978 2003-07-28  Jim Meyering  <jim@meyering.net>
1980         * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
1981         `bool'.  Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
1982         would cause lines[-1 - swap] (with swap = false) to evaluate to
1983         lines[4294967295].
1985 2003-07-27  Jim Meyering  <jim@meyering.net>
1987         * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
1988         since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
1990         * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
1991         directories, as required by POSIX.   Reported by Karl Berry.
1992         * tests/rm/dir-no-w: New file.  Test for the above fix.
1993         * tests/rm/Makefile.am (TESTS): Add dir-no-w.
1995         * tests/mk-script: Emit `$xx', not its expansion.
1997 2003-07-27  Paul Eggert  <eggert@twinsun.com>
1999         This change was inspired by a similar proposal by Stepan Kasal.
2000         * src/sort.c (mergelines, sortlines_temp): New functions.
2001         (sortlines): Use them, to reduce the number of times that
2002         we need to copy 'struct line' values.  This improved CPU
2003         performance by about 30% on one 18 MB test.
2004         (sort): Don't invoke sortlines unless we have 2 or more lines.
2006 2003-07-26  Stepan Kasal  <kasal@ucw.cz>
2008         * src/sort.c (sort): Don't require two `struct line's per text line,
2009         the new sort algorithm requires just 1.5.
2011 2003-07-27  Jim Meyering  <jim@meyering.net>
2013         * src/pathchk.c (validate_path): Use %lu, not %ld.
2014         From Paul Eggert.
2015         * src/cut.c (is_printable_field): Simplify bit arithmetic.
2016         From Paul Eggert.
2017         * src/ls.c (sort_files): Put `volatile' in the right place.
2018         From Paul Eggert.
2020 2003-07-26  Jim Meyering  <jim@meyering.net>
2022         Use only one bit per field/offset in array, not one `int'.
2023         * src/cut.c (printable_field): Change type to `unsigned char'.
2024         (mark_printable_field, is_printable_field): New functions.
2025         Use them in place of all direct accesses of `printable_field'.
2027         * src/expand.c (parse_tabstops): Detect overflow properly.
2028         * src/cut.c (set_fields): Likewise.
2030         * src/rm.c: Include "dirname.h".
2031         (usage): Use base_name (program_name) in body of --help output.
2032         This lets me...
2033         * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
2034         Idea from Brendan O'Dea, who suggested using
2035         `program_name = basename (argv[0]);' everywhere --
2036         can't do that, but using base_name works just fine here.
2038         * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
2040 2003-07-24  Paul Eggert  <eggert@twinsun.com>
2042         Fix some POSIX-compliance problems with 'test'.  This makes
2043         'test' more compatible with Bash.
2045         * NEWS, doc/coreutils.texi: Document the following.
2046         * src/test.c: Include exitfail.h.
2047         (TEST_FAILURE): New constant, used for exit status if 'test' fails.
2048         (test-syntax_error): Use it.
2049         (binary_operator): Now takes bool arg specifying whether left operand
2050         is -l ARG, so that caller determines this rather than us.
2051         All uses changed.
2052         (term): Use posixtest to evaluate parenthesized subexpressions.
2053         (unary_operator, one_argument): Remove support for -t without operand.
2054         (one_argument): Take argument from argv[pos].
2055         (one_argument, two_arguments, three_arguments): Advance pos.
2056         All callers changed.
2057         (three_arguments): Look for binary ops before "!".  Then look
2058         for parenthesized one_argument expressions, instead of trusting
2059         expr () to do the right thing.
2060         (posixtest): Now takes number of args.  All callers changed.
2061         Treat "( A B )" like "A B".
2062         (main): Set exit_failure to TEST_FAILURE.  Don't depend on
2063         POSIXLY_CORRECT, as we now conform to POSIX by default.
2064         (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
2065         * tests/test/Test.pm (test_vector): Add several tests to check
2066         the above.  Syntax errors now exit with status 2, not 1.
2067         * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
2069 2003-07-26  Jim Meyering  <jim@meyering.net>
2071         * tests/help-version: Adjust for above change in test behavior:
2072         `[' exits with 2, not 1, and test doesn't accept --help or --version.
2074         * Makefile.maint (ME): Don't use trick suggested in Make manual.
2075         It doesn't work for make-3.79.1.  Reported by Christian Krackowizer.
2077         * Makefile.maint (sc_system_h_headers): Another syntax check.
2078         (syntax-check-rules): Add it to the list.
2080         * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
2081         so it matches `%ld' format even on 32-bit systems.
2083         * src/fmt.c (flush_paragraph): Cast field width to `int' to
2084         avoid warning on 64-bit systems.
2086         * src/ls.c (sort_files): Make `func' volatile, so it can't be
2087         clobbered by a `longjmp' into this function.
2089 2003-07-25  Jim Meyering  <jim@meyering.net>
2091         * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
2092         value.
2094         * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
2095         because it'd evoke spurious failure on 64-bit systems.
2097 2003-07-24  Jim Meyering  <jim@meyering.net>
2099         * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
2100         output its current record counts.  Reported by Jurriaan.
2102         * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
2103         `wc' with no options.  This goes along with the change of 2003-07-20.
2105 2003-07-23  Jim Meyering  <jim@meyering.net>
2107         Don't include headers already included by system.h:
2108         * src/tr.c: Don't include errno.h.
2109         * src/true.c: Don't include version-etc.h.
2110         * src/test.c: Don't include limits.h or error.h.
2111         * src/stat.c: Don't include unistd.h or time.h.
2112         * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
2113         * src/pr.c: Don't include time.h.
2114         * src/pathchk.c: Don't include errno.h.
2115         * src/nice.c: Don't include sys/time.h.
2116         * src/ls.c: Don't include stdlib.h.
2118         * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
2119         * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
2120         * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
2121         * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
2122         * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
2123         * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
2124         * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
2125         * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
2126         Don't include closeout.h.
2128         * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
2129         can access the required version of rm.
2130         * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
2132         * tests/cut/Test.pm (out-delim3a): New test.
2134         * man/help2man: Update to version 1.33.
2136         * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
2138         * src/dircolors.c: Include xstrndup.h.
2139         (xstrndup): Remove function, now that it's been factored out into
2140         it's own file.
2142 2003-07-22  Paul Eggert  <eggert@twinsun.com>
2144         * src/wc.c (wc): Fix typo in computation of file from file_x,
2145         which caused the former to be used uninitialized if file_x was
2146         nonzero.
2148 2003-07-22  Jim Meyering  <jim@meyering.net>
2150         * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
2152         * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
2153         help2man, to avoid having `rm.td/rm' appear in rm.1.  Reported by
2154         Thomas Luzat.  See http://bugs.debian.org/202413 for details.
2156         * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
2158         * src/hostid.c: Don't include <unistd.h>.  system.h already does that.
2160         * src/cut.c (set_fields): Mark all selected indices before trying to
2161         determine range endpoints.
2162         * tests/cut/Test.pm: New test for the above fix.
2164         Begin to address this comment: What if someone wants to
2165         extract the 1,000,000-th field of some huge input file?
2166         The first step is to rearrange things so that the values
2167         in the printable_field array are all 0/1 rather than 0/1/2.
2168         * src/cut.c (RANGE_START_SENTINEL): Remove.
2169         Store range-start indices in a hash table, rather than
2170         overloading the `printable_field' array.
2171         (range_start_ht): New global.
2172         (hash_int, hash_compare_ints, is_range_start_index): New functions.
2173         (print_kth): Use is_range_start_index; don't test printable_field.
2174         (set_fields): Detect overflow.
2175         (set_fields): Insert each range-start index into range_start_ht.
2176         (main): Call set_fields only once, and only after
2177         output_delimiter_specified and (if required) range_start_ht have
2178         been defined.
2180 2003-07-20  Paul Eggert  <eggert@twinsun.com>
2182         * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
2183         invoked with a null pointer when there were no file arguments.
2185 2003-07-20  Jim Meyering  <jim@meyering.net>
2187         * Makefile.maint (sc_changelog): Add another nit-picky check.
2189         * src/wc.c (write_counts): Add a comment.
2190         (wc): Rename `file' parameter.
2191         Set new local, `file', to be the file name, or (when it's NULL)
2192         _("standard output") so that all uses of `file' use the proper value.
2193         Use STREQ, not strcmp.
2195 2003-07-20  Paul Eggert  <eggert@twinsun.com>
2197         wc count field widths now are heuristically adjusted depending
2198         on the input size, if known.  If only one count is printed, it
2199         is guaranteed to be printed without leading spaces.
2201         Previously, wc did not align the count fields if
2202         POSIXLY_CORRECT was set, but POSIX did not actually require
2203         this undesirable behavior, so it has been removed.
2205         * NEWS: Document this.
2206         * doc/coreutils.texi (wc invocation): Likewise.
2208         * src/wc.c (number_width): New var.
2209         (posixly_correct): Remove.
2210         (struct fstatus): New struct.
2211         (write_counts): Output fields of width number_width.
2212         Do not worry about POSIXLY_CORRECT.
2213         Use null file, not empty-string file, to denote stdin,
2214         since "" is a valid file name on some hosts.
2215         (wc, wc_file): New arg fstatus.  Use it to avoid invoking fstat
2216         if possible.
2217         (wc):  Avoid problems if end_pos - current_pos overflows.
2218         Do not print odd message if stdin has a read error.
2219         (get_input_fstatus, compute_number_width): New functions.
2220         (main): Use them to implement the new behavior.
2221         Ignore POSIXLY_CORRECT.
2223         * tests/wc/Test.pm: Adjust to the new output widths.
2225 2003-07-19  Jim Meyering  <jim@meyering.net>
2227         * tests/rm/fail-eperm: Don't create temporary directory --
2228         we don't use it.
2230         * tests/shred/remove: Don't open-code test for UID != 0.
2231         Use priv-check's require-non-root instead.
2232         Update to use newer framework.
2234         * tests/help-version (expected_failure_status_expr): Record that
2235         expr exits with status of 3 for e.g., a write error.
2237         * tests/priv-check: Use `id -u' to see if we're running as root,
2238         rather than trying go write to an write-protected file.
2239         When running as root, ensure $NON_ROOT_USERNAME is valid.
2240         When running as root with `require-non-root', ensure that `.'
2241         is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
2242         to $NON_ROOT_USERNAME.  If `.' is not writable, then skip the test.
2244         * src/printenv.c: Include "exitfail.h".
2245         (main): Set exit_failure rather than calling close_stdout_set_status.
2246         * src/date.c: Likewise.
2247         * src/sort.c: Likewise.
2248         * src/tty.c: Likewise.
2250 2003-07-18  Jim Meyering  <jim@meyering.net>
2252         * tests/touch/not-owner: Update to use newer framework.
2254         * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
2255         directory, and remove Perl-coded `you may not run as root' test.
2256         * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
2257         hard-coding something not quite equivalent.
2258         Paul Jarc reported the inconsistent diagnostics.
2260         * src/sort.c (main): Use close_stdout via atexit.
2261         Now `sort --version' and `sort --help' fail, as they should
2262         when their output is redirected to /dev/full.
2264         * src/su.c (usage): Don't call close_stdout here.
2265         (main): Use close_stdout via atexit.
2266         Now `su --version > /dev/full' fails, as it should.
2267         Somehow, the change of 2000-05-07 that purports to fix this
2268         was not checked in.
2270         * tests/help-version (--help/--version vs. /dev/full): Special-case
2271         `[' to protect it from expected_failure_status-`eval'.
2273         * src/uniq.c (writeline): Use a SPACE, not a TAB between the
2274         count and the corresponding line, as required by POSIX.
2275         Reported by Clement Wang.
2276         * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
2278         * tests/expr/basic: Add tests for when exit status is 2.
2280         * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
2281         Use an anonymous `enum', rather than #define.
2283 2003-07-17  Paul Eggert  <eggert@twinsun.com>
2285         * src/expr.c: Include "exitfail.h", "quotearg.h".
2286         (EXPR_INVALID, EXPR_ERROR): New constants.
2287         (nomoreargs, null, toarith, nextarg): Return bool, not int.
2288         (syntax_error): New function, exiting with status 2.  Use it
2289         insteading of printing "syntax error" ourselves.
2290         (main): Initialize exit_failure to EXPR_ERROR.
2291         Exit with EXPR_INVALID on syntax error (too few arguments).
2292         (nextarg): Use strcmp, not strcoll; strcoll might return
2293         an undesirable 0, or might fail.
2294         (docolon, eval4, eval3): Exit with status 3 on invalid argument type
2295         or other such error.
2296         (eval2): Report an error if strcoll fails in a string comparison.
2297         * src/sort.c: Include "exitfail.h".
2298         (main): Set exit_failure, not xalloc_exit_failure and
2299         xmemcoll_exit_failure.
2300         * tests/expr/basic: Invalid value exits with status 3, not 2.
2302 2003-07-16  Jim Meyering  <jim@meyering.net>
2304         * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
2305         per GNU maintainer guidelines.  The next non-beta release will be 5.1.
2307         This script would have caught at least two recent bugs:
2308         those in [ and kill.
2309         * tests/help-version: Revive this script.
2310         It wasn't doing anything useful, since $all_programs wasn't being
2311         defined by the invoking Makefile.am.
2312         Reflect that nohup is no longer a script, so don't exclude it.
2313         Add framework to handle the programs added since it was last run:
2314         kill, stat, unlink, [, link, readlink.
2315         Fix path-related problems deriving from the move of this script
2316         from src/ to its present location.
2317         * tests/Makefile.am (all_programs): Define.
2318         (TESTS_ENVIRONMENT): Use it.
2320         * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
2321         whereby kill would always attempt to operate on argv[0] and fail.
2323         * src/test.c (integer_expected_error): Improve diagnostic -- now,
2324         it also matches the one from bash's builtin test.
2325         (binary_operator): Add \n at end of diagnostic.
2327         * tests/rm/fail-2eperm: Remove setuidgid-related code.  Move it to ...
2328         * tests/priv-check: Move setuidgid-related and
2329         NON_ROOT_USERNAME-checking code to this file.
2331         * README: Update section on testing as `root'.
2332         Suggestion from Paul Jarc.
2334         * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
2335         names of authors that I just found in bash's builtins/test.def.
2337         Running `[' with no arguments would evoke a segfault.
2338         * src/test.c (main) [LBRACKET]: Move initialization of argv to
2339         precede potential use via test_syntax_error.
2341         * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
2342         warning from automake -Wall.
2344 2003-07-15  Jim Meyering  <jim@meyering.net>
2346         * Version 5.0.1.
2348         * Makefile.maint (%.asc): Remove target first, so gpg doesn't
2349         prompt us about it.
2351         * announce-gen (print_changelog_deltas): Relax tests for matching
2352         version-number line in NEWS.
2353         Change the .sig suffix to .asc here, too.
2355 2003-07-14  Jim Meyering  <jim@meyering.net>
2357         * Makefile.maint (%.asc): Renamed from %.sig.
2358         Generate and use ascii-armored signatures.
2359         Use gpg's -o option.
2361 2003-07-13  Jim Meyering  <jim@meyering.net>
2363         * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
2364         (main): Use them.
2366         * Makefile.maint (syntax-check): Move each individual check into
2367         its own target.
2368         (syntax-check-rules): This is the list of syntax-check targets.
2369         (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
2370         (sc_cast_of_x_alloc_return_value, sc_space_tab):
2371         (sc_error_exit_success, sc_xalloc_h_in_src):  New targets.
2373 2003-07-12  Jim Meyering  <jim@meyering.net>
2375         * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
2376         traces of the nohup script.
2378         * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
2379         $(OPTIONAL_BIN_ZCRIPTS).
2381         * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
2382         target, not before the `>'.
2384         * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
2385         now that that function no longer calls `error'.
2387         * src/df.c (find_mount_point): Emit a diagnostic for each
2388         failed syscall, rather than relying on caller to do that.
2389         The caller couldn't do a good job, anyhow -- too many different
2390         ways to fail (each with a different referent).
2391         Give a diagnostic upon failed save_cwd, now that that function
2392         no longer calls `error'.
2393         (show_point): Don't diagnose find_mount_point's errors, now that
2394         it handles them itself.
2396         * src/df.c (find_mount_point): Don't let free clobber errno upon
2397         failed chdir.
2399         * src/sys2.h: Remove alloca-related block.
2400         * src/system.h: Include <alloca.h> here, instead.
2402         It appears that the `#pragma alloca' included via "system.h" is
2403         adequate, since join.c uses alloca, yet lacked an in-file #pragma.
2404         * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
2405         * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
2407         * src/chown-core.c (change_file_owner): Do not restore any special
2408         permission bits (e.g., set-user-ID, set-group-ID) that are reset
2409         by chown(2) on some systems.  Suggestion and insistence :-) from
2410         Michael Stone.
2412         * tests/input-tty: Also check `test -t 1'.
2413         This is necessary on linux-2.4.21.  Otherwise, the stty/basic-1
2414         test would block when run in the background.
2416 2003-07-11  Jim Meyering  <jim@meyering.net>
2418         * tests/sample-test: Also fail if cat-to-create-expected-output
2419         fails.  Otherwise, if both `exp' and `out' were to end up empty
2420         because of e.g., a full disk, they would mistakenly compare equal.
2422         * src/nohup.c: New file.  Rewrite of nohup.sh in C.
2423         This solves a portability problem: on at least Solaris systems,
2424         when nohup.sh used the vendor /bin/sh, it would exit with status
2425         of `1' rather than the required 126 or 127 upon failure to exec
2426         the specified program.
2428         * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
2429         (bin_PROGRAMS): Add nohup.
2430         (EXTRA_DIST): Remove nohup.sh.
2431         (all_programs): Remove use of $(EXTRA_SCRIPTS).
2432         * src/nohup.sh: Remove file.
2433         * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
2435         * tests/misc/nohup: Tests for the above.
2436         * tests/misc/Makefile.am (TESTS): Add nohup.
2438         * src/head.c (diagnose_copy_fd_failure): New function, renamed from
2439         the macro, COPY_FD_DIAGNOSE.
2440         (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
2441         (head_file): Likewise.
2443         * src/date.c: Include "quote.h".
2444         (batch_convert): Use the quote function rather than using literal `...'
2445         in a diagnostic.
2447         * src/setuidgid.c (main): Enclose diagnostic in _(...).
2448         * src/fmt.c (main): Likewise.
2449         * src/mknod.c (main): Likewise.
2450         * src/tac.c (tac_seekable): Likewise.
2451         * src/yes.c (main): Likewise.
2452         * src/od.c (main): Likewise.
2453         * src/install.c (change_attributes): Likewise.
2455 2003-07-10  Jim Meyering  <jim@meyering.net>
2457         * src/head.c (usage): Use 1024*1024 in place of 1048576.
2458         * src/tail.c (usage): Likewise.
2460         * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
2461         place of the kludge in this test.  Suggestion from Paul Jarc.
2463         * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
2464         * src/setuidgid.c: New program, solely for testing (not installed).
2466         * src/chown-core.c (change_file_owner): Don't leak file descriptors
2467         when dereferencing symlinks.
2469 2003-07-09  Jim Meyering  <jim@meyering.net>
2471         * tests/du/slash: New file/test for today's lib/ftw.c fix.
2472         * tests/du/Makefile.am (TESTS): Add slash
2474         * src/tail.c (xlseek): Avoid warning about ``return without value
2475         from function returning non-void''.
2477 2003-07-08  Jim Meyering  <jim@meyering.net>
2479         * man/help2man: Update to version 1.29.
2481         * man/help2man: Add END handler to close STDOUT and check for errors.
2483 2003-06-30  Paul Eggert  <eggert@twinsun.com>
2485         Add support for a "[" that conforms to the GNU coding standards,
2486         i.e., that does not depend on its name.
2487         * src/lbracket.c: New file.
2488         * README: Add "[".
2489         * man/Makefile.am (programs): Ignore "[", since it doesn't have
2490         a separate man page.
2491         * src/Makefile.am (bin_PROGRAMS): Add "[".
2492         (__SOURCES): New var.
2493         * src/test.c (LBRACKET): Define to 0 if not defined.
2494         (main): Use LBRACKET rather than argv[0].
2496         * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
2497         Reported by Paul Jarc and Dan Jacobson.
2499         * src/test.c (main): Do not recognize --help or --version if
2500         POSIXLY_CORRECT, when invoked as "test".  Handle "[ ]" correctly.
2501         Do not bother testing that margv[margc] is non-null.
2503 2003-07-04  Jim Meyering  <jim@meyering.net>
2505         * src/who.c (print_line): Rewrite to use asprintf, in order to be
2506         able to avoid emitting trailing spaces.  Reported by Dan Jacobson.
2508         * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
2509         option, and perform the +1600 invocations of head IFF the envvar
2510         RUN_EXPENSIVE_TESTS is set.
2512 2003-07-03  Jim Meyering  <jim@meyering.net>
2514         * src/cp.c (do_copy): Give a better diagnostic when failing due
2515         to nonexistent destination directory.  Reported by Dmitry Rutsky.
2516         See http://bugs.debian.org/199730 for details.
2518 2003-06-27  Jim Meyering  <jim@meyering.net>
2520         split's --verbose option did nothing [broken in 4.5.10 and 5.0]
2521         * src/split.c (longopts): Use `1', not `0' as the value for
2522         for &verbose.  Reported by Keith Thompson.
2524         Test for the above fix.
2525         * tests/misc/split-a: Also use --verbose and compare stderr
2526         output with what we'd expect.
2528 2003-06-20  Jim Meyering  <jim@meyering.net>
2530         * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2531         Use `error_t' (rather than int) as type for local `err'.
2532         From Alfred M. Szmidt.
2534 2003-06-19  Marcus Brinkmann  <marcus@gnu.org>
2536         * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2537         Fix author preservation code.
2539 2003-06-19  Jim Meyering  <jim@meyering.net>
2541         * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
2542         (do_link): Don't warn about hard link to symlink.
2544 2003-06-18  Jim Meyering  <jim@meyering.net>
2546         * src/cut.c: Include "getdelim2.h", not "getstr.h".
2547         Reflect renaming: getstr -> getdelim2.
2549         * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
2550         readline -> readlinebuffer.
2552 2003-06-09  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2554         * src/readlink.c: Include <sys/types.h> before system.h (because
2555         the latter includes <sys/stat.h>).  Required on Ultrix 4.3.
2557 2003-06-17  Jim Meyering  <jim@meyering.net>
2559         * src/system.h (initialize_main): Define.
2560         Use it in every `main'.  Applied via this:
2561         p='initialize_main (&argc, &argv);'
2562         perl -ni -e '/program_name.=.argv.0/ and print "  '"$p"'\n"; print' \
2563           $(grep -l program_name.=.argv.0 *.c)
2564         test.c uses margc/margv, so I made the change manually for that file.
2565         Based on a patch from Bernard Giroud.
2567 2003-06-09  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
2569         Fix for build failure on Ultrix 4.3.
2570         * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
2571         Include sys/param.h and sys/mount.h on ultrix.
2573 2003-06-16  Jim Meyering  <jim@meyering.net>
2575         * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
2576         definitions.
2577         * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
2578         them here instead, but with one change: define EISDIR to -1, not 0.
2580         * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
2581         guaranteed to be defined.
2582         * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
2584         * README: Mention the CVS repository.
2585         Encourage addition of test cases.
2587 2003-06-12  Jim Meyering  <jim@meyering.net>
2589         * src/touch.c (touch): Call close only if necessary.
2590         From Bruno Haible.
2592         * src/wc.c (usage): Correct wording: wc prints counts in the order
2593         `newline, word, byte'.  Reported by Keith M. Briggs.
2594         * man/wc.x: Fix it here, too.  And change `lines' to `newlines'.
2596 2003-06-10  Jim Meyering  <jim@meyering.net>
2598         * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
2600 2003-06-07  Jim Meyering  <jim@meyering.net>
2602         * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
2603         rule.
2605 2003-06-06  Jim Meyering  <jim@meyering.net>
2607         * src/extract-magic (main): Avoid newer 3-arg form of open,
2608         so this script works also with e.g., perl5.005_03.
2609         Patch by John David Anglin.
2611 2003-06-04  Paul Eggert  <eggert@twinsun.com>
2613         * src/system.h: Include <stdbool.h> unconditionally.
2615 2003-06-04  Jim Meyering  <jim@meyering.net>
2617         * man/Makefile.am (check-programs-vs-x): Rename target
2618         from check-programs-vs-1.  Adjust rule to check for the
2619         primary (.x) file, not the generated one (.1).
2621 2003-06-03  Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
2623         * man/kill.x: New file.
2624         * man/Makefile.am (dist_man_MANS): Add kill.1.
2625         (kill.1): New rule.
2627 2003-06-04  Jim Meyering  <jim@meyering.net>
2629         Ensure that the .x file for a new program is never forgotten again.
2630         * man/Makefile.am (programs): Define.
2631         (check-programs-vs-1): New phony target.
2632         (check-local): Depend on it.
2634 2003-06-03  Jim Meyering  <jim@meyering.net>
2636         Avoid unnecessary copying of environment.
2637         * src/env.c (main): Rather than clearing the environment and --
2638         unless told to ignore environment -- copying all settings from
2639         the saved, original environment, clear the environment only when
2640         that is requested.  Suggested by Jens Elkner.
2642 2003-06-02  Jim Meyering  <jim@meyering.net>
2644         * src/system.h: Always include <string.h>, since we assume C89.
2645         Include <limits.h> without checking for HAVE_LIMITS_H.
2647         * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
2648         (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
2650 2003-06-01  Jim Meyering  <jim@meyering.net>
2652         Avoid a race condition in `tail -f' described by Ken Raeburn in
2653         http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
2654         * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
2655         (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
2656         (tail_bytes, tail_lines, tail): Likewise.
2657         (tail_file): Use the new `read_pos' value as the size,
2658         rather than stats.st_size from the fstat call.
2660 2003-05-28  Jim Meyering  <jim@meyering.net>
2662         * src/extract-magic: Allow expansion of `$file' in the here-
2663         document corresponding to the comment at the top of fs.h.
2665 2003-05-26  Jim Meyering  <jim@meyering.net>
2667         * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
2668         <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
2669         Use #if/#elif/... cascade so we get only one set of include files.
2670         Reported by Nelson Beebe.
2672 2003-05-24  Jim Meyering  <jim@meyering.net>
2674         * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
2675         * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
2676         accept the BSD format.
2678 2003-03-28  Joe Orton  <jorton@redhat.com>
2680         * src/md5sum.c (bsd_split_3): New function.
2681         (split_3): Detect checksums from BSD 'md5' command and handle them
2682         using bsd_split_3.
2684         * tests/md5sum/basic-1: New tests for --check exit status, and for
2685         BSD-style checksum files.
2687 2003-05-21  Jim Meyering  <jim@meyering.net>
2689         * src/head.c (elide_tail_lines_pipe): Fix a thinko.
2690         This sort of thing is why it'd be *Really Good* to factor
2691         out the common code used here and in tail.c.
2693 2003-05-14  Jim Meyering  <jim@meyering.net>
2695         * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
2697         * tests/du/slink: Skip this test if `.' is on an XFS file system.
2699         * tests/du/fd-leak: New file.  Test for the bug in du that
2700         was fixed by the 2003-05-12 change to lib/ftw.c.
2701         * tests/du/Makefile.am (TESTS): Add fd-leak.
2703         * src/head.c (AUTHORS): Enclose string in N_(...), now that it
2704         includes a translatable word, `and'.
2706         * src/dd.c (usage): Don't use `,' as the thousands separator
2707         in e.g. 1,000,000 and 1,048,576.  Instead, do this:
2708         `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
2709         * src/df.c (usage): Likewise.
2710         * src/du.c (usage): Likewise.
2711         * src/ls.c (usage): Likewise.
2713         * Makefile.maint (syntax-check): Add another check.
2715 2003-05-13  Paul Eggert  <eggert@twinsun.com>
2717         Fix uniq to conform to POSIX, which requires that "uniq -d -u"
2718         must output nothing.  Problem reported by Josh Hyman.
2720         * src/uniq.c (enum output_mode, mode): Remove, replacing with:
2721         (output_unique, output_first_repeated, output_later_repeated):
2722         New vars.  All uses of "mode" changed to use these variables,
2723         which are not mutually exclusive as "mode" was.
2724         (writeline): New arg "match", used to control whether to
2725         obey output_first_repeated or output_later_repeated.
2726         All callers changed.
2727         (check_file, main): Adjust to above changes.
2729         * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
2731 2003-05-14  Jim Meyering  <jim@meyering.net>
2733         * tests/rm/rm3: Use tr's \n notation rather than \012.
2734         This package can afford to do that, since its tests are guaranteed use
2735         GNU tr, which has accepted the more modern notation for 10 years.
2736         * tests/rm/rm5: Likewise.
2737         * tests/cp/same-file: Likewise.
2738         * tests/stty/row-col-1: Likewise.
2739         * tests/stty/basic-1: Likewise.
2740         * tests/rm/deep-1: Likewise.
2741         * tests/mv/part-symlink: Likewise.
2742         * tests/mkdir/perm: Likewise.
2743         * tests/misc/nice: Likewise.
2745 2003-05-13  Jim Meyering  <jim@meyering.net>
2747         * src/copy.c (struct F_triple) [name]: Remove const attribute.
2748         (triple_free): Don't apply cast to argument of free.
2749         (seen_file): Add cast here instead.
2751         * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
2752         (src_to_dest_free): Don't apply cast to argument of free.
2754         * src/sort.c (zaptemp): Don't apply cast to argument of free.
2755         * src/pr.c (init_fps, init_store_cols): Likewise.
2756         * src/join.c (delseq, freeline): Likewise.
2757         * src/expr.c (OLD): Likewise.
2758         * src/sort.c (sort): Likewise.
2759         * src/head.c (elide_tail_lines_pipe): Likewise.
2761         * src/tail.c: Include "quote.h".
2762         Use quote in diagnostics.  Change many error format strings
2763         from just `%s' to e.g., `error reading %s'.
2764         (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
2765         Rewrite newline-counting loop to use memchr.
2767         * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
2768         Now that assert is no longer used, don't include <assert.h>.
2770 2003-05-12  Jim Meyering  <jim@meyering.net>
2772         * src/head.c: Include <assert.h>.
2773         (AUTHORS): Add my name.
2774         (elide_tail_lines_pipe): New function.
2776 2003-05-10  Jim Meyering  <jim@meyering.net>
2778         * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
2780         * src/readlink.c (main): Set program_name before first use.
2781         Remove that (redundant) first use.
2782         Don't exit successfully just because --verbose was specified.
2783         Pass 0, not EXIT_SUCCESS, as first argument to error; when that
2784         parameter is 0, error does not exit.
2786         * src/uname.c (main): When failing due to too many arguments, also say
2787         that, rather than just "Try `uname --help' for more information.".
2788         * src/comm.c (main): Likewise, but for too few arguments.
2789         * src/logname.c: Include error.h.
2790         (main): Say why we're failing.
2792         * src/uniq.c (main): Don't segfault when argc < optind.
2793         * src/who.c (main): Handle argc < optind.
2794         * src/df.c (main): Likewise.
2795         * src/install.c (main): Likewise.
2796         * src/mv.c (main): Likewise.
2797         * src/pwd.c (main): Likewise.
2798         * src/tty.c (main): Likewise.
2799         * src/chroot.c (main): Likewise.
2800         * src/hostname.c: Likewise.
2801         * src/du.c (main): Likewise.
2802         * src/expand.c (main): Likewise.
2803         * src/env.c (main): Likewise.
2804         * src/unexpand.c (main): Likewise.
2805         * src/printenv.c (main): Likewise.
2806         * src/sync.c (main): Handle argc == 0.
2807         * src/expr.c (main): Likewise.
2808         * src/printf.c (main): Likewise.
2809         * src/basename.c (main): Likewise.
2810         * src/ln.c (main): Test for `missing argument' before computing n_files.
2811         * src/tail.c (main): Test for the case of no arguments before
2812         computing n_files.
2814         * src/kill.c (send_signals): Don't check command line arguments here.
2815         (main): Check them here instead.  Handle argc < optind.
2817         * src/logname.c (main): Use error, rather than fprintf, for the sake
2818         of consistency.
2820         * src/rm.c (main): Don't overrun array bound if argc is 0.
2822 2003-05-09  Jim Meyering  <jim@meyering.net>
2824         * src/sort.c (main): Don't overrun array bound if argc is 0.
2825         That would happen when invoked via: execl ("/usr/bin/sort", NULL);
2826         Reported by Wartan Hachaturow.
2828 2003-05-07  Jim Meyering  <jim@meyering.net>
2830         Implement support so that `head --lines=-N' works on seekable files.
2831         * src/head.c (enum Copy_fd_status): Define.
2832         (COPY_FD_DIAGNOSE): New macro.
2833         (elide_tail_lines_seekable): New funtion.
2834         (elide_tail_lines_file): Call it here.
2836 2003-05-06  Jim Meyering  <jim@meyering.net>
2838         * src/sys2.h (CHAR_BIT): Remove duplicate definition.
2840 2003-05-04  Jim Meyering  <jim@meyering.net>
2842         * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
2843         caused the addition of thousands of small files to the tar archive.
2844         * tests/misc/head-elide-tail: New file.  Add them here instead.
2845         * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
2847 2003-05-04  Paul Eggert  <eggert@twinsun.com>
2849         * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
2850         (IF_READDIR_NEEDS_REWINDDIR): Remove.
2851         (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
2852         which was a bit weird because it couldn't be emulated by a function.
2854 2003-05-03  Jim Meyering  <jim@meyering.net>
2856         Extend head to accept --lines=-N (--bytes=-N) and to print all
2857         but the N lines (bytes) at the end of the file.
2858         * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
2859         Use quote() in diagnostics, rather than literal `' marks.
2860         (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
2861         New functions.
2862         (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
2863         (head_file): Reorganize so as to call head from only one place.
2864         (main): Likewise, for head_file.
2865         Handle new, undocumented option, --presume-input-pipe.
2866         Handle negative line and byte counts.
2867         * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
2869         * tests/du/8gb: Skip test if the file system of `.' doesn't support
2870         sparse files -- otherwise it'd create a file of size 8GB.
2872 2003-05-02  Jim Meyering  <jim@meyering.net>
2874         * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
2875         Instead explain about `-' and standard input.
2876         (main): Give a proper diagnostic for e.g., `fmt -c -72'.
2877         Reported by Keith Thompson.
2878         * tests/fmt/basic: Add test for the above fix.
2880         * src/fmt.c: Include "quote.h".
2881         Use quote() in diagnostics, rather than literal `' marks.
2882         (main): Exit nonzero when unable to open an input file.
2883         * tests/fmt/basic: Add test for the above fix.
2885         * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
2886         specifications like `-72x'.
2887         * tests/fmt/basic: Add test for the above fix.
2889         Work around nasty readdir bug on Darwin6.5.
2890         * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
2891         [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
2892         returned NULL and there has been at least one successful unlink or
2893         rmdir call since the opendir or previous rewinddir, then call
2894         rewinddir and reiterate the loop.
2896         Factor out common code.
2897         * src/remove.c (readdir_ignoring_dotdirs): New function.
2898         (is_empty_dir): Use it here.
2899         (remove_cwd_entries): Use it here.
2901 2003-05-01  Jim Meyering  <jim@meyering.net>
2903         * tests/rm/r-3: Create 500 rather than just 300 files.
2904         There's a bug in Darwin6.5's readdir that shows up only with
2905         338 or more files.
2906         Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
2907         has two components.
2909         * src/tail.c:
2910         Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
2911         (dump_remainder): Move two declarations `down' into the scope
2912         where they are used.
2913         (xlseek): Return the resulting offset.
2914         (file_lines): Rename parameter, file_length, to end_pos.
2915         (pipe_lines): Don't coerce safe_read return value to `int'.
2916         Adapt tests accordingly.
2917         (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
2918         to `unsigned int'.
2919         Change type of `total_bytes' from `int' to `size_t',
2920         since the former wouldn't always be wide enough.
2921         Don't coerce safe_read return value to `int',
2922         and adapt tests accordingly.
2923         Now that testing for a read error no longer involves
2924         using `tmp', handle that case *after* freeing `tmp'.
2925         (start_bytes): Clean up.
2926         (tail_bytes): Now that `n_bytes' may be larger than
2927         OFF_T_MAX, test for that condition and, if it's true, don't
2928         use lseek optimizations.
2929         (parse_options): Don't fail just because N_UNITS is larger than
2930         the maximum size of a file -- tail may be applied to an input
2931         stream (e.g., a pipe) with more data than that.
2933         * Makefile.maint (syntax-check): Rename from alloc-check.
2934         Also check for SPACE-TAB sequences.
2935         Also check for malloc/calloc/realloc casts.
2937 2003-05-01  Jim Meyering  <jim@meyering.net>
2939         * src/tail.c (start_lines): Rewrite to use memchr.  Clean up.
2941 2003-04-28  Jim Meyering  <jim@meyering.net>
2943         * tests/misc/tty-eof: Send two tokens, not just one, so we don't
2944         make the now-more-picky tsort fail.
2946 2003-04-24  Jim Meyering  <jim@meyering.net>
2948         * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
2949         (main): Minor syntactic clean-up.
2951         * src/tsort.c (tsort): Fail if the input contains an odd number of
2952         tokens.  Reported by junkio@cox.net.
2954         * tests/tsort/basic-1: Test for the above fix.
2956 2003-04-21  Jim Meyering  <jim@meyering.net>
2958         * tests/misc/printf: Add tests for the printf fixes below.
2960         * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
2962 2003-04-20  Paul Eggert  <eggert@twinsun.com>
2964         Fix printf POSIX compatibility bug reported by Ben Harris in
2965         <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
2966         * doc/coreutils.texi (printf invocation): It's \NNN in the format,
2967         \0NNN in the %b operand.
2968         * src/printf.c (usage): Likewise.
2969         (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
2970         is desired.  All uses changed.  Behave like Bash printf if %b
2971         operand uses \NNN where the initial N is not 0.
2973 2003-04-17  Jim Meyering  <jim@meyering.net>
2975         * src/stty.c: Remove uses of PROTOTYPE macro.
2977 2003-04-15  Jim Meyering  <jim@meyering.net>
2979         * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
2980         each sequence of spaces before a TAB character.
2982 2003-04-13  Jim Meyering  <jim@meyering.net>
2984         * src/remove.c (is_empty_dir): Don't closedir (NULL).
2986 2003-04-12  Jim Meyering  <jim@meyering.net>
2988         Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
2989         --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
2990         FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
2991         * src/nl.c (main): Fix those problems and remove literal quote marks
2992         (e.g., "`%s'") from format string; instead use "%s" in each format
2993         string and `quote (optarg)' as the corresponding argument.
2994         Also, diagnose all invalid command line options before failing.
2996         * src/nl.c (proc_text): Fix a bug that would make nl output extra
2997         newlines in some cases.  Details here: http://bugs.debian.org/177256.
2998         This bug was introduced on 2001-11-10 for textutils-2.0.17.
2999         * tests/misc/nl: Add test for the above-fixed bug.
3001         * tests/misc/readlink: New file.  Test the --canonicalize option.
3002         * tests/misc/Makefile.am (TESTS): Add readlink.
3004 2003-04-11  Jim Meyering  <jim@meyering.net>
3006         Clean up.
3007         * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
3008         * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
3009         * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
3010         retain alignment) each sequence of spaces before a TAB character.
3012         * src/ls.c: Include <stdlib.h> unconditionally.
3014         * Makefile.maint (xalloc-check): Rename from header-check.
3016         * src/yes.c: Include error.h after system.h, not before.
3018         Clean up.
3019         * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
3020         * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
3021         * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
3022         * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
3023         * src/tr.c: * src/unexpand.c, src/users.c:
3024         Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
3025         return values and of xrealloc's first argument.
3026         Fix the former with this:
3027         perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
3029 2003-04-10  Jim Meyering  <jim@meyering.net>
3031         * src/stty.c (wrapf): Declare with format attribute.
3033         The S_MAGIC_... names shouldn't be maintained in two places (prior
3034         to this change, one would have to keep stat.c and fs.h in sync).
3035         This change makes it so those names and the corresponding
3036         hexadecimal constants all reside in stat.c.  fs.h is now generated.
3037         * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
3038         (BUILT_SOURCES): Add fs.h, now that it's generated.
3039         (EXTRA_DIST): Add extract-magic.
3040         * src/extract-magic: New script to extract fs.h definitions from stat.c.
3041         * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
3042         fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
3044         * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
3045         file with nominal length > 4GB fails.  Reported by Michael Deutschmann.
3047         * man/unexpand.x: Add `SEE ALSO' reference to expand.
3048         * man/expand.x: Add `SEE ALSO' reference to unexpand.
3049         Suggestion from Dan Jacobson.
3051 2003-04-10  Maciej W. Rozycki  <macro@ds2.pg.gda.pl>
3053         * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
3054         * src/stat.c (human_fstype): Handle Linux's devpts.
3056 2003-04-09  Paul Eggert  <eggert@twinsun.com>
3058         * src/split.c (line_bytes_split): Arg is of type size_t, since
3059         that's all that is supported for now.
3060         (main): Check for overflow in obsolescent line count option.
3062 2003-04-09  Jim Meyering  <jim@meyering.net>
3064         * tests/misc/split-fail: Add a new test for the above fix.
3066         * src/split.c (bytes_split): Use size_t temporary (rather than
3067         uintmax_t original) in remaining computations.  From Paul Eggert.
3069         Handle command line option arguments larger than 2^31.
3070         This allows e.g., splitting into files of size 2GB and larger,
3071         and running split --lines=N with N=2^31 or more.
3072         But for --line-bytes=N, the restriction that N <= SIZE_MAX
3073         remains (for now), due to the way it is implemented.
3075         * src/split.c: Include "inttostr.h".
3076         (bytes_split, lines_split, line_bytes_split, main):
3077         Use uintmax_t, not size_t, for file sizes.
3078         (main): Give a better diagnostic for option arguments == 0.
3079         Use umaxtostr to print file sizes.
3080         Reported by Luke Hassell.
3082 2003-04-08  Jim Meyering  <jim@meyering.net>
3084         * src/rm.c (usage): Mention that --directory (-d) works only
3085         on some systems.  Suggestion from Samuel Tardieu.
3087         * tests/basename/basic: Run $PERL to see if it is available,
3088         rather than testing its value.
3089         * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
3090         * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
3091         * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
3092         * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
3093         * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
3094         * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
3095         * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
3096         * tests/sum/basic-1, tests/seq/basic: Likewise.
3098         * tests/misc/Makefile.am (TESTS): Add split-fail.
3099         * tests/misc/split-fail: New file.
3101         * src/split.c: Rename local variables: nchars -> n_bytes.
3102         (lines_split): Rename local, nlines -> n_lines.
3103         (main): Rename local variable: s/accum/n_units/.
3104         (main): Use STDIN_FILENO, not literal `0'.
3106 2003-04-07  Jim Meyering  <jim@meyering.net>
3108         * src/stat.c: Add #include directives for Ultrix 4.4.
3109         Based on a suggested change from Bert Deknuydt.
3111 2003-04-06  Jim Meyering  <jim@meyering.net>
3113         * Makefile.maint (makefile-check): New rule.
3114         (local-check): Add it.
3116 2003-04-05  Jim Meyering  <jim@meyering.net>
3118         * Makefile.am (nearly all of them):
3119         Use $(VAR) rather than @VAR@, now that we can rely on automake to
3120         emit a definition for each substituted variable.
3121         * tests/Makefile.am.in: Likewise.
3123         * tests/rm/rm5: Add a comment explaining why this test fails when
3124         using Tru64's broken sed.
3125         * tests/rm/rm3: Likewise.
3127         Make `kill -t' output signal descriptions (not `?') on Tru64.
3128         * src/kill.c (sys_siglist): Also check for __sys_siglist.
3129         Patch by Tony Leneis.
3130         * configure.ac: Also check for declaration of __sys_siglist.
3131         Required for Tru64 4.0D, 4.0F, and 5.1.
3132         Reported by Tony Leneis.
3134 2003-04-04  Jim Meyering  <jim@meyering.net>
3136         * src/Makefile.am (PERL): Remove unnecessary definition.
3138         Because of inappropriate (but POSIX-mandated) behavior of rename,
3139         `mv a b' would not remove `a' in some unusual cases.  Work around
3140         this by unlinking `a' when necessary.
3142         * src/copy.c (same_file_ok): Add an output parameter.
3143         Set it in the offending case.
3144         (copy_internal): When necessary, unlink SRC_PATH and inform caller.
3145         Reported by Ed Avis.
3146         * tests/mv/hard-4: New test for the above.
3147         * tests/mv/Makefile.am (TESTS): Add hard-4.
3149         Clean up rules for automatically generated sources:
3150         * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
3151         Make each generated file be read-only.
3152         Add each file name to BUILT_SOURCES separately.
3153         (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
3155         Put LOCALEDIR macro definition in new file: localedir.h.
3156         * src/Makefile.am (DEFS): Remove definition.
3157         (localedir.h): New rule.
3158         (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
3159         * src/system.h: Include "localedir.h".
3161 2003-04-02  Jim Meyering  <jim@meyering.net>
3163         * Version 5.0.
3165         * tests/misc/Makefile.am (TESTS): Add false.
3167         * Makefile.maint (TMPDIR): Make sure it's defined.
3168         (my-distcheck): Build in $(TMPDIR), not `.'.
3170         * src/Makefile.am (false.c): Change all occurrences of
3171         `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
3172         unsuccessfully also with --help.  Reported by Paul Jarc,
3173         * tests/misc/false: New test for the above.
3175 2003-03-30  Jim Meyering  <jim@meyering.net>
3177         * NEWS: Note the location of older NEWS files.
3179         * src/remove.c (is_empty_dir): Don't let a failing closedir
3180         clobber errno.  Spotted by Arnold Robbins.
3182         * src/env.c: Fix typo in comment.  From Arnold Robbins.
3184 2003-03-29  Jim Meyering  <jim@meyering.net>
3186         * Version 4.5.12.
3188         * README: Note to expect build problems for stat.c on Ultrix 4.3.
3189         Note that there are some harmless test failures when running
3190         `make check' as root on some systems.
3192 2003-03-28  Jim Meyering  <jim@meyering.net>
3194         * tests/stty/row-col-1: Skip this test if stty can't get window size.
3195         This happens when connecting to sparc-solaris5.7 via ssh from within
3196         emacs.  Reported by Karl Berry.
3198         * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
3199         Otherwise, on systems (DJGPP) that emulate pipes using files,
3200         this test would never complete, waiting for `yes' to terminate.
3201         * tests/du/slink: As above, use seq, not `yes' to generate link target.
3202         * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
3203         Reported by Rich Dawe.
3205 2003-03-27  Jim Meyering  <jim@meyering.net>
3207         * src/id.c: Remove Arnold Robbins' obsolete e-mail address
3208         from `written by...' comment, at his request.
3210 2003-03-24  Paul Eggert  <eggert@twinsun.com>
3212         Fix buffer overrun problem reported by TAKAI Kousuke, along
3213         with some other POSIX incompatibilities.
3215         * src/printf.c (print_esc): Do not treat \x specially if
3216         POSIXLY_CORRECT.  Avoid buffer overrun if the format ends
3217         in backslash.  Treat incomplete escape sequences as strings
3218         of characters, as POSIX requires.
3219         (print_formatted): Allow multiple flags.  Avoid buffer overrun
3220         if the format is incomplete.
3222 2003-03-24  Jim Meyering  <jim@meyering.net>
3224         * tests/misc/printf: Add tests for the above fixes and changes.
3226 2003-03-26  Jim Meyering  <jim@meyering.net>
3228         * src/copy.h (struct cp_options): Add a comment.
3230 2003-03-23  Jim Meyering  <jim@meyering.net>
3232         * README: Describe problem with 64-bit mode on HPUX 11.x,
3233         with patch for /usr/include/inttypes.h.
3234         * TODO: Plan to add an autoconf test to work around the bug.
3236 2003-03-22  Jim Meyering  <jim@meyering.net>
3238         * src/stat.c: Don't include <sys/sysmacros.h>.
3239         That is already done via system.h.  Otherwise, the multiple
3240         inclusion would evoke redefinition warnings from Cray's /bin/cc,
3241         aka Cray Standard C Version 4.0.3  (057126) Mar 22 2003  22:02:28.
3242         (human_fstype): Factor some directives `up', out of this function.
3243         Cast away `const' to avoid error from Cray's /bin/cc.
3245 2003-03-20  Jim Meyering  <jim@meyering.net>
3247         * announce-gen (print_changelog_deltas): Ensure that a newline
3248         precedes each row of `*'s.
3250 2003-03-20  Jim Meyering  <jim@meyering.net>
3252         * Version 4.5.11.
3254         * src/seq.c (valid_format): Also accept ` ' and `'' as valid
3255         format flag characters.
3256         Do not require that a field width be specified.
3257         Do not fail when given a field width of `0'.
3258         Reported by Dan Jacobson.
3259         * tests/seq/basic: Add new tests for the above-fixed bug.
3261         * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
3262         (install-root): Likewise.
3263         (install-exec-local): Likewise.
3264         Based on a patch from Richard Dawe.
3266 2003-03-19  Jim Meyering  <jim@meyering.net>
3268         * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
3269         because the DJGPP 2.03 port of 'ln -s' doesn't work.
3270         Include $(EXEEXT) in program names.
3271         Since $(LN_S) may degenerate to `cp -p', be careful
3272         to invoke it from the destination directory.
3273         Mostly from Richard Dawe.
3274         * configure.ac: Use AC_PROG_LN_S.
3276         * tests/mv/part-symlink: Unset CDPATH.  Otherwise, having the
3277         CDPATH shell variable set could cause this test to fail.
3278         Reported by Karl Berry.
3280 2003-03-18  Jim Meyering  <jim@meyering.net>
3282         * src/fmt.c [struct Word] (paren, period, punct, final): Change the
3283         type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
3284         AIX 5.1's xlc could not compile the former.
3285         Patch by Petter Reinholdtsen.  Also reported by Mike Jetzer.
3287 2003-03-17  Richard Dawe  <rich@phekda.freeserve.co.uk>
3289         * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
3290         program names, since automake only adds $(EXEEXT) to programs
3291         in its *_PROGRAMS.
3293 2003-03-16  Jim Meyering  <jim@meyering.net>
3295         * src/remove.c (rm): Put two local variables in static storage,
3296         so they can't be clobbered by the potential longjmp.
3298 2003-03-15  Jim Meyering  <jim@meyering.net>
3300         * Makefile.cfg (gnu_rel_host): Fix code to match the comment
3301         so that a version number with a two-digit component can still count
3302         as an alpha release.  Reported by Richard A Downing.
3303         (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
3305 2003-03-14  Jim Meyering  <jim@meyering.net>
3307         * src/ansi2knr.c: Remove no-longer-used file.
3308         * src/ansi2knr.1: Likewise.
3310         * Makefile.maint (prev_version_file): Don't use ?= for this particular
3311         assignment, since it causes trouble with old versions of GNU make
3312         (e.g. 3.76.1).  The other uses of `?=' are inoffensive.  Details here.
3313         http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
3314         Patch from Alexandre Duret-Lutz.
3316         * Use patched automake-1.7.3.  Regenerate Makefile.in files in
3317         subdirectories so that each includes a definition of ACLOCAL_M4.
3319         * announce-gen (main): Label the compressed source URLs.
3321         * Version 4.5.10.
3323         * tests/du/slink: Relax the test for the `local'ness of a file system,
3324         so that now it works also for tmpfs.
3326         * tests/du/hard-link: Transform output from first du, so that this
3327         test doesn't fail on file systems like tmpfs that order directory
3328         entries differently.
3330 2003-03-13  Jim Meyering  <jim@meyering.net>
3332         * tests/du/8gb: Work around what appears to be an NFS failure that
3333         would make this test fail on some systems.
3335 2003-03-11  Jim Meyering  <jim@meyering.net>
3337         * tests/du/basic: Make the test file exactly 4k bytes long.
3339         * src/split.c (longopts): Don't hard-code `2' here.
3340         Instead, just specify `&verbose', and ...
3341         (main): ... remove the `case 2:' block for --verbose.
3343         * tests/du/basic: Make the test file larger than 64 bytes, so that
3344         we don't immediately disqualify file systems (e.g., NetApp) on which
3345         smaller files take up zero disk blocks.  Reported by Vin Shelton.
3347 2003-03-10  Jim Meyering  <jim@meyering.net>
3349         Don't segfault for a negative field width or precision in format string.
3350         Note that this is just a stopgap fix.  The longer term solution may
3351         involve adapting bash's builtins/printf.def.
3353         * src/printf.c: (UNSPECIFIED): Define.
3354         (print_direc): Use the special value, UNSPECIFIED, to indicate
3355         that field_width or precision has not been specified.
3356         (print_formatted): Fail if field_width or precision is the
3357         special value, UNSPECIFIED.
3358         Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
3360         * src/sys2.h (INT_MIN): Define, if necessary.
3361         * tests/misc/printf: Add a test for the above-fixed bug.
3363 2003-03-09  Jim Meyering  <jim@meyering.net>
3365         * src/remove.c (AD_stack_pop): Cast sizeof... to int before
3366         changing its sign.  This avoids a warning from gcc on 64-bit systems.
3367         Reported by Bob Proulx.
3368         (pop_dir): Reverse order of sign change and cast, to be consistent
3369         with the above.
3371 2003-03-08  Jim Meyering  <jim@meyering.net>
3373         * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
3374         shell variable, but only in the environment.  With /bin/sh->bash, the
3375         shell variable is set to `y', and that would cause a spurious warning.
3376         Reported by Bob Proulx.
3378         * tests/Makefile.am (check-root): Remove touch/fifo.
3379         It doesn't appear to have to be run as root.
3381         * tests/rm/fail-2eperm: Rather than simply using the first non-root
3382         user name, make sure that the selected user name has a usable shell.
3383         Reported by Paul Jarc.
3385         Before, when using shred on a device, one had to specify --exact,
3386         or be careful to choose a size that would not be rounded up and
3387         exceed the maximum value;  that could result in a failure of
3388         the final write.
3389         * src/shred.c (do_wipefd): --exact is now the default for non-regular
3390         files.  Suggestion from Ben Elliston.
3391         (usage): Say it.
3393         * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
3394         Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
3395         Patch by Bob Proulx.
3397         * src/Makefile.am (check-misc): Check for use of `defined' in
3398         #define directives.
3399         Change to $(srcdir) before running grep.
3401         * src/sleep.c: Remove now-unused #include and #define directives.
3403         * src/du.c (process_file): If a file's size is not being counted
3404         e.g., because it's a hard link to a file we've already counted,
3405         then don't print a line for it.
3407         * tests/du/hard-link: New test for the above-fixed bug.
3408         * tests/du/Makefile.am (TESTS): Add hard-link.
3410         `du -S' didn't work
3411         * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
3412         and make the two-array approach work.
3414         * tests/du/basic: Correct/add tests for the above fix.
3415         Set LC_ALL, etc., now that we use sort.
3416         Check the block/size of a small file, too.
3417         Correct expected results for simple dir1/dir2/file case.
3418         Add another test of du -S.
3420 2003-03-07  John David Anglin  <dave.anglin@nrc-cnrc.gc.ca>
3422         Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
3423         middle-end/9986).  As one of GCC's optimizations, it transforms a
3424         fputs_unlocked call to a fputc_unlocked call when the string is
3425         one character long.  However, hpux doesn't have fputc_unlocked.
3427         * expr.c (usage): Use putchar, not fputs, to output a single character.
3428         * ls.c (dired_dump_obstack): Likewise.
3429         * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
3430         * stat.c (print_it): Likewise.
3432 2003-03-07  Jim Meyering  <jim@meyering.net>
3434         * src/cp.c: Remove everything associated with mmap-stack.c.
3435         This reverts the two changes of 2003-02-21.
3436         * src/du.c: Remove everything associated with mmap-stack.c.
3437         This reverts the change of 2003-02-19.
3439 2003-03-06  Jim Meyering  <jim@meyering.net>
3441         * tests/cp/same-file: Unset CDPATH.  Otherwise, having the
3442         CDPATH shell variable set could cause this test to fail.
3443         Reported by Karl Berry.
3445 2003-03-05  Jim Meyering  <jim@meyering.net>
3447         * Version 4.5.9.
3449         * src/printf.c (print_esc): Remove pointless comparison of unsigned
3450         integer with zero, to avoid a warning from Intel's ecc.
3451         Reported by Nelson Beebe.
3453         * src/du.c (process_file): Sizes must all be of type uintmax_t.
3454         Otherwise, for files or totals that are too big, numbers would
3455         be truncated.  Patch mostly by Michael Stone.
3456         Reported by Ingo Saitz as Debian bug #183210.
3458         * tests/du/8gb: New test for the above-fixed bug.
3459         * tests/du/Makefile.am (TESTS): Add 8gb.
3461         * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
3462         rather than UTILS_OPEN_MAX - 10.
3464 2003-03-04  Jim Meyering  <jim@meyering.net>
3466         * README: Refer new feature discussion to bug-coreutils@gnu.org,
3467         rather than bug-gnu-utils, now that the former is better known.
3468         Suggestion from Göran Uddeborg.
3470         * src/stat.c (usage): Capitalize consistently.
3471         Reported by Göran Uddeborg.
3473         * Makefile.maint (rel-files): Include $(signatures), so that
3474         those files are also copied into $(release_archive_dir).
3476         * src/df.c (find_mount_point): Call error here, now that restore_cwd
3477         no longer does it.
3478         * src/remove.c (AD_pop_and_chdir): Likewise.
3480         * tests/Makefile.am (check-root): Add fail-2eperm.
3482 2003-03-03  Jim Meyering  <jim@meyering.net>
3484         * src/remove.c (remove_cwd_entries): Include the full filename of
3485         the offending file, not just the basename.
3487         * tests/misc/tty-eof: Set $ME properly.
3489         * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
3490         Remove now-unused variables.
3491         (tag-prev-version, prev-cvs-tag): Likewise.
3493         * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
3494         accurate diagnostic when failing to remove a file owned by some other
3495         user.  Reported by Ivo Timmermans via Michael Stone.
3496         This fixes Debian bug# 178471.
3498         * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
3499         * tests/rm/fail-2eperm: New test, for the above-fixed bug.
3500         Based on a report from Ivo Timmermans.
3502 2003-03-02  Jim Meyering  <jim@meyering.net>
3504         * src/copy.c (copy_internal) [un_backup]: When recovering from a
3505         failure to create a hard link, do not remove the entry associating
3506         the source dev/ino with the destination file name.
3507         * tests/mv/Makefile.am (TESTS): Add hard-3.
3508         * tests/mv/hard-3: New test, for the above-fixed bug.
3509         Inspired by a report from Iida Yosiaki.
3511 2003-03-01  Jim Meyering  <jim@meyering.net>
3513         * src/df.c (print_header): Don't embed spaces in a separate `Type'
3514         header string.  Instead, put `Filesystem' and `Type' headers in the
3515         same string, so translators can use horizontal space as needed.
3516         Reported by Jean Charles Delepine.
3518 2003-02-28  Jim Meyering  <jim@meyering.net>
3520         * src/copy.c (copy_internal): When link fails because of an
3521         existing destination file, unlink that file and try again.
3522         Reported by Iida Yosiaki.
3524         * tests/mv/Makefile.am (TESTS): Add hard-2.
3525         * tests/mv/hard-2: New test for the above-fixed bug.
3526         Based on a test case from Iida Yosiaki.
3528 2003-02-26  Jim Meyering  <jim@meyering.net>
3530         * tests/du/basic: Don't test du's -b option here.  Directory byte
3531         counts are smaller (512 rather than 4096) on at least OSF/1 5.1
3532         and IBM AIX 4.2.  Reported by Nelson Beebe.
3534 2003-02-25  Jim Meyering  <jim@meyering.net>
3536         * Makefile.maint (announcement): Now that ChangeLog entries
3537         are output by announce-gen, don't do it here.
3538         * announce-gen (print_changelog_deltas): New function.
3539         (main): Use it.
3541 2003-02-22  Jim Meyering  <jim@meyering.net>
3543         * announce-gen: New option: --release-type=TYPE
3544         * Makefile.maint (beta, major): New targets.  Remove `release'.
3545         Put them all together on a line.
3546         Pass the release type (via RELEASE_TYPE envvar) to the MAKE
3547         invocation of `announcement'.
3548         (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
3550         * announce-gen: New option: --news=NEWS_FILE.
3551         Extract NEWS entries here, not via rules in Makefile.maint.
3552         * Makefile.maint (announcement): Now that NEWS entries are
3553         extracted by announce-gen, don't do it here.
3554         (news-r1, news-r2): Remove now-unused definitions.
3556 2003-02-21  Jim Meyering  <jim@meyering.net>
3558         * Version 4.5.8.
3560         Merge in changes from autoconf's version of this file.
3561         * Makefile.maint (www-gnu): Define.
3562         (standards.texi-url_prefix): Use $(www-gnu).
3563         (make-stds.texi-url_prefix): Likewise.
3565         * src/cp.c: Include "mmap-stack.h".
3566         (main): Invoke `run' through a macro that (when possible) runs it
3567         with a large, mmap'd stack.
3569         * src/cp.c (run): New function, preparing for the above.
3570         Exit from this function, not from main
3571         (main): Call run.
3573         * src/du.c: New option: --apparent-size.
3574         (enum) [APPARENT_SIZE_OPTION]: New member.
3575         (long_options): Add it.
3576         (usage): Describe it.
3577         (main): Handle it.
3578         ['b']: Set apparent_size.
3579         David Eisner reported that the behavior of --bytes had changed.
3580         Paul Eggert proposed the use of a new option, --apparent-size.
3582         * src/du.c (apparent_size): New global.
3583         (print_only_size): Reflect the fact that we're printing byte counts,
3584         not ST_NBLOCKSIZE-byte-block counts.
3585         (print_size): Call print_only_size rather than duplicating its code.
3586         (process_file): Accumulate byte counts, rather than block counts.
3588         * src/du.c (process_file): Always reset size_to_propagate_to_parent
3589         for --separate-dirs (-S).
3591 2003-02-20  Jim Meyering  <jim@meyering.net>
3593         * Use automake-1.7.3.  Regenerate dependent files.
3595         * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
3596         This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
3597         (usage) [%B]: Describe it.
3598         [%b]: Refer to %B.
3600         * src/du.c (process_file): Reorganize the code to use only
3601         one `sum' array, and change how -S works back to the way it was
3602         before 2003-01-31.  Patch by Bruno Haible.
3604         * tests/du/basic: New test.
3605         * tests/du/Makefile.am (TESTS): Add basic.
3607         * tests/envvar-check: Add checks for the following:
3608         BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
3610         * tests/Makefile.am: Rename phony target envvar-check to evar-check
3611         so as not to conflict with the distributed file by the same name.
3613         * src/du.c (process_file): Set info->skip before any possible return.
3615         Report correct usage for directories, not 0.
3616         * src/du.c (process_file): Return for `file_type == FTW_DPRE'
3617         _before_ recording the dev/ino of a directory.
3618         Reported by Bruno Haible.
3620         Now, df always displays the device file name corresponding to the
3621         listed mount point under `Filesystem'.  Before, for an unmounted
3622         block- or character-special file argument, it would display the
3623         command-line argument instead.
3624         * src/df.c (show_disk): Return a value indicating whether
3625         there was a match.  Don't try to find a mount point here.
3626         (show_entry): If show_disk doesn't find a match, call show_point.
3628 2003-02-19  Jim Meyering  <jim@meyering.net>
3630         * src/du.c: Include "mmap-stack.h".
3631         (du_files): Add prototype with ATTRIBUTE_NORETURN.
3632         Exit from this function, not from...
3633         (main): ...here.
3634         Instead, if possible, invoke du_files through a macro that
3635         runs it with a large, mmap'd stack.
3637         * src/join.c (usage): Change wording in --help output:
3638         use FILENUM instead of `SIDE' and say what FILENUM means.
3639         Reported by Bernhard Gabler.
3641         * src/df.c (print_header): Rather than using a hard-coded literal
3642         string of spaces matching the length of the English `...Type' header,
3643         output the right number of spaces to match the selected translation.
3644         Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
3646         * src/split.c (bytes_split): Remove unnecessary `else' after break.
3647         (lines_split): Likewise.  and correct misleading indentation.
3649         * src/split.c: Include "full-read.h".
3650         (bytes_split, lines_split, line_bytes_split): Use full_read,
3651         not safe_read.   The way split was using the latter, a short read
3652         could cause split to terminate before EOF.
3654         * tests/misc/tty-eof: Test all programs that can read stdin,
3655         requiring no arguments and that write to standard output.
3657         * tests/misc/tty-eof: New file.  Renamed from ...
3658         * tests/misc/cat-tty-eof: Remove file.  Rename to tty-eof.
3659         * tests/misc/Makefile.am (TESTS): Reflect renaming.
3661 2003-02-18  Jim Meyering  <jim@meyering.net>
3663         cksum would perform an extra read after encountering EOF
3664         * src/cksum.c (cksum): Exit the loop upon EOF, too.
3665         Patch by Michael Bacarella.
3667         Test for the bug fixed today in cksum, md5sum, and sha1sum.
3668         * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
3669         cat, cksum, md5sum, and sha1sum all in the same loop.
3671 2003-02-14  Jim Meyering  <jim@meyering.net>
3673         * src/remove.c: Include "euidaccess.h".
3674         Remove declaration of euidaccess.
3676 2003-02-12  Jim Meyering  <jim@meyering.net>
3678         * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
3679         in cast to avoid warning from icc.  Reported by Alexandre Duret-Lutz.
3681 2003-02-10  Jim Meyering  <jim@meyering.net>
3683         * src/test.c: Don't include group-member.h.
3684         Include euidaccess.h.
3685         (eaccess): Rewrite function to set the real uid and gid temporarily
3686         to the effective uid and gid, then invoke 'access', and then set the
3687         real uid and gid back.  On systems that lack setreuid or setregid,
3688         fall back on the kludges in euidaccess.  Before, it would not work
3689         for e.g., files with ACLs, files that were marked immutable,
3690         or on file systems mounted read-only.  Nelson Beebe raised the issue.
3691         Paul Eggert suggested the new implementation.
3693 2003-02-09  Jim Meyering  <jim@meyering.net>
3695         * src/test.c (test_stat): Remove function.  It's job is done (only
3696         when necessary) by the wrapper in lib/stat.c.  Adjust all uses.
3698 2003-02-08  Jim Meyering  <jim@meyering.net>
3700         * Version 4.5.7.
3702         * tests/mv/part-symlink: Don't assume that the file owner username
3703         length is less than 9 in ls output: instead, omit that field
3704         altogether.  Reported by, and suggested fix from, Ferdinand.
3706         * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
3707         * tests/du/Makefile.am (TESTS): Add restore-wd.
3709         * src/rm.c: Correct now-invalid comment about cycle-detection.
3711 2003-02-06  Jim Meyering  <jim@meyering.net>
3713         * NEWS: Add entries from old/*/NEWS
3714         from fileutils-4.1 through 4.1.11 and
3715         from sh-utils-2.0 through 2.0.15.  Suggestion from Karl Berry.
3717         * Version 4.5.6.
3719         * src/du.c (process_file): Don't return early for excluded files
3720         or for files whose dev/inode we've already seen.
3722 2003-02-05  Jim Meyering  <jim@meyering.net>
3724         * tests/du/exclude: New file.
3725         * tests/du/Makefile.am (TESTS): Add exclude.
3727 2003-02-04  Dmitry V. Levin  <ldv@altlinux.org>
3729         * src/who.c (print_boottime, print_deadprocs, print_runlevel):
3730         Fix memory allocation arithmetic.
3732 2003-02-04  Jim Meyering  <jim@meyering.net>
3734         `df /dev/block-or-char-device-file--not-mounted' now reports
3735         the name of the file system on which the file resides, usually `/'.
3736         Before, it would leave the `Mounted on' field blank.
3737         * src/df.c (show_disk): Move function to precede find_mount_point.
3738         (show_disk): Add parameter: STATP.
3739         If we don't find a matching device name, then resort to calling
3740         find_mount_point.  Reported by Bob Proulx.
3742 2003-02-03  Andreas Schwab  <schwab@suse.de>
3744         * tests/rm/cycle: Require non-root.
3745         * tests/rm/isatty: Likewise.
3747 2003-02-02  Jim Meyering  <jim@meyering.net>
3749         * Version 4.5.5.
3751         * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
3753         Ensure that there are no offending uses of `:'.
3754         * Makefile.maint (makefile_path_separator_check): New rule.
3755         (local-check): Add it to the list.
3757 2003-02-01  Jim Meyering  <jim@meyering.net>
3759         * src/du.c (MAX_N_DESCRIPTORS): Define.
3761         * src/stat.c (G_fail): New global.
3762         (human_time): Diagnose failed localtime, not failed nstrftime.
3763         (main): Fail if G_fail is set.
3765 2003-01-31  Richard Dawe  <rich@phekda.freeserve.co.uk>
3767         * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
3768         hard-coding the path-separator.  Also double-quote the new PATH,
3769         to avoid problems when the path-separator is a semi-colon or when
3770         `pwd` contains e.g. a space.
3771         * tests/chgrp/Makefile.am: Likewise.
3772         * tests/chmod/Makefile.am: Likewise.
3773         * tests/chown/Makefile.am: Likewise.
3774         * tests/cp/Makefile.am: Likewise.
3775         * tests/dd/Makefile.am: Likewise.
3776         * tests/dircolors/Makefile.am: Likewise.
3777         * tests/du/Makefile.am: Likewise.
3778         * tests/expr/Makefile.am: Likewise.
3779         * tests/factor/Makefile.am: Likewise.
3780         * tests/fmt/Makefile.am: Likewise.
3781         * tests/install/Makefile.am: Likewise.
3782         * tests/ln/Makefile.am: Likewise.
3783         * tests/ls/Makefile.am: Likewise.
3784         * tests/ls-2/Makefile.am: Likewise.
3785         * tests/md5sum/Makefile.am: Likewise.
3786         * tests/misc/Makefile.am: Likewise.
3787         * tests/mkdir/Makefile.am: Likewise.
3788         * tests/mv/Makefile.am: Likewise.
3789         * tests/od/Makefile.am: Likewise.
3790         * tests/rm/Makefile.am: Likewise.
3791         * tests/rmdir/Makefile.am: Likewise.
3792         * tests/seq/Makefile.am: Likewise.
3793         * tests/sha1sum/Makefile.am: Likewise.
3794         * tests/shred/Makefile.am: Likewise.
3795         * tests/stty/Makefile.am: Likewise.
3796         * tests/sum/Makefile.am: Likewise.
3797         * tests/tail-2/Makefile.am: Likewise.
3798         * tests/touch/Makefile.am: Likewise.
3799         * tests/tsort/Makefile.am: Likewise.
3800         * tests/unexpand/Makefile.am: Likewise.
3802 2003-01-31  Jim Meyering  <jim@meyering.net>
3804         * src/stat.c: Include "file-type.h"
3805         (print_human_type): Remove function.
3806         (human_access): Rename from print_human_access.  Return a string.
3807         (human_time): Rename from print_human_time.  Return a string.
3808         (print_stat): Arrange so that field width and an alignment specifier
3809         are honored for the %A, %F, %x, %y, and %z formats.
3810         [%F]: Use file_type; this gives slightly different file type strings,
3811         e.g., `directory' instead of `Directory' and `regular file' or
3812         `regular empty file' instead of `Regular file'.
3813         Prompted by a report from Richard Dawe that the uses of
3814         S_IFSOCK and S_IFIFO in print_human_time were not portable
3815         to systems using e.g., DJGPP.
3817 2003-01-31  Richard Dawe  <rich@phekda.freeserve.co.uk>
3819         * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
3820         test using S_IFMT and S_IFLNK.  S_IFLNK may not be defined.
3822 2003-01-31  Jim Meyering  <jim@meyering.net>
3824         * src/du.c (main): Upon processing an invalid option or an invalid
3825         --exclude-from or --max-depth option argument, don't exit right away,
3826         in case there are others.  Rather record the failure and exit after
3827         processing other options.
3829         * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
3830         tar archive easier to reproduce.
3832         Rewrite to perform directory traversal using nftw.
3834         * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
3835         (AUTHORS): Add self.
3836         (opt_one_file_system): Move global into `main'.
3837         (path, xstat, exit_status): Remove declarations.
3838         (arg_length, suffix_length): New globals.
3839         (G_fail): New global, sort of like the old `exit_status'.
3840         (IS_FTW_DIR_TYPE): Define.
3841         (print_only_size): New function.
3842         (process_file): New function.
3843         (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
3844         (str_trunc, pop_dir, count_entry): Likewise.
3845         (du_files): Rewrite to use nftw.
3847 2003-01-30  Jim Meyering  <jim@meyering.net>
3849         * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
3850         symlink-to-directory with -L, even without the trailing slash.
3852 2003-01-27  Jim Meyering  <jim@meyering.net>
3854         * src/Makefile.am (check-misc): Check for st_blocks, too.
3856         * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
3857         Reported by Richard Dawe.
3859 2003-01-27  Andreas Schwab  <schwab@suse.de>
3861         * src/ls.c (quote_name): Add fourth parameter, width, into which to
3862         store the screen columns, and return the number of bytes instead.
3863         (print_dir): Pass NULL as fourth parameter of quote_name.
3864         (print_name_with_quoting): Likewise.
3865         (length_of_file_name_and_frills): Get the width from the fourth
3866         parameter of quote_name instead of return value.
3868 2003-01-27  Jim Meyering  <jim@meyering.net>
3870         * src/ls.c (decode_switches): If `dired' is set without
3871         `format == long_format', then silently reset dired.  This doesn't
3872         change the behavior of ls (all prior uses of dired were protected
3873         by `&& format == long_format'), and lets us...
3874         (DIRED_INDENT): ... remove the `format == long_format' conjunct.
3875         (PUSH_CURRENT_DIRED_POS): Likewise.
3876         (main): Likewise.
3878 2003-01-22  Jim Meyering  <jim@meyering.net>
3880         * tests/du/no-x: New test, for functionality added to lib/ftw.c.
3881         * tests/du/Makefile.am (TESTS): Add no-x.
3883 2003-01-21  Jim Meyering  <jim@meyering.net>
3885         * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
3886         && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
3887         it may still be a directory -- or not (e.g., with FreeBSD on an
3888         NFS-mounted file system), so resort to calling lstat to find out.
3889         Based on a patch by Michael van Elst.
3891         * tests/cp/same-file: Don't assume that the file owner username
3892         length is less than 9 in ls output: instead, omit that field
3893         altogether.  Reported by, and suggested fix from, Ferdinand.
3895 2003-01-20  Jim Meyering  <jim@meyering.net>
3897         * tests/date/Test.pm (wide-fmt): New test to demonstrate that
3898         large format widths no longer cause strftime to infloop.
3900         * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
3902 2003-01-19  Jim Meyering  <jim@meyering.net>
3904         * src/readlink.c: Include "canonicalize.h".
3906 2003-01-18  Jim Meyering  <jim@meyering.net>
3908         * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
3909         New member.
3910         (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
3911         (long_options): Add option --dereference-command-line-symlink-to-dir.
3912         (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
3913         rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
3914         -d, -F, -l options is specified.
3915         (decode_switches): Handle --dereference-command-line-symlink-to-dir.
3916         (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
3917         Change --dereference-command-line (-H) to dereference *all*
3918         command line arguments, including broken symlinks.
3920 2003-01-15  Paul Eggert  <eggert@twinsun.com>
3922         Change ls -H back to the way it was yesterday, since this is
3923         compatible with FreeBSD and the POSIX spec is confusing
3924         and somewhat contradictory.
3926         * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
3927         from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
3928         (long_options): Change the long option name back.
3929         (usage): Change the usage back.
3930         (gobble_file): When -H is specified, dereference a top-level
3931         arg even if it points to a non-directory.
3933 2003-01-15  Jim Meyering  <jim@meyering.net>
3935         * src/ls.c (gobble_file): Fall back on using lstat when required:
3936         when --dereference (-L) is not specified, and
3937         - when operating on a dangling symlink
3938         - when operating on command-line-symlink-to-directories
3939         This fixes numerous problems.  Here are examples:
3940         - `ls dangling-symlink' would fail with `no such file...'
3941         Now it prints `dangling-symlink'.
3942         - `ls -i symlink' would mistakenly print the inode of the referent.
3943         Now it prints the inode of the symlink.  Likewise for --size (-s).
3944         Based on a patch from Michael Stone.
3945         Reported by Deepak Goel as Debian bug #173793.
3947         Rename ls's --dereference-command-line (-H)
3948         option to   --dereference-command-line-symlink-to-dir.
3949         * src/ls.c [enum Dereference_symlink]
3950         (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
3951         DEREF_COMMAND_LINE_ARGUMENTS.  Update all uses.
3952         (long_options): Rename the long option.
3953         (usage): Say that --dereference-... changes how ls treats
3954         only symlinks to directories specified on the command line.
3956 2003-01-14  Jim Meyering  <jim@meyering.net>
3958         * tests/ls/dangle: New file/test, for the above fix.
3959         * tests/ls/inode: Another new file/test, for the above fix.
3960         * tests/ls/Makefile.am (TESTS): Add dangle and inode.
3962         * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
3963         so that ls --color would no longer highlight the names of files with
3964         the execute bit set when not specified on the command line.
3965         Patch by Michael Stone.  Reported by Stephen Depooter as
3966         Debian bug 175135.
3968         * tests/ls-2/tests (color-exe): New test, for the above fix.
3970 2003-01-13  Jim Meyering  <jim@meyering.net>
3972         * tests/shred/exact: Also test for just fixed bug with --zero.
3974         * src/shred.c (long_opts): --zero does not require an argument.
3975         Patch by Michael Stone.  Reported by Roland Turner as Debian bug 172019.
3977 2003-01-12  Jim Meyering  <jim@meyering.net>
3979         * Makefile.maint (cvs-update): Skip any file with local modifications.
3981         * src/unexpand.c (usage): Document --first-only and mention that
3982         --tabs=N (-t) enables --all (-a).  Reported by wiregauze@yahoo.com.
3984 2002-12-01  Dmitry V. Levin  <ldv@altlinux.org>
3986         * src/df.c: Include "canonicalize.h".
3987         Use canonicalize_file_name unconditionally.
3989 2003-01-09  Jim Meyering  <jim@meyering.net>
3991         * README: Add readlink.
3993 2002-11-30  Dmitry V. Levin  <ldv@altlinux.org>
3995         * src/df.c: Include "xgetcwd.h".
3996         * src/pwd.c: Likewise.
3998 2002-11-30  Dmitry V. Levin  <ldv@altlinux.org>
4000         * src/shred.c: Remove declaration of xstrdup.
4001         We already get it via xalloc.h which is included via system.h.
4003 2002-08-27  Dmitry V. Levin  <ldv@altlinux.org>
4005         New program: readlink.
4007         * src/Makefile.am (bin_PROGRAMS): Add readlink.
4008         * src/readlink.c: New file.
4010         * man/readlink.x: New file.
4011         * man/Makefile.am (dist_man_MANS): Add readlink.1.
4012         (readlink.1): New rule.
4014 2003-01-09  Jim Meyering  <jim@meyering.net>
4016         When selecting ranges of byte offsets (as opposed to ranges of fields)
4017         and when --output-delimiter=STRING is specified, output STRING between
4018         ranges of selected bytes.
4019         * src/cut.c (RANGE_START_SENTINEL): Define.
4020         (output_delimiter_specified): New global.
4021         (print_kth): Add parameter.  Adjust all callers.
4022         (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
4023         (cut_bytes): When requested, output STRING between ranges of
4024         selected bytes.
4025         (main): Make a diagnostic a little clearer.
4026         Based on a patch from Jan Nieuwenhuizen.
4028         * tests/cut/Test.pm: New tests for the above.
4030         * src/cut.c (set_fields): Make code agree with comment:
4031         Don't merge abutting ranges like 4- and 2-3.  This makes no
4032         difference currently, but is required to support an upcoming change.
4034 2003-01-07  Jim Meyering  <jim@meyering.net>
4036         * src/cut.c (set_fields): Fix typo in comment.
4038         * tests/touch/not-owner: New test, mostly extracted from fail-diag.
4039         * tests/touch/Makefile.am (TESTS): Add not-owner.
4040         * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
4041         Now, this tests only the nonexistent-directory diagnostic.
4042         Suggestion from Michael Stone.
4044         * tests/touch/fail-diag: Fix typo: s/ld/ls/.
4046 2003-01-04  Jim Meyering  <jim@meyering.net>
4048         * src/copy.h: Remove use of PARAMS.
4049         * src/remove.h: Likewise.
4050         * src/chown-core.h: Likewise.
4052         rm could be tricked into mistakenly reporting a cycle.
4053         * src/remove.c: [cycle_check_state]: New global.
4054         (remove_cwd_entries): Adapt to new semantics of cycle_check.
4055         (rm): Call cycle_check_init and cycle_check_free for each file.
4056         * tests/rm/cycle (rm): New test, for the above fix.
4057         * tests/rm/Makefile.am (TESTS): Add cycle.
4059         When rm detects a cycle, don't abort the entire command,
4060         but rather just the affected command line argument.
4061         * src/remove.c: Include <setjmp.h>
4062         (struct dirstack_state) [current_arg_jumpbuf]: New member.
4063         (remove_cwd_entries): Call longjmp if we detect a cycle.
4064         (rm): Call setjmp here.
4066         * src/remove.c (cycle_check, is_power_of_two): Remove functions.
4067         Instead, include cycle-check.h and use it.
4069         * src/remove.h (struct dev_ino): Remove declaration.
4071         * src/remove.c (remove_cwd_entries): Fix typos in comment.
4073         Don't include trailing /. in diagnostics about directories.
4074         * src/remove.c (full_filename_): When FILENAME is just `.'
4075         and there is a nonempty directory-name part, don't append `/.'.
4076         * tests/rm/unread2: Remove trailing /. from diagnostic.
4077         * tests/rm/rm2: Likewise.
4079         * src/remove.c (struct dirstack_state): Define.
4080         To be used in place of these file-scoped globals ...
4081         (dir_stack, len_stack, Active_dir): Remove globals.
4082         (ds_init, ds_free): New functions.
4083         (full_filename): Define.
4084         (full_filename_): Rename from full_filename.
4086         Begin to make AD_* functions more generic.
4087         * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
4088         (AD_push): Likewise.
4089         (AD_INIT_OTHER_MEMBERS): Define.
4090         (remove_dir): Define the `status' member manually after each
4091         call to AD_push or AD_push_initial.
4093         * src/Makefile.am (check-misc): New rule, to ensure that no more
4094         S_IS* macro definitions sneak into the code.
4095         (check): Depend on check-misc.
4097         * src/remove.c [S_ISLNK]: Don't define.  It's already defined in sys2.h.
4098         * src/du.c (count_entry) [S_ISLNK]: Don't define.
4099         * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
4101 2003-01-03  Jim Meyering  <jim@meyering.net>
4103         * src/true.c: Add copyright.
4104         (AUTHORS): I suppose I've written it.
4106         * src/Makefile.am (false.c): Make the generated file be read-only.
4108 2003-01-04  Jim Meyering  <jim@meyering.net>
4110         * src/ls.c: Include "dev-ino.h".
4111         [struct dev_ino]: Remove declaration.
4113 2003-01-02  Jim Meyering  <jim@meyering.net>
4115         * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
4116         from mv: s/missing file arguments/missing file argument/.
4117         With --target-directory=DIR, cp and mv work with a single file argument.
4118         Reported by Karl Berry.
4120         * tests/rm/isatty: Enable this test.
4122 2002-12-31  Jim Meyering  <jim@meyering.net>
4124         * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
4125         (AD_push): Likewise.
4126         (AD_INIT_OTHER_MEMBERS): Define.
4127         (remove_dir): Define the `status' member manually after each
4128         call to AD_push or AD_push_initial.
4130         * src/ls.c [struct dev_ino]: Remove definition.
4131         Include "dev-ino.h" instead.
4133 2002-12-28  Jim Meyering  <jim@meyering.net>
4135         * tests/du/Makefile.am (TESTS): Add no-deref.
4136         * tests/du/no-deref: New script.
4138 2002-12-23  Jim Meyering  <jim@meyering.net>
4140         * src/remove.c (remove_cwd_entries): Fix typo in comment.
4142 2002-12-21  Jim Meyering  <jim@meyering.net>
4144         * announce-gen: Generate MML-formatted announcement.
4145         This makes it a *lot* harder to send stale MD5/SHA1 signatures.
4147 2002-12-20  Jim Meyering  <jim@meyering.net>
4149         * src/touch.c (touch): Change the wording of a diagnostic so
4150         that it makes sense both when the file exists and when it doesn't.
4151         Suggestion from Michael Stone.
4153 2002-12-18  Jim Meyering  <jim@meyering.net>
4155         * src/stty.c (valid_options): Declare to be static.
4157 2002-12-15  Jim Meyering  <jim@meyering.net>
4159         * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
4161         * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
4162         * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
4163         * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
4164         * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
4165         * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
4167         * src/remove.c (PARAMS): Remove definition.
4168         * src/sys2.h: Likewise.
4170         * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
4171         Include strftime.h instead.
4173 2002-12-14  Jim Meyering  <jim@meyering.net>
4175         * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
4177         * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
4178         This is necessary at least for Irix6.5 when using c89.
4179         Reported by Nelson Beebe.
4181         * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
4183         * tests/misc/cat-tty-eof: New test.
4185         * src/mknod.c (usage): Specify how major and minor mode numbers
4186         are interpreted.  Report forwarded by Kristin E Thomas.
4187         * src/mknod.c: Remove now-redundant usage-specifying comment.
4189 2002-12-13  Jim Meyering  <jim@meyering.net>
4191         * Version 4.5.4.
4193         * tests/du/trailing-slash: Allow for a directory of size `0'.
4194         That happens at least on file systems of type tmpfs on linux-2.4.18.
4196         * announce-gen: New script to begin replacing the commands
4197         associated with the rule here...
4198         * Makefile.maint (announcement): Invoke announce-gen.
4199         * Makefile.am (EXTRA_DIST): Add announce-gen.
4201         * tests/cp/preserve-2: New file/test, for latest fix.
4202         * tests/cp/Makefile.am (TESTS): Add preserve-2.
4204 2002-12-11  TAKAI Kousuke  <takai@vlsi.kuee.kyoto-u.ac.jp>
4206         Fix a bug whereby cp would fail to parse an option like
4207         --preserve=mode,ownership.
4208         * src/cp.c (decode_preserve_arg): Advance `comma' to
4209         point the character following the comma.
4211 2002-12-11  Jim Meyering  <jim@meyering.net>
4213         * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
4214         in case it's already defined.
4216 2002-12-09  Jim Meyering  <jim@meyering.net>
4218         * tests/touch/fail-diag: Don't get a test failure if /no exists.
4219         Instead, evoke a framework failure if /no-$$ exists.
4220         Reported by Michael Stone.
4222 2002-12-08  Jim Meyering  <jim@meyering.net>
4224         * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
4225         Define to rpl_lstat, so that even on systems like Solaris 5.8,
4226         du honors (per POSIX) the trailing slash on an argument referring
4227         to a symlink-to-directory.
4229 2002-12-06  Jim Meyering  <jim@meyering.net>
4231         * Use autoconf-2.57.  Regenerate dependent files.
4232         * Use automake-1.7.2.  Regenerate dependent files.
4234         * src/ls.c (gobble_file): Also stat the file if it's a
4235         regular file and --indicator-style=classify (aka -F).
4236         Thanks to Ed Santiago for opening my eyes.
4238         * tests/ls/file-type: New file.  Test for the above.
4239         A test to contrast ls -F and ls --indicator-style=file-type.
4240         * tests/ls/Makefile.am (TESTS): Add file-type.
4242 2002-12-04  Jim Meyering  <jim@meyering.net>
4244         * tests/ls/follow-slink: Make sure the symlink was created.
4245         Richard Dawe reported that `ln -s link link' succeeds, but creates
4246         no file on systems running some version of the DJGPP libc.
4248 2002-12-03  Jim Meyering  <jim@meyering.net>
4250         * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
4251         since this package no longer panders to K&R compilers.
4253 2002-12-02  Jim Meyering  <jim@meyering.net>
4255         * tests/du/slink: Skip this test if `.' is on a non-local file system.
4257         * tests/Fetish.pm (_at_replace): Do the substitution only if there's
4258         something to replace.
4260 2002-12-01  Jim Meyering  <jim@meyering.net>
4262         * src/stat.c: Don't include <string.h> or <ctype.h>.
4263         That's already done via system.h.
4264         * src/dircolors.c: Don't include <ctype.h>.
4266 2002-11-30  Jim Meyering  <jim@meyering.net>
4268         * ls.c (gobble_file): Remove the block of code that caused
4269         `ls --color -F symlink-to-dir' to list the files in
4270         `symlink-to-dir/.'.  Now, it prints `symlink-to-dir@', (just
4271         like `ls -F symlink-to-dir') but with the addition of highlighting.
4272         Similarly, `ls --color -dF symlink-to-dir' would print
4273         `symlink-to-dir/';  now it prints `symlink-to-dir@'.
4274         Reported by Jeff Sheinberg as Debian bug #168203.
4275         * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
4277         ls is now more efficient: with certain options, it no longer needs
4278         to stat each directory entry on systems with valid dirent.d_type.
4279         * src/ls.c (print_dir): Add DT_LNK and DT_REG.
4280         (main): Make --recursive set format_needs_type, not format_needs_stat.
4281         (gobble_file): Remove a FIXME comment, now that it's fixed.
4283 2002-11-24  Jim Meyering  <jim@meyering.net>
4285         * src/du.c (du_files): Don't strip any trailing slash.
4286         Rewrite so that `/' is no longer represented internally as
4287         the empty string.
4288         (count_entry): When appending a file name component,
4289         account for the fact that the current path may end in `/'.
4290         François Pinard reported that `du symlink-to-dir/' was not
4291         equivalent to `du symlink-to-dir/.'.  Now it is.
4292         * tests/du/trailing-slash: New file/test, for the above fix.
4293         * tests/du/Makefile.am (TESTS): Add trailing-slash.
4295 2002-11-23  Jim Meyering  <jim@meyering.net>
4297         * src/tac.c (output): Declare some local variables to be of type size_t,
4298         rather than `int' to avoid warnings from gcc.
4300 2002-11-21  Paul Eggert  <eggert@twinsun.com>
4302         * src/ls.c (decode_switches): Use case-sensitive matching to
4303         decode the QUOTING_STYLE environment variable.  This is more
4304         consistent with the documentation, and with --quoting-style.
4306 2002-11-21  Martin Buck  <martin.buck@ascom.ch
4308         * src/stty.c (struct speeds): Add support for all baud rates defined
4309         in linux-2.4.19.
4311 2002-11-19  Jim Meyering  <jim@meyering.net>
4313         * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
4314         run in a UTF locale.  Report and suggested fix by Bruno Haible.
4315         * tests/fmt/basic: Likewise.
4317 2002-11-17  Jim Meyering  <jim@meyering.net>
4319         * configure.ac: Update via autoupdate.
4320         Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
4322         * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
4323         Reported by Hans Ginzel.
4325 2002-11-15  Jim Meyering  <jim@meyering.net>
4327         * Makefile.cfg (gnu_rel_host): Define.
4328         (url_dir_list): Choose from (alpha|ftp).gnu.org depending
4329         on whether $(VERSION) looks like a major release number.
4331         * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
4332         (release): Rename from `alpha'.
4333         (alpha): Depend on release.
4335         * Makefile.maint (signatures): Define with ?=, so it's easy to override.
4337 2002-11-14  Jim Meyering  <jim@meyering.net>
4339         * Makefile.maint (mail_gpg_sign_cookie): Make optional.
4340         (announcement): Use the new variable.
4342         * Makefile.maint: Sync with Bison, i.e.:
4343         (po-check): Scan .l and .y files instead of the
4344         .c and the .h files that they generate.  This fixes the bug
4345         reported by Tim Van Holder in:
4346         <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
4347         Look for N_ as well as for _.  Try to avoid matching #define for
4348         N_ and _.
4349         From Paul Eggert.
4351 2002-11-12  Jim Meyering  <jim@meyering.net>
4353         * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
4354         Replace sole use with equivalent `#ifdef S_ISLNK'.
4355         Inconsistency reported by Dmitry V. Levin.
4357 2002-11-11  Jim Meyering  <jim@meyering.net>
4359         * src/stat.c (usage): Transform --help items output via s/ - /   /,
4360         so that help2man produces properly formatted man pages.
4361         Reported by Herbert Xu as Debian bug #168400.
4363 2002-11-10  Jim Meyering  <jim@meyering.net>
4365         * src/ls.c (sighandler): Handle SIGTSTP specially.
4366         Based on suggestions from Solar Designer and Dmitry V. Levin.
4367         Add comments.
4369         * Makefile.cfg (cvs_files): Define.  From autoconf.
4370         (local_updates): Likewise.
4372         * src/ls.c (restore_default_color_handler, sigtstp_handler):
4373         Remove functions.
4374         (sighandler): New function, based on the one in sort.c.
4375         (main): Use sigaction, if possible; otherwise signal.
4376         Handle these signals:
4377         SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
4378         Don't register our handler if the signal is already being ignored.
4380         * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
4381         * src/csplit.c (interrupt_handler): Likewise.
4382         * src/sort.c (sighandler): Likewise.
4383         (main): Declare `i' and `nsigs' to be unsigned, not int.
4385 2002-11-09  Jim Meyering  <jim@meyering.net>
4387         ls --color: restore terminal text color upon signal.
4388         * src/ls.c: Include "full-write.h" and <signal.h>.
4389         (restore_default_color, restore_default_color_handler): New functions.
4390         (sigtstp_handler, put_indicator_direct): New functions.
4391         (main) [print_with_color]: Register signal handlers.
4392         Patch mostly by Solar Designer and Stanislav Ievlev.
4394         Update from autoconf.
4395         * Makefile.maint (AMTAR): Remove definition.
4396         (update, cvs-update, po-update, do-po-update): New rules.
4397         (wget-update): Update (thus renaming to cvs-update).
4398         (automake_repo): Use anoncvs@sources.redhat.com.
4400 2002-11-06  Jim Meyering  <jim@meyering.net>
4402         * tests/misc/Makefile.am (TESTS): Add printf-hex.
4404         * tests/misc/printf: Be careful to test the code in this package,
4405         not the shell built-in function.
4407         * src/printf.c (print_esc): A hexadecimal escape sequence has
4408         at most two hex. digits, not three.  Reported by Padraig Brady.
4409         (usage): Update description.
4410         * tests/misc/printf-hex: New file/test, for the above fix.
4412 2002-10-07  Paul Eggert  <eggert@twinsun.com>
4414         Add support for locale-specific size indications (e.g.,
4415         thousands-separators) and for explicit size suffixes on output.
4417         * doc/coreutils.texi (Block size): Say that:
4418         This affects display format as well as block size.
4419         Fractional block counts are rounded up.
4420         ls file size blocksize defaults to 1.
4421         A block size spec preceded by ' generates thousands separators.
4422         A suffix without a preceding integer generates suffixes.
4423         (tail invocation): 32k -> 32 KiB.
4424         (What information is listed): ls -h is now equivalent to
4425         ls --block-size=human, and ls -H is now equivalent to
4426         ls --block-size=si.  Displayed file size is now always affected by
4427         --block-size.
4429         * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
4430         lib/umaxtostr.c: New files, taken from GNU tar.
4432         * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
4433         umaxtostr.c.
4434         (EXTRA_DIST): Add inttostr.c.
4436         * lib/human.c, lib/human.h: Rewrite to support locale-specific
4437         notations like thousands separators.
4438         Specify what includer of include.h must include beforehand.
4439         (human_group_digits, human_suppress_point_zero, human_autoscale,
4440         human_base_1024, human_SI, human_B): New enum values.
4441         (human_readable): Rename from human_readable_inexact; put the
4442         options before the sizes.  All uses changed.  The old human_readable
4443         function has been removed; use inttostr.h instead.
4444         (human_options): Renamed from human_block_size, with new signature
4445         that allows block sizes up to UINTMAX_MAX.  All callers changed.
4447         * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
4448         AC_HEADER_STDBOOL.  No need to check for limits.h since it's in
4449         freestanding C89.  No need to check for stdlib.h or string.h since
4450         autoconf does this now.
4452         * src/cksum.c (cksum): Use primitives from inttostr.h, not
4453         human.h, to print large numbers simply.
4454         * src/csplit.c (handle_line_error, parse_patterns): Likewise.
4455         * src/dd.c (print_stats, main): Likewise.
4456         * src/df.c (print_header): Likewise.
4457         * src/factor.c (print_factors): Likewise.
4458         * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
4459         * src/shred.c (dopass): Likewise.
4460         * src/sort.c (checkfp): Likewise.
4461         * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
4462         * src/tail.c (xlseek): Likewise.
4463         * src/wc.c (write_counts, wc): Likewise.
4465         * src/df.c (human_output_opts): New var.
4466         (output_block_size): Now uintmax_t, not int, to handle larger
4467         block sizes.  All uses changed.
4468         * src/du.c: Likewise.
4469         * src/ls.c: Likewise.
4471         * src/df.c (print_header): In the header line, prefer SI to human
4472         representation if it's shorter; if neither is shorter, try to
4473         intuit what the user would prefer.
4475         * src/expr.c (inttostr): Remove; use new imaxtostr library
4476         function instead.
4478         * src/ls.c (file_output_block_size): New var, to distinguish
4479         file sizes from other sizes.
4480         (decode_switches): Set it.
4482         * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
4483         (dopass): When printing progress, use floor for what has been done
4484         so far (since we should be conservative there), and ceiling for
4485         what needs to be done (since that's what other programs use).
4487 2002-10-19  Jim Meyering  <jim@meyering.net>
4489         * src/pinky.c (print_heading): Align TTY and Name headings.
4490         Reported by Karl Eichwalder.
4492 2002-10-18  Jim Meyering  <jim@meyering.net>
4494         * src/split.c (cwrite): Change type of `bytes' parameter to size_t
4495         Remove now-useless cast.
4496         (stdread): Remove function.
4497         (bytes_split): Use size_t instead of int.
4498         Use safe_read, not stdread.
4499         (lines_split): Likewise.
4500         Use memchr rather than a `while' loop.
4501         (line_bytes_split): Use size_t instead of int.
4502         Use safe_read, not stdread.
4503         (main): Add some FIXME comments to remind me to remove casts.
4505         * src/system.h (ST_BLKSIZE): Correct comment describing how to
4506         reproduce HPUX-11 cat failure.  From Petter Reinholdtsen.
4508 2002-10-17  Jim Meyering  <jim@meyering.net>
4510         Fix a problem that could make e.g., `cat' misbehave on systems which
4511         give invalid (unreasonably large) values for stat.st_blksize.
4512         * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
4513         Reported by Petter Reinholdtsen.
4515 2002-10-14  Jim Meyering  <jim@meyering.net>
4517         Specifying a printf conversion specifer as nl's separator string
4518         could cause nl to segfault.
4519         * src/nl.c (build_print_fmt): Don't include separator string
4520         in the printf format; it might contain `%'.
4521         Use a better bound on the length of the print_fmt buffer.
4522         (print_lineno): Print the separator here instead.
4523         Reported by Doug Coleman.
4525         * tests/misc/nl: New file/tests, including a test for the above.
4526         * tests/misc/Makefile.am (TESTS): Add nl.
4528         * tests/misc/split-l: New test, to make sure `split --lines=N' works.
4529         * tests/misc/Makefile.am (TESTS): Add split-l.
4531 2002-10-13  Jim Meyering  <jim@meyering.net>
4533         * Version 4.5.3.
4535         * src/du.c (usage): Tweak description of --dereference-args/-D.
4537         * src/du.c (count_entry): Also save cwd when dereferencing (via
4538         --dereference-args, -D) a command-line argument.
4539         Reported by Michal Svec.  Based on a patch by Andreas Schwab.
4541         * src/Makefile.am (../AUTHORS): New target/rule.
4543 2002-10-12  Jim Meyering  <jim@meyering.net>
4545         * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
4546         of type size_t, since that's the way it's used and avoids a warning.
4548         * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
4549         since that's how it's always used and avoids a new warning from gcc.
4550         (read_input): Adapt to new safe_read ABI.
4552         * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
4553         to avoid warnings.
4555         * src/pinky.c (print_long_entry): fread returns size_t.
4556         Declare local `bytes' accordingly, to avoid warning.
4558         tail -c +N would perform an extra read after encountering EOF
4559         [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
4560         * src/tail.c (start_bytes): Detect EOF, inform caller.
4561         (tail_bytes): Upon EOF in start_bytes, return immediately.
4562         (file_lines): Reorganize to use memrchr rather than an explicit loop.
4563         Adapt to new safe_read ABI.
4565 2002-10-11  Jim Meyering  <jim@meyering.net>
4567         * tests/du/deref: New file/test, for the above fix.
4568         * tests/du/Makefile.am (TESTS): Add deref.
4570 2002-10-10  Jim Meyering  <jim@meyering.net>
4572         * tests/ln/Makefile.am (TESTS): Add target-1.
4573         * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
4575 2002-10-09  Jim Meyering  <jim@meyering.net>
4577         * tests/cp/backup-is-src: Ensure that certain environment variables
4578         are not set (e.g., SIMPLE_BACKUP_SUFFIX).  Reported by Duncan Roe.
4580         * tests/tail-2/big-4gb: Mark this as an expensive test; it would
4581         consume 4GB of disk space on systems without support for sparse files.
4582         Fix a logic error that'd make it `cat err' even though dd didn't fail.
4584         * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
4585         Patch by steven@magelico.net, forwarded by Michael Stone.
4587         * tests/ls/dired: Ensure that ls produces English messages.
4588         Patch by Alexey Vyskubov, forwarded by Michael Stone.
4590 2002-10-08  Dmitry V. Levin  <ldv@altlinux.org>
4592         * src/ln.c (main): Fix target_directory parsing when n_files == 1.
4594 2002-10-08  Jim Meyering  <jim@meyering.net>
4596         * tests/tail-2/big-4gb: Use double quotes around diagnostic.
4597         Fix syntax in test: use =, not ==.
4598         Reported by Bob Proulx.
4599         Change all the rest like this: grep -lR "testing framework'" .\
4600         |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
4602         * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
4603         * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
4604         * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
4605         * src/wc.c (wc): Likewise.
4607 2002-10-07  Paul Eggert  <eggert@twinsun.com>
4609         * src/cat.c (cat):
4610         Don't advance the write pointer past the end of the write buffer.
4611         * src/sort.c (begfield, limfield): Likewise.
4613 2002-10-07  Jim Meyering  <jim@meyering.net>
4615         * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
4616         * src/head.c (head_bytes, head_lines): Likewise.
4618 2002-10-06  Jim Meyering  <jim@meyering.net>
4620         * src/dd.c (scanargs): Ensure that specified block sizes (specified
4621         via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
4622         (skip, dd_copy): Adapt to new safe_read ABI.
4624         * Makefile.maint (signatures): Define.
4625         (%.sig): New rule.
4626         (announcement): Depend on $(signatures).
4628         * Makefile.maint (announcement): Output all URLs for detached
4629         signatures, not just the last one from the previous loop.
4631 2002-10-05  Jim Meyering  <jim@meyering.net>
4633         * Version 4.5.2.
4635         * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
4636         don't recurse into directory, DIR.  Prompted by a report from
4637         Leonardo Milano.
4639         * tests/rm/i-no-r: New file/test, for the above fix.
4640         * tests/rm/Makefile.am (TESTS): Add i-no-r.
4642         * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
4643         * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
4645 2002-10-03  Jim Meyering  <jim@meyering.net>
4647         * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
4648         * src/df.c (AUTHORS): Likewise.
4649         * src/du.c (AUTHORS): Likewise.
4650         * src/tail.c (AUTHORS): Likewise.
4651         * src/touch.c (AUTHORS): Likewise.
4653 2002-10-02  Jim Meyering  <jim@meyering.net>
4655         * Makefile.am (SUBDIRS): Remove `old'.
4656         (EXTRA_DIST): List the files in old/.
4657         * configure.ac (AC_CONFIG_FILES): Remove old/* names.
4658         Suggestion from Akim Demaille.
4660 2002-10-01  Jim Meyering  <jim@meyering.net>
4662         * src/sys2.h (SSIZE_MAX): Define.
4664 2002-09-30  Jim Meyering  <jim@meyering.net>
4666         * src/csplit.c: Don't include stdlib.h here.  It's already included
4667         via system.h.
4669 2002-09-29  Jim Meyering  <jim@meyering.net>
4671         * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
4672         expression to avoid bogus warning from gcc.
4674         * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
4675         (cat): Declare insize and outsize to be of type size_t, not int.
4676         Rearrange pointer/integer expressions to avoid bogus warnings.
4677         (main): Declare insize and outsize to be of type size_t, not int.
4679         * src/tail.c (parse_options): Give a sensible diagnostic for
4680         an invalid byte or line count.  Reported by Mikko Tuumanen.
4682         * src/touch.c (main): Split a long line.
4684         * tests/du/Makefile.am (TESTS): Add slink.
4685         * tests/du/slink: New test for system.h change of 2002-08-31.
4687         In move mode, always first try to rename.  Before, upon failure to
4688         rename a directory, this code would never attempt to rename any
4689         other file in that directory, but would thenceforth always copy.
4690         On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
4691         may fail with EXDEV, yet renaming files within that directory to
4692         a newly-created destination directory succeeds.
4693         * src/copy.c (copy_internal): Remove local, move_mode;
4694         use x->move_mode instead.  Based on a patch from Tom Haynes.
4696 2002-09-28  Jim Meyering  <jim@meyering.net>
4698         * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
4699         Factor out some duplication.
4700         (main): Use it.
4701         [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
4703         * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
4704         compiler warnings.
4705         (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
4706         to avoid compiler warnings.
4708         * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
4709         compiler warnings.
4711         Fix things so `mkdir -p' can create very deep directories, e.g.,
4712         mkdir -p $(perl -e 'print "a/" x 40000') now works.
4713         * src/mkdir.c (main): For --parents (-p), call make_path with the
4714         entire directory name, so we don't ever require that file operations
4715         like stat or chmod be performed on the entire command line argument.
4716         * makepath.c (make_path): Restore umask *before* creating the final
4717         component.
4719 2002-09-27  Andreas Schwab  <schwab@suse.de>
4721         * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
4722         to avoid overflow.  Reported by Hans Lermen.
4724 2002-09-26  Jim Meyering  <jim@meyering.net>
4726         * src/install.c (get_ids): Use strtoul, not strtol.  Remove some casts.
4728 2002-09-25  Jim Meyering  <jim@meyering.net>
4730         * src/test.c (eaccess): Change type of local `euid' from int to uid_t
4731         and add a cast, to avoid a warning about `signed and unsigned type in
4732         conditional expression'.
4734 2002-09-22  Jim Meyering  <jim@meyering.net>
4736         * src/rmdir.c: Include "dirname.h", for declaration of
4737         strip_trailing_slashes.
4739         * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
4740         Now they're defined through system.h.
4742         * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
4743         * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
4744         since it's already included from sys2.h via system.h.
4746         * Use automake-1.6f.  Regenerate dependent files.
4748         * src/Makefile.am (PERL): Remove duplicate definition.
4750         fmt's -s, -t, -c options didn't work properly for long lines.
4751         Since get_line may end up calling put_paragraph (for long lines),
4752         be sure to set global, `other_indent', before it is used there.
4754         * src/fmt.c (set_other_indent): New function, factored out of...
4755         (get_paragraph): ... here.  Call it.
4756         (get_line): Call set_other_indent before calling flush_paragraph,
4757         which calls fmt_paragraph, which in turn calls put_paragraph,
4758         which uses other_indent.
4760         * tests/fmt/Makefile.am (TESTS): Add long-line.
4761         * tests/fmt/long-line: New file/test, for the above fix.
4763 2002-09-21  Jim Meyering  <jim@meyering.net>
4765         * src/od.c: No longer include deprecated <values.h>.
4766         It was required solely for now-removed reference to BITSPERBYTE.
4767         * src/install.c: Likewise.
4768         Suggestion from Bruno Haible.
4770 2002-09-06  Andreas Schwab  <schwab@suse.de>
4772         `rmdir -p dir-specified-with-trailing-slash/' would fail.
4773         * src/rmdir.c (remove_parents): Strip trailing slashes.
4775 2002-09-20  Jim Meyering  <jim@meyering.net>
4777         * tests/rmdir/t-slash: New file/test, for the above fix.
4778         * tests/rmdir/Makefile.am (TESTS): Add t-slash.
4780         * Makefile.maint (announcement): Arrange to gpg-sign the message.
4781         Add a URL for each detached signature file.
4783 2002-09-07  Bruno Haible  <bruno@clisp.org>
4785         * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
4787 2002-09-18  Jim Meyering  <jim@meyering.net>
4789         `od -t x8' used the wrong (`l'-prefixed) printf format.
4790         Likewise for the o8 and u8 formats.
4791         * src/od.c (ISPEC_TO_FORMAT): Define macro.
4792         (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
4793         Reported by Arun Sharma.
4795 2002-09-17  Jim Meyering  <jim@meyering.net>
4797         * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
4798         From gettext's intl/loadmsgcat.c.
4800         * tests/od/x8: New file/test, for the above fix.
4801         * tests/od/Makefile.am (TESTS): Add x8.
4803 2002-09-15  Jim Meyering  <jim@meyering.net>
4805         * Use autoconf-2.54.  Regenerate dependent files.
4807         * src/csplit.c (get_format_width): Add cast to avoid
4808         warning about `signed and unsigned type in conditional expression'.
4810 2002-09-14  Jim Meyering  <jim@meyering.net>
4812         * src/who.c (print_user): Change type of local to size_t
4813         to avoid warnings about `comparison between signed and unsigned'.
4814         * src/ptx.c (generate_all_output): Likewise.
4816         * src/dd.c (main, skip): Add casts to avoid warnings about
4817         `comparison between signed and unsigned'.
4819         * src/id.c (print_full_info, print_group_list): Add casts to avoid
4820         warnings about `signed and unsigned type in conditional expression'.
4822         * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
4823         to avoid warnings about `comparison between signed and unsigned'.
4824         (split_3): Change parameter names to be readable and add comment.
4825         Clean up the test for whether a line may be ignored.
4827 2002-09-13  Jim Meyering  <jim@meyering.net>
4829         * src/printf.c (main): Handle leading command line argument of `--'.
4830         Reported by Raul: DervishD <raul@pleyades.net>
4831         * tests/misc/printf: New file: test for the above.
4832         * tests/misc/Makefile.am (TESTS): Add printf.
4834         * src/date.c (usage): Explain that %S's range of [0..60] is required --
4835         rather than 0..59 -- to accommodate the occasional positive leap second.
4836         Reported by Richard Neill.
4838 2002-09-12  Jim Meyering  <jim@meyering.net>
4840         * src/Makefile.am (nanosec_libs): Define.
4841         (sleep_LDADD, tail_LDADD): Use it here.
4843         Factor nanosleep-related code into ../lib/xnanosleep.c.
4844         * src/sleep.c: Include xnanosleep.h.
4845         Factor out fenv.h-related code.
4846         (timespec_subtract): Remove function.
4847         (main): Remove code that deals with computing start and stop times
4848         as well as the loop around nanosleep.  Now that's in xnanosleep.c.
4850         Allow S (in --sleep-interval=S) to be a floating point value.
4851         * src/tail.c: Include xnanosleep.h and xstrtod.h.
4852         Move declaration of global variable, sleep_interval, to ...
4853         (main): ...here.
4854         (usage): Update description of --sleep-interval option.
4855         (tail_forever): New parameter, sleep_interval.  Update caller.
4856         Use xnanosleep, rather than sleep.
4857         (parse_options): New parameter, sleep_interval.  Update caller.
4858         Use xstrtod, now that we accept floating point values.
4859         Prompted by a patch from Augey Mikus.
4861 2002-09-06  Jim Meyering  <jim@meyering.net>
4863         * src/remove.c (prompt): Change comment to give a better note to
4864         translators.  From Michael Piefel.
4866 2002-09-02  Jim Meyering  <jim@meyering.net>
4868         * README: A good problem report/patch includes diffs against
4869         the most recent test release.
4871         * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
4872         (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
4874         * src/kill.c (print_table_row): Use an unsigned type for widths
4875         to avoid warning about comparison between signed and unsigned.
4876         (list_signals): Likewise.
4878         * src/od.c (skip): Add a cast to avoid warning about comparison
4879         between signed and unsigned.
4880         * src/install.c (get_ids): Likewise.  Also rearrange range-checking
4881         comparisons to make them more readable.
4883 2002-09-01  Jim Meyering  <jim@meyering.net>
4885         * Version 4.5.1.
4887 2002-08-31  Jim Meyering  <jim@meyering.net>
4889         Symlinks were always reported as using 0 blocks.
4890         * src/system.h (ST_NBLOCKS): Don't depend on file type.
4891         This reverts the change of 2000-01-30.
4892         Based on a report and patch from Neil Brown via Michael Stone.
4893         This fixes Debian Bug#156358.
4895         * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
4896         `exit (1)' to `exit (EXIT_FAILURE)', and
4897         `usage (1)' to `usage (EXIT_FAILURE)'.
4899         * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
4900         * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
4901         * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
4902         * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
4903         * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
4904         But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
4905         error never exits successfully.
4907 2002-08-29  Jim Meyering  <jim@meyering.net>
4909         * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
4910         when ignoring any return value.
4912         * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
4913         failures.  On some systems (at least EMC Celerra and Solaris5.8),
4914         this appears to be necessary.
4915         (is_empty_dir): Likewise.  Also, always close directory handle.
4916         * src/ls.c (print_dir): Likewise.
4917         (print_dir): Rename local variable: reading -> dirp.
4918         Reported by Mike Coleman.
4920 2002-08-28  Jim Meyering  <jim@meyering.net>
4922         * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
4923         Give a diagnostic and fail if closedir fails.
4925 2002-08-26  Jim Meyering  <jim@meyering.net>
4927         * Makefile.am (THANKS-to-translators): New rule.
4928         (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
4929         * THANKStt.in: New file.
4931         * src/cat.c (close_stdout_wrapper): New, kludgey, function and
4932         file-scoped global.
4933         (main): Register it with atexit.
4934         Close STDOUT_FILENO, to avoid a problem when writing to
4935         /dev/audio on at least Solaris 5.7 and 5.8 systems.
4936         Reported by Shing-Shong Shei.
4938 2002-08-25  Jim Meyering  <jim@meyering.net>
4940         * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
4941         * src/tac.c (main): Likewise.
4942         * src/tail.c (main): Likewise.
4943         * src/tee.c (main): Likewise.
4944         * src/tr.c (main): Likewise.
4945         * src/wc.c (main): Likewise.
4947 2002-08-20  Jim Meyering  <jim@meyering.net>
4949         * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
4951 2002-08-10  Paul Eggert  <eggert@twinsun.com>
4953         * src/nohup.sh: Don't use "exec --"; it's not portable and
4954         shouldn't be needed.
4956 2002-08-09  Jim Meyering  <jim@meyering.net>
4958         * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
4959         (usage): Clarify help text for the -COLUMN option.
4960         Patch by Padraig Brady.
4961         * tests/pr/Test.pm [col-last]: New test for the above.
4963         * configure.ac: Start with version 4.5.1, chosen so that it's larger
4964         than the latest version numbers of the component packages.
4966         * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
4967         programs in ../src.
4969 2002-08-08  Jim Meyering  <jim@meyering.net>
4971         * src/date.c: Guard inclusion of <langinfo.h> with
4972         `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
4973         * src/sort.c: Likewise.
4974         Patch by GOTO Masanori.
4976 2002-08-05  Paul Eggert  <eggert@twinsun.com>
4978         Fix some minor time-related bugs with POSIX time arguments.
4979         Some valid time stamps were being rejected (notably -1, and
4980         time stamps before 1900 on 64-bit hosts).  And some invalid
4981         time stamps were being accepted, e.g. September 31.
4983         * src/date.c (main): Adjust to posixtime signature change.
4984         * src/touch.c (main): Likewise.  Remove unnecessary initialization.
4985         Use localtime, not posixtm, to warn about obsolete "touch".
4987 2002-08-05  Jim Meyering  <jim@meyering.net>
4989         * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
4991 2002-08-04  Jim Meyering  <jim@meyering.net>
4993         * src/Makefile.am (check-README): New target/rule.
4994         (check): Depend on it.
4996         * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
4998 2002-08-03  Jim Meyering  <jim@meyering.net>
5000         * Makefile.am (SUBDIRS): Add old.
5001         * old/: New directory, containing legacy ChangeLog* and NEWS files
5002         from the fileutils, sh-utils, and textutils packages.
5004         * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
5006 2002-08-02  Paul Eggert  <eggert@twinsun.com>
5008         * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
5010         * src/uniq.c: Include hard-locale.h, xmemcoll.h.
5011         (hard_LC_COLLATE): New var.
5012         (different): Args are now char *, not const char *.
5013         Use xmemcoll instead of memcmp to compare lines, so that
5014         LC_COLLATE has effect.  However, use memcmp if it is an
5015         easy locale.
5016         (check_file): Do not include newline in comparison, so that
5017         xmemcoll has a byte to stomp on temporarily.
5018         (main): Set hard_LC_COLLATE.
5020 2002-07-29  Jim Meyering  <jim@meyering.net>
5022         * Makefile.am (SUBDIRS): Remove djgpp, for now.
5024 2002-07-20  Jim Meyering  <jim@meyering.net>
5026         * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
5027         into EXIT_FAILURE.  Otherwise, false --help and false --version
5028         would fail.
5030 2002-07-08  Jim Meyering  <jim@meyering.net>
5032         * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
5033         rather than the hard-coded `sh-utils'.
5035 2002-07-01  Jim Meyering  <jim@meyering.net>
5037         * configure.ac: Merge the three files from fileutils,
5038         textutils, and sh-utils.
5039         * Makefile.am: Likewise.
5040         * src/Makefile.am: Likewise.