bc45537c72560a0a0f691a1505b815a2edb97052
[platform/upstream/coreutils.git] / ChangeLog
1 2008-01-17  Jim Meyering  <meyering@redhat.com>
2
3         Do not define-away __attribute__ when __STRICT_ANSI__ is set.
4         * src/system.h (__attribute__): Remove the __STRICT_ANSI__ disjunct.
5         It has been unnecessary since approximately gcc-2.6, and now, leaving
6         it would cause gcc -Werror -ansi to fail to compile csplit.c.
7         * gl/lib/randread.c (__attribute__): Likewise.
8
9 2008-01-16  Jim Meyering  <meyering@redhat.com>
10
11         * NEWS: Mention the configure.ac fix.
12
13         * TODO: Add an introduction.
14         Remove a few entries.  Update a few others.
15
16 2008-01-13  Jim Meyering  <meyering@redhat.com>
17
18         Remove each output redirection target before writing to it.
19         * tests/check.mk (vc_exe_in_TESTS): Remove t1 and t2 _first_,
20         in case they exist beforehand and are not writable.
21         * build-aux/check.mk (am__check_pre): Likewise, remove $@-t.
22
23 2008-01-13  Elias Pipping  <pipping@gentoo.org>
24
25         * configure.ac: Correct a non-portable use of sed.
26
27 2008-01-12  Mike Frysinger  <vapier@gentoo.org>
28
29         * src/dircolors.hin (image formats): Add the .svg suffix.
30
31 2008-01-12  Jim Meyering  <meyering@redhat.com>
32
33         Use new version of announce-gen.
34         * Makefile.maint (announcement): Remove use of the
35         --gnulib-snapshot-time-stamp option.
36         Use new --gnulib-version option instead.
37         (gnulib-version): New variable.
38
39 2008-01-11  Jim Meyering  <meyering@redhat.com>
40
41         * Version 6.9.92.
42
43         * tests/tr/Test.pm: Prefer en_US.ISO-8859-1 to en_US.iso88591.
44         Suggestions from James Youngman and Pádraig Brady in
45         http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12218/focus=12227
46
47 2008-01-10  Jim Meyering  <meyering@redhat.com>
48
49         * README-hacking: Add Git to the list of required tools.
50
51 2008-01-08  Paul Eggert  <eggert@cs.ucla.edu>
52
53         Fix a minor race condition when using cp -p --parents.
54         * src/cp.c (make_dir_parents_private): If stat fails on the parent
55         directory, do not add it to the list of directories whose modes
56         might need fixing later.  Also, do not bother invoking 'stat'
57         unless the stat results might be needed later.
58
59 2008-01-08  Jim Meyering  <meyering@redhat.com>
60
61         parent-perm: avoid a bizarre test failure.
62         * tests/cp/parent-perm: Accommodate the situation in which
63         chmod ("dir", 02755) returns 0 yet fails to set the S_ISGID bit.
64
65         Remove uses of now-undefined Makefile variable.
66         * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Remove uses
67         of no-longer-defined variable, $(LIB_ACL_TRIVIAL).
68
69 2008-01-07  Jim Meyering  <meyering@redhat.com>
70
71         cp (but not copy.c): plug a small leak.
72         * src/cp.c (do_copy) [--parents]: Free the attribute list.
73
74         Make a racy test failure less likely to happen.
75         * tests/misc/tty-eof: Uncomment a debug "warn".
76         This change happens to make this test far less likely to fail.
77         With that statement commented out, this test would fail about
78         20% of the time on my desktop.  Now, it's gone 100 iterations
79         in a row with no failure.
80
81         * NEWS: Mention the cp bug fix.
82
83 2008-01-07  Jan Blunck  <jblunck@suse.de>
84
85         cp --parents: don't use uninitialized memory when restoring permissions
86         * src/cp.c (make_dir_parents_private): Always stat each source
87         directory, in case its permissions are required in re_protect,
88         when setting permissions of a just-created destination directory.
89
90 2008-01-07  Jim Meyering  <meyering@redhat.com>
91
92         cp: add a test for today's bug fix.
93         * tests/cp/parent-perm: New script.  Test today's change.
94         Based on reproducer from Jan Blunck.
95         * tests/cp/Makefile.am (TESTS): Add parent-perm.
96
97 2008-01-06  Jim Meyering  <meyering@redhat.com>
98
99         touch: add a test for today's change.
100         * tests/touch/now-owned-by-other: New script.  Test today's change.
101         * tests/touch/Makefile.am (TESTS): Add now-owned-by-other.
102         * tests/Makefile.am (all_t): Add td, a new root-only test.
103         (td): New target.
104         * NEWS: Mention the improvement.
105
106 2008-01-06  Paul Eggert  <eggert@cs.ucla.edu>
107
108         touch: ignore "-d now" option, when appropriate
109         * src/touch.c (main): Treat "-d now" as if it were absent, if
110         neither -a nor -m is specified.  Problem reported by Dan Jacobson in:
111         http://lists.gnu.org/archive/html/bug-coreutils/2008-01/msg00010.html
112
113 2008-01-05  Jim Meyering  <meyering@redhat.com>
114
115         Avoid tr case-conversion failure in some locales.
116         * src/tr.c (skip_construct): New function.
117         (main): When processing a pair of case-converting classes, don't
118         iterate through the elements of each [:upper:] or [:lower:] class.
119         Reported by Gerald Pfeifer in
120         <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/12218>.
121         * tests/tr/Test.pm [tolower-F]: New test for the above fix.
122         [upcase-xtra, dncase-xtra]: New tests, for a related code path.
123         * NEWS: Mention the tr bug fix.
124
125 2008-01-02  Jim Meyering  <jim@meyering.net>
126
127         * .gitignore: Ignore lzma-compressed files, too.
128
129         Update copyright date.
130         * tests/sample-test: Likewise.
131         * doc/coreutils.texi: Likewise.
132
133 2007-12-31  Jim Meyering  <jim@meyering.net>
134
135         * doc/coreutils.texi (Block size): Put braces around multi-digit
136         exponents.  Reported by Darrel Francis.
137
138         Add a syntax check, so this doesn't recur.  Reorganize existing checks.
139         * doc/Makefile.am (sc-exponent-grouping):
140         (syntax_checks): New variable.
141         (sc-avoid-io, sc-avoid-non-zero, sc-avoid-timezone):
142         (sc-avoid-zeroes, sc-use-small-caps-NUL): New rules, extracted
143         from check-texinfo.
144         (check-texinfo): Depend on $(syntax_checks).
145
146 2007-12-30  Mike Frysinger <vapier@gentoo.org>
147
148         * src/dircolors.hin (TERM): Add gnome-256color.
149
150 2007-12-21  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
151
152         * doc/coreutils.texi: Fix a typo.  Avoid the term `relationals'.
153
154 2007-12-20  Jim Meyering  <meyering@redhat.com>
155
156         Use comma-separated list in ./configure --help output.
157         * configure.ac: Map commas to spaces in excluded-program list.
158         Use a comma-separated list, not a space-separated one.
159         * m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG):
160         Expect list of program names to be comma-separated.
161         Reported by Jan Bauke Douma.
162
163         Avoid another "make check" failure due to omitted programs.
164         * tests/test-lib.sh (require_built_): New function.
165         * tests/misc/groups-version: Use it to skip this test if
166         either groups or id is not built.
167
168         Avoid spurious "make check" failures due to omitted programs.
169         * man/Makefile.am (distcheck-hook): Make check rules dependents of
170         this target, not of check-local, so that people aren't distracted by
171         failures due to programs omitted via --enable-no-install-program=...
172
173 2007-12-19  Paul Eggert  <eggert@cs.ucla.edu>
174
175         * src/uniq.c (usage): Improve wording in --help "Note".
176
177 2007-12-18  Jim Meyering  <meyering@redhat.com>
178
179         * src/uniq.c (usage): Note that sorting uniq's input is often useful.
180         Suggested by Eric Blake.
181         (usage): Say "key-selection", not "field-selection".
182         Quote example commands consistently.
183
184 2007-12-15  Jim Meyering  <meyering@redhat.com>
185
186         Version 6.9.91.
187
188         * Makefile.cfg (gpg_key_ID): Use new, longer signing subkey.
189
190 2007-12-12  Jim Meyering  <meyering@redhat.com>
191
192         * tests/mv/part-symlink: Redirect diff output to stderr.
193
194 2007-12-11  Jim Meyering  <meyering@redhat.com>
195
196         Add a test to exercise today's bug fix.
197         * tests/misc/selinux: Test for today's bug fix.
198         * NEWS: Mention the SELinux "ls -l" fix.
199
200 2007-12-11  Paul Eggert  <eggert@cs.ucla.edu>
201
202         "ls -l" wouldn't output "+" on SELinux hosts unless -Z was also given.
203         * src/ls.c (gobble_file): Also get the file context if -l is specified.
204         Treat getfilecon failures like file_has_acl failures.
205         (UNKNOWN_SECURITY_CONTEXT): New constant.
206         (clear_files): Don't free it.
207         (gobble_file): Set unknown security contexts to it; that way, we
208         don't have to have special cases for unknown contexts.
209         (print_long_format, print_file_name_and_frills): Don't worry
210         about scontext being null, since it's always some string now.
211
212 2007-12-11  Jim Meyering  <meyering@redhat.com>
213
214         * NEWS: Add the "Bug fixes" heading.
215
216 2007-12-09  Jim Meyering  <meyering@redhat.com>
217
218         "rm" as root would fail to unlink a non-directory on OS X 10.4.x
219         * src/remove.c (remove_entry) ["can unlink directories"]: Fix a
220         mistakenly reversed condition.
221         * NEWS: Mention this bug fix.
222         Reported by Pieter Bowman.
223
224 2007-12-08  Jim Meyering  <meyering@redhat.com>
225
226         * src/c99-to-c89.diff: Adjust shred.c offsets.
227
228 2007-12-04  Jim Meyering  <meyering@rho.meyering.net>
229
230         Reflect change in gnulib: don't include getpagesize.h,
231         now that it's provided by unistd.h.
232         * src/cat.c: Don't include getpagesize.h.
233         * src/copy.c: Likewise.
234         * src/dd.c: Likewise.
235         * src/shred.c: Likewise.
236         * src/split.c: Likewise.
237
238 2007-12-02  Jim Meyering  <meyering@redhat.com>
239
240         Copy a .po file into place also when the target doesn't exist.
241         * bootstrap (gnulib_tool): ... not just when the checksum differs.
242         So now, if I manually remove po/xx.po, rerunning bootstrap will
243         copy the latest into place.
244
245         Make my-distcheck depend on "check".
246         * Makefile.maint (my-distcheck): Also depend on "check", so I can't tag
247         and release something that fails "make check" (however harmless) when
248         run in a checked-out-from-git dir, but not in the distributed tarball.
249
250         * NEWS: Add the usual "Noteworthy changes in release 6.9.91..." line.
251
252         Remove just-installed su, if unable to make it set-UID root.
253         Normally, su isn't even installed.  However, if you configure with
254         --enable-install-program=su, and then install with insufficient
255         privileges, we now make sure to remove the just-installed binary.
256         * src/Makefile.am (install-exec-hook): Rename from install-exec-local,
257         so that this rule is guaranteed to be run *after* installation.
258         If unable to chown and chmod the installed "su" program, remove it.
259         Reported by Greg Schaefer.
260
261 2007-12-01  Bob Proulx  <bob@proulx.com>
262
263         Make existing-perm-race executable.
264         * tests/cp/existing-perm-race: Update file mode.
265
266 2007-12-01  Jim Meyering  <meyering@redhat.com>
267
268         Version 6.9.90.
269
270         * NEWS: Remove the now-untrue statement about cp vs. dangling symlinks
271
272         Change release procedure: tag *before* running e.g., "make stable".
273         * Makefile.maint (vc-dist): Don't tag.  Now, you must apply the tag
274         before running "make beta", "make stable", etc.
275         (vc-tag-check): Remove rule.  No longer makes sense.
276
277         * Makefile.maint (vc-tag-check): Correct check for existing git tag.
278
279         Defer NEWS and ChangeLog checks until after the version-changing tag.
280         * Makefile.maint (alpha beta major): Don't depend on the
281         news-date-check changelog-check targets.  They must fail before
282         applying the version-changing tag.  Instead, run them after "vc-dist".
283
284         * NEWS: Record release date and new version number.
285         Mention some of the SELinux changes.
286         * src/stat.c (main): Adjust a comment.
287
288         * TODO: Add some entries (documentation needed),
289         and remove the one for mktemp.
290
291         Add "extern" keyword to declaration of cp_options_default.
292         * src/copy.c (cp_options_default): Mark as "extern", so the
293         "sc_tight_scope" part of "make distcheck" passes.
294
295 2007-12-01  Jim Meyering  <meyering@redhat.com>
296
297         Change comments: say bug present up to coreutils-6.9, not fixed in 6.10.
298         * tests/cut/Test.pm: Adjust comment.
299         * tests/misc/cut: Likewise.
300         * tests/misc/ls-misc: Likewise.
301         * tests/misc/od: Likewise.
302         * tests/misc/stty-invalid: Likewise.
303         * tests/tr/Test.pm: Likewise.
304
305 2007-11-29  Paul Eggert  <eggert@cs.ucla.edu>
306
307         Add a test for cp -p and existing file permissions.
308         * tests/cp/Makefile.am (TESTS): Add existing-perm-race.
309         * tests/cp/existing-perm-race: New test.  It isn't much of a
310         test yet, since it's hard to catch the race, but it has a FIXME
311         that will let us do a better test later.
312
313 2007-11-28  Paul Eggert  <eggert@cs.ucla.edu>
314
315         Fix a security race with "cp -p A B" when B already exists.
316         * src/copy.h (struct cp_options): New member owner_privileges.
317         * src/copy.c (USE_ACL): Define to 0 if not defined, for convenience.
318         (owner_failure_ok): New function.
319         (set_owner): Avoid a security-related race by doing an extra chmod
320         first if it looks like there might be trouble right after a chown.
321         Accept a source struct stat rather than a uid and gid, and
322         accept a boolean NEW_DST and destination struct stat.
323         All callers changed.
324         * src/copy.h (cp_options_default): New function, replacing the
325         old chown_privileges.
326         * src/copy.c (cp_options_default): Likewise.
327         * src/cp.c (cp_option_init): Use it.
328         * src/install.c (cp_option_init): Likewise.
329         * src/mv.c (cp_option_init): Likewise.
330
331 2007-11-30  Jim Meyering  <meyering@redhat.com>
332
333         Avoid a spurious test failure when build directory is set-GID.
334         * tests/cp/fail-perm: Ensure that '.'s set-GID bit is off.
335
336         Be extra careful to quote $abs_top_builddir-derived names.
337         * tests/misc/ls-misc (shell_quote): New function.
338         Use it to quote file names derived from $abs_top_builddir,
339         in case it contains shell meta-characters.  This is not currently
340         needed, since CuTmpdir detects the fishy name and skips the test.
341         But it's important enough to add the extra protection.
342         Reported by Ralf Wildenhues.
343
344         Include test name in the "unsafe working directory name" diagnostic.
345         * tests/CuTmpdir.pm (import): If $ME is '-', use $prefix.
346
347 2007-11-30  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
348
349         Add quotes to protect against white space in build dir name.
350         * tests/check.mk (TESTS_ENVIRONMENT): Quote $(abs_srcdir).
351         * tests/chmod/setgid: Quote absolute names.
352         * tests/misc/help-version: Likewise.
353         * tests/misc/pwd-unreadable-parent: Likewise.
354         * tests/rmdir/ignore: Likewise.
355         * tests/test-lib.sh: Likewise.
356
357         Define `tst', for CU_TEST_NAME.
358         * build-aux/check.mk (am__check_pre): Set `tst', for
359         CU_TEST_NAME in tests/check.mk.
360
361         * tests/CuTmpdir.pm (END): Do not do the cleanup if $dir is not
362         defined, because it then goes wild and changes the mode of all
363         directories below $HOME.  Undefined $dir can happen if the test
364         is to be skipped because of an unsafe working directory name.
365
366 2007-11-28  Paul Eggert  <eggert@cs.ucla.edu>
367
368         Close a file descriptor leak when cp --preserve=context fails.
369         * src/copy.c (copy_reg): Close dest_desc too, if getfscreatecon
370         or fsetfilecon fail.
371
372 2007-11-28  Jim Meyering  <meyering@redhat.com>
373
374         * README: Document the known problem with gettext <= 0.17.
375
376 2007-11-28  Paul Eggert  <eggert@cs.ucla.edu>
377
378         * gl/modules/randread (Depends-on): Remove nonexistent rand-isaac.
379
380 2007-11-27  Jim Meyering  <meyering@redhat.com>
381
382         Don't block use of 'cat' or 'wc' in "make check".
383         * Makefile.maint (my-distcheck): Add "cat" and "wc" to the list
384         of programs that we can't blacklist.
385
386         Fix md5sum+sha*sum on sparc: regenerate files with latest autoconf.
387         * configure et al: Regenerate with very latest version of autoconf
388         (v2.61a-312-gb524b0f), to fix md5sum and sha*sum miscompilation
389         on big-endian systems (like sparc) due to lack of the required
390         definition in of WORDS_BIGENDIAN in lib/config.h.
391
392 2007-11-26  Jim Meyering  <meyering@redhat.com>
393
394         setuidgid.c: more cleanup
395         * src/setuidgid.c: Include "mgetgroups.h".
396         (main): Don't presume there's a fixed limit on the maximum number
397         of group IDs.  Don't use NGROUPS; it's artificially low.
398         Change the name of a local: s/gids_count/n_gids/.
399         Remove non-portable "const": s/const int tmp =.../int tmp =.../
400
401 2007-11-25  Jim Meyering  <meyering@redhat.com>
402
403         Document install's -D option.
404         * doc/coreutils.texi (install invocation): Document -D.
405         Reported by Akim Demialle.
406
407         setuidgid: Update --help output.
408         * src/setuidgid.c (usage): Describe -g GID[,GID1...] option.
409         Mention that USER may be a numeric ID or a user name.
410
411 2007-11-24  Jim Meyering  <meyering@redhat.com>
412
413         Tweak new test.
414         * tests/cp/preserve-gid: Split some long lines.
415         Prepend "+" to numeric uid and gid chown arguments, on principle.
416         Use skip_test_.
417
418         setuidgid: minor clean-up.
419         * setuidgid.c: Include "xstrtoul.h".
420         (main): Detect overflow in string-to-gid_t and -to-uid_t conversions.
421         Improve diagnostics.
422
423         * src/setuidgid.c: Normalize leading white space: no more TABs.
424
425         Test the new feature: cp -p preserves the GID whenever possible.
426         * tests/cp/preserve-gid: New file.  Test for today's change.
427         * tests/cp/Makefile.am (TESTS): Add preserve-gid.
428         * tests/Makefile.am (all_t): Add tc.
429         (tc): New target.
430
431         setuidgid: accept numeric UID, and new option -g GID,GID1,GID2,...
432         * src/setuidgid.c: Add functionality for the new test above.
433
434         "cp -p" tries to preserve GID even if preserving the UID fails.
435         * NEWS: Mention this new feature.
436         * src/copy.c (set_owner): Try to preserve just the GID,
437         when initial fchown/lchown fails.
438         * src/cp.c (re_protect): Likewise.
439
440 2007-11-23  Jim Meyering  <meyering@redhat.com>
441
442         * src/runcon.c (main): Remove unused parameter, "envp".
443
444         Add tests to show new class of strings accepted by date -d.
445         * tests/misc/date (rel-1day, rel-plus1): New tests for the recent
446         change in gnulib's getdate.y.
447         * NEWS: Mention the fix.
448
449 2007-11-22  Jim Meyering  <meyering@redhat.com>
450
451         Quiet warnings about unused parameters.
452         * src/copy.c (set_author) [!HAVE_STRUCT_STAT_ST_AUTHOR]:
453         "Use" each of the parameters.
454
455         * GNUmakefile: Correct the "rerunning..." diagnostic.
456
457         Make it easier to diagnose PATH-induced "make distcheck" failures.
458         * Makefile.maint (write_loser): Define.
459         (my-distcheck): Use an always-failing wrapper script, that gives
460         a diagnostic, not "false".
461         Run only "make -C tests check" with the restrictive PATH.
462         Run the new gnulib-tests/ with the usual PATH.
463
464         cp: by default, refuse to copy through a dangling destination symlink
465         * NEWS: Mention this change.
466         * doc/coreutils.texi (cp invocation): Describe the new behavior.
467         * src/copy.c: No longer include "canonicalize.h".
468         (copy_reg): Upon failure to open a dangling destination symlink,
469         don't canonicalize the name, but rather fail (default) or, with
470         POSIXLY_CORRECT, repeat the open call without O_EXCL (potentially
471         dangerous).
472         * src/copy.h (struct cp_options) [open_dangling_dest_symlink]:
473         New member.  Reorder the others, grouping "bool" and "enum"
474         members together.
475         * tests/cp/thru-dangling: Test for changed and new behavior.
476         * src/cp.c (cp_option_init): Initialize new member.
477         * src/install.c (cp_option_init): Likewise.
478         * src/mv.c (cp_option_init): Likewise.
479
480 2007-11-21  Pádraig Brady <P@draigBrady.com>
481
482         * doc/coreutils.texi (split invocation): Improve the
483         descriptions of the split command options.
484
485 2007-11-21  Jim Meyering  <meyering@redhat.com>
486
487         * src/c99-to-c89.diff: Adjust seq.c offsets.
488
489 2007-11-18  Paul Eggert  <eggert@cs.ucla.edu>
490
491         * src/seq.c (print_numbers): Rewrite in an attempt to avoid the
492         more-general rounding issues exposed by the previous patch.
493
494 2007-11-18  Jim Meyering  <meyering@redhat.com>
495
496         * src/c99-to-c89.diff: Adjust seq.c offsets.
497
498         Remove unused parameter in remove.c.
499         * src/remove.c (fd_to_subdirp): Remove unused parameter.
500         (remove_cwd_entries, remove_dir): Update callers.
501
502         bootstrap: work also with 4-argument variant of AC_INIT (from gnulib)
503         2007-11-18  Sergey Poznyakoff  <gray@gnu.org.ua>
504         * bootstrap (gnulib_extra_files): Adjust sed command.
505
506 2007-11-17  Jim Meyering  <meyering@redhat.com>
507
508         Correct preceding patch.
509         * src/seq.c (print_numbers): Also handle first < last && step < 0.
510         * tests/misc/seq [empty-rev]: New test for this case.
511
512         "seq .1 .1" would mistakenly generate no output on some systems
513         * NEWS: Say this.
514         * src/seq.c (print_numbers): Handle another floating point corner case.
515         This avoids failure of seq's eq-wid-7 test on FreeBSD 6.1.
516
517 2007-11-16  Paul Eggert  <eggert@cs.ucla.edu>
518
519         Port tests/rmdir/ignore away from GNU/Linux.
520         * tests/rmdir/ignore: Don't assume that rmdir($PWD) will fail
521         with errno==ENOTEMPTY when $PWD is not empty; Posix also allows
522         rmdir to fail with errno==EBUSY.
523
524 2007-11-16  Jim Meyering  <meyering@redhat.com>
525
526         Avoid an obscure new "make distcheck" failure.
527         * Makefile.maint (my-distcheck): Also allow 'mv', for its use
528         in gnulib-tests/Makefile.
529
530 2007-11-16  Paul Eggert  <eggert@cs.ucla.edu>
531
532         Port readlink-fp-loop to Solaris.
533         * tests/misc/readlink-fp-loop (symlink_loop_msg): New var,
534         which records the symlink-loop message, whose wording is
535         not standardized by Posix.  Do not rely on "echo x > p/1"
536         to work when p/1 has a lot of indirect symlinks.  (I'm surprised
537         that it works on Linux.  Perhaps a Linux bug?)
538
539 2007-11-15  Paul Eggert  <eggert@cs.ucla.edu>
540
541         Port to Solaris 'make' and use a Posixish shell on Solaris.
542         * bootstrap.conf (gnulib_modules): Add gnu-make, posix-shell.
543         * build-aux/check.mk (SHELL): Set to $(PREFERABLY_POSIX_SHELL),
544         so that commands can assume Posix syntax.
545         (ENABLE_HARD_ERRORS, TEST_LOGS): Don't use GNU Make's "?=" syntax.
546         (SH_E_WORKAROUND): New macro.
547         (am__check_pre, $(TEST_SUITE_LOG)): Use it.
548         (am__check_pre): Fail if "mkdir" fails.  Use $(SHELL)
549         rather than relying on the "#!/bin/sh" in the file, so that tests
550         can use Posix syntax.
551         (am__check_pre, am__tty_colors): Use $$src rather than $$<, to
552         support the Posix-make $(TEST_LOGS) rule.
553         (%.log: %.test, %.log: %$(EXEEXT)): Remove unused inference rules
554         that rely on a GNU Make extension and cause Solaris 'make' to fail.
555         (SUFFIXES): New macro, so that we can use Posix style inference rules.
556         (%.log: %): Use this rule only if GNU_MAKE.
557         Set $$src so that macros can use $$src rather than $$<.
558         (CHECK-FORCE, DEPENDENCY, $(TEST_LOGS)): New macros and rules,
559         which rely only on Posix 'make' semantics, and are used only with
560         non-GNU 'make' implementations.  $(TEST_LOGS) invokes 'make'
561         recursively (and a bit inefficiently) to simulate the GNU 'make'
562         rules.
563         (.log.html): Renamed from "%.html: %.log", so that it relies only
564         on Posix 'make' semantics.
565         (check-clean, .PHONY): Do not depend on check-clean-local, since
566         Solaris 'make' complains about nonexistent rules like that.
567         * src/Makefile.am (SUFFIXES): Remove; no longer needed.
568         (groups): Use a specific rule rather than an inference rule that
569         is only instantiated once.  The inference-rule approach does not
570         work with Solaris 'make', which gets confused by the "groups:
571         Makefile" line.  It's not clear from the Posix spec that Solaris
572         'make' is buggy here, so instead of worrying about it, rewrite
573         the makefile so that it clearly conforms to Posix.
574         * tests/check.mk (TESTS_ENVIRONMENT): Export PACKAGE_BUGREPORT.
575         GNU 'make' does this automatically for us, but Solaris 'make'
576         doesn't.
577
578 2007-11-15  Paul Eggert  <eggert@cs.ucla.edu>
579
580         Port to Solaris 8 perl, which does not support "use warnings;".
581         * tests/dd/skip-seek: Skip test if "use warnings;" fails.
582         * tests/du/files0-from: Likewise.
583         * tests/misc/base64: Likewise.
584         * tests/misc/basename: Likewise.
585         * tests/misc/cut: Likewise.
586         * tests/misc/date: Likewise.
587         * tests/misc/dircolors: Likewise.
588         * tests/misc/dirname: Likewise.
589         * tests/misc/expand: Likewise.
590         * tests/misc/expr: Likewise.
591         * tests/misc/factor: Likewise.
592         * tests/misc/fmt: Likewise.
593         * tests/misc/fold: Likewise.
594         * tests/misc/head-elide-tail: Likewise.
595         * tests/misc/ls-misc: Likewise.
596         * tests/misc/md5sum: Likewise.
597         * tests/misc/md5sum-newline: Likewise.
598         * tests/misc/mktemp: Likewise.
599         * tests/misc/od: Likewise.
600         * tests/misc/paste-no-nl: Likewise.
601         * tests/misc/pr: Likewise.
602         * tests/misc/seq: Likewise.
603         * tests/misc/sha1sum: Likewise.
604         * tests/misc/sha1sum-vec: Likewise.
605         * tests/misc/sha224sum: Likewise.
606         * tests/misc/sha256sum: Likewise.
607         * tests/misc/sha384sum: Likewise.
608         * tests/misc/sha512sum: Likewise.
609         * tests/misc/sort-merge: Likewise.
610         * tests/misc/stat-printf: Likewise.
611         * tests/misc/sum: Likewise.
612         * tests/misc/test-diag: Likewise.
613         * tests/misc/tsort: Likewise.
614         * tests/misc/unexpand: Likewise.
615         * tests/misc/wc-files0-from: Likewise.
616         * tests/misc/xstrtol: Likewise.
617         * tests/mv/i-1: Likewise.
618         * tests/rm/empty-name: Likewise.
619         * tests/rm/unreadable: Likewise.
620
621 2007-11-15  Andreas Schwab  <schwab@suse.de>
622
623         * m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix syntax error.
624         Remove trailing space from result.
625
626 2007-11-15  Jim Meyering  <meyering@redhat.com>
627
628         Avoid misbehavior of a cross-device "mv" or "install".
629         Those programs must not dereference a destination symlink.
630         * src/copy.c (copy_reg): Don't treat a dangling destination symlink
631         differently in move mode.  In move mode, the only way the added
632         O_EXCL can cause failure is when some other process has recreated
633         the file this code unlinked a few instructions before.
634
635 2007-11-14  Jim Meyering  <meyering@redhat.com>
636
637         Another bootstrap kludge.
638         * bootstrap: Ensure gnulib-tests/test-*.sh are executable
639
640         #ifdef-out matchpathcon-related code, for now.
641         * src/install.c (setdefaultfilecon): #ifdef-out all of the
642         matchpathcon-related code, until it's more efficient.
643         (setdefaultfilecon): Instead of the above, stub-out the entire function.
644
645         Use gnulib's stpncpy module, now required by install.c
646         * bootstrap.conf (gnulib_modules): Add stpncpy.
647
648         Enable gnulib-tool's --with-tests option.
649         * bootstrap: After all is done, transform the generated
650         gnulib-tests/gnulib.mk.
651         * bootstrap.conf (gnulib_tool_option_extras): Set it here.
652         * gnulib-tests/Makefile.am: New file.
653         * Makefile.am (SUBDIRS): Add gnulib-tests.
654         * configure.ac (AC_CONFIG_FILES): Add gnulib-tests/Makefile.
655         * m4/jm-macros.m4 (coreutils_MACROS) [ARGMATCH_DIE_DECL]: Omit the
656         "extern " prefix to "void usage ()", so that the macro string value can
657         be used to construct a function definition in gnulib's test-argmatch.c.
658
659 2007-11-12  Benno Schulenberg  <bensberg@justemail.net>
660
661         Clarify description of cp's -a option.
662         * src/cp.c (usage) [-a]: Remove unnecessary 'P'.
663         Since option -d of 'cp' includes the function of -P, mentioning the
664         latter in the description of option -a is redundant and therefore
665         slightly confusing, as the reader tries to figure out what it adds.
666         * doc/coreutils.texi (cp invocation): Likewise: s/-dpPR/-dpR/.
667
668 2007-11-09  Jim Meyering  <meyering@redhat.com>
669
670         bootstrap: fix typo to enable use of $gnulib_tool_option_extras.
671         * bootstrap (gnulib_tool_options): Add a space before the use
672         of $gnulib_tool_option_extras, so that it's separated from the
673         preceding argument.
674
675         install+SELinux: reduce a 12x performance hit to ~1.5x
676         * src/install.c (setdefaultfilecon): Call matchpathcon_init_prefix,
677         to mitigate what would otherwise be a large performance hit due to
678         the use of matchpathcon.
679         Dan Walsh suggested the use of matchpathcon_init_prefix.
680         * gl/lib/se-selinux.in.h (matchpathcon_init_prefix): Define.
681
682 2007-11-08  Jim Meyering  <meyering@redhat.com>
683
684         Adapt to gnulib's s/jm_/gl_/ cache variable renaming.
685         * configure.ac: Change the cache variable name prefix "jm_" to "gl_",
686         to match today's change in gnulib.
687
688 2007-11-05  Jim Meyering  <meyering@redhat.com>
689
690         Fix bootstrap failure to handle files like lib/uniwidth/cjk.h.
691         * bootstrap (cp_mark_as_generated): Create any required parent
692         destination directories before copying a file into place.
693
694         * src/c99-to-c89.diff: Adjust offsets.
695
696         Don't use GNU-sed-specific \< \> operators here, either.
697         * m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Use a loop, as below.
698
699         Use tighter regexps when performing name substitution.
700         * man/Makefile.am (mapped_name): Add ^ and $$ anchors.
701
702         Don't use GNU-sed-specific \< \> operators.
703         * configure.ac (MAN): Transform ginstall.1 to install.1 using
704         a loop, rather than sed with \<...\>.
705         Problem reported by Bruno Haible.
706         Andreas Schwab reminded me that \< and \> are not portable.
707
708         Get git-version-gen from gnulib.
709         * build-aux/git-version-gen: Remove file.
710         * build-aux/.gitignore: Add git-version-gen.
711         * bootstrap.conf (gnulib_modules): Add git-version-gen.
712
713 2007-11-03  Jim Meyering  <meyering@redhat.com>
714
715         git-version-gen: Sync from autoconf's version.
716         * build-aux/git-version-gen: Run git-status
717
718         Sync copyright and scriptversion bits from gnulib.
719         * build-aux/git-version-gen: No semantic change.
720
721         Change the first '-' to '.' in the snapshot version string,
722         e.g., 6.9-377-08144 -> 6.9.377-08144
723         * build-aux/git-version-gen: ... and add comments.
724
725         seq: add another test for the %% bug.
726         * tests/misc/seq (fmt-c): Test the other fixed case, too.
727
728 2007-11-03  Paul Eggert  <eggert@cs.ucla.edu>
729
730         Fix bug with "seq 10.8 0.1 10.95", plus another bug with %% in format.
731
732         * NEWS: Mention the %%-in-format bug fix.
733         * src/seq.c (struct layout): New type.
734         (long_double_format): New arg LAYOUT.  Fill it in.  Fix mishandling
735         of %% in formats.
736         (print_numbers): New arg LAYOUT.  Don't convert LAST to output format
737         when deciding whether to go slightly past LAST.  Instead, convert
738         X to output format and back.  This fixes a bug reported by
739         Andreas Schwab in
740         <http://lists.gnu.org/archive/html/bug-coreutils/2007-10/msg00237.html>
741         where "seq 10.8 0.1 10.95" would output 11.0 on platforms where
742         10.95 rounds to a value that prints as 11.0 when only one digit
743         past the decimal point is asked for.
744         (main): Compute layout, for benefit of print_numbers.
745         * tests/misc/seq (float-3): Undo previous change, since the bug
746         should be fixed now.
747         (fmt-b): New test, for the %% bug.
748
749 2007-11-01  Jim Meyering  <meyering@redhat.com>
750
751         * tests/misc/printf-surprise: Correct sed transform.
752         Reported by Bob Proulx.
753
754         Add example inspired by "make dist" running gzip and lzma in sequence.
755         * doc/coreutils.texi (tee invocation): Show how to run tar just
756         once, compressing the tee'd output streams in parallel.
757
758         Say that the first process substitution example is contrived.
759         * doc/coreutils.texi (tee invocation): ... and show how to do
760         it properly.  Pointed out by James Antill.
761
762         Use mktemp, not mkdtemp, to create test directories.
763         * tests/test-lib.sh: Use the mktemp binary we've just built,
764         not the mkdtemp script.
765         * tests/mkdtemp: Remove file.
766         * tests/Makefile.am (EXTRA_DIST): Remove mkdtemp.
767
768         Adjust a seq subtest not to depend on the vagaries of floating point.
769         * tests/misc/seq (float-3): Use 10.94 as the endpoint, not 10.95,
770         since 10.95 was precisely in the middle of the interval, and with
771         a %.1f format could map to either 10.9 or 11.0.
772         Reported by Mike Frysinger
773
774         Make the new printf-surprise test more precise.
775         * tests/test-lib.sh (require_ulimit_): New function.
776         * tests/misc/printf-surprise: Use ulimit -v to trigger the fixed bug,
777         and rather than checking printf's exit status (which would go wrong
778         on FreeBSD 6.1, since their printf(3) function doesn't require
779         lots of memory in this case) simply test whether it outputs
780         the first 10 bytes.
781
782         Accommodate FreeBSD 6.1 hard-link-to-symlink differences.
783         * tests/cp/same-file: Detect when linking to a symlink links to
784         the target of the symlink (FreeBSD 6.1 does this, Linux does not),
785         and skip the few tests that would otherwise fail.
786         Redirect output of final comparison to stderr, since all stdout
787         is already redirected.
788
789 2007-10-31  Jim Meyering  <meyering@redhat.com>
790
791         Fix a "make distcheck" failure.
792         * Makefile.maint (my-distcheck): Don't stub-out dirname,
793         since build-aux/check.mk now uses it.
794
795         * bootstrap.conf (gnulib_modules): Add xprintf-posix.
796
797 2007-10-30  Jim Meyering  <meyering@redhat.com>
798
799         Avoid seq floating-point test failure on FreeBSD 6.1.
800         * tests/misc/seq (float-4): Also accept -0.0.
801
802 2007-10-29  Jim Meyering  <meyering@redhat.com>
803
804         Change a "make dist" diagnostic.
805         * GNUmakefile: Don't imply that $(_curr-ver) is the new version string.
806
807 2007-10-29  Bob Proulx  <bob@proulx.com>
808
809         Improve color terminal escape usage.
810         * build-aux/check.mk (am__tty_colors): Use 'tput' to deduce
811         terminal color capabilities.
812
813 2007-10-29  Jim Meyering  <meyering@redhat.com>
814
815         Don't try to colorize a dumb terminal.
816         * build-aux/check.mk (am__tty_colors): Skip colors if $TERM is "dumb".
817         Thanks to Bob Proulx.
818
819         Remove gnulib's printf-posix module, for now.
820         * bootstrap.conf (gnulib_modules): It caused too many test failures.
821
822         Remove spurious semicolon after "else".
823         * build-aux/check.mk (am__tty_colors): Fix syntax error.
824
825         If $TERM is empty, don't use colors.  This helps the buildbot,
826         since it produces its result in an environment with a tty, but
827         we don't want color codes in that case.
828         * build-aux/check.mk (am__tty_colors): Test for nonempty $TERM.
829         Suggestion from Bob Proulx.
830
831         Always initialize terminal colorization string variables.
832         * build-aux/check.mk (am__tty_colors): Always initialize red, grn, etc.,
833         In case they're defined in the environment.
834
835         Avoid test failure in non-srcdir build vs. the git tree.
836         * tests/check.mk (vc_exe_in_TESTS): Run this test only in a
837         srcdir build directory.  Reported by Andreas Schwab.
838
839 2007-10-28  Jim Meyering  <meyering@redhat.com>
840
841         Define ENOTSUP, not ENOSYS.  Needed on OpenBSD 3.9.
842         * gl/lib/se-context.in.h (ENOTSUP): Define if missing.
843         * gl/lib/se-selinux.in.h: Likewise.
844
845         Define ENODATA, for FreeBSD 5.0 and 6.1.
846         * src/system.h (ENODATA): Define, if missing.
847
848         Run autoreconf, not just autoconf, to avoid warnings.
849         * GNUmakefile (dummy): Otherwise, we'd sometimes get a warning
850         about autoconf version mismatch between what was used to generate
851         aclocal.m4 and the currently-running autoconf.
852
853         Require gnulib's printf-posix module, to support Interix.
854         * bootstrap.conf (gnulib_modules): Add printf-posix.
855
856         Help xgettext recognize more printf-style format strings.
857         * bootstrap.conf (XGETTEXT_OPTIONS): Add directives for
858         error, error_at_line, xasprintf, xfprintf and xprintf.
859
860 2007-10-27  Jim Meyering  <meyering@redhat.com>
861
862         Adjust format string so msgfmt doesn't object.
863         * src/df.c (main): Use "%s%s" (not %smsg) to print "msg" with or
864         without a "Warning: " prefix.  Reported by Clytie Siddall.
865
866         Clean up tests/Makefile.am.
867         * tests/Makefile.am (EXTRA_DIST): Remove $(TESTS).  No longer defined.
868         (TESTS_ENVIRONMENT): Remove definition.
869
870 2007-10-26  Jim Meyering  <meyering@redhat.com>
871
872         * build-aux/check.mk: Merge with latest from Akim.
873
874         Add a test for the printf fix of 2007-10-21.
875         * tests/misc/printf-surprise: New file.  Test for 2007-10-21's fix.
876         * tests/misc/Makefile.am (TESTS): Add printf-surprise.
877
878 2007-10-24  Micah Cowan  <micah@cowan.name>
879
880         Remove vestiges of cvs-gnulib-checkout process.  Now we use git.
881         * bootstrap: Remove support for now-unnecessary option, --cvs-user,
882         and envvars CVS_USER, CVS_RSH.
883
884 2007-10-24  Micah Cowan  <micah@cowan.name>
885
886         Tell xgettext that "ARG1 % ARG2" is not a C format string.
887         * src/expr.c (usage): Add a comment to override xgettext's default
888         behavior, which would classify "ARG1 % ARG2" as a fprintf-style
889         format string.  Reported by Clytie Siddall.
890
891 2007-10-24  Jim Meyering  <meyering@redhat.com>
892
893         Avoid diagnostics from sha1sum when there is no cached checksum.
894         * bootstrap (update_po_files): Skip the sha1sum check if the po.s1
895         file hasn't been created yet.
896
897         Get gnulib from the git repository, not from an obsolete cvs one.
898         * bootstrap: Suggestion from Micah Cowan.
899
900         Doc improvements.
901         * README-hacking: Prefer the no-hyphen variant of git commands,
902         e.g., use "git pull" not "git-pull".
903         Don't presume that the only way to read this document is via a
904         prior git clone: provide instructions for cloning coreutils, too.
905
906         * README-hacking: Add "cd automake" in build instructions.
907         From Bob Proulx.
908
909         Don't fail part 2 of tests/rm/unreadable when run as root.
910         * tests/rm/unreadable: With UID == 0, expect different results.
911         Reported by Mike Frysinger.
912
913 2007-10-23  Jim Meyering  <meyering@redhat.com>
914
915         * README-hacking: Refer to LZMA Utils <http://tukaani.org/lzma/>.
916
917 2007-10-22  Paul Eggert  <eggert@cs.ucla.edu>
918
919         * README-hacking: Describe how to build with LZMA.
920
921 2007-10-22  Jim Meyering  <meyering@redhat.com>
922
923         Remove git-version-gen's first parameter.
924         * build-aux/git-version-gen: Add comments.
925         Remove first command-line parameter.
926         * configure.ac: Remove corresponding first argument.
927         * GNUmakefile (_curr-ver): Likewise.
928
929 2007-10-21  Jim Meyering  <meyering@redhat.com>
930
931         * NEWS: Mention the printf fix.
932
933         Reorder tests to run more basic ones earlier.
934         * tests/misc/Makefile.am (TESTS): Reorder.
935         * tests/Makefile.am (SUBDIRS): Reorder.
936
937         tr: do not reject an unmatched [:lower:] or [:upper:] in SET1.
938         * NEWS: Mention this.
939         * src/tr.c (get_next) [RE_CHAR_CLASS]: Don't skip the loop when
940         processing [:lower:] and [:upper:].
941         (main): Require [:lower:] or [:upper:] in SET1 only when
942         when one of those is specified in SET2.
943         * tests/tr/Test.pm: Add tests for this fix.
944         Reported by Per Starbäck.
945
946 2007-10-20  Jim Meyering  <meyering@redhat.com>
947
948         * tests/misc/help-version: Add a comment.
949
950         Detect printf(3) failure due to ENOMEM.
951         * src/printf.c: Include "xprintf.h"
952         (print_direc): Use xprintf, rather than printf.
953         * bootstrap.conf (gnulib_modules): Add xprintf.
954         * po/POTFILES.in: Add lib/xprintf.c.
955         Reported by Bruno Haible.
956
957         Put always-failing programs first in PATH, so tests cannot mistakenly
958         run installed versions.
959         * Makefile.maint (my-distcheck): Set up a bogus bin/ dir, to be used
960         for "make check".
961
962         * doc/coreutils.texi (tee invocation): Fix typo.  Add a little.
963         Add a cross-reference to bashref's Process Substitution node.
964
965         Adjust tests to pass, now that Test.pm ones use check.mk.
966         * tests/check.mk (vc_exe_in_TESTS): Adjust regexp not to match the
967         "TESTS = $x-tests" line in each Test.pm-derived Makefile.am file.
968         * tests/sort/main: Remove this unused file.
969
970         Ensure that Test.pm-derived tests use the right $PATH.
971         * tests/Makefile.am.in: Include $(top_srcdir)/tests/check.mk.
972
973 2007-10-20  Bob Proulx  <bob@proulx.com>
974
975         Prevent "make check" from leaving mktemp /tmp/tmp.* files behind.
976         * tests/misc/help-version (mktemp_args): Tell mktemp to create
977         its temporary file in the current directory.
978
979 2007-10-16  Jim Meyering  <meyering@redhat.com>
980
981         Show how to make tee redirect to multiple processes.
982         * doc/coreutils.texi (tee invocation): Tee can redirect output
983         to multiple _processes_, too.
984
985 2007-10-14  Jim Meyering  <meyering@redhat.com>
986
987         Pull all TESTS_ENVIRONMENT settings "up" into tests/check.mk.
988         * tests/Makefile.am.in (TESTS_ENVIRONMENT): Remove definition.
989         * tests/chgrp/Makefile.am: Likewise.
990         * tests/chmod/Makefile.am: Likewise.
991         * tests/chown/Makefile.am: Likewise.
992         * tests/cp/Makefile.am: Likewise.
993         * tests/dd/Makefile.am: Likewise.
994         * tests/du/Makefile.am: Likewise.
995         * tests/install/Makefile.am: Likewise.
996         * tests/ln/Makefile.am: Likewise.
997         * tests/ls/Makefile.am: Likewise.
998         * tests/misc/Makefile.am: Likewise.
999         * tests/mkdir/Makefile.am: Likewise.
1000         * tests/mv/Makefile.am: Likewise.
1001         * tests/readlink/Makefile.am: Likewise.
1002         * tests/rm/Makefile.am: Likewise.
1003         * tests/rmdir/Makefile.am: Likewise.
1004         * tests/tail-2/Makefile.am: Likewise.
1005         * tests/touch/Makefile.am: Likewise.
1006         * tests/check.mk (TESTS_ENVIRONMENT) [EXEEXT, EGREP, MAKE, PERL]:
1007         [CONFIG_HEADER, build_programs, host_os, host_triplet, PATH]:
1008         [REPLACE_GETCWD, CU_TEST_NAME]: Add definitions here.
1009         * tests/misc/pwd-long: Use $abs_top_builddir/src, not $BUILD_SRC_DIR.
1010         * tests/dd/skip-seek: Don't use $ENV{PROG}.
1011         * tests/rm/empty-name: Likewise.
1012         * tests/rm/unreadable: Likewise.
1013         * tests/mv/i-1: Likewise.
1014
1015         Fix a minor typo.
1016         * configure.ac (AC_INIT): Fix a typo (s/9.6/6.9/) that makes a
1017         difference only when running "make dist" without a .git/ subdir.
1018
1019 2007-10-09  Jim Meyering  <meyering@redhat.com>
1020
1021         Move the help-version test into misc/.
1022         * tests/help-version: Move to...
1023         * tests/misc/help-version: ...here.
1024         Source test-lib.sh, as usual.
1025         Use $abs_top_builddir, rather than ".." and "../..".
1026
1027         Make the runcon-no-reorder test slightly more general.
1028         * tests/misc/runcon-no-reorder: Don't hard-code "unconstrained_t".
1029         Use slightly more general "runcon $(id -Z)".
1030         Suggestion from Stephen Smalley.
1031
1032         Skip the chcon test on a system with no SELinux support.
1033         * tests/test-lib.sh (require_selinux_): New function.
1034         * tests/misc/chcon: Use it.
1035         * tests/misc/selinux: Use it here, too.
1036         * tests/cp/cp-a-selinux: and here.
1037         * tests/selinux: Remove file.
1038         * tests/Makefile.am (EXTRA_DIST): Remove selinux.
1039         Reported by Mike Frysinger and Bauke Jan Douma.
1040
1041         * src/dircolors.hin: Recognize .lzma as a compressed-file suffix.
1042
1043         * configure.ac (AM_INIT_AUTOMAKE): Use dist-lzma, rather than dist-bzip2.
1044
1045         Now that we don't install su, don't make misleading suggestions.
1046         * src/Makefile.am (install-exec-local) [$(INSTALL_SU) != yes]:
1047         Don't suggest running "make install-root".
1048         (uninstall-local) [$(INSTALL_SU) != yes]: Don't even check
1049         the installed binary.
1050
1051 2007-10-08  Jim Meyering  <meyering@redhat.com>
1052
1053         When forming a truncated name, use the "[...]" prefix even for
1054         an extremely long name in the current directory
1055         * src/remove.c (full_filename_): Rename a local variable.
1056         Use two separate "truncated" variables, in case the second
1057         call to right_justify does not indicate any truncation -- which
1058         would happen only if the single component FILENAME were longer
1059         than 511 bytes and DIR_NAME were empty.
1060
1061         rm could malfunction under unusual circumstances:
1062         When operating on a relative name longer than 511 bytes,
1063         and (when either processing a directory that is neither writable
1064         nor readable (but still searchable) or when determining whether
1065         to prompt), and encountering an ENOMEM error while forming the
1066         file name, rm would operate on a truncated-to-511-byte name
1067         starting with "[...]" rather than the intended one.
1068         * NEWS: Describe the bugs.
1069         * src/remove.c: Correct two misuses of full_filename:
1070         (full_filename0, xfull_filename): New functions.
1071         (full_filename_): Rewrite to use full_filename0.
1072         (AD_pop_and_chdir): Use xfull_filename, not full_filename.
1073         (write_protected_non_symlink): Likewise.
1074
1075 2007-10-07  Jim Meyering  <meyering@redhat.com>
1076
1077         Don't let a helper function modify errno.
1078         * src/remove.c (full_filename_): Save and restore errno.
1079         Spotted by Bruno Haible.
1080
1081         Reflect 2->3 GPL copyright version update in gnulib.
1082         * gl/lib/tempname.h: Update copyright from gnulib.
1083         * gl/lib/tempname.c: Likewise.
1084         * .x-sc_GPL_version: Don't make an exception for those two files.
1085
1086         * configure.ac (AM_INIT_AUTOMAKE): Don't use dist-lzma just yet.
1087
1088         New program: mktemp.
1089         * NEWS: Mention this.
1090         * README: Add mktemp to the list.
1091         * AUTHORS: Add this: mktemp: Jim Meyering
1092         * src/mktemp.c: New file.
1093         * src/Makefile.am (bin_PROGRAMS): Add mktemp.
1094         (mktemp_LDADD): Add $(LIB_GETHRXTIME).
1095         * man/mktemp.x: New file.
1096         * man/Makefile.am (dist_man_MANS): Add mktemp.1.
1097         (mktemp.1): New dependency.
1098         * man/.cvsignore: Add mktemp.1.
1099         * man/.gitignore: New file.
1100         * src/.cvsignore, src/.gitignore: Add mktemp.
1101         * tests/misc/mktemp: New file.
1102         * tests/misc/Makefile.am (TESTS): Add mktemp.
1103         * tests/Coreutils.pm (run_tests): Give the POST-test function
1104         access to stdout and stderr contents, so it can verify that
1105         the named-on-stdout file/dir does indeed exist and has proper
1106         permissions, etc.
1107         [po/ChangeLog]
1108         * POTFILES.in: Add src/mktemp.c.
1109
1110         Make tempname more random, via the randint module.
1111         * gl/modules/tempname (Depends-on): Add randint and stdbool.
1112         * gl/lib/tempname.c: Include randint.h and stdbool.h.
1113         (uint64_t): Remove definition.  Not needed.
1114         [_LIBC] (RANDOM_BITS): Remove this block, now that we have proper
1115         random bits.
1116         (check_x_suffix): New function.
1117         (gen_tempname_len): Rename from __gen_tempname.
1118         Add a parameter, x_suffix_len, telling how many X's there must be at
1119         the end of the template.
1120         Use pseudo-random numbers all the way, rather than adding 7777
1121         from one iteration to the next.
1122         (__gen_tempname): New function, to call gen_tempname_len, requiring a
1123         suffix length of 6.
1124         * gl/lib/tempname.h: Add prototype for gen_tempname_len.
1125
1126         Convert coreutils' rand*.{c,h,m4} into modules.
1127         First step: move these files to gl/lib:
1128         * lib/rand-isaac.c, lib/rand-isaac.h
1129         * lib/randint.c, lib/randint.h
1130         * lib/randperm.c, lib/randperm.h
1131         * lib/randread.c, lib/randread.h
1132         Step 2: add modules/rand* and remove now-unneeded .m4 files.
1133         * gl/modules/randint: New file.
1134         * gl/modules/randperm: New file.
1135         * gl/modules/randread: New file.
1136         * m4/randint.m4: Remove file.
1137         * m4/randperm.m4: Remove file.
1138         * m4/randread.m4: Remove file.
1139         Step 3: use the new modules
1140         * bootstrap.conf (gnulib_modules): Add randint and randperm.
1141         * m4/prereq.m4 (gl_RANDINT, gl_RANDREAD, gl_RANDPERM): Don't require;
1142         These have been removed.
1143         (gl_ROOT_DEV_INO): Don't require; already handled via bootstrap.conf.
1144
1145         Copy from gnulib the parts of tempname that we'll modify.
1146         * gl/lib/tempname.c: Copy from gnulib.
1147         * gl/lib/tempname.h: Likewise.
1148         * gl/modules/tempname: Likewise.
1149         Allow GPLv2 on temporarily(?)-imported file from gnulib/libc.
1150         * .x-sc_GPL_version: New file.
1151         * Makefile.am (EXTRA_DIST): Add .x-sc_GPL_version
1152
1153 2007-10-07  Jim Meyering  <meyering@redhat.com>
1154
1155         Avoid a pseudo-leak in sort.
1156         * src/sort.c (main) [lint]: Avoid a nominal leak.
1157
1158         Use puts, rather than printf ("%s\n".  Slightly cleaner.
1159         * src/tsort.c (tsort): ...and more efficient.
1160
1161         Avoid seq malfunction on non-POSIX systems: mingw, BeOS, Interix.
1162         * bootstrap.conf (gnulib_modules): Add vasprintf-posix.
1163         Suggestion from Bruno Haible.
1164
1165         Avoid a used-uninitialized error.
1166         * src/copy.c (copy_internal): Don't overload "use_stat".
1167
1168 2007-10-05  Jim Meyering  <meyering@redhat.com>
1169
1170         Make a failing cross-partition mv give a sensible diagnostic.
1171         A cross-partition move of a file in a sticky tmpdir and owned by
1172         another user would evoke an invalid diagnostic after copying it:
1173           mv: cannot remove `x': Operation not permitted
1174         Either of the following (mv.c, remove.c) changes would fix the bug by
1175         itself.  I think it's slightly better to use both; the added cost is
1176         minimal: mv: an extra lstat-per-mv-cmdline-arg-that-goes-cross-partition,
1177         rm: an extra lstat-per-unlink-that-fails-w/EPERM.
1178         * src/remove.c (remove_entry): Also lstat the file upon EPERM.
1179         * src/mv.c (rm_option_init): Initialize root_dev_ino just as is done
1180         in rm, so that a cross-partition invoked remove.c:rm call works the
1181         same way as one invoked from the command-line use of "rm".  That
1182         setting of root_dev_ino makes rm() do the equivalent of an additional
1183         lstat for each argument, which in turn gives rm enough information to
1184         issue the right diagnostic.
1185         * tests/mv/sticky-to-xpart (version): New file.  Test for the above.
1186         * tests/mv/Makefile.am (TESTS): Add sticky-to-xpart.
1187         Arrange for "make check-root" to run the new root-only test.
1188         * tests/Makefile.am (tb): New target, to run the new root-only test.
1189         (all_t): Add tb.
1190         * src/c99-to-c89.diff: Adjust offsets.
1191
1192         Add PACKAGE_VERSION to TESTS_ENVIRONMENT via check.mk.
1193         * tests/check.mk (TESTS_ENVIRONMENT): Add PACKAGE_VERSION here,
1194         rather than in every Makefile.am that needs it.
1195         * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Remove PACKAGE_VERSION.
1196         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Likewise.
1197
1198 2007-10-04  Jim Meyering  <jim@meyering.net>
1199
1200         Adapt to new gnulib naming scheme.
1201         * gl/lib/se-context.in.h: Rename from gl/lib/se-context_.h.
1202         * gl/lib/se-selinux.in.h: Rename from gl/lib/se-selinux_.h.
1203         * gl/m4/selinux-context-h.m4: Remove use of AC_LIBSOURCES.
1204         * gl/m4/selinux-selinux-h.m4: Likewise.
1205         * gl/modules/selinux-h (Files, Makefile.am): Reflect renaming.
1206         (Makefile.am) [lib_SOURCES]: Add se-context.in.h and se-selinux.in.h.
1207
1208         * lib/search_.h: Remove unused file.
1209
1210         * bootstrap (slurp): Adapt to _.h -> .in.h name change.
1211         (update_po_files): Work also when there are no .po files in po/.
1212
1213         Remove test program: lib/t-fpending.c.
1214         * lib/t-fpending.c: Remove file.  Now, this test is in gnulib.
1215         * lib/Makefile.am: Remove associated rules.
1216         * .gitignore: Remove lib/t-fpending.
1217
1218 2007-10-03  Jim Meyering  <jim@meyering.net>
1219
1220         * tests/misc/selinux: Skip this test if the initial chcon fails.
1221
1222 2007-10-02  Jim Meyering  <jim@meyering.net>
1223
1224         Never copy through a symlink that cp has just created.
1225         * src/copy.c (copy_internal): When same-file detection requires
1226         'stat'ing the destination file, also 'lstat' it and ensure that
1227         it wasn't the destination of a preceding copy operation.
1228         This bug was introduced on 2007-06-18.
1229         * tests/cp/abuse: New test for the above.
1230         * tests/cp/Makefile.am (TESTS): Add abuse.
1231
1232 2007-09-30  Jim Meyering  <jim@meyering.net>
1233
1234         cp: do not abbreviate in --help output.
1235         * src/cp.c (usage): Don't abbreviate: s/=link/=links/.
1236         Reported by GĂ©raud Meyer in <http://bugs.debian.org/444137>.
1237
1238 2007-09-29  Eric Blake  <ebb9@byu.net>
1239
1240         Test previous patch.
1241         * tests/misc/groups-dash: New test.
1242         * tests/misc/Makefile.am (TESTS): Add it.
1243
1244 2007-09-28  Eric Blake  <ebb9@byu.net>
1245
1246         * src/groups.sh: Don't ignore first argument if later argument is --.
1247
1248 2007-09-27  Jim Meyering  <jim@meyering.net>
1249
1250         Avoid spurious test failure when SELinux stats "selinux/class".
1251         * tests/ls/stat-free-symlinks: Grep for more precise /^stat("x"/.
1252
1253         Move file-set and hash-triple modules to gnulib.
1254         * bootstrap.conf (gnulib_modules): Remove file-set, now that
1255         it's in gnulib, and the canonicalize module requires it there.
1256         * gl/lib/file-set.c, gl/lib/file-set.h, gl/modules/hash-triple: Remove.
1257         * gl/lib/hash-triple.c, gl/lib/hash-triple.h, gl/modules/file-set:
1258         Remove.
1259
1260         Add a test to exercise a readlink bug.
1261         * tests/misc/readlink-fp-loop: New file.  Test for the readlink bug
1262         fixed through today's change to Gnulib's canonicalize module.
1263         * tests/misc/Makefile.am (TESTS): Add readlink-fp-loop.
1264         Bug report and a test case from mpb.mail@gmail.com.
1265
1266 2007-09-25  Pádraig Brady <P@draigBrady.com>
1267
1268         * doc/coreutils.texi (date invocation):
1269         Make "Date input formats" easier to navigate to.
1270
1271 2007-09-25  Jim Meyering  <jim@meyering.net>
1272
1273         Use XOR, not OR to combine bits.
1274         * gl/lib/hash-triple.c (triple_hash): Use XOR (^), not OR (|), to
1275         combine the bits from hashing the name and those of the inode number.
1276         Add a few comments and remove out-of-context ones.
1277
1278 2007-09-24  Jim Meyering  <jim@meyering.net>
1279
1280         * NEWS: The recent rm-diagnostic fix also affects cross-partition "mv".
1281
1282         copy.c: Remove definitions of factored-out functions.
1283         * src/copy.c: Include "file-set.h".
1284         (seen_file, record_file): Remove functions that I factored
1285         out on 2007-08-23.
1286
1287 2007-09-22  Jim Meyering  <jim@meyering.net>
1288
1289         Don't print the commands of a 10-line script that's run in each subdir.
1290         * tests/check.mk (vc_exe_in_TESTS): Add a leading "@", to reduce noise.
1291
1292         rm: give a sensible diagnostic when failing to remove a symlink
1293         On some systems (those with openat et al), when rm would fail to
1294         remove a symlink, it would fail with the misleading diagnostic,
1295         "Too many levels of symbolic links".
1296         * NEWS: Mention the bug fix.
1297         * src/remove.c (is_nondir_lstat): New function.
1298         (remove_entry): Use it to catch failed-to-remove symlink (and any
1299         other non-dir) here so that we don't fall through and try to treat
1300         it as directory, which -- with a symlink -- would provoke the bogus
1301         ELOOP failure.
1302         * tests/rm/fail-eacces: Add a test for the above.
1303         * src/c99-to-c89.diff: Adjust offsets.
1304
1305         rm: fix a tiny, nearly inconsequential bug.
1306         Don't perform a "."-relative lstat, when the file in question
1307         may well not be in ".".  Although this is a bug, a few attempts
1308         to exercise it on a linux-2.6.22 system failed.  You probably need
1309         a pre-openat system to trigger the failure.  The consequence of this
1310         bug would be a lower-quality diagnostic upon failed dir removal.
1311         * src/remove.c (is_dir_lstat): Add a parameter, fd_cwd.
1312         Use it instead of hard-coding AT_FDCWD.
1313         (remove_entry): Call is_dir_lstat with fd_cwd.
1314
1315 2007-09-22  Karl Berry  <karl@freefriends.org>
1316
1317         * TODO: It'd be nice to add renice.
1318
1319 2007-09-21  Jim Meyering  <jim@meyering.net>
1320
1321         Avoid test failure due to now-parallelized tests.
1322         * tests/du/two-args: Run "du .." from a sub-directory one level deeper.
1323
1324 2007-09-16  Jim Meyering  <jim@meyering.net>
1325
1326         * tests/misc/tac-continue: Arrange to remove a temporary file.
1327
1328         * tests/check.mk (vc_exe_in_TESTS): Don't rely on the value of
1329         $(TESTS), so that "make check TESTS=test-name" works once again.
1330
1331         * tests/CuTmpdir.pm: Use File::Find + chmod syscall, not chmod -R.
1332
1333         Revamp most test scripts.
1334
1335         * tests/rm/v-slash: Avoid test failure with non-C locale.
1336         Reported by Michael Stone.
1337
1338         Enable some previously omitted test scripts.  Add a test cross-check.
1339         * tests/rm/Makefile.am (TESTS): Add empty-name and unreadable.
1340         * tests/rm/empty-name: Likewise.
1341         * tests/rm/unreadable: Reenable this test.  Adjust for new rm.
1342         * tests/mkdir/Makefile.am: Add writable-under-readonly.
1343         * tests/mkdir/writable-under-readonly: Add some comments.
1344         This test is always skipped, for now.
1345         * tests/Makefile.am (ta): Hook up the new root-only script.
1346         * tests/tail-2/infloop-1: Make this test pass.
1347         * tests/tail-2/Makefile.am (TESTS): Add infloop-1.
1348         * tests/tail-2/fflush: Remove unused file.
1349         * tests/check.mk (vc_executable_is_in_TESTS): More portable.
1350         * tests/check.mk (check): Depend on the above.
1351         * build-aux/check.mk: Remove comment mentioning AUTHORS file.
1352
1353         Factor out definitions in TESTS_ENVIRONMENT of srcdir, top_srcdir, etc.
1354         tests/check.mk (top_srcdir): Define.
1355         tests/*/Makefile.am: Remove definitions of $(srcdir), $(top_srcdir),
1356         $(abs_top_srcdir), and $(abs_top_builddir), since they're
1357         defined via the included tests/check.mk.
1358
1359         tests/general: Remove from VC, this long-unused directory and contents.
1360
1361         Adapt tests/tail-2/ to use test-lib.sh.
1362         Adapt tests/readlink/ to use test-lib.sh.
1363
1364         Move the sole test in tests/ls-2/ to tests/misc/.
1365         * tests/ls-2/basic-1: Move this file to ...
1366         * tests/misc/ls-misc: ...here.  Don't rely on $PROG in env.
1367         * tests/misc/Makefile.am (TESTS): Add ls-misc.
1368         * tests/Makefile.am (SUBDIRS): Remove ls-2.
1369         * tests/ls-2: Remove the directory.
1370         * configure.ac (AC_CONFIG_FILES): Remove tests/ls-2/Makefile.
1371
1372         More misc, test-related changes. (some to allow running tests as root)
1373
1374         Move all tests from test/{od,sha1sum,shred,stty} to tests/misc/.
1375         Reflect these renamings:
1376         od/od-N             misc/od-N
1377         od/x8               misc/od-x8
1378         sha1sum/basic-1     misc/sha1sum
1379         sha1sum/sample-vec  misc/sha1sum-vec
1380         shred/exact         misc/shred-exact
1381         shred/remove        misc/shred-remove
1382         stty/basic-1        misc/stty
1383         stty/invalid        misc/stty-invalid
1384         stty/row-col-1      misc/stty-row-col
1385         * tests/misc/Makefile.am (TESTS): Add the new files.
1386         * tests/Makefile.am (SUBDIRS): Remove the dir names.
1387         * tests/od, tests/sha1sum, tests/shred, tests/stty: Remove the
1388         directories.
1389         * configure.ac (AC_CONFIG_FILES): Remove the corresponding Makefile
1390         names.
1391
1392         Move the two tests in tests/tee to tests/misc/.
1393         * tests/tee/basic: Move this file to ...
1394         * tests/misc/tee: ...here.  Don't rely on $PROG in env.
1395         * tests/tee/dash: Move this file to ...
1396         * tests/misc/tee-dash: ...here.  Don't rely on $PROG in env.
1397         * tests/misc/Makefile.am (TESTS): Add tee.
1398         * tests/Makefile.am (SUBDIRS): Remove tee.
1399         * tests/tee: Remove the directory.
1400         * configure.ac (AC_CONFIG_FILES): Remove tests/tee/Makefile
1401
1402         Move the two tests in tests/sum/ to tests/misc/.
1403         * tests/sum/basic-1: Move this file to ...
1404         * tests/misc/sum: ...here.  Don't rely on $PROG in env.
1405         * tests/sum/sysv: Move this file to ...
1406         * tests/misc/sum-sysv: ...here.  Adapt it to use test-lib.sh.
1407         * tests/misc/Makefile.am (TESTS): Add sum and sum-sysv.
1408         * tests/Makefile.am (SUBDIRS): Remove sum.
1409         * tests/sum: Remove the directory.
1410         * configure.ac (AC_CONFIG_FILES): Remove tests/sum/Makefile.
1411
1412         Move the sole test in tests/tsort/ to tests/misc/tsort.
1413         * tests/tsort/basic-1: Move this file to ...
1414         * tests/misc/tsort: ...here.  Don't rely on $PROG in env.
1415         * tests/misc/Makefile.am (TESTS): Add tsort.
1416         * tests/Makefile.am (SUBDIRS): Remove tsort.
1417         * tests/tsort: Remove the directory.
1418         * configure.ac (AC_CONFIG_FILES): Remove tests/tsort/Makefile.
1419
1420         Move the sole test in tests/unexpand to tests/misc/unexpand.
1421         * tests/unexpand/basic-1: Move this file to ...
1422         * tests/misc/unexpand: ...here.  Don't rely on $PROG in env.
1423         * tests/misc/Makefile.am (TESTS): Add unexpand.
1424         * tests/Makefile.am (SUBDIRS): Remove unexpand.
1425         * tests/unexpand: Remove the directory.
1426         * configure.ac (AC_CONFIG_FILES): Remove tests/unexpand/Makefile.
1427
1428         Move the sole test in tests/seq to tests/misc/seq.
1429         * tests/seq/basic: Move this file to ...
1430         * tests/misc/seq: ...here.  Don't rely on $PROG in env.
1431         * tests/misc/Makefile.am (TESTS): Add seq.
1432         * tests/Makefile.am (SUBDIRS): Remove seq.
1433         * tests/seq: Remove the directory.
1434         * configure.ac (AC_CONFIG_FILES): Remove tests/seq/Makefile
1435
1436         Convert tests/mkdir/ to use test-lib.sh.
1437
1438         Move the two tests in tests/md5sum to tests/misc/md5sum.
1439         * tests/md5sum/basic-1: Move this file to ...
1440         * tests/misc/md5sum: ...here.  Don't rely on $PROG in env.
1441         * tests/md5sum/newline-1: Move this file to ...
1442         * tests/misc/md5sum-newline: ...here.  Don't rely on $PROG in env.
1443         * tests/misc/Makefile.am (TESTS): Add md5sum.
1444         * tests/Makefile.am (SUBDIRS): Remove md5sum.
1445         * tests/md5sum: Remove the directory.
1446         * configure.ac (AC_CONFIG_FILES): Remove tests/md5sum/Makefile
1447
1448         tests/sample-test: Update to use test-lib.sh.
1449
1450         Convert tests/misc/ to use test-lib.sh, too.
1451         Convert tests/ls/, too.
1452         Convert tests/ln/, too.
1453         Convert tests/install/, too.
1454
1455         Move the two tests in tests/fmt to tests/misc/fmt.
1456         * tests/fmt/basic: Move this file to ...
1457         * tests/misc/fmt: ...here.  Don't rely on $PROG in env.
1458         * tests/fmt/long-line: Move this file to ...
1459         * tests/misc/fmt-long-line: ...here.
1460         * tests/misc/Makefile.am (TESTS): Add fmt.
1461         * tests/Makefile.am (SUBDIRS): Remove fmt.
1462         * tests/fmt: Remove the directory.
1463         * configure.ac (AC_CONFIG_FILES): Remove tests/fmt/Makefile
1464
1465         Move the sole test in tests/factor to tests/misc/factor.
1466         * tests/factor/basic: Move this file to ...
1467         * tests/misc/factor: ...here.  Don't rely on $PROG in env.
1468         * tests/misc/Makefile.am (TESTS): Add factor.
1469         * tests/Makefile.am (SUBDIRS): Remove factor.
1470         * tests/factor: Remove the directory.
1471         * configure.ac (AC_CONFIG_FILES): Remove tests/factor/Makefile
1472
1473         Move the sole test in tests/expr to tests/misc/expr.
1474         * tests/expr/basic: Move this file to ...
1475         * tests/misc/expr: ...here.  Don't rely on $PROG in env.
1476         * tests/misc/Makefile.am (TESTS): Add expr.
1477         * tests/Makefile.am (SUBDIRS): Remove expr.
1478         * tests/expr: Remove the directory.
1479         * configure.ac (AC_CONFIG_FILES): Remove tests/expr/Makefile
1480
1481         Convert tests/du/*, too.
1482
1483         Move the sole test in tests/dircolors to tests/misc/dircolors.
1484         * tests/dircolors/simple: Move this file to...
1485         * tests/misc/dircolors: ...here.  Don't rely on $PROG in env.
1486         * tests/misc/Makefile.am (TESTS): Add dircolors.
1487         * tests/Makefile.am (SUBDIRS): Remove dircolors.
1488         * tests/dircolors: Remove the directory.
1489         * configure.ac (AC_CONFIG_FILES): Remove tests/dircolors/Makefile
1490
1491         Convert tests/dd/*, too.
1492
1493         Convert tests/mv, too.
1494         * tests/other-fs-tmpdir: Before, all callers would exit 77 upon
1495         failure to find the required dir.  Now, exit 77 in this script so
1496         callers don't have to.  Adjust callers.
1497
1498         Adjust chgrp, chmod, chown, cp tests to use test-lib.sh.
1499         * tests/check.mk: Also define abs_top_builddir.
1500
1501         Parallel "make check" support.
1502         * build-aux/check.mk: New file, from The Vaucanson Group.
1503         * .x-sc_GPL_version: New file, to allow "version 2 or later"
1504         in build-aux/check.mk.
1505         * Makefile.am (EXTRA_DIST): Add .x-sc_GPL_version.
1506         * tests/check.mk: New file.
1507         * tests/Makefile.am (EXTRA_DIST): Add check.mk, mkdtemp and test-lib.sh.
1508
1509         Begin factoring "sample-test" out of test scripts.
1510         * tests/test-lib.sh: New file, to be sourced by all tests that
1511         were previously derived from the "sample-test" template.
1512         * tests/mkdtemp: New file.
1513         * tests/touch/dir-1: Use test-lib.sh.
1514         * tests/touch/empty-file: Likewise.
1515         * tests/touch/fail-diag: Likewise.
1516         * tests/touch/fifo: Likewise.
1517         * tests/touch/no-create-missing: Likewise.
1518         * tests/touch/no-rights: Likewise.  Also, don't sleep.
1519         * tests/touch/not-owner: Likewise.
1520         * tests/touch/obsolescent: Likewise.
1521         * tests/touch/read-only: Likewise.
1522         * tests/touch/relative: Likewise.
1523         * tests/touch/Makefile.am: Include $(top_srcdir)/tests/check.mk,
1524         to get the parallel-"make check" bits.
1525
1526         Move a slow test into tests/misc.
1527         * tests/check.mk: Wrapper.
1528         * tests/ls/time-1: Move this file to tests/misc/ls-time.
1529         * tests/misc/ls-time: New file.  From tests/ls/time-1.
1530         * tests/ls/Makefile.am (TESTS): Remove time-1.
1531         * tests/misc/Makefile.am (TESTS): Add ls-time.
1532
1533         Add support for parallel "make check" (in tests/misc, for now)
1534
1535 2007-09-08  Jim Meyering  <jim@meyering.net>
1536
1537         Accommodate gnulib's renaming: __fpending.h -> fpending.h.
1538         * lib/t-fpending.c: Include "fpending.h", not "__fpending.h".
1539
1540 2007-09-07  Jim Meyering  <jim@meyering.net>
1541
1542         chmod: don't ignore a dangling symlink
1543         * NEWS: Mention the bug fix.
1544         * src/chmod.c (process_file): Handle the case of FTS_SLNONE,
1545         i.e., give a diagnostic saying we cannot operate on such a file.
1546         * tests/chmod/thru-dangling: Compare new stderr output with expected.
1547
1548 2007-09-07  Bob Proulx  <bob@proulx.com>
1549
1550         Add a test: demonstrate that chmod ignores a dangling symlink
1551         * tests/chmod/thru-dangling: New test.  Fails.
1552         * tests/chmod/Makefile.am (TESTS): Add thru-dangling.
1553
1554 2007-09-05  Jim Meyering  <jim@meyering.net>
1555
1556         Adapt to new SELinux behavior: "?" vs. new "unlabeled"
1557         * src/ls.c (gobble_file): Interpret the new "unlabeled" indicator
1558         from getfilecon/lgetfilecon the same way we interpret a negative
1559         return value: no security context.  So we don't print the "+".
1560         * tests/selinux: Recognize that "unlabeled" means insufficient
1561         support for SELinux, just like "?".
1562
1563 2007-09-03  Jim Meyering  <jim@meyering.net>
1564
1565         Invoke $(AUTOCONF) manually, if needed to get an updated version string.
1566         * GNUmakefile: Don't actually touch configure.ac.
1567         That would make git-version-gen always print "...-dirty".
1568
1569         Don't change '-'s to '.'s in the string from git-describe.
1570         * build-aux/git-version-gen: Leave '-'s in the string from git-describe.
1571         Otherwise, s/-/./g would make it too hard to distinguish the base
1572         version number from the appended .DD suffixes.
1573
1574 2007-09-03  Jim Meyering  <jim@meyering.net>
1575
1576         * README-hacking: Require rsync, rather than wget.
1577
1578 2007-09-02  Jim Meyering  <jim@meyering.net>
1579
1580         * bootstrap (WGET_COMMAND): Remove code to set this variable.
1581
1582         Ensure that $(VERSION) is up to date for dist-related targets.
1583         * GNUmakefile: Arrange to rerun autoconf, if the version reported by
1584         git-version-gen doesn't match $(VERSION), but only for dist targets.
1585
1586         bootstrap: uses rsync to download the .po files
1587         * bootstrap (po_download_command_format): New global.
1588         (download_po_files): Use rsync.
1589         (update_po_files): Don't remove .po files after download,
1590         so future rsync runs can take advantage of the copies.
1591
1592 2007-09-01  Jim Meyering  <jim@meyering.net>
1593
1594         * bootstrap (gnulib_tool): Make sha1sum check quietly.
1595
1596         Ensure that snapshot version changes make it to groups, too.
1597         * src/Makefile.am (groups): Depend on Makefile.
1598
1599         Make groups-version executable,
1600         * tests/misc/groups-version: ... as it was in the patch.
1601
1602 2007-08-31  Eric Blake  <ebb9@byu.net>
1603
1604         Test yesterday's change to groups.
1605         * tests/misc/groups-version: New test.
1606         * tests/misc/Makefile.am (TESTS): Add groups-version.
1607
1608 2007-08-31  Jim Meyering  <jim@meyering.net>
1609
1610         Solve the unnecessary-.po-file-regeneration problem once and for all.
1611         * bootstrap (download_po_files): New function, renamed from
1612         get_translations.  Now, downloads, but doesn't update LINGUAS.
1613         (update_po_files): New function.
1614
1615 2007-08-30  Jim Meyering  <jim@meyering.net>
1616
1617         Shorten the snapshot version string by removing the "g".
1618         * build-aux/git-version-gen: Remove git-describe's "g" that would
1619         always precede the abbreviated SHA1.  Suggestion from Dmitry V. Levin.
1620
1621         Perform the s,rm,/bin/rm, fix-up properly.  No more kludge.
1622         * Makefile.am (EXTRA_DIST): Remove .kludge-stamp.
1623         (.kludge-stamp): Remove rule.  Instead, ...
1624         (dist-hook): Do the job here, operating on the file in $(distdir).
1625         (rm_subst): Adjust regexp to match "rm -f rm$(EXEEXT)", not "rm -f rm".
1626         (MAINTAINERCLEANFILES): s/+=/=/, now that this is the sole use.
1627         (dist-hook): Remove the legacy-from-cvs install-sh is-executable check.
1628         * .gitignore: Remove .kludge-stamp.
1629
1630         Make inter-release --version output more useful.
1631         Now, each snapshot has a version "number" like 6.9-219-g58ddd,
1632         which indicates that it is built using the 219th change set
1633         (in _some_ repository) following the "v6.9" tag, and that 58ddd
1634         is a prefix of the commit SHA1.
1635         * build-aux/git-version-gen: New file.
1636         * configure.ac: Run it to set the version.
1637         * Makefile.am (dist-hook): Arrange so that .version appears only
1638         in distribution tarballs, never in a checked-out repository.
1639         * .gitignore: Add .version here, too.  Just in case.
1640
1641 2007-08-30  Eric Blake  <ebb9@byu.net>
1642
1643         * src/.gitignore: Ignore *.exe for platforms with non-empty $(EXEEXT).
1644
1645 2007-08-30  Eric Blake  <ebb9@byu.net>
1646
1647         Use PACKAGE_NAME instead of GNU_PACKAGE.
1648         * src/Makefile.am (.sh, uninstall-local): Adjust all users of
1649         hand-rolled GNU_PACKAGE to instead use autoconf-provided
1650         PACKAGE_NAME.
1651         * src/basename.c (main): Likewise.
1652         * src/chroot.c (main): Likewise.
1653         * src/dirname.c (main): Likewise.
1654         * src/echo.c (main): Likewise.
1655         * src/expr.c (main): Likewise.
1656         * src/factor.c (main): Likewise.
1657         * src/groups.sh (version): Likewise.  Also, reflect change in
1658         --version output due to GPLv3.
1659         * src/hostid.c (main): Likewise.
1660         * src/hostname.c (main): Likewise.
1661         * src/link.c (main): Likewise.
1662         * src/logname.c (main): Likewise.
1663         * src/nice.c (main): Likewise.
1664         * src/nohup.c (main): Likewise.
1665         * src/printenv.c (main): Likewise.
1666         * src/printf.c (main): Likewise.
1667         * src/pwd.c (main): Likewise.
1668         * src/setuidgid.c (main): Likewise.
1669         * src/sleep.c (main): Likewise.
1670         * src/system.h (case_GETOPT_VERSION_CHAR): Likewise.
1671         * src/test.c (main): Likewise.
1672         * src/true.c (main): Likewise.
1673         * src/unlink.c (main): Likewise.
1674         * src/uptime.c (main): Likewise.
1675         * src/users.c (main): Likewise.
1676         * src/whoami.c (main): Likewise.
1677         * src/yes.c (main): Likewise.
1678         * configure.ac (AC_CHECK_DECLS): No need to check strtoimax,
1679         strtoumax, since gnulib does this.
1680
1681 2007-08-30  Jim Meyering  <jim@meyering.net>
1682
1683         Ensure that TMPDIR is valid.  Otherwise, it would cause test failures.
1684         * tests/misc/tty-eof: Set TMPDIR=.
1685         * tests/misc/sort-compress: Likewise.
1686
1687         Use EXIT_FAILURE, not EXIT_FAIL, now that EXIT_FAILURE is always 1.
1688         * src/system.h (EXIT_FAIL): Remove definition.
1689         * src/chroot.c (main): EXIT_FAIL -> EXIT_FAILURE.
1690         * src/env.c (main): Likewise.
1691         * src/nice.c (main): Likewise.
1692         * src/su.c (change_identity, main): Likewise.
1693         * src/tty.c (main): Likewise.
1694         Suggestion from Eric Blake.
1695
1696 2007-08-28  Jim Meyering  <jim@meyering.net>
1697
1698         * src/test.c (usage): Note that [ honors --help and --version,
1699         but that test does not.  Suggestion from Dan Jacobson.
1700
1701         By default, do not install hostname anymore; no kidding, this time.
1702         * src/Makefile.am (EXTRA_PROGRAMS): Remove hostname from this list,
1703         now that it's no longer being installed by default.  This should
1704         have been part of the 2007-08-21 change.
1705         (check-duplicate-no-install): New rule to ensure this doesn't
1706         happen again.
1707         (check): Depend on it.
1708
1709         Reflect renaming: mreadlink-with-size -> areadlink-with-size.
1710         * bootstrap.conf: Update module name.
1711         * src/copy.c (copy_internal): Update header and function names.
1712         * src/ls.c (get_link_name): Likewise.
1713         * src/readlink.c (main): Likewise.
1714         * src/stat.c (print_stat): Likewise.
1715
1716         Add file system type names and magic numbers from "man 2 statfs".
1717         * src/stat.c (human_fstype): Also handle BEFS, BFS, BINFMT_MISC,
1718         FUSECTL, HUGETLBFS, NFSD and OPENPROM.
1719
1720 2007-08-27  Jim Meyering  <jim@meyering.net>
1721
1722         Add some file system type names and magic numbers from glibc.
1723         * src/stat.c (human_fstype): Add any file system names and values
1724         present in glibc's linux_fsinfo.h but not in this list.
1725         Alphabetize the S_* names and capitalize the hexadecimal constants.
1726
1727 2007-08-26  Jim Meyering  <jim@meyering.net>
1728
1729         * tests/misc/fold: Fix a typo: missing \ in a diagnostic
1730         no one is likely ever to see.
1731
1732 2007-08-25  Jim Meyering  <jim@meyering.net>
1733
1734         * src/dircolors.hin: Add .dz and .svgz as archive suffixes.
1735
1736         Remove all .cvsignore files from version control.
1737
1738 2007-08-24  Jim Meyering  <jim@meyering.net>
1739
1740         bootstrap: Ignore more.
1741         * bootstrap (symlink_to_dir): Add a directory name like
1742         uniwidth to e.g., lib/.gitignore.
1743         (slurp): Handle the sys_stat_.h -> sys mapping, too.
1744         * .hgignore: Remove this file, too.
1745         * Makefile.am (EXTRA_DIST): Remove .gitignore and .hgignore.
1746
1747         No longer version-control .???ignore files in lib/, m4/, and po/.
1748         * .gitignore: Ignore a few files in lib/, m4/, and po/ that are not
1749         picked up automatically.
1750         * lib/.gitignore, lib/.cvsignore: Remove files.
1751         * m4/.gitignore, m4/.cvsignore: Remove files.
1752         * po/.gitignore, po/.cvsignore: Remove files.
1753
1754         bootstrap: when fetching .po files, do not remove .gmo files.
1755         * bootstrap (get_translations): Don't remove *.gmo files!
1756         They can be expensive to regenerate.
1757
1758         Create .gitignore and/or .cvsignore from scratch, if absent.
1759         This is in preparation for my removing those files from version
1760         control in the directories managed by gnulib-tool.
1761         * bootstrap: New setting: vc_ignore.
1762         (insert_sorted_if_absent): Create $file if absent.
1763         Adapt to new, possibly empty, list: $vc_ignore.
1764
1765         * src/system.h (fseeko, ftello): Remove now-unneeded definitions.
1766         * src/od.c (LDBL_DIG): Remove now-unneeded definition.
1767
1768         Arrange to use tag names like vM.N, rather than COREUTILS-M_N.
1769         * Makefile.maint (this-vc-tag) [git]: Simply use v$(VERSION).
1770         (this-vc-tag-regexp): New variable.
1771         (vc-tag-check): Use it, rather than $(this-vc-tag).
1772
1773 2007-08-23  Jim Meyering  <jim@meyering.net>
1774
1775         * src/dircolors.hin: Add xterm-16color, xterm-88color and eterm-color.
1776         Suggestion from Dan Nicolaescu.
1777
1778         Don't let ln be a party to destroying user data.
1779         * src/ln.c: Include "file-set.h", "hash.h" and "hash-triple.h".
1780         (dest_set, DEST_INFO_INITIAL_CAPACITY): New globals.
1781         (do_link): Refuse to remove a just-created link.
1782         Record a name,dev,ino triple for each link we create.
1783         (main): Initialize dest_set, if needed.
1784         * tests/mv/childproof: Test for the above fix.
1785         * NEWS: Document this.
1786         Reported by Eric Blake.
1787
1788         Move functions from copy.c into new modules, since ln needs them, too.
1789         * bootstrap.conf (gnulib_modules): Add file-set.
1790         * gl/lib/file-set.c (record_file, seen_file): Functions from copy.c.
1791         * gl/lib/file-set.h: Add prototypes.
1792         * gl/lib/hash-triple.c (triple_hash, triple_hash_no_name):
1793         (triple_compare, triple_free): Functions from copy.c.
1794         * gl/lib/hash-triple.h (struct F_triple): Define.  From copy.c.
1795         Add prototypes.
1796         * gl/modules/file-set: New module.
1797         * gl/modules/hash-triple: New module.
1798         * src/Makefile.am (copy_sources): New variable.
1799         (ginstall_SOURCES, cp_SOURCES, mv_SOURCES): Use it.
1800         * src/copy.c: Include hash-triple.h.
1801         No longer include hash-pjw.h.
1802         (copy_internal): Don't pass a NULL third argument to record_file,
1803         since that function no longer accepts that.
1804         (record_file): Move this function to file-set.c.
1805         Along the way, remove the code to allow a NULL stat-buffer pointer.
1806         Adjust sole caller.
1807         (seen_file): Move this function to file-set.c.
1808         (struct F_triple): Move declaration to hash-triple.h.
1809         (triple_compare, triple_free, triple_hash, triple_hash_no_name):
1810         Move these functions to hash-triple.c.
1811
1812         bootstrap: generate more ignorable names
1813         * bootstrap (slurp): When generating ignorable names, also map
1814         .sin to .sed, .gperf to .c, and .y to .c.
1815
1816         * Makefile.maint (patch-check): Don't remove temporaries upon failure.
1817
1818 2007-08-22  Jim Meyering  <jim@meyering.net>
1819
1820         * src/c99-to-c89.diff: Adjust offsets.
1821
1822         Change "rm --verbose -r a//" not to print extra slashes in a///b
1823         * src/remove.c (push_dir): Don't copy trailing slashes onto the stack.
1824         Reported by François Pinard.
1825         * tests/rm/v-slash: New file.  Test for the above change.
1826         * tests/rm/Makefile.am (TESTS): Add v-slash.
1827
1828         * src/date.c: Don't include "getline.h", now removed from gnulib;
1829         its declarations are now in <stdio.h>.
1830         * src/md5sum.c: Likewise.
1831         * src/dircolors.c: Likewise.
1832
1833         * src/copy.c (DEST_INFO_INITIAL_CAPACITY): Correct a comment.
1834
1835 2007-08-21  Jim Meyering  <jim@meyering.net>
1836
1837         By default, do not install hostname anymore.
1838         * configure.ac: Add "hostname" to the list of not-installed programs.
1839         * src/Makefile.am (no_install__progs): Add "hostname" here, too.
1840         * NEWS: Mention this.
1841
1842 2007-08-20  Bob Proulx  <bob@proulx.com>
1843
1844         Clarify touch documentation of file arguments.
1845         * src/touch.c (usage): Improve wording of documentation regarding
1846         file argument handling and special handling of - argument.
1847         * doc/coreutils.texi (touch invocation): Likewise.
1848         Documentation problem reported by Vincent Lefevre.
1849
1850 2007-08-20  Paul Eggert  <eggert@cs.ucla.edu>
1851
1852         * NEWS: The old cp -p bug affected coreutils releases before 6.0.
1853         Problem reported by Soren Spies in
1854         <http://lists.gnu.org/archive/html/bug-coreutils/2007-08/msg00106.html>.
1855         To be conservative, just say the bug was in all versions through 6.6.
1856
1857 2007-08-19  Eric Blake  <ebb9@byu.net>
1858
1859         Avoid consuming too much seekable input when yesno is used.
1860         * bootstrap.conf (gnulib_modules): Add closein.
1861         * src/system.h (includes): Also include closein.h.
1862         * src/mv.c (main): Use close_stdin, not close_stdout.
1863         * src/cp.c (main): Likewise.
1864         * src/ln.c (main): Likewise.
1865         * src/rm.c (main): Likewise.
1866         * src/install.c (main): Likewise.
1867         * NEWS: Document the fix.
1868
1869 2007-08-20  Jim Meyering  <jim@meyering.net>
1870
1871         Parallel "make check" support.
1872         * build-aux/check.mk: New file, from The Vaucanson Group.
1873         * .x-sc_GPL_version: New file, to allow "version 2 or later"
1874         in build-aux/check.mk.
1875         * Makefile.am (EXTRA_DIST): Add .x-sc_GPL_version.
1876         * tests/check.mk: New file.
1877         * tests/Makefile.am (EXTRA_DIST): Add check.mk, mkdtemp and test-lib.sh.
1878
1879         Begin factoring "sample-test" out of test scripts.
1880         * tests/test-lib.sh: New file, to be sourced by all tests that
1881         were previously derived from the "sample-test" template.
1882         * tests/mkdtemp: New file.
1883         * tests/touch/dir-1: Use test-lib.sh.
1884         * tests/touch/empty-file: Likewise.
1885         * tests/touch/fail-diag: Likewise.
1886         * tests/touch/fifo: Likewise.
1887         * tests/touch/no-create-missing: Likewise.
1888         * tests/touch/no-rights: Likewise.  Also, don't sleep.
1889         * tests/touch/not-owner: Likewise.
1890         * tests/touch/obsolescent: Likewise.
1891         * tests/touch/read-only: Likewise.
1892         * tests/touch/relative: Likewise.
1893         * tests/touch/Makefile.am: Include $(top_srcdir)/tests/check.mk,
1894         to get the parallel-"make check" bits.
1895
1896 2007-08-18  Jim Meyering  <jim@meyering.net>
1897
1898         Use new "idcache.h" header.
1899         * src/ls.c: Remove ancient declarations of getuser and getgroup.
1900         Include "idcache.h", instead.
1901
1902         Run each Coreutils.pm-based test in its own subdirectory.
1903         * tests/CuTmpdir.pm: New file.
1904         * tests/Makefile.am (EXTRA_DIST): Add CuTmpdir.pm.
1905         * tests/misc/od, tests/misc/base64, tests/misc/basename:
1906         * tests/misc/cut, tests/misc/date, tests/misc/dirname:
1907         * tests/misc/expand, tests/misc/fold, tests/misc/head-elide-tail:
1908         * tests/misc/paste-no-nl, tests/misc/pr, tests/misc/sha224sum:
1909         * tests/misc/sha256sum, tests/misc/sha384sum, tests/misc/sha512sum:
1910         * tests/misc/sort-merge, tests/misc/stat-printf, tests/misc/test-diag:
1911         * tests/misc/wc-files0-from, tests/misc/xstrtol:
1912         * tests/dd/skip-seek, tests/dircolors/simple, tests/du/files0-from:
1913         * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
1914         * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
1915         * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
1916         * tests/sum/basic-1, tests/tsort/basic-1, tests/unexpand/basic-1:
1917         * tests/mv/i-1, tests/rm/empty-name, tests/rm/unreadable: Use it.
1918         * tests/misc/test-diag: Use "$ENV{abs_top_builddir}/src/test",
1919         not "../../src/test", so it works when run from a subdirectory.
1920         * tests/ls-2/tests: Create temp files and dirs from within the perl
1921         script, so that they're removed, when run from a subdirectory.
1922         * tests/ls-2/Makefile.am (TESTS_ENVIRONMENT): Define abs_top_builddir,
1923         so we can use "$ENV{abs_top_builddir}/src/test" in a test script.
1924
1925 2007-08-16  Jim Meyering  <jim@meyering.net>
1926
1927         Consolidate od tests.
1928         * tests/misc/od: Perform od-zero-len's test here.
1929         Include boilerplate code, so tests run in a subdirectory.
1930         * tests/misc/od-zero-len: Remove this file.
1931
1932         * tests/ls/time-1: Include sample-test boilerplate code.
1933         Remove the then-unnecessary, hard-coded envvar "unset" commands.
1934
1935 2007-08-15  Jim Meyering  <jim@meyering.net>
1936
1937         Move a slow test into tests/misc.
1938         * tests/ls/time-1: Move this file to tests/misc/ls-time.
1939         * tests/misc/ls-time: New file.  From tests/ls/time-1.
1940         * tests/ls/Makefile.am (TESTS): Remove time-1.
1941         * tests/misc/Makefile.am (TESTS): Add ls-time.
1942
1943         od --skip (-j) works even on files in /proc, when the kernel lies
1944         * src/od.c (skip): Don't let kernel misinformation (nonempty files
1945         in /proc with stat.st_size == 0) make "od -j N" misbehave.
1946         Patch by Paul Eggert.
1947         * NEWS: Document this work-around.
1948         * tests/misc/od-zero-len: New file, test for the above.
1949
1950         * src/printf.c (usage): Adjust summary to also mention OPTIONs.
1951         From Karl Berry.
1952
1953 2007-08-14  Jim Meyering  <jim@meyering.net>
1954
1955         od: fix a bug that arises when skipping exact length of file
1956         * NEWS: Document the bug fix.
1957         * src/od.c (skip): Call fseek even when n_skip is exactly the
1958         same as the length of the current file.  Otherwise, the next
1959         iteration would use unadjusted input stream pointer, thus ignoring
1960         the desired "skip".  Report and patch by Paul GHALEB.
1961
1962         * tests/misc/od: New file, test for the above.
1963         * tests/misc/Makefile.am (TESTS): Add od.
1964
1965 2007-08-10  Paul Eggert  <eggert@cs.ucla.edu>
1966
1967         Accommodate more xstrtol changes.
1968         * src/df.c (long_options): Don't bother prepending "--" to long
1969         options that OPT_STR might decode, as that hack is no longer needed.
1970         (main): Invoke xstrtol_fatal rather than STRTOL_FATAL_ERROR.
1971         * src/du.c (long_options, main): Likewise.
1972         * src/ls.c (decode_switches): Likewise.
1973         * src/od.c (long_options, main): Likewise.
1974         * src/pr.c (first_last_page, main): Likewise.
1975         * src/sort.c (long_options, specify_sort_size): Likewise.
1976         * src/pr.c (first_last_page): Accept option index and option char
1977         instead of an assembled option string.  All callers changed.
1978         * src/sort.c (specify_sort_size): Likewise.
1979         * src/system.h (OPT_STR, LONG_OPT_STR, short_opt_str, OPT_STR_INIT):
1980         Remove.
1981
1982 2007-08-05  Jim Meyering  <jim@meyering.net>
1983
1984         Encapsulate a static variable.
1985         * src/system.h (opt_str_storage): Move static var into...
1986         (short_opt_str): ... new static inline function.
1987         (OPT_STR): Use the new function.
1988
1989 2007-08-04  Jim Meyering  <jim@meyering.net>
1990
1991         Exercise xstrtol's diagnostics via pr's --pages option.
1992         * tests/misc/xstrtol: New file.
1993         * tests/misc/Makefile.am (TESTS): Add xstrtol.
1994
1995 2007-08-04  Paul Eggert  <eggert@cs.ucla.edu>
1996
1997         Adapt to new human and xstrtol API.
1998         * src/df.c (long_options): Prepend "--" to long options that
1999         OPT_STR might decode.
2000         * src/du.c (long_options): Likewise.
2001         * src/od.c (long_options): Likewise.
2002         * src/sort.c (long_options): Likewise.
2003         * src/df.c (main): Adjust to new human and xstrtol API.
2004         * src/du.c (main): Likewise.
2005         * src/ls.c (decode_switches): Likewise.
2006         * src/od.c (main): Likewise.
2007         * src/pr.c (first_last_page): Likewise.  New argument OPTION.
2008         All callers changed.
2009         * src/sort.c (specify_sort_size): New arg OPTION.  All callers
2010         changed.  Adjust to new xstrtol API.
2011         * src/system.h (opt_str_storage): New static var.
2012         (OPT_STR, LONG_OPT_STR, OPT_STR_INIT): New macros.
2013
2014 2007-08-02  Jim Meyering  <jim@meyering.net>
2015
2016         Adjust one more test to accommodate the recent fts change.
2017         This matters only on systems with insufficient openat support.
2018         * tests/du/inacc-dest: Adjust expected diagnostic.
2019
2020         Adjust the other two "no-x" tests and unify all three.
2021         * tests/du/no-x: Factor out du-specific bits.
2022         * tests/chmod/no-x: Use the same code.
2023         * tests/chgrp/no-x: Use the same code.
2024
2025         Adapt du's no-x test not to fail on older Linux systems.
2026         * tests/du/no-x: Accept a third variant of the diagnostic.
2027
2028 2007-07-31  Jim Meyering  <jim@meyering.net>
2029
2030         du: print size (probably incomplete) of each inaccessible directory
2031         * src/du.c (process_file): Print what we know of the size of a
2032         directory even when it is inaccessible.  What we print is just the
2033         size of the directory itself, not counting any of its contents.
2034         * tests/du/inacc-dir: Test for this.
2035         * NEWS: Mention this change.
2036
2037         Add a test for du not counting size of inaccessible directories.
2038         * tests/du/inacc-dir: New file. Test for fts.c bug fixed yesterday.
2039         * tests/du/Makefile.am (TESTS): Add inacc-dir.
2040         * NEWS: Mention the bug fix.
2041
2042 2007-07-28  Jim Meyering  <jim@meyering.net>
2043
2044         Attempt to copy a regular file, even if stat says it is empty.
2045         * NEWS: Document this bug fix.
2046         * src/copy.c (copy_reg): Read from a regular file, even if it
2047         appears (stat.st_size == 0) to be empty.  This reverts an
2048         optimization introduced on 2005-11-23 for coreutils-6.0.
2049         Otherwise, "cp /proc/cpuinfo /tmp" creates an empty file,
2050         on e.g., linux-2.6.20.
2051         * tests/cp/proc-zero-len: New file.  Test for the above.
2052         * tests/cp/Makefile.am (TESTS): Add proc-zero-len.
2053         Reported by Dan BerrangĂ©.
2054
2055 2007-07-26  Bob Proulx  <bob@proulx.com>
2056
2057         sort: Improve sort --random-sort test.
2058         * tests/misc/sort-rand: If "locale" is available pick a random
2059         non-C locale and check "sort --random-sort" behavior using it.
2060
2061 2007-07-24  Jim Meyering  <jim@meyering.net>
2062
2063         sort: add a test to exercise the affected code.
2064         * tests/sort/Test.pm (realloc-buf): Exercise the code that changed
2065         yesterday.  No other test in all of "make check" does this.
2066         * NEWS: Mention the fix.
2067
2068 2007-07-23  Paul Eggert  <eggert@cs.ucla.edu>
2069
2070         sort: avoid unaligned access.
2071         * src/sort.c (fillbuf): When enlarging the line buffer, ensure that
2072         the new size is a multiple of "sizeof (struct line)".  This avoids
2073         alignment problems when indexing from the end of the buffer.
2074         Problem reported by Andreas Schwab in
2075         <http://lists.gnu.org/archive/html/bug-coreutils/2007-07/msg00158.html>.
2076
2077 2007-07-23  Jim Meyering  <jim@meyering.net>
2078
2079         Update all copyright notices to use the newer form (e.g., remove
2080         the postal address, and add the 'licenses' URL).
2081
2082         * COPYING: Update to Version 3.
2083
2084         Update c99/c89 patch for new, copyright-change-induced offsets.
2085         * Makefile.maint (patch-check): Filter out '^Only in...' lines.
2086         * src/c99-to-c89.diff: Handle new c99'isms in seq.c.
2087
2088 2007-07-22  Jim Meyering  <jim@meyering.net>
2089
2090         * configure.ac: Arrange to rerun configure whenever src/Makefile.am
2091         changes.  That file contains the list of program names that must be
2092         substituted into files like man/Makefile.
2093         Add quotes around AC_SUBST arguments.
2094
2095 2007-07-21  Paul Eggert  <eggert@cs.ucla.edu>
2096
2097         * bootstrap (slurp): Work even in environments where "ls" defaults
2098         to "ls -A".  Put in a FIXME, though, since the current code does
2099         not slurp files whose names start with ".", and this looks like
2100         it might be a troublesome area.
2101
2102 2007-07-20  Jim Meyering  <jim@meyering.net>
2103
2104         Document and add a test for today's sort bug fix.
2105         * NEWS: Describe the bug fix.
2106         * tests/sort/Test.pm (obs-inval): Add a test for today's fix.
2107
2108 2007-07-20  Andreas Schwab  <schwab@suse.de>
2109
2110         * src/sort.c (main): Don't free a pointer to non-malloc'd memory.
2111
2112 2007-07-19  Jim Meyering  <jim@meyering.net>
2113
2114         Fix a portability bug in the new ls-color test.
2115         * tests/ls/stat-free-symlinks: Don't rely on the ability of
2116         a built-in printf to interpolate '\e'.  Use '\033' instead.
2117
2118 2007-07-18  Jim Meyering  <jim@meyering.net>
2119
2120         "cp -i --update older newer" no longer prompts; same for mv
2121         * src/copy.c (copy_internal): Perform "update" check before the
2122         possible interactive prompt.  Reported by zeno_AT_biyg_DOT_org
2123         in <http://bugzilla.redhat.com/248591>
2124         * tests/mv/update: Add tests for the above.
2125         * NEWS: Mention the bug fix.
2126
2127 2007-07-15  Jim Meyering  <jim@meyering.net>
2128
2129         ls --color: Don't stat symlinks when neither ORPHAN nor MISSING
2130         attribute has a color.
2131         * src/ls.c (main): Don't set check_symlink_color when C_EXEC is
2132         colored, unless ln=target (aka color_symlink_as_referent) is set.
2133         (gobble_file): Set f->linkok = true also when !check_symlink_color.
2134         http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/10608/focus=10927
2135         Reported by Jeremy Maitin-Shepard.
2136         * tests/strace: New file, contents extracted from...
2137         * tests/mv/atomic: ...here.  Source strace.
2138         * tests/ls/stat-free-symlinks: New file.  Test for the above.
2139         Use strace to ensure that in this corner case, ls does not call stat.
2140         * tests/ls/Makefile.am (TESTS): Add stat-free-symlinks.
2141         * tests/Makefile.am (EXTRA_DIST): Add strace.
2142
2143 2007-07-14  Jim Meyering  <jim@meyering.net>
2144
2145         Remove long-deprecated options.
2146         * NEWS: Mention this.
2147         * src/df.c, src/ls.c: Remove --kilobytes option.
2148         * src/du.c: Remove --kilobytes and --megabytes options.
2149         * src/who.c: Remove -i and --idle options.
2150         * src/ptx.c: Remove --copyright option.
2151
2152         Change interface: make 2nd param _space_-separated, not comma-separated
2153         * m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG): Remove now-
2154         unnecessary use of tr.
2155         Improve comments.
2156         * configure.ac: Adjust caller, as well as the code that ensures the
2157         2nd parameter stays in sync with the list in src/Makefile.am.
2158
2159 2007-07-14  Karel Zak  <kzak@redhat.com>
2160
2161         * m4/include-exclude-prog.m4 (gl_REMOVE_PROG): Fix typo: s/$2/$1/.
2162         (gl_INCLUDE_EXCLUDE_PROG): Quote first use of $2 parameter.
2163         Don't mix comma- and space-separated lists.
2164         Patch from Karel Zak.
2165
2166 2007-07-13  Jim Meyering  <jim@meyering.net>
2167
2168         Warn about non-portable use of unescaped backslash at end of string,
2169         and treat it as if it were escaped.
2170         * src/tr.c (unquote): Considering that such usage would make GNU tr
2171         from coreutils-5.2.1 and earlier *fail*, the least we can do now is
2172         to warn about it.  Solaris' tr ignores it.
2173         * NEWS: Mention this.
2174
2175         Use proper backslash-quoting inside backticks.
2176         * configure.ac: Otherwise we run afoul of strict GNU tr:
2177         a string ending in a lone backslash would provoke a failure.
2178
2179 2007-07-12  Jim Meyering  <jim@meyering.net>
2180
2181         Expand default-no-install prog list in ./configure --help output,
2182         and fix some []-quoting bugs in sed expressions.
2183         * configure.ac: Hard-code the list, "arch,su" here as well
2184         as in src/Makefile.am, and ensure the two stay in sync.
2185         * m4/include-exclude-prog.m4 (gl_INCLUDE_EXCLUDE_PROG): Use $2,
2186         rather than the nearly-equivalent shell variable.
2187         Karel Zak reported that ./configure --help's output included
2188         the literal string, $gl_no_install_progs_default.
2189
2190         Clean up include-exclude-prog.m4.
2191         * m4/include-exclude-prog.m4 (gl_ADD_PROG): Don't modify MAN.
2192         (gl_REMOVE_PROG): Likewise.
2193         Add omitted "\>" in sed regexp.
2194         Remove any leading or trailing spaces.
2195         (gl_ADD_PROG): Remove any leading space.
2196         * configure.ac: Instead, derive $MAN from $optional_bin_progs.
2197         Append $(EXEEXT) to *all* names, not just the first one.
2198
2199 2007-07-11  Jim Meyering  <jim@meyering.net>
2200
2201         If there's a GPL vN copyright comment, require that N == 3.
2202         * Makefile.maint (sc_GPL_version): New rule.
2203         * tests/misc/arch: Fix the sole violation.
2204
2205 2007-07-10  Jim Meyering  <jim@meyering.net>
2206
2207         Skip "arch" test if it's not built.
2208         * tests/misc/Makefile.am (built_programs): Define.
2209         (TESTS_ENVIRONMENT): Add $(built_programs), for...
2210         * tests/misc/arch: ...this: skip the test if arch is not built.
2211         * src/Makefile.am (built_programs.list): New rule.
2212         * tests/Makefile.am (built_programs): Rename from all_programs.
2213         (TESTS_ENVIRONMENT): Use built_programs, not all_programs.
2214         * tests/help-version: Likewise.
2215         * NEWS: Mention that using --enable-no-install-program=X may
2216         cause "make check" to fail.
2217
2218         Add support for enabling/disabling installation of specified programs.
2219         * NEWS: Mention new configure-time options.
2220         Mention that neither arch nor su is built/installed, by default.
2221         * m4/include-exclude-prog.m4: New file.
2222         * configure.ac: Use new macro, gl_ADD_PROG, rather than
2223         manually appending to OPTIONAL_BIN_PROGS and MAN.
2224         Move the code that adds "df" to the list of programs to build from
2225         m4/jm-macros into this file.
2226         Use gl_INCLUDE_EXCLUDE_PROG, then handle special cases: ginstall, [.
2227         (NO_INSTALL_PROGS_DEFAULT): AC_SUBST it.  Used by man/Makefile.am.
2228         * man/Makefile.am (dist_man_MANS): Remove from this list all man pages
2229         corresponding to "bin" programs. Add $(MAN) instead.
2230         (optional_mans): Remove all uses.
2231         (check-x-vs-1): Adapt to work even though arch and su are typically
2232         no longer built (and neither are their .1 files).
2233         * src/Makefile.am (install_su): Rename from INSTALL_SU, now that
2234         INSTALL_SU has a different meaning. Use the new $(INSTALL_SU) value.
2235
2236 2007-07-10  Karel Zak  <kzak@redhat.com>
2237
2238         New program: arch
2239         * NEWS: Mention arch.
2240         * README: Add arch to the list of programs.
2241         * AUTHORS: Add arch.
2242         * src/uname.c: Include "uname.h".
2243         (PROGRAM_NAME): Handle arch, too.
2244         (ARCH_AUTHORS): Define.
2245         (uname_long_options, arch_long_options): Renamed and new globals.
2246         (usage): Handle arch-mode as well as uname-mode.
2247         (decode_switches): New function, extracted from main,
2248         to handle arch-mode as well as uname-mode.
2249         (main): Handle both modes.
2250         * src/uname-arch.c: New program, alias for "uname -m".
2251         * src/uname-uname.c: New file, default uname mode.
2252         * src/uname.h: New file, uname modes.
2253         * src/Makefile.am (EXTRA_PROGRAMS): Add arch.
2254         (uname_SOURCES, arch_SOURCES): Define.
2255         * man/arch.x: New file.
2256         * man/Makefile.am (dist_man_MANS): Add arch.1.
2257         (arch.1): New dependency.
2258         * tests/misc/arch: New test, compare "arch" with "uname -m"
2259         * configure.ac (OPTIONAL_BIN_PROGS): Add arch.
2260         (MAN): Add arch.1.
2261         * .x-sc_require_config_h: Exempt uname-arch.c and uname-uname.c
2262         from the always-include-<config.h> rule.
2263
2264 2007-07-10  Jim Meyering  <jim@meyering.net>
2265
2266         Change "version 2" to "version 3" in all copyright notices.
2267
2268 2007-07-09  Jim Meyering  <jim@meyering.net>
2269
2270         Compensate for new c99'isms in seq.c.
2271         * Makefile.maint (patch-check): Use -p1, not -p2, so a patch
2272         generated via "make patch-check REGEN=1" actually works.
2273         * src/c99-to-c89.diff: Handle new c99'isms in seq.c.
2274
2275 2007-07-09  Pádraig Brady <P@draigBrady.com>
2276
2277         Fix the automatic number width formatting in seq.
2278         * src/seq.c: Fix the -w logic. Ignore spaces and '+'
2279         characters of input numbers when determining width.
2280         Set format correctly for input numbers in scientific notation.
2281         * tests/seq/basic: Add various number width tests.
2282         Details: <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/10903>
2283
2284 2007-07-08  Jim Meyering  <jim@meyering.net>
2285
2286         Run the coreutils-specific code only if tests/Makefile.am.in exists.
2287         * bootstrap (mam_template): Move definition out of loop.
2288
2289         Create symlinks for gl/{lib,m4}/*, just as for gnulib/{lib,m4}/*.
2290         * bootstrap (symlink_to_dir): Rename function from symlink_to_gnulib.
2291         Add a directory parameter.  Update all callers.
2292         (cp_mark_as_generated): Also check for -- and link to -- files in gl/.
2293
2294         * THANKS: Add Pádraig Brady.
2295
2296 2007-07-08  Jim Meyering  <jim@meyering.net>
2297
2298         Adapt to deeper hierarchy in gnulib.
2299         * bootstrap (symlink_to_dir): If the destination directory doesn't
2300         exist, create it. This is required at least for "lib/uniwidth/cjk.h".
2301
2302         Use <wchar.h>, not "wcwidth.h".
2303         * src/wc.c: Now that gnulib provides the POSIX-specified <wchar.h>,
2304         include it and <wctype.h>, rather than "wcwidth.h".
2305         * src/ls.c: Include <wchar.h>, rather than "wcwidth.h".
2306
2307 2007-07-05  Jim Meyering  <jim@meyering.net>
2308
2309         setuidgid: set all groups, not just the primary one.
2310         I wanted to use the xgetgroups function from id.c, so factored
2311         it out and made it into a non-exiting function (hence the "m"
2312         prefix rather than "x").
2313         * src/setuidgid.c (main): Use mgetgroups.
2314         Include "mgetgroups.h".
2315
2316         * src/id.c (xgetgroups): Remove function.
2317         Include "mgetgroups.h".
2318         (print_group_list): Use mgetgroups, not xgetgroups.
2319
2320         * gl/modules/mgetgroups: New module.
2321         * gl/lib/mgetgroups.c: New file.  mgetgroups is derived from
2322         id.c's xgetgroups function.
2323         * bootstrap.conf (gnulib_modules): Add mgetgroups.
2324         * gl/m4/mgetgroups.m4: New file.
2325         * gl/lib/mgetgroups.h: New file.
2326
2327         * bootstrap: Merge in changes from gnulib.
2328
2329         * src/id.c: Include "getugroups.h" rather than declaring manually.
2330
2331 2007-07-04  Paul Eggert  <eggert@cs.ucla.edu>
2332
2333         * NEWS: pr -F no longer suppresses the footer or the first two blank
2334         lines in the header.
2335         * doc/coreutils.texi (pr invocation): Likewise.  Also, a too-short
2336         page length implies -t, not -T.
2337         * src/pr.c (lines_per_header, lines_per_footer): Now constants.
2338         (init_parameters): Don't try to change them.
2339         (print_header): Use the same header and footer format regardless of
2340         wither form feeds are being used.
2341         (usage): Adjust to above change when describing too-short page length.
2342         Too-short page length impliesy -t, not -T.
2343         * tests/pr/2-S_f-t_notab: Adjust to the fact that -F now affects
2344         only formfeed handling; it does not change the header.
2345         * tests/pr/2-Sf-t_notab: Likewise.
2346         * tests/pr/2f-t_notab: Likewise.
2347         * tests/pr/2s_f-t_notab: Likewise.
2348         * tests/pr/2s_w60f-t_nota: Likewise.
2349         * tests/pr/2sf-t_notab: Likewise.
2350         * tests/pr/2sw60f-t_notab: Likewise.
2351         * tests/pr/2w60f-t_notab: Likewise.
2352         * tests/pr/3a3f-0F: Likewise.
2353         * tests/pr/3b3f-0F: Likewise.
2354         * tests/pr/3b3f-0FF: Likewise.
2355         * tests/pr/3b3f-FF: Likewise.
2356         * tests/pr/3f-0F: Likewise.
2357         * tests/pr/3f-FF: Likewise.
2358         * tests/pr/Test.pm: Likewise.
2359         * tests/pr/a3f-0F: Likewise.
2360         * tests/pr/a3f-0FF: Likewise.
2361         * tests/pr/a3f-FF: Likewise.
2362         * tests/pr/b3f-0F: Likewise.
2363         * tests/pr/b3f-0FF: Likewise.
2364         * tests/pr/b3f-FF: Likewise.
2365         * tests/pr/3-5l17f-t: Remove, since it's been renamed to another
2366         file whose name has a line count 7 larger,
2367         reflecting the new line count needed for this behavior.
2368         * tests/pr/3a3l8f-t: Likewise.
2369         * tests/pr/3b3l8f-t: Likewise.
2370         * tests/pr/3l17f-t: Likewise.
2371         * tests/pr/3ml17f-t: Likewise.
2372         * tests/pr/Ja3l17f-lm: Likewise.
2373         * tests/pr/Jb3l17f-lm: Likewise.
2374         * tests/pr/Jml17f-lm-lo: Likewise.
2375         * tests/pr/W-72l17f-ll: Likewise.
2376         * tests/pr/W20l17f-ll: Likewise.
2377         * tests/pr/W26l17f-ll: Likewise.
2378         * tests/pr/W27l17f-ll: Likewise.
2379         * tests/pr/W28l17f-ll: Likewise.
2380         * tests/pr/W35Ja3l17f-lm: Likewise.
2381         * tests/pr/W35Jb3l17f-lm: Likewise.
2382         * tests/pr/W35Jml17f-lmlo: Likewise.
2383         * tests/pr/W35a3l17f-lm: Likewise.
2384         * tests/pr/W35b3l17f-lm: Likewise.
2385         * tests/pr/W35ml17f-lm-lo: Likewise.
2386         * tests/pr/W72Jl17f-ll: Likewise.
2387         * tests/pr/a3l17f-lm: Likewise.
2388         * tests/pr/a3l8f-t: Likewise.
2389         * tests/pr/b3l17f-lm: Likewise.
2390         * tests/pr/b3l8f-t: Likewise.
2391         * tests/pr/l17f-t: Likewise.
2392         * tests/pr/ml17f-0F: Likewise.
2393         * tests/pr/ml17f-lm-lo: Likewise.
2394         * tests/pr/ml17f-t: Likewise.
2395         * tests/pr/ml17f-t-0F: Likewise.
2396         * tests/pr/n+2-5l17f-0FF: Likewise.
2397         * tests/pr/n+2l17f-0FF: Likewise.
2398         * tests/pr/n+2l17f-bl: Likewise.
2399         * tests/pr/n+3l17f-0FF: Likewise.
2400         * tests/pr/n+3l17f-bl: Likewise.
2401         * tests/pr/n+3ml13f-bl-FF: Likewise.
2402         * tests/pr/n+3ml17f-bl-tn: Likewise.
2403         * tests/pr/n+3ml17f-tn-bl: Likewise.
2404         * tests/pr/n+4b2l10f-0FF: Likewise.
2405         * tests/pr/n+5-8b3l10f-FF: Likewise.
2406         * tests/pr/n+5a3l6f-0FF: Likewise.
2407         * tests/pr/n+6b3l6f-FF: Likewise.
2408         * tests/pr/nJml17f-lmlmlo: Likewise.
2409         * tests/pr/nJml17f-lmlolm: Likewise.
2410         * tests/pr/nN1+3l17f-bl: Likewise.
2411         * tests/pr/nN15l17f-bl: Likewise.
2412         * tests/pr/nSml13-bl-FF: Likewise.
2413         * tests/pr/nSml13-t-t-FF: Likewise.
2414         * tests/pr/nSml13-t-tFFFF: Likewise.
2415         * tests/pr/nSml17-bl-FF: Likewise.
2416         * tests/pr/nSml17-t-t-FF: Likewise.
2417         * tests/pr/nSml17-t-tFFFF: Likewise.
2418         * tests/pr/nl17f-bl: Likewise.
2419         * tests/pr/o3Jml17f-lm-lo: Likewise.
2420         * tests/pr/o3a3Sl17f-tn: Likewise.
2421         * tests/pr/o3a3Snl17f-tn: Likewise.
2422         * tests/pr/o3a3l17f-tn: Likewise.
2423         * tests/pr/o3b3Sl17f-tn: Likewise.
2424         * tests/pr/o3b3Snl17f-tn: Likewise.
2425         * tests/pr/o3b3l17f-tn: Likewise.
2426         * tests/pr/o3mSl17f-bl-tn: Likewise.
2427         * tests/pr/o3mSnl17fbltn: Likewise.
2428         * tests/pr/o3ml17f-bl-tn: Likewise.
2429         * tests/pr/w72l17f-ll: Likewise.
2430         * tests/pr/3-5l24f-t: New file, containing the contents of the
2431         file with the same name but with the line count smaller by 7,
2432         reflecting the new behavior with -F.
2433         * tests/pr/3a3l15f-t: Likewise.
2434         * tests/pr/3b3l15f-t: Likewise.
2435         * tests/pr/3l24f-t: Likewise.
2436         * tests/pr/3ml24f-t: Likewise.
2437         * tests/pr/Ja3l24f-lm: Likewise.
2438         * tests/pr/Jb3l24f-lm: Likewise.
2439         * tests/pr/Jml24f-lm-lo: Likewise.
2440         * tests/pr/W-72l24f-ll: Likewise.
2441         * tests/pr/W20l24f-ll: Likewise.
2442         * tests/pr/W26l24f-ll: Likewise.
2443         * tests/pr/W27l24f-ll: Likewise.
2444         * tests/pr/W28l24f-ll: Likewise.
2445         * tests/pr/W35Ja3l24f-lm: Likewise.
2446         * tests/pr/W35Jb3l24f-lm: Likewise.
2447         * tests/pr/W35Jml24f-lmlo: Likewise.
2448         * tests/pr/W35a3l24f-lm: Likewise.
2449         * tests/pr/W35b3l24f-lm: Likewise.
2450         * tests/pr/W35ml24f-lm-lo: Likewise.
2451         * tests/pr/W72Jl24f-ll: Likewise.
2452         * tests/pr/a3l15f-t: Likewise.
2453         * tests/pr/a3l24f-lm: Likewise.
2454         * tests/pr/b3l15f-t: Likewise.
2455         * tests/pr/b3l24f-lm: Likewise.
2456         * tests/pr/l24f-t: Likewise.
2457         * tests/pr/ml24f-0F: Likewise.
2458         * tests/pr/ml24f-lm-lo: Likewise.
2459         * tests/pr/ml24f-t: Likewise.
2460         * tests/pr/ml24f-t-0F: Likewise.
2461         * tests/pr/n+2-5l24f-0FF: Likewise.
2462         * tests/pr/n+2l24f-0FF: Likewise.
2463         * tests/pr/n+2l24f-bl: Likewise.
2464         * tests/pr/n+3l24f-0FF: Likewise.
2465         * tests/pr/n+3l24f-bl: Likewise.
2466         * tests/pr/n+3ml20f-bl-FF: Likewise.
2467         * tests/pr/n+3ml24f-bl-tn: Likewise.
2468         * tests/pr/n+3ml24f-tn-bl: Likewise.
2469         * tests/pr/n+4b2l17f-0FF: Likewise.
2470         * tests/pr/n+5-8b3l17f-FF: Likewise.
2471         * tests/pr/n+5a3l13f-0FF: Likewise.
2472         * tests/pr/n+6b3l13f-FF: Likewise.
2473         * tests/pr/nJml24f-lmlmlo: Likewise.
2474         * tests/pr/nJml24f-lmlolm: Likewise.
2475         * tests/pr/nN1+3l24f-bl: Likewise.
2476         * tests/pr/nN15l24f-bl: Likewise.
2477         * tests/pr/nSml20-bl-FF: Likewise.
2478         * tests/pr/nSml20-t-t-FF: Likewise.
2479         * tests/pr/nSml20-t-tFFFF: Likewise.
2480         * tests/pr/nSml24-bl-FF: Likewise.
2481         * tests/pr/nSml24-t-t-FF: Likewise.
2482         * tests/pr/nSml24-t-tFFFF: Likewise.
2483         * tests/pr/nl24f-bl: Likewise.
2484         * tests/pr/o3Jml24f-lm-lo: Likewise.
2485         * tests/pr/o3a3Sl24f-tn: Likewise.
2486         * tests/pr/o3a3Snl24f-tn: Likewise.
2487         * tests/pr/o3a3l24f-tn: Likewise.
2488         * tests/pr/o3b3Sl24f-tn: Likewise.
2489         * tests/pr/o3b3Snl24f-tn: Likewise.
2490         * tests/pr/o3b3l24f-tn: Likewise.
2491         * tests/pr/o3mSl24f-bl-tn: Likewise.
2492         * tests/pr/o3mSnl24fbltn: Likewise.
2493         * tests/pr/o3ml24f-bl-tn: Likewise.
2494         * tests/pr/w72l24f-ll: Likewise.
2495
2496 2007-06-23  Jim Meyering  <jim@meyering.net>
2497
2498         Prefer "STREQ (a, b)" over "strcmp (a, b) == 0"; similar for != 0.
2499         * src/base64.c (main): Likewise.
2500         * src/install.c (setdefaultfilecon): Likewise.
2501         * src/sort.c (main): Likewise.
2502         * Makefile.maint (sc_prohibit_strcmp): New rule.
2503         * .x-sc_prohibit_strcmp: New file, to list the few exceptions.
2504         * Makefile.am (EXTRA_DIST): Add .x-sc_prohibit_strcmp.
2505
2506 2007-06-22  Paul Eggert  <eggert@cs.ucla.edu>
2507
2508         * NEWS: seq no longer mishandles obvious cases like
2509         "seq 0 0.000001 0.000003" by omitting the last output number.
2510         * doc/coreutils.texi (seq invocation): Remove advice about workaround
2511         for seq off-by-one problem, since the bug is fixed now.  Replace
2512         it with more-generic advice about rounding errors.
2513         * src/seq.c (long_double_format, print_numbers):
2514         New arg NUMERIC_FORMAT.  All uses changed.
2515
2516 2007-06-22  Pádraig Brady  <P@draigBrady.com>  (trivial change)
2517
2518         * tests/seq/basic: Add test cases for seq off-by-one problem.
2519
2520 2007-06-22  Jim Meyering  <jim@meyering.net>
2521
2522         * src/stat.c (long_options): Add a FIXME comment to help ensure
2523         that the deprecated and undocumented "--filesystem" option is
2524         removed someday.
2525
2526 2007-06-18  Paul Eggert  <eggert@cs.ucla.edu>
2527
2528         A few more symlink-related fixes.  Fix a bug triggered by cp
2529         --parents and symlinks.  Close some race conditions possible when
2530         the destination replaces a newly-created file with a symlink.
2531         * NEWS: Document that 'cp --parents' no longer mishandles
2532         symlinks in file name components of source.
2533         * src/copy.c (HAVE_LCHOWN): Default to false.
2534         (lchown) [!defined HAVE_LCHOWN]: Define to chown, for convenience.
2535         * src/cp.c (lchown) [!HAVE_LCHOWN]: Likewise.
2536         * src/install.c (lchown [!HAVE_LCHOWN]: Likewise.
2537         * src/copy.c (set_owner): Use lchown instead of chown, for safety
2538         in case the file got replaced by a symlink in the meantime.
2539         * src/cp.c (re_protect): Likewise.
2540         * src/install.c (change_attributes): Likewise.
2541         * src/copy.c (copy_internal): Use ordinary C rather than an #if.
2542         * src/cp.c (lchown) [!HAVE_LCHOWN]: Define to chown, for convenience.
2543         (struct dir_attr): Cache the entire struct stat of the directory,
2544         rather than just its mode, so that we needn't stat the directory
2545         twice (which can lead to races).
2546         (re_protect): Don't use XSTAT as that's not appropriate in
2547         this context (symlinks should be followed here).  Instead, use
2548         the cached stat value.
2549         (make_dir_parents_private): Save dir's entire struct stat, not
2550         just its mode.
2551         * tests/cp/cp-parents: Add test to check against bug with
2552         cp --parents and symlinks.
2553
2554 2007-06-18  Jim Meyering  <jim@meyering.net>
2555
2556         Use mreadlink_with_size (doesn't exit), not xreadlink_with_size.
2557         * bootstrap.conf (gnulib_modules): Add readlink-with-size.
2558         Remove xreadlink and xreadlink-with-size.
2559         * src/copy.c (copy_internal): Use mreadlink_with_size,
2560         not xreadlink_with_size.
2561         * src/ls.c (get_link_name): Likewise.
2562         * src/readlink.c (main): Likewise.
2563         * src/stat.c (print_stat): Likewise.
2564
2565         * README-hacking: Don't mention Gzip 1.2.4, now that 1.3.12 is out.
2566
2567 2007-06-16  Jim Meyering  <jim@meyering.net>
2568
2569         Make chgrp and chown diagnostics consistent.
2570         * src/chown.c (main): Emit the diagnostic before the file name,
2571         not after it, to be consistent with chgrp's diagnostic.
2572         * src/chgrp.c (parse_group): Emit a ":" between the diagnostic
2573         and the file name.
2574         Reported by Egmont Koblinger.
2575         * THANKS: Add Egmont Koblinger.
2576
2577 2007-06-15  Paul Eggert  <eggert@cs.ucla.edu>
2578
2579         Correct cp's handling of destination symlinks in some cases.
2580         * NEWS: "cp" no longer considers a destination symlink to be the
2581         same as the referenced file when copying links or making backups.
2582         * src/copy.c (copy_reg): When following a symlink, use the
2583         followed name in later chown etc. requests, so that the created
2584         file is affected, rather than the symlink.  Use O_NOFOLLOW on
2585         source when not dereferencing symlinks; this avoids a race.
2586         Preserve errno correctly when doing multiple open attempts on the
2587         destination.
2588         (copy_internal): Follow destination symlinks only when copying a
2589         regular file and only when we don't intend to remove or rename the
2590         destination first, regardless of whether following source
2591         symlinks; this is because since POSIX and tradition (e.g.,
2592         FreeBSD) say we should ordinarily follow destination symlinks if
2593         the system calls would ordinarily do so.
2594         * src/copy.h (struct cp_options): Add comment that 'dereference'
2595         is only for source files.
2596         * src/cp.c (usage): Note that --derereference etc. are only for
2597         source files.
2598         (make_dir_parents_private): Follow symlinks, regardless of whether
2599         --dereference is specified, because these are destination symlinks.
2600         * tests/cp/same-file: Adjust tests to match revised behavior.
2601         Filter out perror output since it might vary from host to host.
2602         Use sed alone instead of also using echo.
2603
2604         * doc/coreutils.texi (cp invocation): Document the behavior better when
2605         the destination is a symlink.  Clarify source versus destination
2606         symlinks.  Describe the new behavior for destination symlinks.
2607
2608 2007-06-15  Jim Meyering  <jim@meyering.net>
2609
2610         * src/copy.c: Include "canonicalize.h".
2611         (copy_reg): Use canonicalize_filename_mode to follow the symlink,
2612         so that we can always open with O_EXCL and avoid a race.
2613
2614 2007-06-15  Jim Meyering  <jim@meyering.net>
2615
2616         Don't include "quote.h" when it is not used.
2617         * src/md5sum.c: Remove unnecessary inclusion of "quote.h".
2618         * src/expr.c: Likewise.
2619         * src/shred.c: Likewise.
2620         * Makefile.maint (sc_prohibit_quote_without_use): New rule.
2621         * src/c99-to-c89.diff: Adjust offsets.
2622
2623 2007-06-14  Paul Eggert  <eggert@cs.ucla.edu>
2624
2625         Clarify what "cat" documentation means by "blank" lines.
2626         * doc/coreutils.texi (cat invocation): "Blank" lines actually mean
2627         empty lines.
2628         * src/cat.c (usage): Say that "nonblank" means nonempty.  Clarify
2629         --squeeze-blank.
2630
2631 2007-06-13  Jim Meyering  <jim@meyering.net>
2632
2633         rmdir: give better diagnostics
2634         * src/rmdir.c (remove_parents): Give a more descriptive/consistent
2635         diagnostic upon failure.
2636         (main): Likewise.
2637         Suggestion from Joey Hess.
2638         * THANKS: Add Joey Hess.
2639
2640         Don't include "quotearg.h" when it is not used.
2641         * Makefile.maint (sc_prohibit_quotearg_without_use): New rule.
2642         * src/cp.c: Don't include "quotearg.h".  It wasn't used.
2643
2644         * README-hacking: List Gperf as a build-requirement, too.
2645         Reported by Steve Ward.
2646
2647 2007-06-11  Jim Meyering  <jim@meyering.net>
2648
2649         * README: Mention README-hacking, for whose who start from
2650         cloned/checked-out sources rather than from a distribution tarball.
2651         Reported by Steve Ward.
2652         * THANKS: Add Steve Ward.
2653
2654 2007-06-10  Jim Meyering  <jim@meyering.net>
2655
2656         bug-fix: cp would fail to write through a dangling symlink
2657         * NEWS: Mention the bug fix.
2658         * src/copy.c (copy_reg): When open fails with EEXIST, the destination
2659         is lstat'able, and a symlink, call open again, but now without O_EXCL.
2660         * tests/cp/thru-dangling: New file, to test for the above fix.
2661         * tests/cp/Makefile.am (TESTS): Add thru-dangling.
2662         * THANKS: Add Michael McLagan.
2663         Bug report from Michael McLagan in <http://bugzilla.redhat.com/243588>.
2664
2665 2007-06-04  Paul Eggert  <eggert@cs.ucla.edu>
2666
2667         * doc/coreutils.texi (Common options): Mention that -h and
2668         --human-readable are equivalent to --block-size=human-readable.
2669         Documentation problem reported by Steve Ward in
2670         <http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00007.html>.
2671         (du invocation): Use optSi rather than duplicating the macro's
2672         contents (incorrectly, since we claimed a "B" was output).
2673
2674 2007-05-31  Jim Meyering  <jim@meyering.net>
2675
2676         Pull printf-related code from gnulib, rather than using forked copy.
2677         * bootstrap.conf (gnulib_modules): Don't avoid size_max and xsize
2678         modules.  While I dislike xsize-style overflow avoidance, maintaining
2679         a forked version of e.g., vasnprintf.c was too much work.
2680
2681 2007-05-29  Jim Meyering  <jim@meyering.net>
2682
2683         * src/dircolors.hin: Add screen-256color.
2684         Suggested by sdl.web@gmail.com in <http://bugzilla.redhat.com/239266>.
2685
2686 2007-05-26  Jim Meyering  <jim@meyering.net>
2687
2688         * TODO: Add an entry for comm --output-delimiter=STR
2689
2690 2007-05-25  James Youngman  <jay@gnu.org>
2691
2692         wc: ignore multibyte-character decoding errors
2693         * src/wc.c (wc): Don't issue an error message when mbrtowc
2694         indicates that we have seen an invalid byte sequence.  This
2695         makes "wc /bin/sh" bearable (though the word and line counts
2696         are likely not to be useful).
2697         * NEWS: Mention the change.
2698
2699 2007-05-22  Jim Meyering  <jim@meyering.net>
2700
2701         Check for an up-to-date copyright year in coreutils.texi.
2702         * Makefile.maint (copyright-check): Also check for an up-to-date
2703         copyright year in doc/$().texi, if that file exists.
2704         * doc/coreutils.texi: Add 2007 to list of Copyright years.
2705         Reported by Karl Berry.
2706
2707         cut: diagnose a range starting with 0 (-f 0-2) as invalid, and
2708         give a better diagnostic for a field-number/offset of 0.
2709         * NEWS: Mention the fix.
2710         * src/cut.c (ADD_RANGE_PAIR): Add an explicit check.
2711         Based on a patch from James Youngman.
2712         * tests/misc/cut: Add tests for the above.
2713
2714         "cut -f 2-0" now fails; before, it was equivalent to "cut -f 2-"
2715         Also, diagnose the '-' in "cut -f -" as an invalid range, rather
2716         than interpreting it as the unlimited range, "1-".
2717         * NEWS: Mention these changes.
2718         * src/cut.c (set_fields): Don't interpret an accumulator "value"
2719         of 0 as an unspecified range endpoint.
2720         Give better diagnostics.
2721         Adjust a comment so that it is true also for 64-bit size_t.
2722
2723         * tests/cut/Test.pm: Add tests for the above.
2724
2725         stty: fix a harmless syntax nit
2726         * src/stty.c (visible): Use ";" as the statement terminator
2727         between two assignments, not ",".
2728         (integer_arg): Join an unnecessarily wrapped line.
2729
2730 2007-05-20  Jim Meyering  <jim@meyering.net>
2731
2732         stty: diagnose an invalid hex value in 35-colon commmand-line argument
2733         * NEWS: Mention this.
2734         * src/stty.c (strtoul_tcflag_t, strtoul_cc_t): New functions.
2735         (recover_mode): Use those functions (not sscanf), to parse the
2736         string robustly.
2737         * tests/stty/invalid: New file.  Test for the above.
2738         * tests/stty/Makefile.am (TESTS): Add invalid.
2739         * .x-sc_prohibit_atoi_atof: Don't exempt stty.c from this check.
2740         Add tests/stty/invalid so we don't have to obfuscate the comment
2741         about sscanf therein.
2742         * Makefile.maint (sc_prohibit_atoi_atof): Mention sscanf in the
2743         diagnostic, too.
2744
2745         * TODO: Remove some now-completed or no longer relevant items.
2746
2747 2007-05-19  Jim Meyering  <jim@meyering.net>
2748
2749         Rename uses of futimens -> gl_futimens; glibc now declares the former.
2750         * src/copy.c (copy_reg): Reflect renaming: futimens -> gl_futimens.
2751         * src/touch.c (touch): Likewise.
2752
2753 2007-05-18  Jim Meyering  <jim@meyering.net>
2754
2755         * Makefile.maint (my-distcheck): Remove -pedantic from $(CFLAGS)
2756         for now, to avoid c89-check failure due to use of #include_next.
2757
2758 2007-05-15  Jim Meyering  <jim@meyering.net>
2759
2760         Generate a dozen test-related Makefile.am files at bootstrap-time.
2761         * README-hacking: Build-from-checkout now require Perl, too.
2762         * bootstrap: Now that these generated Makefile.am files are no longer
2763         under version control, they must be created at bootstrap time.
2764
2765 2007-05-14  Paul Eggert  <eggert@cs.ucla.edu>
2766
2767         * man/chmod.x: Document chmod's behavior with setuid and setgid bits.
2768         Remove misleading implication about leading zero.  Problem
2769         reported by Jan Engelhardt in
2770         <http://lists.gnu.org/archive/html/bug-coreutils/2007-05/msg00134.html>.
2771
2772 2007-05-13  Jim Meyering  <jim@meyering.net>
2773
2774         Remove the generated tests/*/Makefile.am files from version control.
2775         * tests/cut/Makefile.am: git-remove this generated file.
2776         * tests/head/Makefile.am: Likewise.
2777         * tests/join/Makefile.am: Likewise.
2778         * tests/pr/Makefile.am: Likewise.
2779         * tests/sort/Makefile.am: Likewise.
2780         * tests/tac/Makefile.am: Likewise.
2781         * tests/tail/Makefile.am: Likewise.
2782         * tests/test/Makefile.am: Likewise.
2783         * tests/tr/Makefile.am: Likewise.
2784         * tests/uniq/Makefile.am: Likewise.
2785         * tests/wc/Makefile.am: Likewise.
2786         * .cvsignore, .gitignore: Ignore these generated files.
2787
2788         * src/.cvsignore, src/.gitignore: Add chcon here, ...
2789         * .cvsignore, .gitignore: ... not here.
2790
2791         Test uniq's new --zero-terminated (-z) option.
2792         * tests/uniq/Test.pm: When possible, create a "-z"-testing variant
2793         of each existing test.
2794         (2z, 3z, 4z, 5z, 20z, 122, 123): New tests from James Youngman.
2795
2796 2007-05-12  James Youngman  <jay@gnu.org>
2797
2798         Add -z option to uniq.  Originally proposed by Egmont Koblinger.
2799         * NEWS: Mention uniq's new option: --zero-terminated (-z).
2800         * src/uniq.c: Add new option, --zero-terminated (-z), to make
2801         uniq use the NUL byte as separator/delimiter rather than newline.
2802         (check_file): Add a parameter: delimiter.  Update caller.
2803         Use readlinebuffer_delim in place of readlinebuffer everywhere.
2804         (main): Handle the new option.
2805         (usage): Describe new option the same way sort does.
2806         * doc/coreutils.texi (uniq invocation): Describe the new option.
2807
2808 2007-05-07  Jim Meyering  <jim@meyering.net>
2809
2810         * NEWS: Mention that last week's tr bug dates back to 1992.
2811
2812 2007-05-04  Jim Meyering  <jim@meyering.net>
2813
2814         Avoid test failure when run with an unusual umask.
2815         * tests/ls/color-dtype-dir: Set umask to 022.
2816         Suggestion from AIDA Shinra.
2817
2818         Avoid failure of root-only test when run with a restrictive umask.
2819         * tests/rm/no-give-up: Ensure that non-root can access "d/" through
2820         root-owned ".".  Reported by AIDA Shinra.
2821
2822         tr -c: don't abort when translating with S2 larger than complement of S1
2823         * src/tr.c (main): Remove invalid assertion triggered by e.g.,
2824         tr -c a '[b*256]'.  There's nothing wrong with having Set2 larger
2825         than Set1.  Reported by Guntram Blohm.
2826         * tests/tr/Test.pm (no-abort-1): Test for the above.
2827         * NEWS: Mention this bug fix.
2828         * THANKS: Add Guntram Blohm.
2829
2830 2007-05-03  Jim Meyering  <jim@meyering.net>
2831
2832         Avoid test failure when run with a permissive umask.
2833         * tests/rm/no-give-up: Set permissions of test directory properly,
2834         i.e., not depending on umask prohibiting go=w.
2835         Reported by AIDA Shinra.
2836
2837 2007-05-02  Paul Eggert  <eggert@cs.ucla.edu>
2838
2839         The following commands and options now support the standard size
2840         suffixes kB, M, MB, G, GB, and so on for T, P, Y, Z, and Y:
2841         head -c, head -n, od -j, od -N, od -S, split -b, split -C,
2842         tail -c, tail -n.
2843         * doc/coreutils.texi (od invocation, head invocation, tail invocation):
2844         Document support for new size suffixes.
2845         (head invocation, tail invocation):
2846         Document that -n uses the same suffixes as -c.
2847         (tail invocation): More-clearly document what leading "+" does.
2848         * src/head.c (usage, string_to_integer): Support new suffixes.
2849         * src/od.c (usage, main): Likewise.
2850         * src/split.c (usage, main): Likewise.
2851         * src/tail.c (usage, parse_options): Likewise.
2852         Prompted by a patch from Evan Hunt.
2853
2854 2007-05-02  Jim Meyering  <jim@meyering.net>
2855
2856         * src/du.c (usage): Tweak description of --dereference-args (-D) again.
2857         Prompted by another request for clarification from Justin Pryzby.
2858
2859         Invoke rm via 'setuidgid ... env PATH="$PATH" ...', as in fail-eperm.
2860         * tests/rm/fail-2eperm: Patch from AIDA Shinra.
2861         Reported by Peter Dyballa.
2862         * THANKS: Add AIDA Shinra and Peter Dyballa.
2863
2864 2007-04-28  Paul Eggert  <eggert@cs.ucla.edu>
2865
2866         * src/nohup.c (usage): Describe how standard input and output
2867         are redirected.
2868
2869 2007-04-25  Jim Meyering  <jim@meyering.net>
2870
2871         * src/du.c (usage): Clarify description of --dereference-args (-D).
2872         Prompted by a report from Justin Pryzby.
2873
2874         * bootstrap.conf (gnulib_modules): Add fseeko and ftello.
2875         (gnulib_modules): Add autobuild.
2876
2877 2007-04-24  Jim Meyering  <jim@meyering.net>
2878
2879         * THANKS: Add Andreas Frische.
2880         * NEWS: Mention today's ls --color fix.
2881         * tests/ls-2/tests (sl-dangle): Add a test for today's fix.
2882
2883 2007-04-24  Eric Blake  <ebb9@byu.net>
2884
2885         ls --color once again colors dangling symlinks correctly
2886         * src/ls.c (gobble_file): Much like the 2007-04-07 fix,
2887         add a term to the expression that decides whether we need
2888         stat and/or lstat calls.  Reported by Andreas Frische.
2889
2890 2007-04-16  Jim Meyering  <jim@meyering.net>
2891
2892         * src/cut.c (usage): Adjust synopsis to show that an OPTION is required.
2893         Reported by Rudolf Kastl.
2894         * THANKS: Add Rudolf Kastl.
2895
2896 2007-04-11  Paul Eggert  <eggert@cs.ucla.edu>
2897
2898         split --line-bytes=N (-C N): don't create an empty file.
2899         * src/split.c (line_bytes_split): Don't create an empty line
2900         afterwards if the last buffer happens to be exactly full.
2901         * tests/misc/split-fail: Add a test case for this.
2902         * NEWS: mention this.
2903
2904 2007-04-10  Jim Meyering  <jim@meyering.net>
2905
2906         ls: don't form or compute the length of strings that won't be used.
2907         * src/ls.c (gobble_file): Form and compute length of strings for
2908         block size, owner, group, author, major+minor numbers and file size
2909         only if they'll actually be used.  I.e., don't form most of them
2910         when not producing long format output.
2911
2912 2007-04-07  Jim Meyering  <jim@meyering.net>
2913
2914         Add a test for, and document, today's fix.
2915         * NEWS: Mention today's ls --color fix.
2916         * tests/ls-2/tests (sl-target): Add a test for today's fix.
2917         * THANKS: Add Kirk Kelsey.
2918
2919 2007-04-07  Eric Blake  <ebb9@byu.net>
2920
2921         Fix a bug in how the LS_COLORS ln=target attribute is handled.
2922         * src/ls.c (gobble_file): Use "stat" (not lstat) also when the
2923         ln=target attribute applies.  Reported by Kirk Kelsey.
2924
2925 2007-04-02  Jim Meyering  <jim@meyering.net>
2926
2927         * src/copy.c (copy_reg): Initialize local "con", before calling
2928         getfscreatecon, in case that function (or its inline stub) does
2929         not set it.
2930
2931 2007-04-01  Paul Eggert  <eggert@cs.ucla.edu>
2932
2933         * src/ls.c (print_horizontal): Fix bug reported by Mike Frysinger:
2934         ls -x DIR would sometimes output the wrong string in place of the
2935         first entry.
2936         * NEWS: Mention the bug fix.
2937         * tests/ls/x-option: New file.
2938         * tests/ls/Makefile.am (TESTS): Add x-option.
2939
2940         gnulib moved md5 and sha1 modules into a new crypt/ directory; adapt
2941         * bootstrap.conf (gnulib_modules): Adjust to gnulib's renaming of
2942         md5 to crypt/md5 and sha1 to crypt/sha1.
2943
2944 2007-03-30  Jim Meyering  <jim@meyering.net>
2945
2946         * NEWS: Mention these SELinux changes.
2947
2948         * ChangeLog-selinux: Remove file.
2949         Move its contents into this file, removing old dates.
2950
2951         * src/runcon.c (main): Don't reorder arguments.  Reported by
2952         Ulrich Drepper in <http://bugzilla.redhat.com/232652>.
2953         * tests/misc/runcon-no-reorder: New file.  Test for the above.
2954         * tests/misc/Makefile.am (TESTS): Add runcon-no-reorder.
2955
2956         * src/runcon.c (main): Remove "." at end of a diagnostic.
2957
2958         * src/runcon.c: New program.
2959         * src/Makefile.am (bin_PROGRAMS): Add runcon.
2960         (runcon_LDADD): Define.
2961         * README: Add runcon to the list of programs.
2962         * AUTHORS: Add this: runcon: Russell Coker
2963         * tests/help-version: Add runcon as an exception.
2964         * man/Makefile.am (dist_man_MANS): Add runcon.1.
2965         (runcon.1): New dependency.
2966
2967         mkfifo, mknod: Accept new "-Z, --context=C" option.
2968         * src/mkfifo.c, src/mknod.c: Include <selinux/selinux.h>.
2969         (main): Honor it.
2970         * src/Makefile.am (mkfifo_LDADD, mknod_LDADD): Use $(LIB_SELINUX).
2971
2972         mkdir: Accept new "-Z, --context=C" option.
2973         * src/mkdir.c: Include <selinux/selinux.h>.
2974         (main): Honor it.
2975         * src/Makefile.am (mkdir_LDADD): Use $(LIB_SELINUX).
2976
2977         * tests/cp/cp-a-selinux: New file.  Test for the bug reported in
2978         <http://bugzilla.redhat.com/219900>.
2979         * tests/cp/Makefile.am (TESTS): Add cp-a-selinux.
2980
2981         * tests/selinux: New file.
2982         * tests/Makefile.am (EXTRA_DIST): Add selinux.
2983         * tests/misc/selinux: Source the new script, rather than open coding it.
2984
2985         Change how "cp -a" and "cp --preserve=context" work with SELinux.
2986         Now, cp -a attempts to preserve context, but failure to do so does
2987         not change cp's exit status.  However "cp --preserve=context" is
2988         similar, but failure *does* cause cp to exit with nonzero status.
2989         * src/copy.h (struct cp_options) [require_preserve_context]: New member.
2990         * src/copy.c (copy_reg, copy_internal): Implement the above.
2991         * src/mv.c (cp_option_init): Initialize the new member.
2992         * src/install.c (cp_option_init): Likewise.
2993         * src/cp.c (cp_option_init): Likewise.
2994         (decode_preserve_arg): Set it or reset it.
2995
2996         cp, mv, install: add SELinux support, but unlike with the Red Hat
2997         patch, mv and cp do not provide the "-Z context" option.
2998         * src/copy.c: Include <selinux/selinux.h>.
2999         (restore_default_fscreatecon): New function.
3000         (copy_reg): Make cp --preserve=context work for existing destination.
3001         (copy_internal): Likewise for new destinations.
3002         * src/copy.h (cp_options) [preserve_security_context]: New member.
3003         * src/cp.c: Include <selinux/selinux.h>.
3004         (selinux_enabled): New global.
3005         (usage): Mention new --preserve=context option.
3006         (PRESERVE_CONTEXT): Define/use.
3007         (decode_preserve_arg): Handle PRESERVE_CONTEXT.
3008         (main): Remove an obsolete comment.
3009         If --preserve=context is specified on a system without SELinux
3010         enabled, give a diagnostic and fail.
3011         * src/mv.c: Include <selinux/selinux.h>.
3012         Set x->preserve_security_context if SELinux is enabled.
3013         * src/install.c: Accept new "-Z, --context=C" option.
3014         Accept --preserve-context option (but not -P option).
3015         Accept alternate spelling: --preserve_context, for now.
3016         Include <selinux/selinux.h> and "quotearg.h".
3017         (selinux_enabled, use_default_selinux_context): New globals.
3018         (PRESERVE_CONTEXT_OPTION): Define.
3019         (cp_option_init): Default: do not preserve security context.
3020         (setdefaultfilecon): New function.
3021         (main): Honor new options.
3022         * src/Makefile.am (mv_LDADD, cp_LDADD, ginstall_LDADD):
3023         Add $(LIB_SELINUX).
3024         * src/system.h (GETOPT_SELINUX_CONTEXT_OPTION_DECL): Define.
3025
3026         * tests/misc/selinux [VERBOSE]: Print version info for each
3027         of the tested tools, not just ls.
3028
3029         * src/c99-to-c89.diff: Remove the ls.c patch, now that I've
3030         temporarily removed the offending c99'ism.
3031
3032         * src/chcon.c (usage): Split a string literal that was longer than 509.
3033
3034         * src/ls.c (gobble_file): Don't call getfilecon unless print_scontext.
3035         Upon failed getfilecon, accept not just ENOTSUP, but also ENODATA.
3036
3037         * src/c99-to-c89.diff: Adjust offsets.
3038
3039         * AUTHORS: Add chcon.
3040
3041         * src/c99-to-c89.diff: Remove trailing blanks.
3042
3043         * src/chcon.c: Don't include "dirname.h".  system.h already includes it.
3044
3045         * gl/lib/selinux-at.c: Remove a use of HAVE_CONFIG_H.
3046
3047         * src/c99-to-c89.diff: Handle a new c99'ism in ls.c.
3048
3049         * src/id.c (main): Tweak id -Z diagnostic.
3050
3051         id: Add SELinux support: -Z option.
3052         * src/id.c (main): Apply patches from Fedora, with these changes:
3053         Remove #ifdef WITH_SELINUX.
3054         Use error (EXIT_FAILURE, not fprintf+exit(1).
3055         * src/Makefile.am (id_LDADD): Define, so as to add $(LIB_SELINUX).
3056
3057         stat: Add support for SELinux in the form of a %C format directive.
3058         * src/stat.c (follow_links): Make this variable file-global.
3059         (out_file_context): New function.
3060         (print_statfs): Honor %C.
3061         (print_stat): Honor %C.
3062         (do_stat): Remove follow_links parameter.
3063         (usage): Document the two %C directives.
3064         (main): Accept -Z (though it's a no-op).
3065         * src/Makefile.am (stat_LDADD): Define.
3066
3067         ls: Add support for SELinux and a slightly modified -Z option.
3068         I started with the patches from Red Hat.
3069         The entries below tell how the code evolved.
3070
3071         * src/ls.c (print_long_format, print_file_name_and_frills): When
3072         there is no security context (due to getfilecon/lgetfilecon failing
3073         with e.g. ENOTSUP), print it as "?", not "".
3074         * src/ls.c (print_file_name_and_frills): Make -Z work without -l.
3075         (length_of_file_name_and_frills): Likewise.
3076
3077         * src/ls.c: Remove the --lcontext and --scontext options.
3078         Change the way -Z, --context work so that it no longer implies -l.
3079         Thus, -Z -l will work like -lcontext and -Z without -l will work
3080         like --scontext.
3081
3082         Adjust tests to reflect new 'ls -l' syntax -- affects only
3083         systems with SELinux when operating on a file with no ACL.
3084         These tests assumed that everything before the first space on
3085         each line is the 10-byte mode string.  But there may also be a "+"
3086         in the 11th column, just before the space.  However, note that this
3087         is not new.  The same thing would have happened even without the
3088         change below, when listing a file with an ACL.
3089         * tests/chmod/equals, tests/cp/cp-parents, tests/cp/fail-perm:
3090         * tests/cp/link-preserve, tests/install/basic-1, tests/misc/mknod:
3091         * tests/mkdir/parents, tests/mkdir/special-1, tests/mv/partition-perm:
3092
3093         Don't make compilation depend on USE_ACL.  An SELinux security
3094         context counts as an "alternate access control method", so ls
3095         must output a "+" for each file with a security context.
3096         * src/ls.c [struct fileinfo] (have_acl): Declare unconditionally.
3097         (FILE_HAS_ACL): Remove macro definition.  Use f->have_acl directly.
3098         (gobble_file): Record whether a file has a security context, and
3099         update the condition used to determine whether to print the "+".
3100         (gobble_file): Call getfilecon/lgetfilecon also when
3101         format == long_format, so that we get the "+".
3102
3103         * src/ls.c (gobble_file): Add a comment explaining why (with a
3104         security context option) ls doesn't exit nonzero due to e.g.,
3105         getfilecon failing with errno == ENOTSUP.
3106
3107         * src/ls.c (gobble_file): Ignore failure of getfilecon if it's due
3108         to ENOTSUP.
3109
3110         * src/ls.c (gobble_file): Factor out three small blocks using
3111         getfilecon and lgetfilecon.
3112         Don't ignore return value from getfilecon and lgetfilecon.
3113
3114         * src/ls.c (print_long_format): Don't use ?: (empty 2nd arg with C
3115         ternary operator).
3116         (print_scontext_format): Likewise.
3117         (print_scontext): Declare to be "bool", not int.  Adjust uses.
3118
3119         * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Add $(LIB_SELINUX).
3120
3121         * tests/misc/chcon: New file.
3122         * tests/misc/chcon-fail: New file.
3123         * tests/Makefile.am (check-root): Run new, root-only misc/chcon test.
3124         * tests/misc/Makefile.am (TESTS): Add chcon and chcon-fail.
3125
3126         * tests/misc/Makefile.am (TESTS): Add selinux.
3127         * tests/misc/selinux: New file.
3128         * tests/help-version: Skip chcon.
3129         * man/chcon.x: New file.
3130         * man/Makefile.am: Build chcon.1.
3131
3132         New program: chcon
3133         * gl/modules/selinux-at: New module.  Check for libselinux and set
3134         LIB_SELINUX here, unconditionally, rather than depending on
3135         the configure-time --enable-selinux option.
3136         * gl/modules/selinux-h: New module.
3137         * bootstrap.conf (gnulib_modules): Add selinux-at.
3138         * gl/lib/selinux-at.c, gl/lib/selinux-at.h: New files.
3139         * gl/lib/se-selinux_.h: New file.
3140         * gl/lib/se-context_.h: New file.
3141         * gl/m4/selinux-selinux-h.m4: New file.
3142         * gl/m4/selinux-context-h.m4: New file.
3143         * src/Makefile.am (bin_PROGRAMS): Add chcon.
3144         (chcon_LDADD): Define.
3145         * README: Add chcon to the list of programs.
3146         * src/chcon.c: Rewrite the original (Red Hat) chcon to use fts.
3147
3148 2007-03-29  Jim Meyering  <jim@meyering.net>
3149
3150         * .vg-suppressions: Add libc-getpwuid-leak.
3151
3152 2007-03-28  Jim Meyering  <jim@meyering.net>
3153
3154         Help translators include translation team's web or email address.
3155         * src/system.h (emit_bug_reporting_address): New function.
3156         * src/base64.c: Use it rather than a literal printf.
3157         * src/basename.c, src/cat.c, src/chgrp.c, src/chmod.c:
3158         * src/chown.c, src/chroot.c, src/cksum.c, src/comm.c, src/cp.c:
3159         * src/csplit.c, src/cut.c, src/date.c, src/dd.c, src/df.c:
3160         * src/dircolors.c, src/dirname.c, src/du.c, src/echo.c, src/env.c:
3161         * src/expand.c, src/expr.c, src/factor.c, src/fmt.c, src/fold.c:
3162         * src/head.c, src/hostid.c, src/hostname.c, src/id.c, src/install.c:
3163         * src/join.c, src/kill.c, src/link.c, src/ln.c, src/logname.c:
3164         * src/ls.c, src/md5sum.c, src/mkdir.c, src/mkfifo.c, src/mknod.c:
3165         * src/mv.c, src/nice.c, src/nl.c, src/nohup.c, src/od.c:
3166         * src/paste.c, src/pathchk.c, src/pinky.c, src/pr.c, src/printenv.c:
3167         * src/printf.c, src/ptx.c, src/pwd.c, src/readlink.c, src/rm.c:
3168         * src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c, src/shuf.c:
3169         * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c:
3170         * src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac.c:
3171         * src/tail.c, src/tee.c, src/test.c, src/touch.c, src/tr.c:
3172         * src/true.c, src/tsort.c, src/tty.c, src/uname.c, src/unexpand.c:
3173         * src/uniq.c, src/unlink.c, src/uptime.c, src/users.c, src/wc.c:
3174         * src/who.c, src/whoami.c, src/yes.c: Likewise.
3175
3176         * src/stty.c: Don't include "vasprintf.h", now that its
3177         declarations are guaranteed to be in gnulib's stdio.h.
3178         * src/who.c: Likewise.
3179
3180 2007-03-27  Jim Meyering  <jim@meyering.net>
3181
3182         * README: Use "install", not "ginstall" in the list of program names.
3183         * src/Makefile.am (check-README): Substitute s/ginstall/install/.
3184
3185 2007-03-25  Jim Meyering  <jim@meyering.net>
3186
3187         * src/c99-to-c89.diff: Regenerate.
3188
3189 2007-03-25  Paul Eggert  <eggert@cs.ucla.edu>
3190
3191         Avoid the need for euidaccess and/or lstat on every directory entry
3192         with 'rm -r dir' (without -f), if we are root, or if we are removing
3193         a directory tree that is full of symbolic links.
3194         * bootstrap.conf (gnulib_modules): Add write-any-file.
3195         * src/copy.c: Include write-any-file.h.
3196         (UNWRITABLE): Remove macro, replacing with....
3197         (writable_destination): New function, which uses can_write_any_file
3198         to avoid the need for euidaccess when we are privileged.
3199         (overwrite_prompt, abandon_move): Use it.
3200         * src/remove.c: Include write-any-file.h.
3201         (D_TYPE): New macro.
3202         (DT_UNKNOWN, DT_DIR, DT_LNK) [!HAVE_STRUCT_DIRENT_D_TYPE]: New macros.
3203         (write_protected_non_symlink): Don't bother to stat if we can write
3204         any file.
3205         (prompt): New arg PDIRENT_TYPE.  All callers changed.
3206         Use readdir dirent type to avoid the need for 'lstat' on each directory
3207         entry in cases like 'rm -r dir', if we are root, or if the tree is
3208         full of symbolic links.
3209         (DT_IS_KNOWN, DT_MUST_BE): Remove.
3210         (remove_entry): New arg DIRENT_TYPE_ARG.  All callers changed.
3211
3212 2007-03-24  Jim Meyering  <jim@meyering.net>
3213
3214         If strace malfunctions, skip the test rather than failing it.
3215         * tests/mv/atomic: Required on a mips-unknown-linux-gnu system
3216         running the aging linux-2.4.27-mipscvs-20040814.
3217
3218 2007-03-23  Paul Eggert  <eggert@cs.ucla.edu>
3219
3220         * src/pathchk.c: Don't include euidaccess.h, as we don't call
3221         euidaccess.
3222
3223 2007-03-23  Jim Meyering  <jim@meyering.net>
3224
3225         * README-package-renamed-to-coreutils: Add a URL for the FAQ,
3226         and a couple more archive links.
3227
3228 2007-03-22  Jim Meyering  <jim@meyering.net>
3229
3230         Post-release version change.
3231         * NEWS: Add a line for 6.9+.
3232         * configure.ac (AC_INIT): Set new version string.
3233
3234         Version 6.9.
3235         * NEWS: Record release date and new version number.
3236         * configure.ac (AC_INIT): New version number.
3237
3238         * tests/mv/hard-3: Correct the preceding change: $3 -> $2.
3239
3240 2007-03-22  Paul Eggert  <eggert@cs.ucla.edu>
3241
3242         Improve a test script.
3243         * tests/mv/hard-3: Check for 'ls' failure, too.
3244         Generate more-useful debugging output when 'ls' fails.
3245
3246 2007-03-21  Jim Meyering  <jim@meyering.net>
3247
3248         Fix a test script not to claim an ext2 file system is of type xfs.
3249         * tests/du/slink: When using df --local and df --type=TYPE,
3250         test only the exit code.  Don't bother with stdout.
3251         Prompted by a report by Thomas Schwinge of an inaccurate diagnostic.
3252
3253         * gl/lib/savewd.c: Remove this file, since the savewd_save change
3254         is now in gnulib.  The other wasn't useful.
3255
3256 2007-03-20  Jim Meyering  <jim@meyering.net>
3257
3258         * gl/lib/acl.c: Remove this file, now that gnulib's version subsumes it.
3259
3260         Skip part of this test when "." is not a local file system.
3261         * tests/install/basic-1: Otherwise, it would fail on some NFS
3262         file systems.
3263         * tests/mkdir/p-3: Likewise.
3264
3265 2007-03-19  Paul Eggert  <eggert@cs.ucla.edu>
3266
3267         * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD):
3268         Add $(LIB_ACL_TRIVIAL).
3269
3270 2007-03-18  Jim Meyering  <jim@meyering.net>
3271
3272         Fix a generic NFS-related test failure.
3273         * tests/mkdir/p-3: When setting up an unreadable "." in an
3274         inaccessible parent, make the parent inaccessible *after* making "."
3275         unreadable.  Otherwise, running "chmod a-r ." in an already-
3276         inaccessible parent would fail on NFS with "Stale NFS file handle".
3277
3278         Fix a bug in how pr -m -s works.
3279         * NEWS: Describe how the fix affects pr.
3280         * src/pr.c (init_parameters): The --merge (-m) option does
3281         not imply --expand-tabs (-e), so don't set "untabify_input".
3282         Reported by Wis Macomson.
3283         * tests/misc/pr: New file.  Test for the above fix.
3284         * tests/misc/Makefile.am (TESTS): Add pr.
3285         * THANKS: Update.
3286
3287 2007-03-17  Jim Meyering  <jim@meyering.net>
3288
3289         Detect use of AC_CONFIG_AUX_DIR also when its argument is quoted.
3290         * bootstrap: Put ""s around use of $build_aux, in case
3291         someone uses a name containing shell meta-characters.
3292         Reported by Alfred M. Szmidt.
3293         * tests/misc/tty-eof: Add shuf to the list of tested commands.
3294
3295         Avoid test failure on NFS-mounted Solaris ZFS file system.
3296         * tests/du/basic: Skip a test if "." is on a non-local file system.
3297
3298         Avoid an obscure build failure, prefer waitpid over wait.
3299         * src/install.c (strip): Use waitpid, not wait.  It's equivalent,
3300         but feels less obsolescent.
3301
3302         * bootstrap: Don't use \> in grep regexp.  For HP-UX.
3303
3304 2007-03-16  Jim Meyering  <jim@meyering.net>
3305
3306         Begin adding support for Solaris ZFS (4 entries per trivial ACL)
3307         * gl/lib/acl.c (ACL_NOT_WELL_SUPPORTED): New macro.
3308         (file_has_acl, copy_acl): Use it, rather than enumerating errno values.
3309         (is_trivial_acl): New function.  Incomplete, for now.
3310         (file_has_acl, copy_acl): Use the new function, rather than
3311         counting the number of entries in an ACL.
3312
3313         * bootstrap: Update from gnulib.
3314
3315         * .x-sc_prohibit_atoi_atof: Add TODO here, too.
3316
3317 2007-03-16  Paul Eggert  <eggert@cs.ucla.edu>
3318
3319         * src/copy.c: Include filemode.h.
3320         (overwrite_prompt): Say "try to overwrite", not "overwrite", to
3321         make it clearer that the attempt may fail.  Problem reported by
3322         Dan Jacobson in:
3323         http://lists.gnu.org/archive/html/bug-coreutils/2007-03/msg00130.html
3324         Output symbolic mode as well as numeric.
3325         * tests/mv/i-2 (fail): Adjust to new prompt format.
3326
3327 2007-03-15  Jim Meyering  <jim@meyering.net>
3328
3329         Enforce policy: don't use *scanf functions.
3330         * Makefile.maint (sc_prohibit_atoi_atof): Add to regexp and diagnostic.
3331         * .x-sc_prohibit_atoi_atof: Give stty a temporary pass.
3332         * TODO: note that stty.c needs this small clean-up.
3333
3334 2007-03-13  Jim Meyering  <jim@meyering.net>
3335
3336         Prepare to work on ACL-related failure when using Solaris ZFS.
3337         * gl/lib/acl.c: New file, copied from gnulib.
3338
3339         Work around a failing test due to an NFS-based race condition.
3340         * tests/cp/sparse: Accept a report that the copy is *smaller*.
3341
3342 2007-03-12  Jim Meyering  <jim@meyering.net>
3343
3344         Make bootstrap.conf a tiny bit more generic.
3345         * bootstrap.conf (XGETTEXT_OPTIONS): Exclude gettext-related .m4
3346         files when e.g., AM_GNU_GETTEXT([external] appears in configure.ac.
3347
3348 2007-03-10  Jim Meyering  <jim@meyering.net>
3349
3350         Try to fix today's NFS-related failure: Treat ESTALE like EACCES.
3351         * gl/lib/savewd.c: Copy this file from gnulib, then change
3352         "errno != EACCES" to (errno != EACCES && errno != ESTALE).
3353         The symptom was this failure in tests/install/basic-1:
3354         ginstall: cannot create directory `rel/a': Stale NFS file handle
3355
3356         The preceding change solved part of the problem.  Now ginstall fails.
3357         * tests/install/basic-1: Temporarily, don't redirect ginstall's
3358         stderr to /dev/null, so I can see why the NFS autobuilder's NFS test
3359         is failing.
3360
3361         * tests/install/basic-1: When setting up an unreadable "." in an
3362         inaccessible parent, make the parent inaccessible *after* making "."
3363         unreadable.  Otherwise, running "chmod a-r ." in an already-
3364         inaccessible parent would fail on NFS with "Stale NFS file handle".
3365         Reported by Bob Proulx.
3366
3367         * Makefile.maint (po-check): Exclude c99-to-c89.diff.
3368
3369 2007-03-09  Jim Meyering  <jim@meyering.net>
3370
3371         Avoid test failures on Darwin 7.9.0 (MacOS X 10.3.9)
3372         * tests/chgrp/basic: Don't let failure by chgrp to set the
3373         group of a symlink make this test fail.  Do give a diagnostic.
3374         In the chgrp-no-change-ctime test, add darwin7.9.0 as another
3375         known-failing system.
3376         When failing on some other system, print $host_triplet, too.
3377         Also avoid test failures on Darwin 8.8.x (MacOS X 10.4).
3378         Reported by Peter Fales.
3379
3380 2007-03-08  Jim Meyering  <jim@meyering.net>
3381
3382         * src/c99-to-c89.diff: Reflect the new c99'ism, update offsets.
3383
3384 2007-03-08  Paul Eggert  <eggert@cs.ucla.edu>
3385
3386         rm without -f: give a better diagnostic when euidaccess fails.
3387         * src/remove.c (write_protected_non_symlink): Return int, not bool,
3388         so that we can indicate failure too (as a postive error number).
3389         (prompt): If write_protected_non_symlink fails, report that error
3390         number and fail rather than charging ahead and removing the dubious
3391         entry.  Redo the logic of printing a diagnostic so that we need to
3392         invoke quote (full_filename (...)) only once.  More details at:
3393         <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9952/focus=9996>
3394
3395 2007-03-08  Jim Meyering  <jim@meyering.net>
3396
3397         Generalize a few more cvs-isms.
3398         * bootstrap (checkout_only_file): Rename from CVS_only_file.
3399         Change comments and diagnostics not to say "CVS".
3400
3401         * bootstrap: Run libtool, if necessary.
3402
3403         Make bootstrap a little more general.
3404         * bootstrap (build_aux): Factor out/use this definition.
3405         Formally require a "AC_CONFIG_AUX_DIR($build_aux)" line in configure.ac.
3406         (insert_sorted_if_absent): Move function definition "up", to
3407         precede new first use.
3408         If $build_aux/ doesn't exist initially, create it, and
3409         mark it as ignored.
3410
3411 2007-03-03  Andrew Church  <achurch@achurch.org>  (tiny change)
3412             Paul Eggert  <eggert@cs.ucla.edu>
3413
3414         Fix a bug: cp -x would fail to set mount point permissions.
3415         * NEWS: mention cp -x bug fix
3416         * src/copy.c (copy_internal): Don't return immediately after
3417         copying a mount point that we do not intend to recurse under.
3418         Based on a patch by Andrew Church.
3419
3420 2007-03-03  Jim Meyering  <jim@meyering.net>
3421
3422         pwd-unreadable-parent: Skip test on ia64/Linux, too.
3423         * tests/misc/pwd-unreadable-parent: Also skip when $REPLACE_GETCWD.
3424         Reported by Bob Proulx.
3425
3426 2007-03-02  Jim Meyering  <jim@meyering.net>
3427
3428         pwd-unreadable-parent: Skip test on non-Linux/GNU systems.
3429         * tests/misc/pwd-unreadable-parent: Rather than trying to decide
3430         whether this test has a chance of succeeding, run it only when
3431         $(host_os) is linux-gnu.  It was failing on powerpc-apple-darwin8.8.0
3432         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Add host_os=$(host_os).
3433
3434         * tests/misc/pwd-long: Also allow "+" in $PWD.
3435
3436         Remove another coreutils-ism.  Formatting cleanup.
3437         * Makefile.maint (my-distcheck): Update an outdated comment.
3438         (emit_upload_commands): Use $(PACKAGE) rather than "coreutils".
3439         (my-distcheck): Skip the c99/c89 check if there's no such .diff file.
3440
3441 2007-03-01  Jim Meyering  <jim@meyering.net>
3442
3443         * Makefile.maint (warn_cflags): Hoist, adding "-Dlint -O".
3444         (my-distcheck): Use the new variable, instead of too-long literal.
3445
3446         Make "make syntax-check" rules less coreutils-specific.
3447         * Makefile.maint (sc_cast_of_x_alloc_return_value): Use CVS_LIST_EXCEPT.
3448         (sc_cast_of_alloca_return_value): Likewise.
3449         (sc_root_tests): Do nothing if there is no check-root target
3450         in tests/Makefile.am.
3451
3452         Run the writable-files check only for release-building targets.
3453         * Makefile.maint (local-checks-available): Remove writable-files.
3454         (alpha beta major): Put it here, instead.
3455
3456         "make syntax-check" now runs only Makefile.cfg-selected tests
3457         * Makefile.maint (syntax-check-rules): Hoist this definition so that
3458         it precedes the indirect use in the definition of $(local-check).
3459         (local-check): Use :=, not just "=".
3460         (syntax-check): Depend on $(local-check), not $(syntax-check-rules).
3461
3462 2007-02-28  Bruno Haible  <bruno@clisp.org>
3463
3464         * bootstrap.conf (gnulib_modules): Replace xreadlink with
3465         xreadlink-with-size. Add xreadlink.
3466         * src/copy.c (copy_internal): Update.
3467         * src/ls.c (is_directory): Update.
3468         * src/stat.c (print_stat): Update.
3469         * src/readlink.c (main): Use the one-argument xreadlink function.
3470
3471 2007-02-28  Paul Eggert  <eggert@cs.ucla.edu>
3472
3473         * doc/coreutils.texi (Common options): --si outputs "M", not "MB".
3474         Problem reported by Philip Rowlands in
3475         <http://lists.gnu.org/archive/html/bug-coreutils/2007-02/msg00283.html>.
3476
3477 2007-02-28  Jim Meyering  <jim@meyering.net>
3478
3479         * .x-sc_file_system: Add the new test, tests/misc/df-P, to this
3480         list of exceptions, for the "make distcheck" sc_file_system rule.
3481
3482         * Makefile.maint (gnulib_snapshot_date): Remove now-unused definition.
3483
3484 2007-02-27  Paul Eggert  <eggert@cs.ucla.edu>
3485
3486         Make df -P immune to effects of e.g., the BLOCK_SIZE envvar.
3487         * NEWS: With -P, the default block size and output format is not
3488         affected by DF_BLOCK_SIZE, BLOCK_SIZE, or BLOCKSIZE.
3489         * src/df.c (main): Implement this.
3490
3491 2007-02-27  Jim Meyering  <jim@meyering.net>
3492
3493         Add a test for the above.
3494         * tests/misc/df-P: New file.
3495         * tests/misc/Makefile.am (TESTS): Add df-P.
3496
3497 2007-02-25  Jim Meyering  <jim@meyering.net>
3498
3499         * Makefile.maint (announcement): Adjust so that it works with
3500         announce-gen's --gnulib-snapshot-time-stamp option.
3501         Indent one of the command lines using TAB, not 8 spaces.
3502
3503         Post-release version change.
3504         * NEWS: Add a line for 6.8+.
3505         * configure.ac (AC_INIT): Set new version string.
3506
3507 2007-02-24  Jim Meyering  <jim@meyering.net>
3508
3509         Version 6.8.
3510         * NEWS: Record release date and new version number.
3511         * configure.ac (AC_INIT): New version number.
3512
3513         Don't skip this test on new-enough Linux/GNU systems.
3514         * tests/misc/pwd-unreadable-parent: Test $REPLACE_GETCWD = 0,
3515         rather than for __GETCWD_PREFIX in config.h (the latter is no
3516         longer defined, ever, due to gnulib changes).
3517         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define REPLACE_GETCWD.
3518
3519         Remove the "gnits" option; it prohibits my using "+" as a version
3520         string suffix, and all it does (beyond the default "gnu" option)
3521         is to _require_ the THANKS file.
3522         * configure.ac (AM_INIT_AUTOMAKE): Remove it.
3523
3524         Remove all AUTOMAKE_OPTIONS settings in Makefile.am files.
3525         * tests/chgrp/Makefile.am, tests/chmod/Makefile.am:
3526         * tests/chown/Makefile.am, tests/cp/Makefile.am:
3527         * tests/du/Makefile.am, tests/expr/Makefile.am:
3528         * tests/factor/Makefile.am, tests/general/Makefile.am:
3529         * tests/install/Makefile.am, tests/ln/Makefile.am:
3530         * tests/ls/Makefile.am, tests/mkdir/Makefile.am:
3531         * tests/mv/Makefile.am, tests/readlink/Makefile.am:
3532         * tests/rm/Makefile.am, tests/rmdir/Makefile.am:
3533         * tests/seq/Makefile.am, tests/stty/Makefile.am:
3534         * tests/tee/Makefile.am, tests/touch/Makefile.am:
3535
3536         * README: Document the OSF/1 4.0d build failure and work-around.
3537         Reported by Bruno Haible.
3538
3539         * NEWS: Use a simple "+" suffix to denote pre-release, not "-dirty".
3540         Nicer connotations.
3541         * configure.ac: Use 6.7+, not 6.7-dirty.
3542
3543 2007-02-24  Paul Eggert  <eggert@cs.ucla.edu>
3544
3545         * NEWS: sort no longer compresses temporaries by default.
3546         * bootstrap.conf: Remove findprog.
3547         * doc/coreutils.texi (sort invocation): The default is to not
3548         compress.  Don't treat "" specially.
3549         * src/sort.c: Don't include findprog.h.
3550         (create_temp): Compress only if the user specified --compress-program.
3551         * tests/misc/sort-compress: Adjusts tests to match new behavior.
3552
3553 2007-02-24  Jim Meyering  <jim@meyering.net>
3554
3555         Avoid a shell syntax error, when building with an inadequate Perl.
3556         * man/Makefile.am (.x.1): Add quotes around $(PERL) in case, since
3557         it can expand to "/.../missing perl".
3558
3559         * man/Makefile.am (.x.1): Warn when unable to update a man page.
3560         Suggestion from Bruno Haible.
3561
3562 2007-02-23  Bruno Haible  <bruno@clisp.org>
3563
3564         Handle better the combination of old Perl and a pre-c99 compiler.
3565         * man/Makefile.am (.x.1): If the autoconf test has determined that
3566         perl is missing or not a sufficient version, do nothing.
3567
3568         * tests/readlink/can-e: Put the closing double-quote at the end of a
3569         backquoted word, not in the middle. Works around a bug in sh on
3570         OSF/1 4.0d.
3571         * tests/readlink/can-f: Likewise.
3572         * tests/readlink/can-m: Likewise.
3573
3574         * tests/du/slink: Skip the test if executing on an nfsv3 file system.
3575         This avoids a test failure at least on OSF/1 4.0d.
3576
3577 2007-02-23  Jim Meyering  <jim@meyering.net>
3578
3579         * src/date.c (usage): Split a diagnostic that had grown to be
3580         longer than the C89 maximum of 509 bytes.
3581
3582 2007-02-23  Ed Santiago <ed@edsantiago.com>
3583
3584         * src/date.c (usage): Mention that --rfc-3339 uses space, not 'T',
3585         for a separator.  Include sample RFC 2822 and 3339 output.
3586
3587 2007-02-23  Jim Meyering  <jim@meyering.net>
3588
3589         With -Dlint, make shuf free all heap-allocated storage.
3590         * src/shuf.c (main): Move declaration of input_lines to
3591         function scope, and initialize to NULL, so we can free it.
3592         [lint]: Free all malloc'd memory.
3593         * tests/misc/shuf: Also test shuf's -e and -i options.
3594
3595 2007-02-22  Jim Meyering  <jim@meyering.net>
3596
3597         Merge in a change from some other incarnation of this file (gzip?)
3598         * bootstrap (gnulib_tool): Skip get_translations if there is no po/ dir.
3599
3600         Adjust preceding change not to perform an unaligned access.
3601         * src/copy.c (copy_reg): Undo previous change.  Instead, make
3602         it clearer that we're using a single-byte sentinel, and
3603         [lint]: Initialize sizeof (uintptr_t) - 1 bytes after the sentinel.
3604         Reported by Andreas Schwab.
3605
3606         Placate valgrind, wrt ./cp --sparse=always
3607         * src/copy.c (copy_reg): Place the sentinel by setting a
3608         full word's worth of bits, not just a single byte's worth.
3609         This avoids a harmless (but distracting) case of memory being
3610         used-uninitialized.
3611
3612 2007-02-21  Paul Eggert  <eggert@cs.ucla.edu>
3613
3614         Honor dd's noatime flag if possible, even if not supported on build fs
3615         * doc/coreutils.texi (dd invocation): Warn that noatime might not be
3616         reliable.
3617         * src/dd.c (flags, usage): Look at O_NOATIME, not
3618         HAVE_WORKING_O_NOATIME, to decide whether to support the noatime
3619         flag, so that dd attempts O_NOATIME even if the build file system
3620         does not support it.  Problem reported by Jim Meyering today in
3621         bug-coreutils.
3622         * tests/dd/misc: Generate a warning, not a failure, if noatime
3623         exists but fails.
3624
3625 2007-02-21  Jim Meyering  <jim@meyering.net>
3626
3627         * tests/misc/date: Remove vestigial use of Data::Dumper.
3628
3629 2007-02-20  Paul Eggert  <eggert@cs.ucla.edu>
3630
3631         * src/copy.c (cached_umask): Cast -1 to mode_t to avoid a warning
3632         about out-of-range initializer with Sun C 5.8.
3633
3634 2007-02-20  Jim Meyering  <jim@meyering.net>
3635
3636         * bootstrap (CVS_only_file): Use README-hacking.
3637
3638         Now that we use GIT, not cvs, rename README-cvs.
3639         * README-hacking: Renamed from...
3640         Update to reflect that we now use git.
3641
3642         * README-cvs: ...this.
3643
3644         * src/env.c (main): When invoked with no arguments (i.e. when printing
3645         the environment), use a local variable to iterate through the global
3646         "environ" array, rather than "environ" itself.  This is solely to
3647         avoid changing the environment for an LD_PRELOAD-substituted "puts"
3648         or "exit" function.  Tiny patch by Harvey Eneman.  See
3649         <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9735>.
3650         * THANKS: Update.
3651
3652         * bootstrap: Move definitions of temporary directory names and the
3653         new bt_regex "up" to precede all uses, so it's clearer what their
3654         scope is.  Also, use [.], rather than \\., since the former works
3655         even if eval'd.
3656
3657         * bootstrap: Remove occurrences of $bt (._bootmp) from lib/Makefile.
3658         Based on the bison 2007-02-19 change by Joel E. Denny.
3659
3660 2007-02-19  Paul Eggert  <eggert@cs.ucla.edu>
3661
3662         * NEWS: sort now uses a --compress-program option rather than
3663         an environment variable.
3664         * doc/coreutils.texi (sort invocation): Document this.
3665         * src/sort.c (usage): Likewise.
3666         (COMPRESS_PROGRAM_OPTION): New const.
3667         (long_options, create_temp, main): Support new option.
3668         * tests/misc/sort-compress: Test it.
3669
3670 2007-02-19  Jim Meyering  <jim@meyering.net>
3671
3672         * bootstrap: Fix typo s/dowloading/downloading/ in --help output.
3673
3674 2007-02-18  Jim Meyering  <jim@meyering.net>
3675
3676         * src/system.h: Don't include exit.h, now that it's subsumed
3677         by the gnulib-generated stdlib.h.
3678
3679         * tests/rm/fail-eacces: Skip this test when running as root.
3680         Reported by Matthew Woehlke.
3681
3682         * bootstrap: Use "._bootmp" as the temporary directory name,
3683         not ".#bootmp".  The latter's "#" caused trouble with the new,
3684         gnulib-added "LINK_WARNING_H = $(top_srcdir)/.#bootmp/..." line.
3685
3686 2007-02-14  Paul Eggert  <eggert@cs.ucla.edu>
3687
3688         * bootstrap.conf (gnulib_modules): Add c-strcase.  Remove strcase.
3689         * src/dircolors.c: Include c-strcase.h.
3690         (dc_parse_stream): Use c_strcasecmp rather than
3691         strcasecmp to avoid unreliable results in locales like Turkish
3692         where strcasecmp is incompatible with the C locale.
3693
3694 2007-02-13  Jim Meyering  <jim@meyering.net>
3695
3696         Also check for and print stderr output, in case a program fails.
3697         * tests/misc/tty-eof: Occasionally (not reproducible), this
3698         test would fail, with one or more programs exiting nonzero, e.g.,
3699         tty-eof: sha224sum exited with status 1 (expected 0)
3700         Now, maybe we'll get a clue, the next time that happens.
3701
3702 2007-02-12  Jim Meyering  <jim@meyering.net>
3703
3704         * .x-sc_useless_cpp_parens: Ignore a false-positive in a shell script.
3705
3706         * tests/misc/pwd-unreadable-parent: Skip the test if we're
3707         definitely using the replacement.
3708         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define CONFIG_HEADER.
3709
3710 2007-02-10  Jim Meyering  <jim@meyering.net>
3711
3712         Remove excess leading spaces that would make help2man misbehave.
3713         * src/printf.c (usage): Remove excess spaces on 2nd line of %b desc.
3714         * src/nl.c (usage): Remove excess spaces on 2nd line of pBRE desc.
3715         * src/dd.c (usage): Remove excess spaces on 2nd line of sync desc.
3716         * src/date.c (usage): Use two spaces after each optional flag, not one.
3717         Reported by Thomas Huriaux in <http://bugs.debian.org/410407>.
3718
3719         * Makefile.maint (longopt_re): Relax the regexp, making square
3720         brackets optional, so it matches the newly reported violations, too.
3721
3722         * src/csplit.c (usage): Use two spaces (not one) to separate
3723         each option string from its description, so help2man formats
3724         the derived man page properly.  Reported by Thomas Huriaux in
3725         <http://bugs.debian.org/410407>.
3726         * src/df.c (usage): Likewise.
3727         * src/du.c (usage): Likewise.
3728         * src/install.c (usage): Likewise.
3729         * src/ls.c (usage): Likewise.
3730
3731 2007-02-03  Jim Meyering  <jim@meyering.net>
3732
3733         Test for today's gnulib/lib/getcwd.c fix affecting pwd and readlink
3734         * NEWS: Mention the bug fix.
3735         * tests/misc/pwd-unreadable-parent: New file.
3736         * tests/misc/Makefile.am (TESTS): Ad pwd-unreadable-parent.
3737
3738 2007-02-02  Paul Eggert  <eggert@cs.ucla.edu>
3739
3740         * NEWS: Document fix for cp --preserve=mode.
3741         * src/copy.c (copy_internal): Omit the group- or other-writeable
3742         permissions when creating a directory, to avoid a race condition
3743         if the special mode bits aren't right just after the directory is
3744         created.
3745         * src/cp.c (make_dir_parents_private): Likewise.
3746         * tests/cp/parent-perm-race: Test for the "cp --preserve=mode"
3747         race fix in copy.c.
3748
3749         * NEWS: Document fix for cp --parents.
3750         * src/cp.c (make_dir_parents_private): Report the error sooner with
3751         "cp --parents DIR/FILE DEST" when DIR is a non-directory, thus not
3752         creating the directory, DEST/DIR.
3753         * tests/cp/cp-parents: Test for the non-race-condition bug fixed
3754         by the above change.
3755
3756 2007-02-02  Jim Meyering  <jim@meyering.net>
3757
3758         * src/nl.c (proc_text): Use "NULL", not "(struct re_registers *) 0".
3759
3760         * src/c99-to-c89.diff: Make shred.c Index: and a/b prefixes
3761         consistent, so this can be applied with patch -p0.
3762         Reported by Matthew Woehlke.
3763
3764         Arrange for "make check-root" to run the new root-only test.
3765         * tests/Makefile.am (t9): New target, to run tests/cp/cp-a-selinux.
3766         (all_t): Add t9.
3767
3768         * Makefile.maint (patch-check): Use patch with its -p2 option,
3769         since that makes this check slightly more strict.
3770
3771         Use a directory on a loopback device mounted with -o context=...
3772         * tests/cp/cp-a-selinux: Since this test now runs mount and umount,
3773         it is a root-only one.
3774
3775 2007-01-29  Jim Meyering  <jim@meyering.net>
3776
3777         Plug a leak in ls.
3778         * src/ls.c (print_dir): Don't leak a "DIR"+fd upon failure to
3779         determine dev/inode or upon detecting a symlink loop.
3780
3781         * src/ls.c: Rename three global variables.
3782         (cwd_file): Rename from 'files'.
3783         (cwd_n_alloc): Rename from 'nfiles'.
3784         (cwd_n_used): Rename from 'files_index'.
3785
3786         Shave 8 bytes off the size of "struct fileinfo".
3787         * src/ls.c (fileinfo): Put all members of type "bool" together.
3788
3789 2007-01-28  Paul Eggert  <eggert@cs.ucla.edu>
3790
3791         Modify "ls" to sort its data faster, using the new gnulib mpsort
3792         module rather than qsort.  This is particularly a win in
3793         environments where strcoll is slow, since mpsort typically calls
3794         strcoll less often than qsort does.
3795         * bootstrap.conf (gnulib_modules): Add mpsort.
3796         * src/ls.c: Include mpsort.h.
3797         (sorted_file, sorted_file_alloc): New vars, for a new vector of
3798         pointers to the file info, for speed.
3799         (clear_files, extract_dirs_from_files, sort_files, print_current_files):
3800         (print_many_per_line, print_horizontal, print_with_commas):
3801         (calculate_columns): Set and use new vector.
3802         (initialize_ordering_vector): New function.
3803
3804 2007-01-26  Paul Eggert  <eggert@cs.ucla.edu>
3805
3806         Adjust to today's change to gnulib, which added a module for
3807         string.h to replace the little include files like strcase.h.
3808         * src/dircolors.c: Don't include strcase.h.
3809         * src/system.h: Don't include mempcpy.h, memrchr.h, stpcpy.h, strpbrk.h.
3810
3811 2007-01-26  Jim Meyering  <jim@meyering.net>
3812
3813         * src/dd.c (advance_input_after_read_error): Change diagnostic to
3814         say "invalid file offset" rather than "screwy file offset".
3815
3816         * .x-sc_cast_of_argument_to_free: Remove this file.
3817         * Makefile.am (EXTRA_DIST): Likewise.
3818
3819 2007-01-25  Dan Hipschman  <dsh@linux.ucla.edu>
3820
3821         * src/sort.c (create_temp): Remove superfluous access-X_OK
3822         check.  find_in_path does this for us.
3823
3824 2007-01-24  Jim Meyering  <jim@meyering.net>
3825
3826         Remove usually-skipped test.
3827         * tests/cp/open-perm-race: Remove this file.  It is subsumed
3828         by parent-perm-race.
3829         * tests/cp/Makefile.am (TESTS): Remove open-perm-race.
3830         * tests/sort/Makefile.am: Regenerate.
3831
3832         Pass "make distcheck" again.
3833         * src/sort.c (usage): Split a diagnostic that had grown to be
3834         longer than the C89 maximum of 509 bytes.
3835         * .x-sc_cast_of_argument_to_free: New file.  Allow a cast in sort.c.
3836         FIXME: this is just temporary, while we wait to remove the offending
3837         access-calling code.
3838         * Makefile.am (EXTRA_DIST): Add .x-sc_cast_of_argument_to_free.
3839         * Makefile.maint (sc_cast_of_argument_to_free): Use the
3840         canonical, $$($(CVS_LIST_EXCEPT)).
3841         * m4/.gitignore, m4/.cvsignore, lib/.gitignore, lib/.cvsignore: Update.
3842
3843 2007-01-24  Paul Eggert  <eggert@cs.ucla.edu>
3844
3845         * NEWS: New option sort -C, proposed by XCU ERN 127, which looks
3846         like it will be approved.  Also add --check=quiet, --check=silent
3847         as long aliases, and --check=diagnose-first as an alias for -c.
3848         * doc/coreutils.texi (sort invocation): Document this.
3849         Also, mention that sort -c can take at most one file.
3850         * src/sort.c: Implement this.
3851         Include argmatch.h.
3852         (usage): Document the change.
3853         (CHECK_OPTION): New constant.
3854         (long_options): --check now takes an optional argument, and is now
3855         treated differently from 'c'.
3856         (check_args, check_types): New constant arrays.
3857         (check): New arg CHECKONLY, which suppresses diagnostic if -C.
3858         (main): Parse the new options.
3859         * tests/sort/Test.pm (02d, 02d, incompat5, incompat6):
3860         New tests for -C.
3861
3862 2007-01-24  Jim Meyering  <jim@meyering.net>
3863
3864         Fix a typo.
3865         * tests/misc/sort-compress: Use $abs_top_builddir, not $top_builddir.
3866         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Likewise.
3867
3868         Don't depend on "which".
3869         * tests/misc/sort-compress (SORT): Use $abs_builddir, now which.
3870         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Export top_builddir.
3871
3872 2007-01-24  Dan Hipschman  <dsh@linux.ucla.edu>
3873
3874         Test sort compression.
3875         * tests/misc/Makefile.am: Add the test.
3876         * tests/misc/sort-compress: New file containing the tests.
3877
3878 2007-01-24  Jim Meyering  <jim@meyering.net>
3879
3880         * NEWS: sort temp file compression: tweak wording.
3881         * src/sort.c (struct sortfile) [name]: Declare member to be const.
3882
3883 2007-01-21  Jim Meyering  <jim@meyering.net>
3884
3885         * src/sort.c (MAX_FORK_RETRIES_COMPRESS, MAX_FORK_RETRIES_DECOMPRESS):
3886         In pipe_fork callers, use these named constants, not "2" and "8".
3887         (proctab, nprocs): Declare to be "static".
3888         (pipe_fork) [lint]: Initialize local, pid,
3889         to avoid unwarranted may-be-used-uninitialized warning.
3890         (create_temp): Use the active voice.  Describe parameters, too.
3891
3892 2007-01-21  James Youngman  <jay@gnu.org>
3893
3894         Centralize all the uses of sigprocmask().  Don't restore an invalid
3895         saved mask.
3896         * src/sort.c (enter_cs, leave_cs): New functions for protecting
3897         code sequences against signal delivery.
3898         * (exit_cleanup): Use enter_cs and leave_cs instead of
3899         calling sigprocmask directly.
3900         (create_temp_file, pipe_fork, zaptemp): Likewise
3901
3902 2007-01-21  Dan Hipschman  <dsh@linux.ucla.edu>
3903
3904         Add compression of temp files to sort.
3905         * NEWS: Mention this.
3906         * bootstrap.conf: Import findprog.
3907         * configure.ac: Add AC_FUNC_FORK.
3908         * doc/coreutils.texi: Document GNUSORT_COMPRESSOR environment
3909         variable.
3910         * src/sort.c (compress_program): New global, holds the name of the
3911         external compression program.
3912         (struct sortfile): New type used by mergepfs and friends instead
3913         of filenames to hold PIDs of compressor processes.
3914         (proctab): New global, holds compressor PIDs on which to wait.
3915         (enum procstate, struct procnode): New types used by proctab.
3916         (proctab_hasher, proctab_comparator): New functions for proctab.
3917         (nprocs): New global, number of forked but unreaped children.
3918         (reap, reap_some): New function, wait for/cleanup forked processes.
3919         (register_proc, update_proc, wait_proc): New functions for adding,
3920         modifying and removing proctab entries.
3921         (create_temp_file): Change parameter type to pointer to file
3922         descriptor, and return type to pointer to struct tempnode.
3923         (dup2_or_die): New function used in create_temp and open_temp.
3924         (pipe_fork): New function, creates a pipe and child process.
3925         (create_temp): Creates a temp file and possibly a compression
3926         program to which we filter output.
3927         (open_temp): Opens a compressed temp file and creates a
3928         decompression process through which to filter the input.
3929         (mergefps): Change FILES parameter type to struct sortfile array
3930         and update access accordingly.  Use open_temp and reap_some.
3931         (avoid_trashing_input, merge): Change FILES parameter like
3932         mergefps and call create_temp instead of create_temp_file.
3933         (sort): Call create_temp instead of create_temp_file.
3934         Use reap_some.
3935         (avoid_trashing_input, merge, sort, main): Adapt to mergefps.
3936
3937         The idea of compressing sorts temporary files was first
3938         suggested/implemented by Jay Soffian in 1998, and again
3939         by Charles Randall in 2001.
3940
3941 2007-01-20  Jim Meyering  <jim@meyering.net>
3942
3943         * tests/misc/pwd-long: Work properly even when run from the
3944         wrong one of two or more bind-mounted sibling directories.
3945         Suggestion from Mike Stone in <http://bugs.debian.org/380552>.
3946
3947 2007-01-20  Paul Eggert  <eggert@cs.ucla.edu>
3948
3949         Standardize on list of signals when an app catches signals.
3950         * src/csplit.c (main): Also catch SIGALRM, SIGPIPE, SIGPOLL,
3951         SIGPROF, SIGVTALRM, SIGXCPU, SIGXFSZ.
3952         * src/ls.c (main): Likewise (except SIGPIPE was already caught).
3953         Note that ls.c is special, as it also catches SIGTSTP.
3954         * src/sort.c (main): Likewise.  Also catch SIGQUIT.  More details in
3955         <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9510>.
3956
3957 2007-01-19  Dan Hipschman  <dsh@linux.ucla.edu>
3958         and Paul Eggert  <eggert@cs.ucla.edu>
3959
3960         * src/sort.c (cleanup): Clear temphead at the end.
3961         (exit_cleanup): New function.
3962         (main): Don't invoke atexit until we're ready.
3963         Invoke it with exit_cleanup, not with cleanup and close_stdout,
3964         to avoid a race condition with cleanup and signal handling.  More
3965         details: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9508
3966
3967 2007-01-18  Jim Meyering  <jim@meyering.net>
3968
3969         * src/c99-to-c89.diff: Adjust remove.c offsets.
3970
3971 2007-01-17  Jim Meyering  <jim@meyering.net>
3972
3973         Make "rm --interactive=never ..." never prompt.
3974         * NEWS: Mention this.
3975         * src/remove.h (enum rm_interactive): New ternary type.
3976         (struct rm_options) [interactive]: Use it, here -- rather than bool.
3977         * src/remove.c (prompt): Reflect type change.
3978         * src/mv.c (rm_option_init): Initialize to RMI_NEVER now.
3979         * src/rm.c (main): Add a FIXME comment for '-d' option.
3980         Adapt to type change of rm_options.interactive.
3981
3982         * tests/rm/i-never: New file.  Test for the above fix.
3983         * tests/rm/Makefile.am (TESTS): Add i-never.
3984
3985 2007-01-15  Jim Meyering  <jim@meyering.net>
3986
3987         * bootstrap (gnulib_tool): When adding to .cvsignore and .gitignore,
3988         emit foo.h, for each foo_.h.  This yields one false-positive, fts.h,
3989         but that's ok, since fts_.h will eventually be renamed.
3990
3991         * src/remove.c (remove_dir): Don't use errno in diagnostic.
3992         Root-only test failure reported by Alex van Hout and Jon Grosshart in
3993         <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9415/focus=9415>.
3994
3995         * bootstrap.conf (avoided_gnulib_modules): Fix my typo:
3996         s/--avoid=canonicalize-lgpl/--avoid=canonicalize-gpl/
3997
3998 2007-01-14  Bruno Haible  <bruno@clisp.org>
3999
4000         Enable use of gnulib's new fchdir module.
4001         * bootstrap.conf (avoided_gnulib_modules): Avoid canonicalize-lgpl,
4002         since we use canonicalize.
4003         (gnulib_modules): Add fchdir.
4004         * m4/jm-macros.m4 (coreutils_MACROS): Remove fchdir-stub.
4005
4006 2007-01-13  Jim Meyering  <jim@meyering.net>
4007
4008         * tests/cp/open-perm-race: Remove gdb-based test.
4009         It would run only when compiled with -g, and besides is now
4010         subsumed by file-perm-race.
4011         * tests/cp/Makefile.am (TESTS): Remove open-perm-race.
4012
4013         * Transform all Makefile.am files so that when running "make check",
4014         CU_TEST_NAME is set to the name of the test.  This is so that when I
4015         run valgrind-enabled (--log-file-qualifier=CU_TEST_NAME) "make check"
4016         on the entire package it is more convenient to map a leak or error
4017         found in a valgrind log file back to the offending test.
4018         Use this command:
4019         (echo tests/Makefile.am.in; find tests -name Makefile.am) \
4020          |xargs perl -pi -e '/^(\s*)PATH=...VG_PATH_PREFIX/ and ' \
4021            -e 'print $1,q|CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst |,"\\\n"'
4022
4023 2007-01-11  Jim Meyering  <jim@meyering.net>
4024
4025         Avoid a leak in expr's implementation of the ":" (match) operator.
4026         * src/expr.c (docolon): Free the regexp buffer using regfree, rather
4027         than doing it manually, being careful to set fastmap to NULL first.
4028         Free any re_regs.start and .end members, if necessary.
4029
4030         * tests/misc/test-diag: Work also when libc's error function
4031         reports the entire program name ("../../src/test"), rather than
4032         just the final component.
4033
4034 2007-01-10  Jim Meyering  <jim@meyering.net>
4035
4036         Don't use fts_statp uninitialized for "chown -RLh --preserve-root ...".
4037         * src/chown-core.c (FTSENT_IS_DIRECTORY): New macro.
4038         (change_file_owner): Perform the ROOT_DEV_INO_CHECK only for a
4039         directory.  Non-directory entries lack fts_statp data when using
4040         the FTS_NOSTAT option.
4041
4042 2007-01-07  Jim Meyering  <jim@meyering.net>
4043
4044         * tests/sample-test: Update copyright date to 2007.
4045         * Makefile.maint (copyright-check): Also check the copyright date
4046         in tests/sample-test.
4047
4048 2007-01-06  Jim Meyering  <jim@meyering.net>
4049
4050         * tests/fmt/basic (pfx-only, pfx-of-pfx): New tests,
4051         based on examples from G.P. Halkes in
4052         <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/9388>.
4053
4054 2007-01-06  G.P. Halkes  <buscom@ghalkes.nl>
4055
4056         * src/fmt.c (copy_rest): Correct prefix handling.
4057         Don't elide a line with the prefix followed by only white space.
4058         (get_line): Move EOF-check to loop-termination condition.
4059         * tests/fmt/basic (pfx-1): Adjust test to expect desired result.
4060         (pfx-2): Remove test; its premise was contrary to the documentation.
4061
4062 2007-01-05  Jim Meyering  <jim@meyering.net>
4063
4064         Avoid a used-uninitialized bug for invalid input, i.e., when the size
4065         of the input, not counting newlines, is 1 % 4.
4066         * gl/lib/base64.c (base64_decode): Don't hard-code inlen==4.
4067         It may be smaller when flushing.
4068
4069 2007-01-05  Mike Frysinger  <vapier@gentoo.org>
4070
4071         * src/dircolors.hin: Add a TERM directive for cons25.
4072
4073 2007-01-04  Jim Meyering  <jim@meyering.net>
4074
4075         * Makefile.cfg (local-checks-to-skip): Skip strftime-check, in
4076         case you don't have convenient access to glibc info documentation.
4077
4078         Use the release year, not the current year.
4079         * src/groups.sh (version): Use a better name: @RELEASE_YEAR@.
4080         * src/Makefile.am (RELEASE_YEAR): Define it.
4081         (.sh): Use it.
4082         Thanks to a prod from Eric Blake.
4083
4084         Ensure that "group --version" always prints the current year.
4085         * src/groups.sh (version): Use @CURRENT_YEAR@, rather than 2006.
4086         * src/Makefile.am (.sh): Also substitute for @CURRENT_YEAR@.
4087         Suggestion from Eric Blake.
4088
4089         When decoding, always allow newlines in input, with almost no
4090         performance impact.
4091         * src/base64.c (do_decode): Initialize decode context.
4092         Call base64_decode one more time, after all input is processed.
4093         (usage): When decoding, newlines are always accepted.
4094
4095         * tests/misc/base64: Add a bunch of tests, for the above.
4096         * gl/lib/base64.c: Include <string.h>.
4097         (base64_decode_ctx_init, get_4, decode_4): New functions.
4098         (base64_decode): Efficiently handle interspersed newlines.
4099         (base64_decode_alloc): Update signature.
4100         * gl/lib/base64.h (struct base64_decode_context): Define.
4101         (base64_decode_ctx_init): Add prototype.
4102         (base64_decode, base64_decode_alloc): Update prototypes.
4103
4104         * gl/lib/base64.c: Copied from gnulib.
4105         * gl/lib/base64.h: Likewise.
4106
4107 2007-01-03  Jim Meyering  <jim@meyering.net>
4108
4109         * THANKS: Add Evan Hunt.
4110
4111 2007-01-03  Bruno Haible  <bruno@clisp.org>
4112
4113         Avoid spurious test failures on MacOS X 10.3.9, in a German locale.
4114         * tests/chown/deref: Apply lang-default.
4115         * tests/misc/split-a: Likewise.
4116         * tests/mv/reply-no: Likewise.
4117
4118         * src/copy.c (copy_internal): Use mkfifo as a fallback if mknod fails.
4119         Needed on MacOS X.
4120
4121 2007-01-02  Paul Eggert  <eggert@cs.ucla.edu>
4122
4123         Now, "ls -FRL" always follows symbolic links on Linux.
4124         * NEWS: Mention this bug fix.
4125         * src/ls.c (gobble_file): Fix bug reported by
4126         Nobuyuki Tsuchimura in
4127         http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00152.html
4128         where "ls -FRL" didn't follow a symbolic link in some cases on Linux.
4129         * tests/ls/follow-slink: Add a test for this case.
4130
4131 2007-01-01  Jim Meyering  <jim@meyering.net>
4132
4133         * tests/rm/fail-eperm: Revert last change.  The PATH=... setting
4134         is not honored at least on HP-UX 11.23 systems.
4135         Instead, simply transform the actual output diagnostic.
4136         Test failure reported by Bob Proulx.
4137
4138 2006-12-30  Jim Meyering  <jim@meyering.net>
4139
4140         * bootstrap (gnulib_extra_files): Remove announce-gen.
4141         * bootstrap.conf (gnulib_modules): Add it here instead, now that
4142         it's a module.
4143
4144         * tests/misc/base64: Factor a long, repetitive string.
4145
4146         * src/c99-to-c89.diff: Adjust remove.c offsets.
4147
4148         Clean up after the change of 2006-12-28.
4149         * src/remove.c (AD_pop_and_chdir): Change **DIRP parameter to *DIRP,
4150         now that this function never modifies the pointer.  Adjust comments
4151         and code accordingly.
4152         (remove_dir): Set "dirp" to NULL right after AD_pop_and_chdir call,
4153         now that AD_pop_and_chdir no longer does that.
4154
4155         * tests/rm/fail-eperm: Avoid spurious differences (the error function
4156         from latest glibc no longer prints the full program_name): so don't
4157         invoke rm via ../../src/rm.  Instead, invoke it via "PATH=../../src rm".
4158
4159         * tests/mv/acl (skip): Skip this test also if the destination
4160         directory, which is on a different file system, lacks ACL support.
4161
4162         * src/copy.c (copy_reg): Rewrite a comment that was rendered
4163         inaccurate by the 2006-10-18 change.
4164
4165 2006-12-28  Jim Meyering  <jim@meyering.net>
4166
4167         When moving "up" the hierarchy, be careful to remove a just-emptied
4168         directory before opening ".", to avoid trouble with file system
4169         implementations that cache readdir results at opendir-time.
4170         * src/remove.c (AD_pop_and_chdir): Add a file descriptor parameter.
4171         Don't update **DIRP.  Don't call fdopendir here.
4172         (remove_dir): Call fdopendir here instead.
4173         Report and patch from Mikulas Patocka:
4174         <http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00170.html>
4175
4176 2006-12-27  Jim Meyering  <jim@meyering.net>
4177
4178         * src/tail.c (usage): Mention +N for --bytes and --lines.
4179         Suggestion from Evan Hunt.
4180
4181 2006-12-26  Jim Meyering  <jim@meyering.net>
4182
4183         * configure.ac: Require autoconf-2.61 and automake-1.10.
4184         Without the former (even with autoconf-2.60), "make distcheck"
4185         would fail (without the 2006-09-26 autoconf AC_CHECK_DECL fix),
4186         due to an inttypes.h generated with CFLAGS including -pedantic.
4187         With the old decl check, @HAVE_DECL_STRTOUMAX@ would be 0.
4188
4189         * Makefile.maint (VC-tag): Define, so as to gpg-sign each release
4190         tag, using the release version number as the message.
4191         (vc-dist): Use $(VC-tag), rather than "$(VC) tag".
4192
4193 2006-12-21  Paul Eggert  <eggert@cs.ucla.edu>
4194
4195         * NEWS: dd bs= operands now silently override later ibs= and obs=,
4196         as POSIX requires.
4197         * src/dd.c (scanargs): Implement it.
4198         * tests/dd/misc (outbytes): Test it.
4199         * doc/coreutils.texi (dd invocation): Specify that bs=N
4200         overrides later ibs and obs, undoing part of the
4201         previous change.  (The behavior was wrong.)
4202
4203 2006-12-20  Jim Meyering  <jim@meyering.net>
4204
4205         "rm -rf /etc/motd" (run by non-root) now prints a diagnostic.
4206         * src/remove.c (remove_entry): Handle EACCES for a non-directory, too.
4207         Don't let a non-directory get by with errno == EPERM, either.
4208         Check the file type directly (using cached stat value), rather
4209         than trying to guess it from errno values.
4210         Karl Berry reported that a cross-partition "mv /etc/issue ~"
4211         failed with the um,... suboptimal diagnostic,
4212         "mv: cannot remove `/etc/issue': Not a directory".
4213         * tests/rm/Makefile.am (TESTS): Add fail-eacces.
4214         * tests/rm/fail-eacces: New file.
4215         * NEWS: Mention that both mv and rm are affected.
4216
4217         "cut -f 2- A B" no longer triggers a double-free bug
4218         * src/cut.c (cut_fields): Set file-scoped global to NULL after
4219         freeing it.  This avoids a double-free (and core dump on some systems)
4220         for this usage: "echo 1>a; echo 2>b; cut -f2- a b".  Reported by
4221         James Hunt in <http://bugzilla.redhat.com/220312>.
4222         * NEWS: List this bug fix.
4223         * THANKS: Mention him.
4224         * tests/misc/cut: New file.
4225         * tests/misc/Makefile.am (TESTS): Add cut.
4226
4227 2006-12-15  Jim Meyering  <jim@meyering.net>
4228
4229         * tests/cp/open-perm-race: Correct the gdb-existence check.
4230         Don't run either subsequent gdb command in a sub-shell.
4231         Reported by Thomas Schwinge.
4232         * THANKS: bring up to date.
4233
4234 2006-12-14  Paul Eggert  <eggert@cs.ucla.edu>
4235
4236         Make sure cp -p isn't too generous with file permissions.
4237         * tests/cp/Makefile.am (TESTS): Add file-perm-race.
4238         * tests/cp/file-perm-race: New file.
4239
4240         Ensure cp -pR --parents isn't too generous with parent permissions.
4241         * tests/cp/Makefile.am (TESTS): Add parent-perm-race.
4242         * tests/cp/parent-perm-race: New file.
4243
4244 2006-12-14  Jim Meyering  <jim@meyering.net>
4245
4246         * tests/chgrp/default-no-deref: Don't assume that files are created
4247         with the primary group by default.  That's not true in a directory
4248         with the set-GID bit set.
4249
4250         Don't hang when there's no input tty.
4251         * tests/cp/open-perm-race: Skip this test if there is no
4252         controlling input `terminal'.
4253
4254         Test for a hard-to-detect race fix, using gdb.
4255         * tests/cp/open-perm-race: New file, to test for the
4256         cp --preserve=ownership fix of 2006-12-06.
4257
4258         * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Define abs_top_builddir.
4259         (TESTS): Add open-perm-race.
4260
4261         * src/chgrp.c (main): Don't prohibit -RLh, aka -RL with --no-dereference.
4262         * src/chown.c (main): Likewise.
4263         * src/chown-core.c (change_file_owner): Add to a comment.
4264         * tests/chown/preserve-root: Add tests.
4265
4266         * NEWS: --preserve-root now works with chgrp, chmod, and chown.
4267         * src/chmod.c (process_file): Do honor the --preserve-root option.
4268         * src/chown-core.c (change_file_owner): Likewise, but here, also
4269         handle the case in which a traversal would go "through" a symlink
4270         to root.  Reported by Matthew M. Boedicker
4271         * tests/chown/preserve-root: Test for the above.
4272         * tests/chown/Makefile.am (TESTS): Add preserve-root.
4273
4274         * NEWS: Mention the chmod fix induced by the 2006-12-11 change
4275         to gnulib's m4/openat.m4.
4276
4277 2006-12-13  Andreas Schwab  <schwab@suse.de>
4278
4279         Don't fail if mv/acl test succeeds.
4280         * tests/mv/acl (skip): Check for acl support in the file system.
4281         * tests/mv/Makefile.am (XFAIL_TESTS): Remove.
4282         (TESTS_ENVIRONMENT): Pass CONFIG_HEADER.
4283
4284 2006-12-13  Paul Eggert  <eggert@cs.ucla.edu>
4285
4286         Remove some arbitrary restrictions on size fields, so that
4287         commands like "sort -k 18446744073709551616" no longer fail merely
4288         because 18446744073709551616 doesn't fit in uintmax_t.  The trick
4289         is that these fields can all be treated as effectively infinity;
4290         their exact values don't matter, since no internal buffer can be
4291         that long.
4292         * src/join.c (string_to_join_field): Verify that SIZE_MAX <=
4293         ULONG_MAX if the code assumes this.  Silently truncate too-large
4294         values to SIZE_MAX, as the remaining code will do the right thing
4295         in this case.
4296         * src/sort.c (parse_field_count): Likewise.
4297         * src/uniq.c (size_opt, main): Likewise.
4298         * tests/join/Test.pm (bigfield): New test.
4299         * tests/sort/Test.pm (bigfield): New test.
4300         * tests/uniq/Test.pm (121): New test.
4301
4302 2006-12-13  Jim Meyering  <jim@meyering.net>
4303
4304         * tests/chgrp/default-no-deref: New test.
4305         * tests/chgrp/Makefile.am (TESTS): Add default-no-deref.
4306
4307 2006-12-12  Jim Meyering  <jim@meyering.net>
4308
4309         * src/system.h (SETVBUF): Remove definition, now that the
4310         autoconf macro, AC_FUNC_SETVBUF_REVERSED, does nothing.
4311         * src/tee.c (tee_files): s/SETVBUF/setvbuf/.
4312         * src/od.c (open_next_file): Likewise.
4313
4314 2006-12-09  Jim Meyering  <jim@meyering.net>
4315
4316         * man/Makefile.am (.x.1): Make help2man use $(PACKAGE_STRING) as the
4317         "source".  I.e. "GNU coreutils 6.7".
4318
4319         * NEWS: With the change from "-pre" to "-dirty" suffix, also change
4320         from NEXT_VER-pre to CUR_VER-dirty.  So, this is 6.7-dirty.
4321         * configure.ac (AC_INIT): s/6.8-dirty/6.7-dirty/.
4322
4323         * tests/uniq/Test.pm (test_vector): Skip the pipe-reading test
4324         whenever uniq is expected to fail.  This should catch the other case
4325         [test #112] in which uniq emits "cat: write error: Broken pipe" on
4326         some systems.
4327
4328 2006-12-08  Jim Meyering  <jim@meyering.net>
4329
4330         Include bootstrap tool version info in the announcement form.
4331         * Makefile.maint (gnulib_snapshot_date): Define.
4332         (announcement): Use two new announce-gen options,
4333         --bootstrap-tools and --gnulib-snapshot-date.
4334         * Makefile.cfg (gnulib_dir): Set.
4335
4336         Post-release version change.
4337         * NEWS: Add a line for 6.8-dirty.
4338         * configure.ac (AC_INIT): Set new version string.
4339
4340 2006-12-07  Jim Meyering  jim@meyering.net
4341
4342         Version 6.7.
4343         * NEWS: Record release date.  Remove '-pre' suffix.
4344         * configure.ac (AC_INIT): Remove version string suffix.
4345
4346 2006-12-07  Jim Meyering  <jim@meyering.net>
4347
4348         Make the output of "make check" more reproducible.
4349         * tests/touch/empty-file: Use envvar-check, so "make check" doesn't
4350         evoke diagnostics like this when COLUMNS=0 in the environment:
4351         ls: ignoring invalid width in environment variable COLUMNS: 0
4352         * tests/touch/no-rights: Likewise.
4353         * tests/help-version: Likewise.
4354         * tests/uniq/Test.pm: Don't perform the pipe-reading version of test
4355         118, since it emits "cat: write error: Broken pipe" on some systems.
4356
4357 2006-12-06  Paul Eggert  <eggert@cs.ucla.edu>
4358
4359         * NEWS: Document the cp -p fix for special bits.
4360         * src/copy.c (set_owner): Now returns a three-way result, so
4361         that the caller can clear the special bits.  All callers changed.
4362         (copy_reg): Don't set the special bits if chown failed.
4363         (copy_internal): Likewise.
4364         * tests/cp/special-bits: Test this fix.
4365
4366 2006-12-06  Paul Eggert  <eggert@cs.ucla.edu>
4367
4368         * NEWS: Document the cp --preserve=ownership fix.
4369         * m4/jm-macros.m4 (coreutils_MACROS): Check for fchmod.
4370         * src/copy.c (fchmod_or_lchmod): New function.
4371         (copy_reg): New arg OMITTED_PERMISSIONS.  All uses changed.
4372         Omit confusing and unused ", dst_mode" arg to 'open' without O_CREAT.
4373         When creating a file, use O_EXCL, so we're more likely to detect
4374         funny business by other processes.  At the end, if permissions
4375         were omitted, chmod them back in.
4376         (copy_internal): If the ownership might change, omit some permissions
4377         at first, then restore them after chowning the file.
4378         * src/cp.c (make_dir_parents_private): Likewise.
4379         * src/copy.c (cached_umask): New function.
4380         * src/copy.h (cached_umask): New decl.
4381
4382 2006-12-06  Jim Meyering  <jim@meyering.net>
4383
4384         Make the output of "make check" more reproducible.
4385         * tests/misc/date-sec: Don't emit any diagnostic about sleeping.
4386
4387 2006-12-03  Paul Eggert  <eggert@cs.ucla.edu>
4388
4389         * src/install.c (install_file_in_file): Preserve time stamps
4390         before changing owner or file mode bits, for consistency with
4391         other coreutils programs.
4392
4393 2006-12-03  Jim Meyering  <jim@meyering.net>
4394
4395         * tests/misc/date-sec: Output a fixed string.
4396
4397         * NEWS: du --one-file-system (-x) would skip subdirectories of any
4398         directory listed as second or subsequent command line argument.
4399         * tests/du/one-file-system: New file.  Test for today's fts.c fix.
4400         * tests/du/Makefile.am (TESTS): Add one-file-system.
4401         Reported by Mike Frysinger.
4402
4403 2006-12-02  Jim Meyering  <jim@meyering.net>
4404
4405         * tests/du/basic: Generate 4KB file simply using printf, rather than
4406         seq+head.  This avoids a spurious "Broken pipe" diagnostic from seq.
4407
4408 2006-11-28  Jim Meyering  <jim@meyering.net>
4409
4410         * tests/mv/no-target-dir: Detect a buggy rename syscall.  If found,
4411         skip this test.  This happens at least on ia64 linux-2.4.19 w/ext3.
4412         Reported by Matthew Woehlke.
4413
4414         * tests/mv/dir2dir: Also accept EBUSY.
4415         Reported by Matthew Woehlke.
4416
4417 2006-11-27  Jim Meyering  <jim@meyering.net>
4418
4419         * Makefile.maint (patch-check): Rewrite to diagnose failure.
4420         * src/c99-to-c89.diff: Adjust shred.c offsets.
4421
4422 2006-11-26  Paul Eggert  <eggert@cs.ucla.edu>
4423
4424         Improve the check for departures from C89, and fix the departures
4425         I found.
4426         * Makefile.maint (my-distcheck): Also check for C89 compatibility
4427         as best we can with GCC.
4428         * src/stat.c (PRINTF_OPTION): Omit comma before } in enum
4429         declaration; C89 doesn't allow this.
4430         * src/dcgen: Don't generate string literals longer than
4431         what C89 requires support for.
4432         * src/cut.c (usage): Don't use string literals longer than
4433         what C89 requires support for.
4434         * src/date.c (usage): Likewise.
4435         * src/dd.c (usage): Likewise.
4436         * src/du.c (usage): Likewise.
4437         * src/ls.c (usage): Likewise.
4438         * src/od.c (usage): Likewise.
4439         * src/readlink.c (usage): Likewise.
4440         * src/seq.c (usage): Likewise.
4441         * src/shred.c (usage): Likewise.
4442
4443 2006-11-26  Mike Frysinger  <vapier@gentoo.org>
4444
4445         Recognize new archive, audio and image formats.
4446         Give audio files a separate color.
4447         * src/dircolors.hin: Add comments for common .sh and .csh scripts.
4448         Add .bz2, .tbz2, .tz, .rar, .ace, .zoo, .cpio, .7z, .rz as archive
4449         suffixes.  Add .mng, .pcx, .m2v, .mkv, .ogm, .mp4, .m4v, .mp4v, .vob,
4450         .qt, .nuv, .wmv, .asf, .rm, .rmvb, .flc, .yuv as image formats.
4451         Add .aac, .au, .mid, .midi, .mka, .ra as audio suffixes.  Change
4452         audio color to 00;36 to differentiate from image/video color.
4453
4454 2006-11-26  Jim Meyering  <jim@meyering.net>
4455
4456         * Makefile.maint (patch-check): Compile patched sources with
4457         CFLAGS='-Wdeclaration-after-statement -Werror', to ensure that
4458         no violations remain.
4459
4460         * src/c99-to-c89.diff: Remove 3 bogus hunks.
4461
4462         * src/remove.c (fd_to_subdirp): Remove unused parameter, ds.
4463         Update callers.
4464
4465         * src/c99-to-c89.diff: Adjust for changes in rm.c and in remove.c.
4466
4467         * src/rm.c (main): Remove unnecessary (assuming C99) braces.
4468
4469 2006-11-26  Paul Eggert  <eggert@cs.ucla.edu>
4470
4471         Port parts of the code to C89 to minimize the need for c99-to-c89.diff,
4472         while trying to retain the readability of C99 as much as possible.
4473         * src/remove.c (rm_1): Remove decl of local, fd_cwd.
4474         Replace each of two uses with literal AT_FDCWD.
4475         (cache_stat_init): Return its argument, for convenience.
4476         Update the caller in remove_dir.
4477         (AD_pop_and_chdir): Return prev_dir rather than storing through
4478         a pointer argument.  All uses changed.
4479         (AD_ensure_initialized): New function.
4480         (AD_mark_helper): Use it, to avoid the need for declaration
4481         after statement.
4482         (rm): Move cycle_check_init call into callee...
4483         (rm_1): ...here.
4484         Use an else clause in place of a "continue" statement.
4485         (close_preserve_errno): Remove.
4486         (fd_to_subdirp): Rewrite to avoid the need for decl after statement.
4487
4488 2006-11-25  Jim Meyering  <jim@meyering.net>
4489
4490         * Makefile.am (EXTRA_DIST): Remove announce-gen from here, too.
4491
4492 2006-11-24  Theodoros V. Kalamatianos  <thkala@softlab.ece.ntua.gr> (tiny change)
4493
4494         * tests/du/inacc-dest: Skip this test when running as root.
4495
4496 2006-11-23  Jim Meyering  <jim@meyering.net>
4497
4498         * announce-gen: Remove file.  It's moving to gnulib.
4499         * bootstrap: Pull it from gnulib/build-aux instead.
4500         * Makefile.maint (announcement): Reflect move to ./build-aux.
4501
4502         * tests/du/deref-args: Use "printf %65536s x" to create a 64KB file,
4503         rather than a pipeline that would sometimes evoke a diagnostic
4504         like "seq: write error: Broken pipe".
4505
4506         * tests/help-version: Suppress dd transfer rate output.
4507
4508         * configure.ac (AC_INIT): Bump to 6.7-pre, not 6.6-pre.
4509
4510 2006-11-22  Jim Meyering  <jim@meyering.net>
4511
4512         * announce-gen (print_news_deltas): Fix silly, but harmless typo:
4513         change "(:?..." to "(?:..." in regexps.
4514
4515         Post-release version change.
4516         * NEWS: Add a line for 6.7-pre.
4517         * configure.ac (AC_INIT): Bump to 6.7 and add "-pre" suffix.
4518
4519         Version 6.6.
4520         * NEWS: Record release date.  Remove "-pre" suffix.
4521         * configure.ac (AC_INIT): Remove "-pre" suffix from version string.
4522
4523         * announce-gen: Remove unused --release-archive-directory option.
4524         (print_news_deltas): Accept new adjective, "Noteworthy", in addition
4525         to the old "Major".
4526         Match version numbers in NEWS using tighter regular expressions.
4527         (main): Require the --gpg-key-id=ID option.
4528         * Makefile.maint (announcement): Don't use now-removed
4529         --release-archive-directory=... option.
4530
4531         * NEWS: Mention the three noteworthy changes, all fixed via gnulib.
4532
4533 2006-11-21  Jim Meyering  <jim@meyering.net>
4534
4535         * tests/rm/one-file-system: Upon setup failure (e.g., mount failure),
4536         skip the test rather than failing.  Reported by Michael Deutschmann.
4537
4538         * tests/rm/fail-eperm: Use the "(exit N); exit N" idiom,
4539         rather than just "exit N".
4540
4541         Arrange for "make check-root" to run the new root-only test.
4542         * tests/Makefile.am (t7): New target, to run tests/ls/nameless-uid.
4543         (all_t): Add t7.
4544
4545 2006-11-20  Jim Meyering  <jim@meyering.net>
4546
4547         Add a root-only test for today's lib/idcache.c fix.
4548         * tests/ls/nameless-uid: New file.
4549         * tests/ls/Makefile.am (TESTS): Add nameless-uid.
4550         (TESTS_ENVIRONMENT): Add PERL to the list.
4551
4552 2006-11-19  Jim Meyering  <jim@meyering.net>
4553
4554         * tests/tail-2/assert-2: Mark as a very-expensive test, because I
4555         find the 7-second sleep annoyingly long.  Besides, this test is
4556         probably far too specific and timing sensitive ever to trigger again.
4557         * tests/tail-2/assert: Likewise.
4558
4559         Post-release version change.
4560         * NEWS: Add a line for 6.6-pre.
4561         * configure.ac (AC_INIT): Bump to 6.6 and add "-pre" suffix.
4562
4563         Version 6.5.
4564         * NEWS: Record release date.  Remove "-cvs" suffix.
4565         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
4566
4567 2006-11-18  Jim Meyering  <jim@meyering.net>
4568
4569         "ln --backup f f" produces a misleading diagnostic:
4570         ln: creating hard link `f' => `f': No such file or directory
4571         * src/ln.c (do_link): Give a better diagnostic in this unusual case.
4572         (do_link): Rename local: s/lstat_ok/dest_lstat_ok/.
4573         * tests/ln/Makefile.am (TESTS): Add hard-backup.
4574         * tests/ln/hard-backup: New test for the above.
4575         * NEWS: Mention this fix.
4576
4577 2006-11-16  Paul Eggert  <eggert@cs.ucla.edu>
4578
4579         * bootstrap.conf (gnulib_modules): Add sys_stat, since we use it
4580         directly too.
4581         * lib/.cvsignore, lib/.gitignore: Add root-dev-ino.c, root-dev-ino.h.
4582         * m4/.cvsignore, m4/.gitignore: Add root-dev-ino.m4.
4583         * src/ls.c (DIRED_FPUTS_LITERAL, PUSH_CURRENT_DIRED_POS):
4584         Omit unnecessary parenthesization of args.
4585         * src/od.c (EQUAL_BLOCKS): Likewise.
4586         * src/system.h (STREQ, ASSIGN_STRDUPA): Likewise.
4587
4588 2006-11-16  Jim Meyering  <jim@meyering.net>
4589
4590         * tests/tail-2/append-only: If chattr +a fails, exit 77 (to tell
4591         automake we're skipping this test), and give a diagnostic to tell
4592         the user the same thing.  Reported by Mike Grayson.
4593
4594 2006-11-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4595
4596         * man/Makefile.am (dist_man_MANS): Replace all optional manpages
4597         with `$(MAN)', computed at configure time; also, list them ...
4598         (optional_mans): ... in this new variable.
4599         (max_aux, EXTRA_DIST): Ensure that we distribute all manpages.
4600
4601 2006-11-16  Jim Meyering  <jim@meyering.net>
4602
4603         Help valgrind see that there is no leak in dd.c.
4604         * src/dd.c (dd_copy): Declare real_buf and real_obuf to be static,
4605         so we need not free them at all.  This is easier than freeing
4606         both buffers at each of the early "return"s.
4607
4608         * src/csplit.c (load_buffer): Plug an inconsequential leak.
4609
4610 2006-11-15  Jim Meyering  <jim@meyering.net>
4611
4612         * .x-po-check: Exclude gl/ files.  Otherwise, po-check would
4613         complain that some of gl/lib/*.[ch] are not listed in POTFILES.in.
4614
4615 2006-11-14  Jim Meyering  <jim@meyering.net>
4616
4617         * gl/m4/root-dev-ino.m4: Now that this is part of a real "module",
4618         remove the now-unnecessary use of AC_LIBSOURCES.
4619
4620         Adapt to new version of gnulib-tool.
4621         * gl/modules/root-dev-ino: New file.
4622         * lib/root-dev-ino.c, lib/root-dev-ino.h: Move these files ...
4623         * gl/lib/root-dev-ino.c, gl/lib/root-dev-ino.h: ... to here.
4624         * m4/root-dev-ino.m4: Move this file ...
4625         * gl/m4/root-dev-ino.m4: ... to here.
4626
4627         * bootstrap.conf (gnulib_modules): Add root-dev-ino.
4628
4629 2006-11-13  Jim Meyering  <jim@meyering.net>
4630
4631         * src/sort.c (insertkey): Use xmemdup, rather than xmalloc+assignment.
4632         From Paul Eggert.
4633
4634         Plug another technically-unimportant leak in sort.
4635         * src/sort.c (main): Don't allocate memory for each new key here.
4636         (insertkey): Allocate memory for each key here, instead.
4637         (key_init): Rename from new_key.  Don't allocate.
4638
4639         * src/sort.c (main): Plug a tiny memory leak.
4640         Move declaration of local "minus" down to be nearer point of use.
4641
4642 2006-11-12  Jim Meyering  <jim@meyering.net>
4643
4644         du would exit early, when encountering an inaccessible directory
4645         Reported by Mike Frysinger, in
4646         http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8831
4647         * tests/du/inacc-dest: New test, based on an example from Mike Frysinger.
4648         * tests/chgrp/no-x: Remove the "fts_read failed: ..."
4649         diagnostic from the expected output when using native fdopendir.
4650         * tests/chmod/no-x: Likewise.
4651         * tests/du/no-x: Likewise.
4652         * NEWS: Mention this bug fix.
4653         * tests/du/Makefile.am (TESTS): Add inacc-dest.
4654
4655         * Makefile.maint (sc_cast_of_x_alloc_return_value): Add an exclusion
4656         for xalloc.h itself.
4657
4658         Avoid false-positive when testing via valgrind.
4659         * tests/mv/atomic: Grep strace output for a more specific pattern
4660         than just "unlink", since that got a false positive when testing
4661         under valgrind: unlink("/tmp/valgrind_proc_9657_cmdline_A51E9991") = 0
4662         * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define EGREP.
4663
4664 2006-10-28  Jim Meyering  <jim@meyering.net>
4665
4666         * Makefile.maint (patch-check): Make it easier to regenerate
4667         the src/c99-to-c89.diff file.  E.g., I do this:
4668         make patch-check REGEN_PATCH=1; ediff src/c99-to-c89.diff new-diff
4669
4670         * src/c99-to-c89.diff: Update to reflect new offsets in rm.c.
4671
4672 2006-10-26  Jim Meyering  <jim@meyering.net>
4673
4674         * src/system.h (ftello): Add a compile-time check for the highly
4675         unlikely condition of off_t narrower than long int, rather than
4676         handling it at run time.  Based on a patch from Paul Eggert.
4677
4678 2006-10-25  Paul Eggert  <eggert@cs.ucla.edu>
4679
4680         * tests/chmod/c-option: When double-quoting part of a word, prefer
4681         to double-quote the whole word.  This is a bit easier to read (at
4682         least for me), and in some cases it avoids a shell bug with Tru64
4683         4.0 sh reported by Nelson H. F. Beebe.  For example, instead of
4684         "$abs_srcdir"/../setgid-check we now write
4685         "$abs_srcdir/../setgid-check".
4686         * tests/cp/cp-parents: Likewise.
4687         * tests/du/inaccessible-cwd: Likewise.
4688         * tests/du/long-from-unreadable: Likewise.
4689         * tests/install/basic-1: Likewise.
4690         * tests/install/trap: Likewise.
4691         * tests/misc/close-stdout: Likewise.
4692         * tests/mkdir/concurrent-1: Likewise.
4693         * tests/mkdir/p-1: Likewise.
4694         * tests/mkdir/p-3: Likewise.
4695         * tests/mkdir/parents: Likewise.
4696         * tests/mkdir/perm: Likewise.
4697         * tests/readlink/can-e: Likewise.
4698         * tests/readlink/can-f: Likewise.
4699         * tests/readlink/can-m: Likewise.
4700         * tests/rm/inaccessible: Likewise.
4701         * tests/rm/unread3: Likewise.
4702         * tests/touch/no-create-missing: Likewise.
4703
4704         * lib/.cvsignore: Add uinttostr.c.
4705
4706 2006-10-25  Jim Meyering  <jim@meyering.net>
4707
4708         Portability to Tru64 V4.0.
4709         * src/system.h (ftello) [!HAVE_FSEEKO && !defined ftello]:
4710         Define inline replacement function.
4711         This (along with a yesterday's fix for autoconf's
4712         _AC_SYS_LARGEFILE_MACRO_VALUE macro) makes it so coreutils
4713         now builds once more on Tru64 V4.0.  Reported by Nelson Beebe.
4714
4715 2006-10-25  Bruno Haible  <bruno@clisp.org>
4716
4717         * src/cat.c (infile): Add "const" to declaration.
4718         * src/csplit.c (prefix): Likewise.
4719         * src/printf.c (cfcc_msg): Likewise.
4720         * src/tail.c (valid_file_spec): Likewise.
4721         * src/cut.c (cut_file): Likewise, for a parameter.
4722         * src/expr.c (str_value): Likewise.
4723         * src/fold.c (fold_file): Likewise.
4724         * src/pr.c (init_header): Likewise.
4725         * src/dircolors.c (dc_parse_stream): Likewise, for a local.
4726         * src/tr.c (make_printable_str): Likewise.
4727         * src/nl.c (body_type, header_type, footer_type, current_type):
4728         (separator_str, build_type_arg, nl_file): Likewise, for many.
4729         * src/paste.c (main): Don't assign a read-only string to 'optarg'.
4730         * src/tac.c (separator, tac_seekable, copy_to_temp): Likewise.
4731
4732 2006-10-25  Jim Meyering  <jim@meyering.net>
4733
4734         * tests/sample-test: Update copyright year list to include only
4735         the current year, since this is what I'll want in any new test.
4736
4737 2006-10-24  Jim Meyering  <jim@meyering.net>
4738
4739         * src/c99-to-c89.diff: Update to reflect new offsets.
4740
4741         * NEWS: new feature: rm accepts new option: --one-file-system
4742         Suggested by Steve McIntyre in <http://bugs.debian.org/392925>.
4743         * src/remove.h (struct rm_options) [one_file_system]: New member.
4744         * src/rm.c (rm_option_init): Initialize it.
4745         (usage): Document the option.
4746         * src/mv.c (rm_option_init): Likewise.
4747         * src/remove.c (remove_dir): With --one-file-system and --recursive,
4748         for each directory command line argument, do not affect a file system
4749         different from that of the starting directory.  And give a diagnostic.
4750         * src/rm.c (ONE_FILE_SYSTEM): New enum.
4751         (main): Handle new option.
4752         * tests/rm/one-file-system: Test the above.
4753         * tests/rm/Makefile.am (TESTS): Add one-file-system.
4754         * tests/Makefile.am (check-root): Add the rm/one-file-system
4755         test to the list.
4756         (EXTRA_DIST): Add other-fs-tmpdir.
4757
4758         * tests/mv/setup: Removed.  Renamed to...
4759         * tests/other-fs-tmpdir: ...this new file.
4760         * tests/mv/Makefile.am (EXTRA_DIST): Remove setup.
4761         * tests/mv/acl: Reflect renaming: use ../other-fs-tmpdir.
4762         * tests/mv/backup-is-src: Likewise.
4763         * tests/mv/hard-link-1: Likewise.
4764         * tests/mv/leak-fd: Likewise.
4765         * tests/mv/mv-special-1: Likewise.
4766         * tests/mv/part-fail: Likewise.
4767         * tests/mv/part-hardlink: Likewise.
4768         * tests/mv/part-rename: Likewise.
4769         * tests/mv/part-symlink: Likewise.
4770         * tests/mv/partition-perm: Likewise.
4771         * tests/mv/to-symlink: Likewise.
4772         * tests/mv/into-self-2: Likewise.
4773
4774         Don't let a failure in one test stop "make -k" from running the others.
4775         * tests/Makefile.am (t1 t2 t3 t4 t5): New targets.
4776         (check-root): Depend on them, rather than executing the five
4777         commands in a single rule.  Reported by Greg Schafer.
4778
4779 2006-10-23  Bob Proulx  <bob@proulx.com>  (tiny change)
4780
4781         * Makefile.maint (alpha beta major): Use a better log message for
4782         the automatic commit of .prev-version.
4783
4784 2006-10-23  Jim Meyering  <jim@meyering.net>
4785
4786         * tests/misc/pwd-long: Undo last change, since it made Perl invoke
4787         pwd via a shell.  Instead, ensure that the absolute name of the
4788         pwd binary consists solely of reasonable characters.
4789         Whoops.  Don't exec the perl script.  Otherwise, the sh-trap-based
4790         clean-up code isn't run.
4791
4792         * NEWS: Add a line for 6.5-cvs.
4793         * configure.ac (AC_INIT): Bump to 6.5 and add "-cvs" suffix.
4794
4795 2006-10-22  Jim Meyering  <jim@meyering.net>
4796
4797         Version 6.4.
4798
4799         * NEWS: Record the 6.4 release date.
4800         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
4801
4802         * Makefile.maint: Complete the adaptation to function with a working
4803         directory that is using git (rather than cvs) for version control.
4804
4805 2006-10-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4806
4807         * tests/chmod/c-option: Double-quote instances of `$abs_srcdir'.
4808         * tests/cp/cp-parents: Likewise.
4809         * tests/mkdir/parents: Likewise.
4810         * tests/mkdir/perm: Likewise.
4811
4812         * tests/sample-test: Quote variables containing absolute build
4813         tree paths.  In the cleanup trap, make sure `cd' succeeds before
4814         `chmod'ing and `rm'ing the temporary files.
4815         * tests/chgrp/basic: Likewise.
4816         * tests/chgrp/deref: Likewise.
4817         * tests/chgrp/no-x: Likewise.
4818         * tests/chgrp/posix-H: Likewise.
4819         * tests/chgrp/recurse: Likewise.
4820         * tests/chmod/c-option: Likewise.
4821         * tests/chmod/equal-x: Likewise.
4822         * tests/chmod/equals: Likewise.
4823         * tests/chmod/inaccessible: Likewise.
4824         * tests/chmod/no-x: Likewise.
4825         * tests/chmod/octal: Likewise.
4826         * tests/chmod/setgid: Likewise.
4827         * tests/chmod/umask-x: Likewise.
4828         * tests/chmod/usage: Likewise.
4829         * tests/chown/basic: Likewise.
4830         * tests/chown/deref: Likewise.
4831         * tests/chown/separator: Likewise.
4832         * tests/cp/acl: Likewise.
4833         * tests/cp/backup-1: Likewise.
4834         * tests/cp/backup-dir: Likewise.
4835         * tests/cp/backup-is-src: Likewise.
4836         * tests/cp/cp-HL: Likewise.
4837         * tests/cp/cp-deref: Likewise.
4838         * tests/cp/cp-i: Likewise.
4839         * tests/cp/cp-mv-backup: Likewise.
4840         * tests/cp/cp-parents: Likewise.
4841         * tests/cp/deref-slink: Likewise.
4842         * tests/cp/dir-rm-dest: Likewise.
4843         * tests/cp/dir-slash: Likewise.
4844         * tests/cp/dir-vs-file: Likewise.
4845         * tests/cp/fail-perm: Likewise.
4846         * tests/cp/into-self: Likewise.
4847         * tests/cp/link: Likewise.
4848         * tests/cp/link-no-deref: Likewise.
4849         * tests/cp/link-preserve: Likewise.
4850         * tests/cp/no-deref-link1: Likewise.
4851         * tests/cp/no-deref-link2: Likewise.
4852         * tests/cp/no-deref-link3: Likewise.
4853         * tests/cp/perm: Likewise.
4854         * tests/cp/preserve-2: Likewise.
4855         * tests/cp/r-vs-symlink: Likewise.
4856         * tests/cp/same-file: Likewise.
4857         * tests/cp/slink-2-slink: Likewise.
4858         * tests/cp/sparse: Likewise.
4859         * tests/cp/special-bits: Likewise.
4860         * tests/cp/src-base-dot: Likewise.
4861         * tests/cp/symlink-slash: Likewise.
4862         * tests/dd/not-rewound: Likewise.
4863         * tests/dd/skip-seek2: Likewise.
4864         * tests/dd/unblock-sync: Likewise.
4865         * tests/du/2g: Likewise.
4866         * tests/du/8gb: Likewise.
4867         * tests/du/basic: Likewise.
4868         * tests/du/deref: Likewise.
4869         * tests/du/deref-args: Likewise.
4870         * tests/du/exclude: Likewise.
4871         * tests/du/fd-leak: Likewise.
4872         * tests/du/hard-link: Likewise.
4873         * tests/du/inaccessible-cwd: Likewise.
4874         * tests/du/long-from-unreadable: Likewise.
4875         * tests/du/long-sloop: Likewise.
4876         * tests/du/no-deref: Likewise.
4877         * tests/du/no-x: Likewise.
4878         * tests/du/restore-wd: Likewise.
4879         * tests/du/slash: Likewise.
4880         * tests/du/slink: Likewise.
4881         * tests/du/trailing-slash: Likewise.
4882         * tests/du/two-args: Likewise.
4883         * tests/fmt/long-line: Likewise.
4884         * tests/install/basic-1: Likewise.
4885         * tests/install/create-leading: Likewise.
4886         * tests/install/d-slashdot: Likewise.
4887         * tests/install/trap: Likewise.
4888         * tests/ln/misc: Likewise.
4889         * tests/ln/target-1: Likewise.
4890         * tests/ls/color-dtype-dir: Likewise.
4891         * tests/ls/dangle: Likewise.
4892         * tests/ls/dired: Likewise.
4893         * tests/ls/file-type: Likewise.
4894         * tests/ls/follow-slink: Likewise.
4895         * tests/ls/infloop: Likewise.
4896         * tests/ls/inode: Likewise.
4897         * tests/ls/m-option: Likewise.
4898         * tests/ls/no-arg: Likewise.
4899         * tests/ls/recursive: Likewise.
4900         * tests/ls/rt-1: Likewise.
4901         * tests/ls/stat-dtype: Likewise.
4902         * tests/ls/stat-failed: Likewise.
4903         * tests/ls/stat-vs-dirent: Likewise.
4904         * tests/misc/cat-proc: Likewise.
4905         * tests/misc/close-stdout: Likewise.
4906         * tests/misc/csplit: Likewise.
4907         * tests/misc/date-sec: Likewise.
4908         * tests/misc/false-status: Likewise.
4909         * tests/misc/head-c: Likewise.
4910         * tests/misc/head-pos: Likewise.
4911         * tests/misc/mknod: Likewise.
4912         * tests/misc/nl: Likewise.
4913         * tests/misc/nohup: Likewise.
4914         * tests/misc/pathchk1: Likewise.
4915         * tests/misc/printf: Likewise.
4916         * tests/misc/printf-hex: Likewise.
4917         * tests/misc/pwd-long: Likewise.
4918         * tests/misc/shuf: Likewise.
4919         * tests/misc/sort-rand: Likewise.
4920         * tests/misc/split-a: Likewise.
4921         * tests/misc/split-fail: Likewise.
4922         * tests/misc/split-l: Likewise.
4923         * tests/misc/stat-fmt: Likewise.
4924         * tests/misc/tac-continue: Likewise.
4925         * tests/misc/wc-files0: Likewise.
4926         * tests/mkdir/concurrent-1: Likewise.
4927         * tests/mkdir/p-1: Likewise.
4928         * tests/mkdir/p-2: Likewise.
4929         * tests/mkdir/p-3: Likewise.
4930         * tests/mkdir/p-slashdot: Likewise.
4931         * tests/mkdir/p-thru-slink: Likewise.
4932         * tests/mkdir/p-v: Likewise.
4933         * tests/mkdir/parents: Likewise.
4934         * tests/mkdir/perm: Likewise.
4935         * tests/mkdir/t-slash: Likewise.
4936         * tests/mv/acl: Likewise.
4937         * tests/mv/atomic: Likewise.
4938         * tests/mv/backup-dir: Likewise.
4939         * tests/mv/childproof: Likewise.
4940         * tests/mv/diag: Likewise.
4941         * tests/mv/dir-file: Likewise.
4942         * tests/mv/dir2dir: Likewise.
4943         * tests/mv/dup-source: Likewise.
4944         * tests/mv/hard-2: Likewise.
4945         * tests/mv/hard-3: Likewise.
4946         * tests/mv/hard-4: Likewise.
4947         * tests/mv/hard-link-1: Likewise.
4948         * tests/mv/hard-verbose: Likewise.
4949         * tests/mv/i-2: Likewise.
4950         * tests/mv/i-3: Likewise.
4951         * tests/mv/i-4: Likewise.
4952         * tests/mv/i-5: Likewise.
4953         * tests/mv/i-link-no: Likewise.
4954         * tests/mv/into-self-4: Likewise.
4955         * tests/mv/leak-fd: Likewise.
4956         * tests/mv/mv-special-1: Likewise.
4957         * tests/mv/no-target-dir: Likewise.
4958         * tests/mv/part-fail: Likewise.
4959         * tests/mv/part-hardlink: Likewise.
4960         * tests/mv/part-rename: Likewise.
4961         * tests/mv/part-symlink: Likewise.
4962         * tests/mv/partition-perm: Likewise.
4963         * tests/mv/perm-1: Likewise.
4964         * tests/mv/reply-no: Likewise.
4965         * tests/mv/trailing-slash: Likewise.
4966         * tests/mv/update: Likewise.
4967         * tests/od/od-N: Likewise.
4968         * tests/od/x8: Likewise.
4969         * tests/readlink/can-e: Likewise.
4970         * tests/readlink/can-f: Likewise.
4971         * tests/readlink/can-m: Likewise.
4972         * tests/readlink/rl-1: Likewise.
4973         * tests/rm/cycle: Likewise.
4974         * tests/rm/dangling-symlink: Likewise.
4975         * tests/rm/deep-1: Likewise.
4976         * tests/rm/dir-no-w: Likewise.
4977         * tests/rm/dir-nonrecur: Likewise.
4978         * tests/rm/dot-rel: Likewise.
4979         * tests/rm/empty-inacc: Likewise.
4980         * tests/rm/f-1: Likewise.
4981         * tests/rm/fail-2eperm: Likewise.
4982         * tests/rm/hash: Likewise.
4983         * tests/rm/i-1: Likewise.
4984         * tests/rm/i-no-r: Likewise.
4985         * tests/rm/ignorable: Likewise.
4986         * tests/rm/inaccessible: Likewise.
4987         * tests/rm/interactive-always: Likewise.
4988         * tests/rm/interactive-once: Likewise.
4989         * tests/rm/ir-1: Likewise.
4990         * tests/rm/isatty: Likewise.
4991         * tests/rm/no-give-up: Likewise.
4992         * tests/rm/r-1: Likewise.
4993         * tests/rm/r-2: Likewise.
4994         * tests/rm/r-3: Likewise.
4995         * tests/rm/r-4: Likewise.
4996         * tests/rm/readdir-bug: Likewise.
4997         * tests/rm/rm1: Likewise.
4998         * tests/rm/rm2: Likewise.
4999         * tests/rm/rm3: Likewise.
5000         * tests/rm/rm4: Likewise.
5001         * tests/rm/rm5: Likewise.
5002         * tests/rm/sunos-1: Likewise.
5003         * tests/rm/unread2: Likewise.
5004         * tests/rm/unread3: Likewise.
5005         * tests/rmdir/fail-perm: Likewise.
5006         * tests/rmdir/t-slash: Likewise.
5007         * tests/shred/exact: Likewise.
5008         * tests/shred/remove: Likewise.
5009         * tests/sum/sysv: Likewise.
5010         * tests/tail-2/append-only: Likewise.
5011         * tests/tail-2/assert: Likewise.
5012         * tests/tail-2/assert-2: Likewise.
5013         * tests/tail-2/big-4gb: Likewise.
5014         * tests/tail-2/fflush: Likewise.
5015         * tests/tail-2/infloop-1: Likewise.
5016         * tests/tail-2/proc-ksyms: Likewise.
5017         * tests/tail-2/start-middle: Likewise.
5018         * tests/tail-2/tail-n0f: Likewise.
5019         * tests/tee/basic: Likewise.
5020         * tests/tee/dash: Likewise.
5021         * tests/touch/fail-diag: Likewise.
5022         * tests/touch/no-create-missing: Likewise.
5023         * tests/touch/not-owner: Likewise.
5024         * tests/touch/obsolescent: Likewise.
5025         * tests/touch/read-only: Likewise.
5026         * tests/touch/relative: Likewise.
5027
5028 2006-10-21  Jim Meyering  <jim@meyering.net>
5029
5030         * NEWS: (cp --backup fix): Fix a typo.
5031
5032         * .gitignore: Remove some references to files in subdirectories.
5033         * build-aux/.gitignore, doc/.gitignore, lib/.gitignore: New files.
5034         * m4/.gitignore, po/.gitignore, src/.gitignore: Likewise.
5035
5036         * src/copy.c (copy_internal): Add a comment saying why we prefer
5037         mknod over mkfifo.
5038
5039         Enable an fts optimization (call lstat only for directories,
5040         on some file system types) also with the --preserve-root option
5041         of chown or chgrp.
5042         * src/chown-core.c (change_file_owner): Compare fts_statp-based
5043         dev/ino against root dev/ino only for directories.
5044         (chown_files): Don't let the root_dev_ino setting influence whether
5045         we use FTS_NOSTAT: fts always sets *fts_statp for a directory.
5046
5047 2006-10-20  Jim Meyering  <jim@meyering.net>
5048
5049         * src/od.c (usage): Change description of default to use "-w16",
5050         not the now-invalid "-w 16" syntax.  From Dan Jacobson.
5051
5052 2006-10-19  Jim Meyering  <jim@meyering.net>
5053
5054         * bootstrap: Add names to each .gitignore file (if it exists)
5055         as well as to .cvsignore.
5056
5057         * Makefile.maint (po-check): This rule didn't detect the new use
5058         of "gettext" (as opposed to the use of "_" everywhere else) in
5059         lib/xstrtol.h.  Adjust the grep regexp so that now it does.
5060
5061 2006-10-18  Paul Eggert  <eggert@cs.ucla.edu>
5062
5063         * src/copy.c (copy_reg): Rewrite slightly to avoid duplicate code
5064         when opening dst_name.
5065         (copy_reg, copy_internal): Use (SYSCALL != 0) rather than plain
5066         (SYSCALL) to test for failure in a system call.
5067
5068         * src/copy.c (copy_internal): Use mknod rather than mkfifo to copy
5069         a fifo.  This preserves the special mode bits on Solaris 10, which
5070         is compatible with what Solaris 10 cp -R does.
5071
5072         * src/copy.c (copy_internal): Remove redundant and confusing local
5073         variable src_type.
5074
5075         * src/copy.c (copy_internal): Don't pass mkdir a mode greater than
5076         7777.  This matches historical 'cp' behavior and avoids some
5077         (though not all) implementation-defined behavior of mkdir.
5078         * src/cp.c (make_dir_parents_private): Likewise.
5079         * src/copy.c (copy_internal): Don't pass 'open' a mode greater
5080         than 777.  This is required by POSIX.  It doesn't make any difference
5081         in actual behavior on any host that I know of.
5082
5083 2006-10-17  Jim Meyering  <jim@meyering.net>
5084
5085         * src/dd.c (usage): Use two spaces (not one) to separate the
5086         "fdatasync" option string from its description, so help2man formats
5087         the derived man page properly.  Reported by Samuel Thibault
5088         in <http://bugs.debian.org/393649>.
5089
5090 2006-10-16  Jim Meyering  <jim@meyering.net>
5091
5092         * .x-sc_trailing_blank: Remove names of files that are no longer
5093         version-controlled.
5094
5095 2006-10-16  Paul Eggert  <eggert@cs.ucla.edu>
5096
5097         * src/groups.sh (version): Reword message to match the other programs.
5098         Problem reported by Eric Blake.
5099
5100 2006-10-14  Jim Meyering  <jim@meyering.net>
5101
5102         * Makefile.maint (headers_with_interesting_macro_defs): Define.
5103         (.re-defmac, sc_always_defined_macros): New rules.
5104
5105         * src/system.h (EXIT_FAILURE, EXIT_SUCCESS): Remove definitions.
5106         Instead, include "exit.h".  This hereby retires the work-around for
5107         "Sony NEWS-OS Release 4.0C"'s bug due to "#define EXIT_FAILURE 0".
5108
5109         * src/cksum.c (uint_fast32_t): Don't define.
5110         Instead, include <stdint.h>.
5111
5112         * src/pinky.c (S_IWGRP): Don't define.
5113         It's already defined by "stat-macros.h" (included via system.h).
5114
5115         * Makefile.cfg: Remove cruft that's now handled via bootstrap.
5116         * Makefile.maint: Likewise, remove these targets/rules/variables:
5117         (local_updates, update, cvs-update, wget_files, get-targets): Remove.
5118         (cvs_files, wget-update, automake_repo): Likewise.
5119         Move the comment about cvsu to build-aux/vc-list-files,
5120         where cvsu is actually used.
5121
5122         * Makefile.maint (cvs-update): Use $(CVS), not "cvs".
5123
5124         Work also when the working directory (with e.g. coreutils sources)
5125         is version controlled with git, rather than CVS.
5126         * bootstrap (CVS_only_file): Test for the existence of README-cvs,
5127         rather than CVS.
5128         In messages and comments, say e.g., "checked-out sources",
5129         rather than "CVS sources".
5130         (version_controlled_file): New function.  Work for git as well as
5131         for CVS.  Don't use grep's -q option.
5132         (slurp): Call it here, in place of CVS-specific code.
5133
5134         * NEWS: cp -r --backup dir1 dir2, would rename an existing dir1/dir2
5135         to dir1/dir2~.
5136         * src/copy.c (copy_internal): Although we do create a backup of each
5137         destination directory when in move mode, don't do that when copying.
5138         Reported by Peter Breitenlohner, in
5139         <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8616>.
5140         * tests/cp/backup-dir: New file.  Test for the above.
5141         * tests/cp/Makefile.am (TESTS): Add backup-dir.
5142
5143 2006-10-13  Jim Meyering  <jim@meyering.net>
5144
5145         More chown/chgrp dereferencing-related fixes.
5146         * src/chown-core.c (change_file_owner): Don't use fts_statp if
5147         we're dereferencing symlinks.
5148         Reverse conjuncts, so that we use dereference file_stats
5149         (aka ent->fts_statp) only *after* we've confirmed that
5150         chopt->affect_symlink_referent is true.  Otherwise, we might
5151         use ent->fts_statp uninitialized.
5152         Don't turn on FTS_NOSTAT when dereferencing symlinks.
5153         * tests/chown/deref: Update the expected diagnostic, now that
5154         this test case (trying to use "chown --dereference ..." on a
5155         dangling symlink) takes a different code path.
5156
5157 2006-10-13  Paul Eggert  <eggert@cs.ucla.edu>
5158
5159         Sync from Bison, as follows:
5160
5161         2006-10-01  Paul Eggert  <eggert@cs.ucla.edu>
5162
5163         Fix problems with translating English-language diagnostics.
5164         * bootstrap: Fix bug introduced in recent bootstrap changes, with
5165         respect to bison-runtime pot generation.  The YY_ stuff
5166         wasn't being captured.
5167
5168 2006-10-13  Jim Meyering  <jim@meyering.net>
5169
5170         * src/chown-core.c (change_file_owner): Use fstatat, not stat,
5171         now that we're using fts_open with FTS_CWDFD.
5172         * tests/chgrp/posix-H: Add --preserve-root to an invocation of
5173         chgrp, to exercise the above fix.
5174         * NEWS: Mention the above.
5175
5176         * src/du-tests: Clean up a little, though it's still not portable.
5177
5178         * .vg-suppressions: Add 3 more for debian unstable.
5179
5180         * tests/ls/Test.pm: Remove long-unused file.
5181         * Makefile.am (EXTRA_DIST): Add bootstrap.conf.
5182         Suggestions from Bruno Haible.
5183
5184 2006-10-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5185
5186         * Makefile.am (THANKS-to-translators): Add missing $(srcdir).
5187         (MAINTAINERCLEANFILES): Add .kludge-stamp.
5188         * man/Makefile.am (MAINTAINERCLEANFILES): Typo $(dist_man_MANS)
5189         instead of $(man_MANS).
5190
5191 2006-10-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5192
5193         * configure.ac: Avoid compiler warnings about default return
5194         type in function definitions and unused variables in tests.
5195         * src/who.c (print_user) [HAVE_UT_HOST]: hostlen is only needed
5196         if this is #defined.
5197
5198 2006-10-12  Jim Meyering  <jim@meyering.net>
5199
5200         * configure.ac: Reflect s/gl_MACROS/coreutils_MACROS/ renaming.
5201         Call gl_INIT directly, rather than through the above.
5202
5203 2006-10-11  Paul Eggert  <eggert@cs.ucla.edu>
5204
5205         * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
5206         variable was sometimes used without being initialized.  This
5207         messed up the installation of the INSTALL file in some cases.
5208
5209 2006-10-11  Jim Meyering  <jim@meyering.net>
5210
5211         * src/ls.c (usage): Correct description of -s, --size.
5212         It works even without -l.  Suggestion from Karl Berry.
5213
5214 2006-10-10  Paul Eggert  <eggert@cs.ucla.edu>
5215
5216         * src/ls.c (quote_name): Use initializer rather than memset to
5217         initialize an object to zero.  This is easier to read and is less
5218         likely to introduce a runtime error due to a mixup.  It causes
5219         gcc -W to issue a warning, but you can work around this by
5220         appending -Wno-missing-field-initializers.
5221         * src/pathchk.c (portable_chars_only): Likewise.
5222         * src/shred.c (main): Likewise.
5223         * src/stty.c (main): Likewise.
5224         * src/tr.c (card_of_complement): Likewise.
5225         * src/wc.c (wc): Likewise.
5226
5227 2006-10-09  Paul Eggert  <eggert@cs.ucla.edu>
5228
5229         * src/sort.c (usage): Mention again that sort fields are origin 1.
5230
5231         * NEWS: Fix typo: iso-8602 -> iso-8601.  Problem reported by
5232         Bob Proulx.
5233
5234         * bootstrap (usage, main program, symlink_to_gnulib): Add option
5235         --copy.  Inspired by a suggestion from Bruno Haible.
5236
5237 2006-10-09  Jim Meyering  <jim@meyering.net>
5238
5239         Avoid a compiler warning.
5240         * src/pathchk.c (portable_chars_only): Initialize variable of type
5241         mbstate_t via memset, rather than via '{0}'.  Patch from Bruno Haible.
5242
5243 2006-10-06  Paul Eggert  <eggert@cs.ucla.edu>
5244
5245         Fix bug reported today by Mike Frysinger: mkdir -pv is logging the
5246         wrong file name in some cases.  Lars Wendler reported a bug in
5247         my original fix.
5248         * src/install.c (make_ancestor): New arg COMPONENT.
5249         * src/mkdir.c (make_ancestor): Likewise.
5250         * tests/install/basic-1: Check for install -Dv bug.
5251         * tests/mkdir/Makefile.am (TESTS): Add p-v.
5252         * tests/mkdir/p-v: New file, to test this bug.
5253
5254 2006-10-05  Paul Eggert  <eggert@cs.ucla.edu>
5255
5256         * src/chgrp.c: Don't include lchown.h; no longer needed.
5257         * src/chown.c: Likewise.
5258
5259         * tests/ls/stat-dtype: Use a dynamic test to decide whether the
5260         current file system has useful d_type info.
5261
5262         * src/dd.c (flags): noatime and nofollow now depend on
5263         HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, too.
5264         (usage): Output info about noatime and nofollow only if
5265         they are known to work.
5266         * src/remove.c (AD_push): Inspect HAVE_WORKING_O_NOFOLLOW rather
5267         than O_NOFOLLOW, when testing whether it's possible to avoid a
5268         race condition reliably.
5269
5270 2006-10-05  Jim Meyering  <jim@meyering.net>
5271
5272         * src/c99-to-c89.diff: Update to reflect new offsets.
5273
5274         * tests/install/basic-1: Skip the latter part of this test if the
5275         just-built dd binary is not readable.  Otherwise, this test would fail
5276         when binaries were created as root.  Reported by Bauke Jan Douma in
5277         <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8433>.
5278
5279 2006-10-03  Paul Eggert  <eggert@cs.ucla.edu>
5280
5281         * src/system.h (ST_BLKSIZE): Ceiling at SIZE_MAX / 8 + 1, not at 4
5282         MiB, since XFS hosts can legitimately have large values of
5283         st_blksize.  Problem reported by Tony Ernst in
5284         <http://savannah.gnu.org/bugs/?17903>.
5285
5286 2006-10-04  Jim Meyering  <jim@meyering.net>
5287
5288         * src/remove.c (nonexistent_file_errno): Remove ENAMETOOLONG.
5289         Paul Eggert pointed out that the specified file may exist,
5290         in spite of such an errno value.
5291         * tests/rm/Makefile.am (TESTS): Remove ignore-name-too-long.
5292         * tests/rm/ignore-name-too-long: Remove file.
5293         * NEWS: Update here, too.
5294
5295 2006-10-03  Jim Meyering  <jim@meyering.net>
5296
5297         * tests/rm/fail-eperm: Report failure also if rm is terminated by
5298         a signal.
5299
5300         * src/c99-to-c89.diff: Convert two c99'isms -- one in remove.c
5301         and one in shred.c -- that were added before coreutils-6.3.
5302         Reported by Michael Deutschmann.
5303
5304         * src/c99-to-c89.diff: Update to reflect new offsets.
5305
5306         * src/remove.c (remove_entry): With -f, exit successfully in spite
5307         of a missing file under some very unusual conditions (with errno
5308         being any of ENOENT, ENOTDIR, ENAMETOOLONG).
5309
5310         With --force (-f), rm no longer fails for ENOTDIR.
5311         * src/remove.c (ignorable_missing): New function.
5312         Use it everywhere, rather than open-coding the test.
5313         Andreas Schwab reported the ENOTDIR problem.
5314         (ignorable_missing): Similarly, don't fail for ENAMETOOLONG.
5315
5316         * NEWS: Mention the bug fix.
5317         * tests/rm/ignorable: New file.  Test for the ENOTDIR case.
5318         * tests/rm/ignore-name-too-long: New file. Test for ENAMETOOLONG.
5319         * tests/rm/Makefile.am (TESTS): Add the new file names.
5320
5321         * bootstrap: Undo last change to this file, since now gnulib-tool
5322         sticks with the automake default in generating dependencies.
5323
5324         * NEWS: Add a line for 6.4-cvs.
5325         * configure.ac (AC_INIT): Bump to 6.4 and add "-cvs" suffix.
5326
5327 2006-09-30  Jim Meyering  <jim@meyering.net>
5328
5329         Version 6.3.
5330         * NEWS: Record the 6.3 release date.
5331         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
5332
5333         * NEWS: Mention Paul's Solaris 8 vs. 10 work-around.
5334
5335         * src/c99-to-c89.diff: Update offsets.
5336
5337 2006-09-29  Paul Eggert  <eggert@cs.ucla.edu>
5338
5339         * tests/rm/readdir-bug: Don't use $(...) in a shell script,
5340         as it doesn't work with Solaris /bin/sh.
5341
5342 2006-09-29  Jim Meyering  <jim@meyering.net>
5343
5344         * NEWS: Mention Paul's fix (to gnulib's canon-host.c) for
5345         the pinky segfault.
5346
5347         * tests/seq/basic [neg-2, eq-wid-2]: Comment out tests that
5348         use .1 as the increment.  Actual output varies too much.
5349         [eq-wid-3]: New, commented out test.
5350
5351         * src/shuf.c (read_input): Fix an off-by-one error that
5352         would cause an infloop for piped input of 8KB or more.
5353         * NEWS: Mention the fix.
5354         * tests/misc/shuf: Test for the above fix.
5355
5356         Since any system may be affected by the Darwin readdir bug,
5357         perform the extra rewinddir unconditionally.  The performance
5358         impact of rewinding a directory is negligible.
5359         * src/remove.c (NEED_REWIND): Define to use
5360         CONSECUTIVE_READDIR_UNLINK_THRESHOLD unconditionally.
5361
5362         * tests/seq/basic: Use .11 as the upper bound, in case the ".1"
5363         increment translates to a slightly larger value.
5364         This corrects a test failure on FreeBSD 6.1 reported by Nelson Beebe.
5365         The final expected value wasn't being printed.
5366
5367         Work around a readdir bug in Darwin 7.9.0 (MacOS X 10.3.9) on HFS+
5368         and NFS, whereby rm would not remove all files in a directory.
5369         * src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Reduce to 10.
5370         (NEED_REWIND): New macro, so that we incur the cost of the work-around
5371         rewinddir only on afflicted systems.
5372         * NEWS: Clarify and correct.
5373         * tests/rm/readdir-bug: New file.  Test for the above fix.
5374         * tests/rm/Makefile.am (TESTS): Add it.
5375         Prompted by testing and analysis from Bruno Haible:
5376         http://lists.gnu.org/archive/html/bug-coreutils/2006-09/msg00326.html
5377
5378 2006-09-28  Paul Eggert  <eggert@cs.ucla.edu>
5379
5380         * tests/rm/fail-eperm: Unset BASH_ENV, CDPATH, and ENV, too;
5381         suggested for Debian stable, which uses Perl 5.8.4.
5382
5383 2006-09-28  Jim Meyering  <jim@meyering.net>
5384
5385         Automatically generated dependencies are important even
5386         when all of the sources in a directory come from gnulib.
5387         * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
5388         option that gnulib-tool adds to what becomes our lib/gnulib.mk.
5389
5390         * tests/rm/fail-eperm: Enable Perl's (-T) taint checking.
5391         Ensure that IFS is set properly and unset PATH.
5392         Sanitize inputs.
5393         Work properly even when the name of the selected file starts with "-".
5394         Invoke rm via "../../src/rm", and adjust expected output.
5395         Prompted by a patch from Tim Waugh.
5396
5397         * README-cvs: Add Bison to the list of required packages.
5398
5399 2006-09-26  Jim Meyering  <jim@meyering.net>
5400
5401         * src/c99-to-c89.diff: Update offsets.
5402
5403         * NEWS: rm works around a bug in Darwin 8.6.1 w/NFS that kept
5404         it from removing a directory containing 188 or more entries.
5405         * src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Decrease by
5406         20, go work around the buggy readdir on Darwin 8.6.1 with NFS.
5407         Reported by Matthew Woehlke.
5408
5409 2006-09-26  Paul Eggert  <eggert@cs.ucla.edu>
5410
5411         * NEWS: "groups user" no longer outputs "user :"; you need at least
5412         two users.  "groups" now processes options like --help more compatibly.
5413         * src/groups.sh: Implement the option-processing change.
5414         Handle user and group names with special characters more robustly.
5415         Report write errors instead of exiting silently with status 1.
5416
5417 2006-09-26  Jim Meyering  <jim@meyering.net>
5418
5419         * README: Warn not to run autoreconf manually.  Use bootstrap instead.
5420
5421         * src/groups.sh: When invoked with 0 or 1 argument, just exec "id".
5422         Rewrite to avoid using temporary, $status.
5423
5424         * NEWS: Mention the bug fix.
5425         * src/groups.sh: Don't hide a write failure.
5426         Reported by Iain Calder <ic56@rogers.com>.
5427
5428 2006-09-25  Jim Meyering  <jim@meyering.net>
5429
5430         * src/chown.c (usage): Clarify --dereference description.
5431         * src/chgrp.c (usage): Likewise.  Suggestion from Jamie McClelland.
5432
5433 2006-09-24  Jim Meyering  <jim@meyering.net>
5434
5435         * NEWS: Mention these fixes.
5436         * src/copy.c (copy_reg): With --verbose (-v), print
5437         "removed `file_name'" just after unlinking a file.
5438         (copy_internal): Likewise, in three more places.
5439         Marc Lehman reported that "touch x; ln x y; mv -v x y" was silent.
5440         * tests/mv/hard-verbose: New file.  Test for the above fix.
5441         * tests/mv/Makefile.am (TESTS): Add hard-verbose.
5442
5443         * tests/help-version (sync_args): Don't call sync, since it spins up
5444         disks that I've deliberately caused to spin down (but not unmounted).
5445
5446         * NEWS: Mention the improvement to sort.
5447
5448         * tests/tail-2/proc-ksyms: Require that /proc/ksyms be readable
5449         as well as existing.
5450
5451         * tests/ls/stat-dtype: Don't use tmpfs on linux-2.4 or older,
5452         since that predated addition of d_type support.
5453
5454 2006-09-23  Jim Meyering  <jim@meyering.net>
5455
5456         * gl/modules/getloadavg.diff: New file.  Work around the way the latest
5457         version of the getloadavg module interacts with our bootstrap script.
5458         * bootstrap (gnulib_tool_options): Add "--local-dir gl".
5459         * Makefile.am (EXTRA_DIST): Sort file names.
5460         Add bootstrap and gl/modules/getloadavg.diff
5461
5462 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
5463
5464         * bootstrap: Add support for --force.
5465         (usage): New function.  Describe usage less tersely.
5466         (CVS_only_file): New var.
5467
5468         * NEWS: Document fix for cp -i and mv -i.
5469         * src/copy.c (copy_internal): With -i, prompt even if the source
5470         is a directory and the destination is not.  This is required by
5471         POSIX and gives the user a chance to bail out before failing.
5472         * tests/cp/Makefile.am (TESTS): Add cp-i.
5473         * tests/cp/cp-i: New file.
5474         * tests/mv/Makefile.am (TESTS): Add i-5.
5475         * tests/mv/i-5: New file.
5476
5477 2006-09-20  Jim Meyering  <jim@meyering.net>
5478
5479         * NEWS: Mention the chmod bug fix.
5480
5481         * tests/chmod/inaccessible: New test, specifically for this bug.
5482         Based on a test case from Paul Eggert.
5483         * tests/chmod/Makefile.am (TESTS): Add inaccessible.
5484
5485         Fix the 2006-09-18 bug differently.
5486         * src/chmod.c: (process_file): Upon FTS_NS for a top-level file,
5487         tell fts_read to stat the file again, in case it has become
5488         accessible since the initial fts_open call.
5489         * src/chown-core.c (change_file_owner): Likewise.
5490
5491         * src/chmod.c: Revert last change.  There is a better way.
5492         * src/chown-core.c: Likewise.
5493
5494 2006-09-19  Paul Eggert  <eggert@cs.ucla.edu>
5495
5496         * src/ln.c (target_directory_operand): Rewrite to avoid porting
5497         problem on Tandem reported by Matthew Woehlke in
5498         <https://savannah.gnu.org/bugs/?17172>.
5499
5500 2006-09-18  Paul Eggert  <eggert@cs.ucla.edu>
5501
5502         Fix bug where chmod, chown, and chgrp did not process operands
5503         left-to-right in some cases.
5504         * src/chmod.c (wd_errno): New var.
5505         (chmod_file): New function, with most of the contents of the
5506         old prcess_file function.
5507         (process_files): Use it.  This gives file names to fts one
5508         at a time, so that they are processed left-to-right as POSIX
5509         requires.
5510         * src/chown-core.c (wd_errno, chown_files): Likewise.
5511         (chown_file): New function.
5512         * tests/install/basic-1: Redo test so as to not workaround
5513         the chmod bug, thereby testing for it.
5514
5515         * src/shuf.c (main): Quote the entire range when reporting an
5516         invalid one, rather than just the part that contained the error.
5517
5518         * tests/stty/row-col-1: Rewrite to avoid temporary file that is
5519         sometimes left behind if the test is skipped or interrupted.
5520
5521         * bootstrap (symlink_to_gnulib): New function.
5522         (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
5523         to copies-of-gnulib.
5524         (cp_mark_as_generated, slurp, gnulib_files):
5525         Avoid making a copy if it's the same as the old version.
5526         (gnulib_files): Add support for this variable (used by Bison).
5527
5528         * tests/ls/stat-vs-dirent: Fix quoting problem in diagnostic
5529         indicating flaw in kernel.  Reword to say that the flaw isn't
5530         serious for coreutils, since the flaw does affect ls -i.
5531
5532         * tests/chgrp/basic: Fix bug in test case exposed by building on
5533         Solaris 8 in a setgid directory.  The test case incorrectly
5534         assumed that 'symlink' would be in group $g1.
5535
5536 2006-09-18  Jim Meyering  <jim@meyering.net>
5537
5538         * NEWS: Add a line for 6.3-cvs.
5539         * configure.ac (AC_INIT): Bump to 6.3 and add "-cvs" suffix.
5540
5541         Version 6.2.
5542         * NEWS: Record the 6.2 release date.
5543         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
5544
5545 2006-09-17  Jim Meyering  <jim@meyering.net>
5546
5547         * tests/chgrp/basic: On an OpenBSD system, rather than failing
5548         due to a known problem, merely warn about it.
5549         Rewrite to avoid testing output of chgrp --verbose and chgrp -c.
5550         Instead, use stat to test file system for desired results, directly.
5551         * tests/chgrp/Makefile.am (TESTS_ENVIRONMENT): Set host_triplet.
5552
5553         * tests/envvar-check: Add more variable names to the list of those
5554         that can affect these programs and tests: _POSIX2_VERSION, COLUMNS,
5555         QUOTING_STYLE, TABSIZE, TERM, TMPDIR.
5556
5557 2006-09-16  Paul Eggert  <eggert@cs.ucla.edu>
5558
5559         * NEWS: Document that mkdir -p and install -d now fork on occasion.
5560         * bootstrap.conf (gnulib_modules): Add savewd.
5561         * src/install.c: Include savewd.h.
5562         (process_dir): New function.
5563         (main, install_file_in_file_parents): Use it, along with the new
5564         savewd module, to avoid some race conditions.
5565         * src/mkdir.c: Include savewd.h.
5566         (struct mkdir_options): New members make_ancestor_function, mode,
5567         mode_bits.
5568         (make_ancestor): Return 1 if the resulting directory is not readable.
5569         (process_dir): New function.
5570         (main): Use it, along with new savewd module, to avoid some
5571         race conditions.  Fill in new slots of struct mkdir_options, so
5572         that callees get the values.
5573         * tests/install/basic-1: Test for coreutils 5.97 bug that was
5574         fixed in coreutils 6.0, and which should still be fixed with
5575         this change.
5576         * tests/mkdir/p-3: Likewise.
5577
5578 2006-09-15  Jim Meyering  <jim@meyering.net>
5579
5580         * bootstrap.conf (gnulib_modules): Add rename-dest-slash.
5581         The 2006-09-08 changes made it so "mv dir new-name/" would
5582         fail on NetBSD 1.6.  This makes it work once again.
5583
5584 2006-09-14  Jim Meyering  <jim@meyering.net>
5585
5586         * src/mv.c (main): Remove unnecessary (always-true) test for 2 <= n.
5587         Instead, since it's a little fragile, assert the condition.
5588         (target_directory_operand): Update comment to reflect latest change.
5589
5590 2006-09-12  Paul Eggert  <eggert@cs.ucla.edu>
5591
5592         * src/who.c (print_user): Rewrite to avoid warning from
5593         GCC 4.1.1 with -Wall.
5594
5595 2006-09-12  Jim Meyering  <jim@meyering.net>
5596
5597         * tests/mv/atomic: Check for specific strace output, rather than
5598         simply nonempty.  RHEL AS 4 would fail this test due to strace
5599         generating "[ Process PID=14434 runs in 32 bit mode. ]".
5600         Reported by Nelson Beebe.
5601
5602 2006-09-11  Jim Meyering  <jim@meyering.net>
5603
5604         * src/remove.c (remove_dir): Move new cache_stat_init call onto
5605         it's own line.
5606         (rm_1): Move declaration of "st" and new cache_stat_init call
5607         "down" to nearer where they're used.
5608         * src/c99-to-c89.diff: Add another set of curly braces.
5609
5610 2006-09-10  Paul Eggert  <eggert@cs.ucla.edu>
5611
5612         * src/expr.c (eval6): Fix buffer overrun, or bad performance, if
5613         substr's last operand is very large.  Performance problem reported
5614         by Sebastian Kreft.
5615
5616 2006-09-09  Jim Meyering  <jim@meyering.net>
5617
5618         * Makefile.maint (sc_prohibit_jm_in_m4): Don't hang when there
5619         are no .m4 files.
5620         (sc_require_config_h): Skip this test if there are no version-
5621         controlled .c files.
5622         (sc_prohibit_assert_without_use): Likewise.
5623
5624 2006-09-08  Jim Meyering  <jim@meyering.net>
5625
5626         * bootstrap: Export CVS_RSH separate from its assignment, to work
5627         even with Solaris 10's /bin/sh.  Suggestion from Mark D. Baushke.
5628
5629 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
5630
5631         * NEWS: tail now ignores the -f option if POSIXLY_CORRECT is set,
5632         no file operand is given, and standard input is any FIFO.
5633         This is in response to Open Group XCU ERN 114.
5634         * src/tail.c (main): Likewise.
5635
5636 2006-09-08  Jim Meyering  <jim@meyering.net>
5637
5638         mv and "cp -r" no longer fail when invoked with two arguments
5639         where the first one names a directory and the second name ends in
5640         a slash and doesn't exist.  E.g., "mv dir B/", for nonexistent B,
5641         now succeeds, once more. This reverts part of the 2004-06-27
5642         change for 5.3.0.
5643         * NEWS: Say the above.
5644         * src/mv.c (target_directory_operand): Don't require (here)
5645         that the target operand "look like" a directory.  This change
5646         pushes the test down to the rename syscall level, where a
5647         "mv dir existing-non-dir/" will mistakenly succeed on older systems
5648         that ignore trailing slashes in the rename destination argument.
5649         * src/cp.c (target_directory_operand): Likewise, but for cp.
5650         * tests/mv/trailing-slash: Exercise the above fixes.
5651         * tests/cp/trailing-slash: New file.
5652         * tests/cp/Makefile.am (EXTRA_DIST): Add trailing-slash.
5653
5654         * bootstrap: Use the previously unused variable, $src,
5655         to avoid repeating "$GNULIB_SRCDIR/$file".
5656
5657         * bootstrap (cp_mark_as_generated): Don't use "local", to
5658         accommodate ancient "/bin/sh".  Suggested by Ralf Wildenhues.
5659         Rename now-global "$src" and "$dst" to have cp_ prefix.
5660         Safer, and avoids confusion.
5661
5662         * bootstrap (cp_mark_as_generated): New function.
5663         (slurp): Use it to prepend editor hints and a warning that
5664         the file we're copying is generated.
5665         Suggestion from Bruce Korb.
5666         (cp_mark_as_generated): Don't add C-style comments for .l or .y files.
5667         Fix last-minute typo.
5668
5669 2006-09-07  Jim Meyering  <jim@meyering.net>
5670
5671         * bootstrap: Revert last change.  There are less disruptive ways
5672         to mark these generated files as read-only.
5673
5674         * src/c99-to-c89.diff: Update to have proper offsets.
5675
5676 2006-09-06  Jim Meyering  <jim@meyering.net>
5677
5678         Ensure that some gnulib-tool-generated files are read-only.
5679         * bootstrap (slurp): Put the body of this function in a sub-shell,
5680         with "umask a-w" so that all new files are read-only.  Remove each
5681         file before we write to it, in case it's read-only.
5682         Make po/Makevars and runtime-po/Makevars read-only, too.
5683
5684 2006-09-05  Jim Meyering  <jim@meyering.net>
5685
5686         * tests/cp/acl: Skip this test when cp lacks ACL support.
5687         * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Set $(CONFIG_HEADER).
5688
5689         * src/c99-to-c89.diff (remove.c): Adapt one hunk to match the new
5690         context from change of 2006-09-02.
5691
5692 2006-09-04  Jim Meyering  <jim@meyering.net>
5693
5694         * README-cvs: Fix typo in update command.
5695
5696 2006-09-03  Jim Meyering  <jim@meyering.net>
5697
5698         * NEWS: Tweak the wording in the new change description so that
5699         no one can think this change causes e.g., `rm -fr foo../' to fail.
5700
5701         * tests/rm/inaccessible: Adjust for movement of config.h to lib/.
5702         Use $CONFIG_HEADER, rather than hard-coding it.
5703         * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Set $CONFIG_HEADER.
5704
5705 2006-09-02  Paul Eggert  <eggert@cs.ucla.edu>
5706
5707         * NEWS: rm now rejects attempts to remove /, ./, and ../.
5708         * src/basename.c: Don't include dirname.h, since system.h does it now.
5709         * src/chmod.c: Likewise.
5710         * src/copy.c: Likewise.
5711         * src/cp.c: Likewise.
5712         * src/df.c: Likewise.
5713         * src/dircolors.c: Likewise.
5714         * src/dirname.c: Likewise.
5715         * src/du.c: Likewise.
5716         * src/install.c: Likewise.
5717         * src/ln.c: Likewise.
5718         * src/ls.c: Likewise.
5719         * src/mkdir.c: Likewise.
5720         * src/mv.c: Likewise.
5721         * src/remove.c: Likewise.
5722         * src/rm.c: Likewise.
5723         * src/rmdir.c: Likewise.
5724         * src/shred.c: Likewise.
5725         * src/split.c: Likewise.
5726         * src/su.c: Likewise.
5727         * src/system.h: Include "dirname.h", since dot_or_dotdot needs it
5728         now.
5729         (dot_or_dotdot): Succeed even if "." or ".." is followed by a
5730         slash.
5731         * src/rm.c (usage, main): --preserve-root is now the default.
5732         * src/remove.h: Fix comment.
5733         * src/remove.c (cache_fstatat, cache_stat_init): New functions.
5734         (cache_statted, cache_stat_ok): New functions.
5735         (write_protected_non_symlink): Remove struct stat ** buf_p arg,
5736         which is no longer needed with the new functions.  All callers
5737         changed.
5738         (prompt, is_dir_lstat, remove_entry, remove_dir):
5739         New struct stat * arg.  All callers changed.
5740         (write_protected_non_symlink, prompt, is_dir_lstat, remove_entry):
5741         (remove_cwd_entries, remove_dir, rm_1):
5742         Use and maintain the file status cache.
5743         (prompt, remove_entry): Omit the first "directory" in the diagnostic
5744         "Cannot remove directory `foo': is a directory".  This causes "rm"
5745         to pass a test case that it would otherwise fail now that it
5746         "knows" more about its argument.  I think the diagnostic is better
5747         without the first "directory" anyway.
5748         (prompt): Remove the no-longer-needed IS_DIR arg; all callers changed.
5749         (rm_1): Reject attempts to remove /, ./, or ../.
5750         * tests/rm/Makefile.am (TESTS): Add r-4.
5751         * tests/rm/r-4: New file.
5752
5753 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
5754
5755         * src/stat.c: Include <stddef.h>
5756         (alignof): New macro.
5757         (HAVE_STRUCT_STATXFS_F_FSID___VAL, HAVE_STRUCT_STATXFS_F_FSID_VAL):
5758         Remove.
5759         (STRUCT_STATXFS_F_FSID_IS_INTEGER): New macro.
5760         (FSID_VAL): Remove.
5761         (print_statfs): If f_fsid isn't an integer, grab its words one
5762         at a time in little-endian order.  This is a bit easier to configure
5763         and should avoid a compilation failure on MacOS reported by Bruno
5764         Haible.
5765
5766 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
5767
5768         * src/stat.c (HAVE_STRUCT_STATXFS_F_FSID_VAL, FSID_VAL): New macros, to
5769         work around a Mac OS X porting problem reported by Bruno Haible in
5770         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00308.html>.
5771         (print_statfs): Use them.
5772
5773         * bootstrap.conf (gnulib_modules): Add isapipe.
5774         * src/tail.c: Include isapipe.h.
5775         (IS_PIPE_LIKE_FILE_TYPE): Remove.
5776         (IS_TAILABLE_FILE_TYPE): Just list both FIFOs and sockets as
5777         tailable, since this seems to be portable.
5778         (main): Use isapipe, to fix a bug on MacOS X reported by Bruno Haible in
5779         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00304.html>.
5780
5781         * src/system.h (LOCALEDIR): Remove, since configmake.h now defines
5782         it for us.
5783
5784 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
5785
5786         * src/copy.c (copy_internal): Don't test whether macros like
5787         S_ISLNK are defined, since they're always defined now.
5788         * src/cp.c (main): Likewise.
5789         * src/ln.c (main): Likewise.
5790         * src/ls.c (get_link_name, make_link_name): Likewise.
5791         * src/mknod.c (main): Likewise.
5792         * src/mkfifo.c (usage): Likewise.
5793         * src/who.c (S_IWGRP): Likewise.
5794
5795         Adjust to recent gnulib changes for the gnulib module.
5796         * bootstrap.conf (gnulib_modules): Add fcntl.
5797         * src/system.h (SEEK_SET, SEEK_CUR, SEEK_END): Remove.  Other code
5798         is already assuming these macros are defined.
5799         (O_DIRECT, O_DIRECTORY, O_DSYNC, O_NDELAY, O_NOATIME, O_NONBLOCK):
5800         (O_NOCTTY, O_NOFOLLOW, O_NOLINKS, O_RSYNC, O_SYNC, O_BINARY, O_TEXT):
5801         Remove; the fcntl module now handles these.
5802
5803         Adjust to recent gnulib changes for the inttypes module.
5804         * bootstrap.conf (gnulib_modules): Remove stdint; add inttypes.
5805         (excluded_files): Don't exclude m4/inttypes-h.m4 or m4/inttypes-pri.m4.
5806
5807         * src/system.h: Don't bother to include <stdint.h>, since we can
5808         now assume inttypes.h does the equivalent of including stdint.h.
5809
5810 2006-08-27  Jim Meyering  <jim@meyering.net>
5811
5812         * src/copy.c (copy_internal): Don't make a backup if the last
5813         component of the source name is "." or "..".
5814         Reported by Andreas Schwab in http://savannah.gnu.org/bugs/?17540.
5815         * NEWS: Mention this.
5816         * tests/cp/src-base-dot: New file.  Test for the above fix.
5817         * tests/cp/Makefile.am (TESTS): Add src-base-dot.
5818
5819         * src/system.h (DOT_OR_DOTDOT): Remove macro.  Rewrite as a...
5820         (dot_or_dotdot): ...new static inline function.
5821         * src/remove.c (rm_1): Reflect this renaming.
5822         * src/ls.c (basename_is_dot_or_dotdot): Likewise.
5823
5824         * src/copy.c (copy_internal): Add comments.
5825
5826 2006-08-26  Paul Eggert  <eggert@cs.ucla.edu>
5827
5828         * src/Makefile.am (AM_CPPFLAGS): Remove -I$(srcdir) and -I../lib,
5829         since Automake supplies them for us.  It always did -I$(srcdir),
5830         and with the recent change to AC_CONFIG_HEADERS in configure.ac it
5831         is now also doing -I../lib.
5832
5833         * bootstrap (get_translations): Skip this if WGET_COMMAND is empty.
5834         Fail if the first "echo" fails.  Suppress diagnostics from "ls po/*.po"
5835         since there might not be any .po files.
5836         (WGET_COMMAND): Set to empty if wget doesn't
5837         seem to be available.
5838
5839 2006-08-26  Jim Meyering  <jim@meyering.net>
5840
5841         This test was failing in some environments.
5842         * tests/ls/color-dtype-dir: Don't rely on eval "`dircolors -b`"
5843         to set LS_COLORS in the environment.
5844         * tests/envvar-check: Instead, ensure that LS_COLORS is not set.
5845         Reported by Bob Proulx.
5846
5847         * src/c99-to-c89.diff: Remove hunk for copy.c; no longer needed.
5848
5849         * Makefile.am (EXTRA_DIST): Remove these files here, too:
5850         .x-sc_no_if_have_config_h, .x-sc_prohibit_assert_without_use,
5851         .x-sc_two_space_separator_in_usage.
5852
5853         Fix "mv --verbose --backup" so its output includes the
5854         " (backup: foo.~1~)" suffix also when backing up a directory.
5855         * NEWS: Report this bug fix.
5856         * src/copy.c (emit_verbose): New function, factored out of...
5857         (copy_internal): ...here.  Use the new function.
5858         * tests/mv/backup-dir: Test for the above fix.
5859         * tests/mv/Makefile.am (TESTS): Add backup-dir.
5860
5861 2006-08-25  Paul Eggert  <eggert@cs.ucla.edu>
5862
5863         * .x-sc_no_if_have_config_h: Remove; no longer needed.
5864         * .x-sc_prohibit_assert_without_use: Remove; it was empty.
5865         * .x-sc_two_space_separator_in_usage: Likewise.
5866         * Makefile.maint (sc_no_have_config_h): Renamed from
5867         sc_no_if_have_config_h, since it now checks that HAVE_CONFIG_H
5868         is absent everywhere.
5869         * bootstrap.conf (gnulib_modules): Add config-h.
5870         * src/shred.c: Include <config.h> unconditionally, since
5871         we now assume config.h exists.
5872         * src/dircolors.c: Likewise.
5873
5874 2006-08-26  Jim Meyering  <jim@meyering.net>
5875
5876         "ls --color" would highlight other-writable and sticky directories
5877         no differently than regular directories on a file system with
5878         dirent.d_type support.
5879         * NEWS: Say the above.
5880         * src/ls.c (gobble_file): With --color, also stat the file when
5881         we know it is a directory.
5882         Derived from an anonymous one-line fix and bug report:
5883         <http://savannah.gnu.org/bugs/?15043>.
5884         * tests/ls/color-dtype-dir: New file.  Test for the above fix.
5885         * tests/ls/Makefile.am (TESTS): Add color-dtype-dir.
5886
5887 2006-08-25  Paul Eggert  <eggert@cs.ucla.edu>
5888
5889         * .cvsignore: Remove stamp-h1.  Add coreutils-*, to ignore
5890         tarballs.
5891         * bootstrap.conf: Add configmake, verify.
5892         * src/.cvsignore: Remove localedir.h.
5893         * src/Makefile.am (localedir, DISTCLEANFILES, localedir.h): Remove;
5894         subsumed by configmake.
5895         * src/system.h: Include configmake.h rather than localedir.h
5896         (LOCALEDIR): New macro.
5897
5898         Rewrite to avoid some unnecessary casts, macros, literals.
5899         * src/shred.c (DEFAULT_PASSES, VERBOSE_UPDATE): Now constants,
5900         not macros.
5901         (SECTOR_SIZE, SECTOR_MASK): New constants.
5902         (fillpattern, dopass, do_wipefd, main): Remove unnecessary casts,
5903         and use the SECTOR_* constants when applicable.  Check for size <
5904         0 rather than size == -1, since negative-size files are a sign of
5905         trouble anyway.
5906
5907 2006-08-25  Bruno Haible  <bruno@clisp.org>
5908
5909         * src/shred.c (dopass): Assume a continuable error if EIO even
5910         if the current position is not a multiple of 512.
5911
5912 2006-08-24  Jim Meyering  <jim@meyering.net>
5913
5914         * src/stat.c (print_statfs): Fix typo: remove extra "sizeof".
5915
5916 2006-08-23  Paul Eggert  <eggert@cs.ucla.edu>
5917
5918         * src/stat.c (HAVE_STRUCT_STATXFS_F_FSID___VAL): Define.  This
5919         macro was being used without being defined.
5920         (SB_F_NAMEMAX): Remove cast.
5921         (f_fsid) [BeOS]: Likewise.
5922         (OUT_NAMEMAX): Renamed from NAMEMAX_FORMAT, with a new meaning.
5923         All uses changed.
5924         (out_string, out_int, out_uint, out_uint_o, out_uint_x): New
5925         functions.
5926         (xstrcat): Remove.  All uses changed to use the above functions.
5927         (print_statfs, print_stat): 2nd arg is now the prefix len, not the
5928         buffer len.  All uses changed.  Output '?', not '*', for unknown
5929         data or errors.  Do not assume signed values can be interchanged
5930         with unsigned when printing.
5931         (print_statfs): For %i, print the fsid as a single int, not as a
5932         pair.
5933         (print_it): Quote invalid format better.
5934
5935         * NEWS: printf supports the I flag.
5936         * src/printf.c (print_formatted) [glibc 2.2 or later]: Likewise.
5937
5938 2006-08-23  Bruno Haible  <bruno@clisp.org>
5939
5940         * src/stat.c (STRUCT_STATVFS, statfs, f_fsid, f_blocks, f_bfree) [BeOS]:
5941         (f_bavail, f_bsize, STATFS_FRSIZE, f_files, f_ffree) [BeOS]:
5942         (STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME) [BeOS]: Define.
5943
5944         * src/ls.c (SA_RESTART): Fallback define.
5945
5946 2006-08-23  Paul Eggert  <eggert@cs.ucla.edu>
5947
5948         * src/system.h (EDQUOT): Define if not already defined.
5949         Problem reported by Bruno Haible for BeOS.
5950
5951         * .cvsignore: Remove config.h, config.hin, as they are now
5952         in lib.
5953         * configure.ac (AC_CONFIG_HEADERS): Move config.h and config.hin
5954         to lib.
5955         * src/Makefile.am (AM_CPPFLAGS): Remove '-I..'; no longer needed.
5956
5957         * bootstrap (slurp): Define gl_LOCK_EARLY instead of gl_LOCK,
5958         to accommodate today's gnulib change.
5959
5960 2006-08-23  Jim Meyering  <jim@meyering.net>
5961
5962         * NEWS: Mention the sweeping infrastructure changes.
5963
5964 2006-08-22  Paul Eggert  <eggert@cs.ucla.edu>
5965
5966         * bootstrap.conf (gnulib_modules): Add gnupload.
5967         * Makefile.maint (emit_upload_commands): gnupload is now
5968         in build-aux.
5969         * gnupload: Remove from CVS, since it's now a gnulib module.
5970
5971         * bootstrap (bootstrap_conf_cleanup): Remove.
5972         (excluded_files): New var.
5973         * bootstrap.conf: Likewise.
5974         * bootstrap (slurp): Exclude files early if they're in the
5975         excluded_files list.  That way, their names don't get put into
5976         .cvsignore.
5977
5978         * aclocal.m4, config.hin, configure:
5979         Remove from CVS, since ./bootstrap generates them automatically.
5980         * .cvsignore: Add INSTALL, Makefile.in, aclocal.m4, config.hin,
5981         configure, *.cache, *.lineno, *.log.
5982         Remove more-specific entries.  This catches files like configure.lineno.
5983         * man/.cvsignore: Add Makefile.in.
5984         * src/.cvsignore: Add Makefile.in.
5985         Remove .version, dir.c, install, mvdir, stamp-v, vdir.c, version.c.
5986
5987         * tests/.cvsignore:
5988         * tests/chgrp/.cvsignore:
5989         * tests/chmod/.cvsignore:
5990         * tests/chown/.cvsignore:
5991         * tests/cp/.cvsignore:
5992         * tests/cut/.cvsignore:
5993         * tests/dd/.cvsignore:
5994         * tests/dircolors/.cvsignore:
5995         * tests/du/.cvsignore:
5996         * tests/expr/.cvsignore:
5997         * tests/factor/.cvsignore:
5998         * tests/fmt/.cvsignore:
5999         * tests/head/.cvsignore:
6000         * tests/install/.cvsignore:
6001         * tests/join/.cvsignore:
6002         * tests/ln/.cvsignore:
6003         * tests/ls/.cvsignore:
6004         * tests/ls-2/.cvsignore:
6005         * tests/md5sum/.cvsignore:
6006         * tests/misc/.cvsignore:
6007         * tests/mkdir/.cvsignore:
6008         * tests/mv/.cvsignore:
6009         * tests/od/.cvsignore:
6010         * tests/pr/.cvsignore:
6011         * tests/readlink/.cvsignore:
6012         * tests/rm/.cvsignore:
6013         * tests/rmdir/.cvsignore:
6014         * tests/seq/.cvsignore:
6015         * tests/sha1sum/.cvsignore:
6016         * tests/shred/.cvsignore:
6017         * tests/sort/.cvsignore:
6018         * tests/stty/.cvsignore:
6019         * tests/sum/.cvsignore:
6020         * tests/tac/.cvsignore:
6021         * tests/tail/.cvsignore:
6022         * tests/tail-2/.cvsignore:
6023         * tests/tee/.cvsignore:
6024         * tests/test/.cvsignore:
6025         * tests/touch/.cvsignore:
6026         * tests/tr/.cvsignore:
6027         * tests/tsort/.cvsignore:
6028         * tests/unexpand/.cvsignore:
6029         * tests/uniq/.cvsignore:
6030         * tests/wc/.cvsignore:
6031         Add Makefile.in.  Sort entries if necessary.  Remove *.I, *.E,
6032         *.X, *.O, *-tests, build-script, mk-script if they're never
6033         created in this directory.
6034
6035 2006-08-22  Bruno Haible  <bruno@clisp.org>
6036
6037         BeOS portability.
6038         * src/uptime.c: Include OS.h if it exists.
6039         (print_uptime): On BeOS, use the get_system_info function (actually a
6040         macro). Loop through utmp entries only if utmp.h or utmpx.h exists.
6041         (uptime): Call read_utmp only if utmp.h or utmpx.h exists.
6042
6043 2006-08-22  Jim Meyering  <jim@meyering.net>
6044
6045         * .cvsignore: Add ABOUT-NLS.
6046
6047         Move the check-AUTHORS rule to be run as part of "make distcheck",
6048         rather than "make check".
6049         * src/Makefile.am (check): Don't depend on check-AUTHORS; it would
6050         cause "make check" to fail on systems unable to build all binaries.
6051         * Makefile.maint (check-AUTHORS): New rule.
6052         (local-checks-available): Add it here.
6053         Reported by Bruno Haible.  Needed for BeOS.
6054
6055 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
6056
6057         * src/df.c (print_header, show_dev): Use a column width that
6058         depends on the block size of -P is specified and not autoscaling.
6059         Problem reported by Gustavo G. Rondina in:
6060         http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00164.html
6061
6062 2006-08-21  Jim Meyering  <jim@meyering.net>
6063
6064         * tests/dircolors/simple (a): Don't fail with an unexpected diagnostic
6065         when the shell variable, SHELL, is not set.
6066         Trigger the failure with "(unset SHELL; make check TESTS=simple)".
6067         Reported by Sven Joachim in <http://bugs.debian.org/355368>.
6068
6069         * src/od.c: Now that HAVE_UNSIGNED_LONG_LONG is no longer defined
6070         in config.h, change the uses to HAVE_UNSIGNED_LONG_LONG_INT.
6071         Otherwise, on a system with 4-byte longs, "od -t u8" fails with this:
6072         od: invalid type string `u8';
6073         this system doesn't provide a 8-byte integral type
6074         FIXME: add a test for this, but skip it when sizeof uintmax < 8.
6075
6076 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
6077
6078         Add a bootstrap procedure, so that the CVS version contains fewer
6079         files and we bootstrap the rest from gnulib, gettext, etc.
6080         * README-cvs: New file.
6081         * bootstrap: New file.
6082         * bootstrap.conf: New file.
6083         * .x-sc_trailing_blank: Remove config-log, .gdb-history.  Add .po.
6084         * configure.ac (AC_PREREQ): Move here from m4/*.m4, for benefit
6085         of gnulib-tool.
6086         (gl_DEFAULT_POSIX2_VERSION, gl_USE_SYSTEM_EXTENSIONS, gl_PERL):
6087         (gl_IGNORE_UNUSED_LIBRARIES): Remove; now done by gnulib.
6088         (gl_EARLY): Add.
6089         (gl_MACROS): Call just after gl_EARLY, just for clarity.
6090         * src/c99-to-c89.diff: Remove patch to ls.c; no longer needed.
6091         * src/kill.c (strtoimax): Remove decl.
6092         * src/ls.c: Include "wcwidth.h" instead of rolling it ourselves.
6093         * src/wc.c: Likewise.
6094         * src/ls.c (sort_files): Rewrite to avoid need for C99-style
6095         declaration, so that we don't need to patch this file.
6096         * src/printf.c (strtoimax, strtoumax): Remove decls.
6097         * src/su.c: Include getpass.h.
6098         (getpass): remove.
6099         * src/system.h: Include mempcpy.h, stpcpy.h, strpbrk.h.
6100         Include inttypes.h unconditionally.
6101         (LONGEST_MODIFIER, PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Remove.
6102         (stpcpy, strndup, strstr, strtoul, mempcpy, CHAR_MIN, CHAR_MAX):
6103         (SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, SHRT_MIN, SHRT_MAX, INT_MAX):
6104         (INT_MIN, INTMAX_MAX, INTMAX_MIN, UINT_MAX, LONG_MAX, ULONG_MAX):
6105         (SIZE_MAX, SSIZE_MAX, UINTMAX_MAX): Remove.
6106
6107         * ABOUT-NLS, INSTALL, Makefile.in, man/Makefile.in:
6108         * src/Makefile.in, tests/Makefile.in, tests/chgrp/Makefile.in:
6109         * tests/chmod/Makefile.in, tests/chown/Makefile.in:
6110         * tests/cp/Makefile.in, tests/cut/Makefile.in:
6111         * tests/dd/Makefile.in, tests/dircolors/Makefile.in:
6112         * tests/du/Makefile.in, tests/expr/Makefile.in:
6113         * tests/factor/Makefile.in, tests/fmt/Makefile.in:
6114         * tests/general/Makefile.in, tests/head/Makefile.in:
6115         * tests/install/Makefile.in, tests/join/Makefile.in:
6116         * tests/ln/Makefile.in, tests/ls/Makefile.in:
6117         * tests/ls-2/Makefile.in, tests/md5sum/Makefile.in:
6118         * tests/misc/Makefile.in, tests/mkdir/Makefile.in:
6119         * tests/mv/Makefile.in, tests/od/Makefile.in:
6120         * tests/pr/Makefile.in, tests/readlink/Makefile.in:
6121         * tests/rm/Makefile.in, tests/rmdir/Makefile.in:
6122         * tests/seq/Makefile.in, tests/sha1sum/Makefile.in:
6123         * tests/shred/Makefile.in, tests/sort/Makefile.in:
6124         * tests/stty/Makefile.in, tests/sum/Makefile.in:
6125         * tests/tac/Makefile.in, tests/tail/Makefile.in:
6126         * tests/tail-2/Makefile.in, tests/tee/Makefile.in:
6127         * tests/test/Makefile.in, tests/touch/Makefile.in:
6128         * tests/tr/Makefile.in, tests/tsort/Makefile.in:
6129         * tests/unexpand/Makefile.in, tests/uniq/Makefile.in:
6130         * tests/wc/Makefile.in:
6131         Remove from CVS, since ./bootstrap generates them automatically.
6132
6133 2006-08-20  Eric Blake  <ebb9@byu.net>
6134
6135         * src/stat.c (USE_STATVFS): Reinstate the patch from 2006-08-15;
6136         the patch from 2006-08-18 broke on cygwin.
6137
6138 2006-08-20  Jim Meyering  <jim@meyering.net>
6139
6140         * NEWS: Add a line for 6.2-cvs.
6141         * configure.ac (AC_INIT): Bump to 6.2 and add "-cvs" suffix.
6142
6143 2006-08-19  Jim Meyering  <jim@meyering.net>
6144
6145         * Version 6.1.
6146         * NEWS: Record the 6.1 release date.
6147         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
6148
6149         * tests/Makefile.am (EXTRA_DIST): Add sparse-file.
6150
6151         Avoid test failure when `make check' is run through debuild.
6152         * tests/help-version: Ensure that $SHELL is set to some value
6153         and exported.  Patch from Sven Joachim.  For details, see
6154         <http://bugs.debian.org/355368>.
6155
6156         * tests/ls/stat-dtype: Test for the 2006-08-17 `ls -CF' fix.
6157
6158         * README: Describe potential "pre-C99 build failure", and work-around.
6159
6160         Some of my 2006-07-03 changes to tests/*/Makefile.am were being
6161         backed out due to updates provoked by the copyright changes.
6162         * tests/Makefile.am.in (PATH): Prepend $(VG_PATH_PREFIX), so that
6163         it propagates to the derived Makefile.am files.
6164         ($(srcdir)/Makefile.am): Mark generated .am files as read-only,
6165         so we don't mistakenly edit them again.
6166         * tests/cut/Makefile.am: Regenerate.
6167         * tests/head/Makefile.am: Likewise.
6168         * tests/join/Makefile.am: Likewise.
6169         * tests/pr/Makefile.am: Likewise.
6170         * tests/sort/Makefile.am: Likewise.
6171         * tests/tac/Makefile.am: Likewise.
6172         * tests/tail/Makefile.am: Likewise.
6173         * tests/test/Makefile.am: Likewise.
6174         * tests/tr/Makefile.am: Likewise.
6175         * tests/uniq/Makefile.am: Likewise.
6176         * tests/wc/Makefile.am: Likewise.
6177
6178         * NEWS: Fix cp --sparse so that it preserves tail-end sparseness, even
6179         when the file's apparent size is not a multiple of its block size.
6180         * src/copy.c (copy_reg): Don't write a NUL before calling ftruncate.
6181         For some file sizes, writing that single byte would unnecessarily
6182         waste a few file blocks.  That write may have been necessary in the
6183         early days of Linux, but now, removing it should be safe.
6184         Based on a patch by Alan Curry: <http://bugs.debian.org/370792>
6185         * tests/cp/sparse: New test for the above.
6186         * tests/cp/Makefile.am (TESTS): Add sparse.
6187
6188         * tests/sparse-file: New file, essence factored out of...
6189         * tests/du/8gb: ... here.  Use the new script.
6190
6191 2006-08-18  Paul Eggert  <eggert@cs.ucla.edu>
6192
6193         * src/system.h (select_plural): Reduce by 1000000, not 1000, since
6194         the CVS gettext manual now suggests 1000000.
6195
6196 2006-08-18  Bruno Haible  <bruno@clisp.org>
6197
6198         Add support for NetBSD 3.0.
6199         * src/stat.c (USE_STATVFS): Set to 1 if 'struct statvfs' has a field
6200         f_fstypename.
6201         (STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME): Define also if 'struct statvfs'
6202         has a field f_fstypename.
6203         This undoes the 2006-08-15 to src/stat.c.
6204
6205 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
6206
6207         Copyright notice fixes.
6208
6209         * COPYING: Upgrade to latest version from FSF.
6210
6211         * src/uname.c: Use (C) in copyright notice.
6212
6213         * .vg-suppressions: Add copyright notice.
6214         * ChangeLog: Likewise.
6215         * ChangeLog-2005: Likewise.
6216         * Makefile.am: Likewise.
6217         * NEWS: Likewise.
6218         * README: Likewise.
6219         * README-valgrind: Likewise.
6220         * TODO: Likewise.
6221         * announce-gen: Likewise.
6222         * man/Makefile.am: Likewise.
6223         * man/chmod.x: Likewise.
6224         * man/chown.x: Likewise.
6225         * man/df.x: Likewise.
6226         * man/du.x: Likewise.
6227         * man/rm.x: Likewise.
6228         * src/dircolors.hin: Likewise.
6229         * src/du-tests: Likewise.
6230         * src/extract-magic: Likewise.
6231         * src/tac-pipe.c: Likewise.
6232         * src/wheel-gen.pl: Likewise.
6233         * tests/Coreutils.pm: Likewise.
6234         * tests/Makefile.am.in: Likewise.
6235         * tests/acl: Likewise.
6236         * tests/envvar-check: Likewise.
6237         * tests/expensive: Likewise.
6238         * tests/group-names: Likewise.
6239         * tests/help-version: Likewise.
6240         * tests/mk-script: Likewise.
6241         * tests/priv-check: Likewise.
6242         * tests/rwx-to-mode: Likewise.
6243         * tests/sample-test: Likewise.
6244         * tests/setgid-check: Likewise.
6245         * tests/chgrp/basic: Likewise.
6246         * tests/chgrp/deref: Likewise.
6247         * tests/chgrp/no-x: Likewise.
6248         * tests/chgrp/posix-H: Likewise.
6249         * tests/chgrp/recurse: Likewise.
6250         * tests/chmod/c-option: Likewise.
6251         * tests/chmod/equal-x: Likewise.
6252         * tests/chmod/equals: Likewise.
6253         * tests/chmod/no-x: Likewise.
6254         * tests/chmod/octal: Likewise.
6255         * tests/chmod/setgid: Likewise.
6256         * tests/chmod/umask-x: Likewise.
6257         * tests/chmod/usage: Likewise.
6258         * tests/chown/basic: Likewise.
6259         * tests/chown/deref: Likewise.
6260         * tests/chown/separator: Likewise.
6261         * tests/cp/Makefile.am: Likewise.
6262         * tests/cp/acl: Likewise.
6263         * tests/cp/backup-1: Likewise.
6264         * tests/cp/backup-is-src: Likewise.
6265         * tests/cp/cp-HL: Likewise.
6266         * tests/cp/cp-deref: Likewise.
6267         * tests/cp/cp-mv-backup: Likewise.
6268         * tests/cp/cp-parents: Likewise.
6269         * tests/cp/deref-slink: Likewise.
6270         * tests/cp/dir-rm-dest: Likewise.
6271         * tests/cp/dir-slash: Likewise.
6272         * tests/cp/dir-vs-file: Likewise.
6273         * tests/cp/fail-perm: Likewise.
6274         * tests/cp/into-self: Likewise.
6275         * tests/cp/link: Likewise.
6276         * tests/cp/link-no-deref: Likewise.
6277         * tests/cp/link-preserve: Likewise.
6278         * tests/cp/no-deref-link1: Likewise.
6279         * tests/cp/no-deref-link2: Likewise.
6280         * tests/cp/no-deref-link3: Likewise.
6281         * tests/cp/perm: Likewise.
6282         * tests/cp/preserve-2: Likewise.
6283         * tests/cp/r-vs-symlink: Likewise.
6284         * tests/cp/same-file: Likewise.
6285         * tests/cp/slink-2-slink: Likewise.
6286         * tests/cp/special-bits: Likewise.
6287         * tests/cp/symlink-slash: Likewise.
6288         * tests/cut/Makefile.am: Likewise.
6289         * tests/cut/Test.pm: Likewise.
6290         * tests/dd/misc: Likewise.
6291         * tests/dd/not-rewound: Likewise.
6292         * tests/dd/skip-seek: Likewise.
6293         * tests/dd/skip-seek2: Likewise.
6294         * tests/dd/unblock-sync: Likewise.
6295         * tests/dircolors/simple: Likewise.
6296         * tests/du/2g: Likewise.
6297         * tests/du/8gb: Likewise.
6298         * tests/du/Makefile.am: Likewise.
6299         * tests/du/basic: Likewise.
6300         * tests/du/deref: Likewise.
6301         * tests/du/deref-args: Likewise.
6302         * tests/du/exclude: Likewise.
6303         * tests/du/fd-leak: Likewise.
6304         * tests/du/files0-from: Likewise.
6305         * tests/du/hard-link: Likewise.
6306         * tests/du/inaccessible-cwd: Likewise.
6307         * tests/du/long-from-unreadable: Likewise.
6308         * tests/du/long-sloop: Likewise.
6309         * tests/du/no-deref: Likewise.
6310         * tests/du/no-x: Likewise.
6311         * tests/du/restore-wd: Likewise.
6312         * tests/du/slash: Likewise.
6313         * tests/du/slink: Likewise.
6314         * tests/du/trailing-slash: Likewise.
6315         * tests/du/two-args: Likewise.
6316         * tests/expr/basic: Likewise.
6317         * tests/factor/basic: Likewise.
6318         * tests/fmt/basic: Likewise.
6319         * tests/fmt/long-line: Likewise.
6320         * tests/general/Makefile.am: Likewise.
6321         * tests/general/atgeneral.m4: Likewise.
6322         * tests/general/dd.at: Likewise.
6323         * tests/head/Makefile.am: Likewise.
6324         * tests/head/Test.pm: Likewise.
6325         * tests/install/basic-1: Likewise.
6326         * tests/install/create-leading: Likewise.
6327         * tests/install/d-slashdot: Likewise.
6328         * tests/install/trap: Likewise.
6329         * tests/join/Makefile.am: Likewise.
6330         * tests/join/Test.pm: Likewise.
6331         * tests/ln/backup-1: Likewise.
6332         * tests/ln/misc: Likewise.
6333         * tests/ln/sf-1: Likewise.
6334         * tests/ln/target-1: Likewise.
6335         * tests/ls/Makefile.am: Likewise.
6336         * tests/ls/Test.pm: Likewise.
6337         * tests/ls/dangle: Likewise.
6338         * tests/ls/dired: Likewise.
6339         * tests/ls/file-type: Likewise.
6340         * tests/ls/follow-slink: Likewise.
6341         * tests/ls/infloop: Likewise.
6342         * tests/ls/inode: Likewise.
6343         * tests/ls/m-option: Likewise.
6344         * tests/ls/no-arg: Likewise.
6345         * tests/ls/recursive: Likewise.
6346         * tests/ls/rt-1: Likewise.
6347         * tests/ls/stat-dtype: Likewise.
6348         * tests/ls/stat-failed: Likewise.
6349         * tests/ls/stat-vs-dirent: Likewise.
6350         * tests/ls/symlink-slash: Likewise.
6351         * tests/ls/time-1: Likewise.
6352         * tests/ls-2/tests: Likewise.
6353         * tests/md5sum/basic-1: Likewise.
6354         * tests/md5sum/newline-1: Likewise.
6355         * tests/misc/Makefile.am: Likewise.
6356         * tests/misc/base64: Likewise.
6357         * tests/misc/basename: Likewise.
6358         * tests/misc/cat-proc: Likewise.
6359         * tests/misc/close-stdout: Likewise.
6360         * tests/misc/csplit: Likewise.
6361         * tests/misc/date: Likewise.
6362         * tests/misc/date-sec: Likewise.
6363         * tests/misc/df: Likewise.
6364         * tests/misc/dirname: Likewise.
6365         * tests/misc/expand: Likewise.
6366         * tests/misc/false-status: Likewise.
6367         * tests/misc/fold: Likewise.
6368         * tests/misc/head-c: Likewise.
6369         * tests/misc/head-elide-tail: Likewise.
6370         * tests/misc/head-pos: Likewise.
6371         * tests/misc/mknod: Likewise.
6372         * tests/misc/nice: Likewise.
6373         * tests/misc/nl: Likewise.
6374         * tests/misc/nohup: Likewise.
6375         * tests/misc/paste-no-nl: Likewise.
6376         * tests/misc/pathchk1: Likewise.
6377         * tests/misc/printf: Likewise.
6378         * tests/misc/printf-hex: Likewise.
6379         * tests/misc/pwd-long: Likewise.
6380         * tests/misc/sha224sum: Likewise.
6381         * tests/misc/sha256sum: Likewise.
6382         * tests/misc/sha384sum: Likewise.
6383         * tests/misc/sha512sum: Likewise.
6384         * tests/misc/shuf: Likewise.
6385         * tests/misc/sort-merge: Likewise.
6386         * tests/misc/sort-rand: Likewise.
6387         * tests/misc/split-a: Likewise.
6388         * tests/misc/split-fail: Likewise.
6389         * tests/misc/split-l: Likewise.
6390         * tests/misc/stat-fmt: Likewise.
6391         * tests/misc/stat-printf: Likewise.
6392         * tests/misc/tac-continue: Likewise.
6393         * tests/misc/test-diag: Likewise.
6394         * tests/misc/tty-eof: Likewise.
6395         * tests/misc/wc-files0: Likewise.
6396         * tests/misc/wc-files0-from: Likewise.
6397         * tests/mkdir/concurrent-1: Likewise.
6398         * tests/mkdir/p-1: Likewise.
6399         * tests/mkdir/p-2: Likewise.
6400         * tests/mkdir/p-3: Likewise.
6401         * tests/mkdir/p-slashdot: Likewise.
6402         * tests/mkdir/p-thru-slink: Likewise.
6403         * tests/mkdir/parents: Likewise.
6404         * tests/mkdir/perm: Likewise.
6405         * tests/mkdir/special-1: Likewise.
6406         * tests/mkdir/t-slash: Likewise.
6407         * tests/mkdir/writable-under-readonly: Likewise.
6408         * tests/mv/Makefile.am: Likewise.
6409         * tests/mv/acl: Likewise.
6410         * tests/mv/atomic: Likewise.
6411         * tests/mv/backup-is-src: Likewise.
6412         * tests/mv/childproof: Likewise.
6413         * tests/mv/diag: Likewise.
6414         * tests/mv/dir-file: Likewise.
6415         * tests/mv/dir2dir: Likewise.
6416         * tests/mv/dup-source: Likewise.
6417         * tests/mv/force: Likewise.
6418         * tests/mv/hard-2: Likewise.
6419         * tests/mv/hard-3: Likewise.
6420         * tests/mv/hard-4: Likewise.
6421         * tests/mv/hard-link-1: Likewise.
6422         * tests/mv/i-1: Likewise.
6423         * tests/mv/i-2: Likewise.
6424         * tests/mv/i-3: Likewise.
6425         * tests/mv/i-4: Likewise.
6426         * tests/mv/i-link-no: Likewise.
6427         * tests/mv/into-self: Likewise.
6428         * tests/mv/into-self-2: Likewise.
6429         * tests/mv/into-self-3: Likewise.
6430         * tests/mv/into-self-4: Likewise.
6431         * tests/mv/leak-fd: Likewise.
6432         * tests/mv/mv-special-1: Likewise.
6433         * tests/mv/no-target-dir: Likewise.
6434         * tests/mv/part-fail: Likewise.
6435         * tests/mv/part-hardlink: Likewise.
6436         * tests/mv/part-rename: Likewise.
6437         * tests/mv/part-symlink: Likewise.
6438         * tests/mv/partition-perm: Likewise.
6439         * tests/mv/perm-1: Likewise.
6440         * tests/mv/reply-no: Likewise.
6441         * tests/mv/setup: Likewise.
6442         * tests/mv/to-symlink: Likewise.
6443         * tests/mv/trailing-slash: Likewise.
6444         * tests/mv/update: Likewise.
6445         * tests/mv/vfat: Likewise.
6446         * tests/od/od-N: Likewise.
6447         * tests/od/x8: Likewise.
6448         * tests/pr/Makefile.am: Likewise.
6449         * tests/pr/Test.pm: Likewise.
6450         * tests/readlink/can-e: Likewise.
6451         * tests/readlink/can-f: Likewise.
6452         * tests/readlink/can-m: Likewise.
6453         * tests/readlink/rl-1: Likewise.
6454         * tests/rm/Makefile.am: Likewise.
6455         * tests/rm/cycle: Likewise.
6456         * tests/rm/dangling-symlink: Likewise.
6457         * tests/rm/deep-1: Likewise.
6458         * tests/rm/dir-no-w: Likewise.
6459         * tests/rm/dir-nonrecur: Likewise.
6460         * tests/rm/dot-rel: Likewise.
6461         * tests/rm/empty-inacc: Likewise.
6462         * tests/rm/empty-name: Likewise.
6463         * tests/rm/f-1: Likewise.
6464         * tests/rm/fail-2eperm: Likewise.
6465         * tests/rm/fail-eperm: Likewise.
6466         * tests/rm/hash: Likewise.
6467         * tests/rm/i-1: Likewise.
6468         * tests/rm/i-no-r: Likewise.
6469         * tests/rm/inaccessible: Likewise.
6470         * tests/rm/interactive-always: Likewise.
6471         * tests/rm/interactive-once: Likewise.
6472         * tests/rm/ir-1: Likewise.
6473         * tests/rm/isatty: Likewise.
6474         * tests/rm/no-give-up: Likewise.
6475         * tests/rm/r-1: Likewise.
6476         * tests/rm/r-2: Likewise.
6477         * tests/rm/r-3: Likewise.
6478         * tests/rm/rm1: Likewise.
6479         * tests/rm/rm2: Likewise.
6480         * tests/rm/rm3: Likewise.
6481         * tests/rm/rm4: Likewise.
6482         * tests/rm/rm5: Likewise.
6483         * tests/rm/sunos-1: Likewise.
6484         * tests/rm/unread2: Likewise.
6485         * tests/rm/unread3: Likewise.
6486         * tests/rm/unreadable: Likewise.
6487         * tests/rmdir/fail-perm: Likewise.
6488         * tests/rmdir/ignore: Likewise.
6489         * tests/rmdir/t-slash: Likewise.
6490         * tests/seq/basic: Likewise.
6491         * tests/sha1sum/basic-1: Likewise.
6492         * tests/sha1sum/sample-vec: Likewise.
6493         * tests/shred/exact: Likewise.
6494         * tests/shred/remove: Likewise.
6495         * tests/sort/Makefile.am: Likewise.
6496         * tests/sort/Test.pm: Likewise.
6497         * tests/sort-time/Makefile: Likewise.
6498         * tests/sort-time/README: Likewise.
6499         * tests/sort-time/rand-gen: Likewise.
6500         * tests/stty/basic-1: Likewise.
6501         * tests/stty/row-col-1: Likewise.
6502         * tests/sum/basic-1: Likewise.
6503         * tests/sum/sysv: Likewise.
6504         * tests/tac/Makefile.am: Likewise.
6505         * tests/tac/Test.pm: Likewise.
6506         * tests/tail/Makefile.am: Likewise.
6507         * tests/tail/Test.pm: Likewise.
6508         * tests/tail-2/Makefile.am: Likewise.
6509         * tests/tail-2/append-only: Likewise.
6510         * tests/tail-2/assert: Likewise.
6511         * tests/tail-2/assert-2: Likewise.
6512         * tests/tail-2/big-4gb: Likewise.
6513         * tests/tail-2/fflush: Likewise.
6514         * tests/tail-2/infloop-1: Likewise.
6515         * tests/tail-2/proc-ksyms: Likewise.
6516         * tests/tail-2/start-middle: Likewise.
6517         * tests/tail-2/tail-n0f: Likewise.
6518         * tests/tee/basic: Likewise.
6519         * tests/tee/dash: Likewise.
6520         * tests/test/Makefile.am: Likewise.
6521         * tests/test/Test.pm: Likewise.
6522         * tests/touch/Makefile.am: Likewise.
6523         * tests/touch/dangling-symlink: Likewise.
6524         * tests/touch/empty-file: Likewise.
6525         * tests/touch/fail-diag: Likewise.
6526         * tests/touch/fifo: Likewise.
6527         * tests/touch/no-create-missing: Likewise.
6528         * tests/touch/no-rights: Likewise.
6529         * tests/touch/not-owner: Likewise.
6530         * tests/touch/obsolescent: Likewise.
6531         * tests/touch/read-only: Likewise.
6532         * tests/touch/relative: Likewise.
6533         * tests/tr/Makefile.am: Likewise.
6534         * tests/tr/Test.pm: Likewise.
6535         * tests/tr/failures: Likewise.
6536         * tests/tsort/basic-1: Likewise.
6537         * tests/unexpand/basic-1: Likewise.
6538         * tests/uniq/Makefile.am: Likewise.
6539         * tests/uniq/Test.pm: Likewise.
6540         * tests/wc/Makefile.am: Likewise.
6541         * tests/wc/Test.pm: Likewise.
6542
6543 2006-08-17  Jim Meyering  <jim@meyering.net>
6544
6545         ls -CF would misalign columns in some cases.
6546         * src/ls.c (get_type_indicator): New function.  extracted from...
6547         (print_type_indicator): ...here.  Use it.
6548         (length_of_file_name_and_frills): Use it here, too, rather than
6549         assuming stat.st_mode is valid.
6550         Reported by Andreas Schwab, here:
6551         <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7774>
6552         See the test for this above. FYI, I did ls -CF /proc and visually
6553         inspected the result.
6554
6555         * src/copy.c (copy_internal, same_file_ok): Adjust comments not
6556         to mention the now-removed cp_options.xstat member.
6557
6558         * Makefile.maint (patch-check): Adapt to work now that the patch
6559         modifies more than one file in src/.
6560
6561         With this patch, permit building with Solaris cc on Solaris 7.
6562         * src/c99-to-c89.diff: Add diffs to convert more c99-isms.
6563         This integrates patches from Bruno Haible.
6564
6565 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
6566
6567         Fix some problems reported by Bruno Haible.
6568         * tests/chmod/setgid (abs_srcdir): Remove; not used or needed.
6569         Skip this test if "chmod g+s d" silently does nothing.
6570         * tests/ls-2/tests: Skip this test suite if we can't set up files
6571         properly for the setuid-etc test.  This simplifies some of the
6572         hacks we were using to work around porting problems.
6573
6574 2006-08-16  Jim Meyering  <jim@meyering.net>
6575
6576         * tests/cp/Makefile.am: Don't mark "acl" as XFAIL.
6577         * tests/cp/acl: Instead, skip the test if either setfacl
6578         or getfacl fails.
6579         Reported by Michael Stone.
6580
6581 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
6582
6583         * tests/lang-default (LC_ALL): Set to "C", so we get
6584         English-language diagnostics.  Unset the other variables; it
6585         should be portable to use 'unset' for this stuff nowadays.
6586         Problem reported by Bruno Haible.  Using "C" reverses the
6587         2000-10-22 change to fileutils in this area.
6588
6589         Fix bugs when printing plurals of numbers that are not
6590         unsigned long int values.
6591         * src/system.h (select_plural): New function.
6592         * src/md5sum.c (digest_check): Use select_plural to avoid bug.
6593         * src/uptime.c (print_uptime): Likewise.
6594         * src/dd.c (print_stats): Likewise.  Also, don't use ngettext to
6595         print a floating point number, as reducing to 0 or 1 doesn't work
6596         for some languages.  Instead, just use "s" for seconds since it
6597         doesn't need a plural form.
6598
6599 2006-08-16  Bruno Haible  <bruno@clisp.org>
6600
6601         Old versions of gzip would write --help output to stderr, and it
6602         would be annoying to see that in the output of every "make" command.
6603         * Makefile.maint (gzip_rsyncable): Throw away stderr output of
6604         "gzip --help".
6605
6606 2006-08-16  Andreas Schwab  <schwab@suse.de>
6607
6608         * tests/cp/acl: Don't use non-portable == operator for test.
6609
6610 2006-08-16  Jim Meyering  <jim@meyering.net>
6611
6612         * tests/ls/stat-dtype: Use stat to test file system type, rather
6613         than df -T, in case /etc/mtab lies.  Reported by Michael Stone.
6614
6615 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
6616
6617         * NEWS: Mention that df exits with nonzero status if it generates
6618         no output.  This change was in 6.0 but inadvertently unmentioned.
6619         * src/df.c (file_systems_processed): Renamed from n_valid_args, and now
6620         a boolean.
6621         (show_dev): Don't set it until we actually output something.
6622         Print the header if this is the first output.
6623         (main): Don't print a header, as that is now show_dev's job.
6624         * tests/misc/Makefile.am (TESTS): Add df.
6625         * tests/misc/df: New file.
6626
6627 2006-08-15  Eric Blake  <ebb9@byu.net>
6628
6629         * src/stat.c (USE_STATVFS): Define to 0 if f_type is needed, but
6630         statvfs.f_type not present.  See
6631         <http://savannah.gnu.org/bugs/?func=detailitem&item_id=16325>.
6632
6633 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
6634
6635         * src/dd.c (print_stats): Don't substitute "1" for number, as this
6636         causes confusion for the Hungarian translators.  Problem reported
6637         by Egmont Koblinger here:
6638         http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7726
6639
6640 2006-08-15  Jim Meyering  <jim@meyering.net>
6641
6642         * .x-sc_require_config_h: Add lib/at-func.c.
6643
6644         * NEWS: Add a line for 6.1-cvs.
6645         * configure.ac (AC_INIT): Bump to 6.1 and add "-cvs" suffix.
6646
6647 2006-08-15  Jim Meyering  <jim@meyering.net>
6648
6649         * Version 6.0.
6650         * NEWS: Record the 6.0 release date.
6651         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
6652
6653         * TODO: Add an item (convert to use gnulib-tool), add to the plan
6654         for id-vs-getgrouplist, and remove a few completed items.
6655
6656         * Makefile.maint (alpha beta major): Fix syntax error.
6657
6658 2006-08-13  Jim Meyering  <jim@meyering.net>
6659
6660         * src/shred.c (usage): Don't indent the second line of an item.
6661         Otherwise, help2man would misformat the output.
6662         Reported by Adam Buchbinder in <https://launchpad.net/bugs/48917>.
6663
6664 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
6665
6666         * configure.ac (AM_GNU_GETTEXT): Upgrade to need-formatstring-macros.
6667         Suggested by Eric Blake to avoid problems like
6668         <http://lists.gnu.org/archive/html/bug-coreutils/2006-07/msg00087.html>.
6669
6670 2006-08-11  Jim Meyering  <jim@meyering.net>
6671
6672         * tests/ls/stat-vs-dirent: Too many (losing) systems trigger the
6673         failure that this test checks for (stat/dirent inode mismatch at
6674         a mount point), so continue to give a diagnostic about the failure,
6675         but don't actually count it as a failure.
6676
6677 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
6678
6679         * ABOUT-NLS: Update from gettext 0.15.
6680         * configure.ac (AM_GNU_GETTEXT_VERSION): Update from 0.13.1 to 0.15.
6681
6682         * src/csplit.c (struct control): Remove fastmap member.
6683         (extract_regexp): Allocate fastmap separately, since otherwise
6684         it might move due to a realloc.  This fixes a bug that led
6685         to a core dump on 64-bit sparc Solaris 10 (Sun Studio 10).
6686
6687 2006-08-10  Jim Meyering  <jim@meyering.net>
6688
6689         * tests/ls/stat-dtype: If "." is tmpfs, skip this test unless uname -s
6690         reports "Linux".  This avoids a failure on Solaris 10's tmpfs.
6691         Redirect both stdout and stderr of df invocations.
6692
6693         * src/dircolors.hin: Add a TERM directive for each of the following:
6694         ansi, color-xterm, gnome, konsole, kterm, rxvt-cygwin,
6695         rxvt-cygwin-native, screen.linux, xterm-256color.
6696         Sort the TERM directives.
6697         From Mike Frysinger.
6698
6699 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
6700
6701         * src/dd.c (usage): Warn about oflag=append without conv=notrunc.
6702         See Debian bug 373736.
6703
6704         * src/dircolors.hin: Add mlterm, rxvt-unicode; this fixes Debian
6705         bug 317503.
6706
6707         * src/.cvsignore: Add shuf.
6708
6709         * Makefile.maint: Remove the po-update procedure; it doesn't
6710         work with the new repository on http://www.iro.umontreal.ca/.
6711         For now I guess we'll have to fix things by hand.
6712         (do-po-update, po-update): Remove.  All references removed.
6713
6714         * src/shuf.c (next_line): New function.
6715         (read_input): Use it, to avoid relying on GCC-specific behavior
6716         with void * arithmetic.  Problem reported by Bob Proulx.
6717         * Makefile.maint (my-distcheck): Compile with -Wpointer-arith
6718         to detect this sort of problem automatically in the future.
6719
6720 2006-08-09  Jim Meyering  <jim@meyering.net>
6721
6722         * src/ls.c: Add a compile-time check to ensure that filetype
6723         and filetype_letter have the same number of elements.
6724
6725         * tests/misc/sort-rand: Remove use of --seed=S.
6726
6727 2006-08-08  Paul Eggert  <eggert@cs.ucla.edu>
6728
6729         Add a command 'shuf', and modify shred and sort to use the new
6730         random number generator library of 'shuf'.
6731
6732         * AUTHORS: Add shuf.
6733         * README: Likewise.
6734         * NEWS: Likewise.  Mention new --random-source option for shred
6735         and sort.  Move "sort +1 -2" notice to the appropriate section,
6736         and clarify its role with respect to POSIXLY_CORRECT.
6737         * man/.cvsignore: Add shuf.1.
6738         * man/Makefile.am (dist_man_MANS): Add shuf.1.
6739         (shuf.1): New dependency.
6740         * man/shuf.x: New file.
6741         * src/Makefile.am (bin_PROGRAMS): Add shuf.
6742         (EXTRA_DIST): Remove rand-isaac.c.
6743         (shuf_LDADD): New macro.
6744         * src/rand-isaac.c: Remove, moving most of its contents to
6745         lib/rand-isaac.c.
6746         * src/shuf.c: New file.
6747         * src/shred.c: Use new random-number interface rather than rand-isaac.c.
6748         Don't include rand-isaac.c; include randint.h and randread.h instead.
6749         (RANDOM_SOURCE_OPTION): New enum.
6750         (long_opts, usage, main): New option --random-source.
6751         * src/sort.c: Likewise.
6752         * src/shred.c (struct irand_state, irand_init, irand32, irand_mod): Remove.
6753         All callers changed to use randint interface.
6754         (fillrand): Remove.  All callers changed to use randread interface.
6755         (dopass): Remove dependency on ISAAC buffer size.
6756         (genpattern): Don't wipe the random state here.
6757         (randint_source): New static var.
6758         (clear_random_data): New function.
6759         (main): Allocate random source, and arrange to wipe it on exit.
6760         * src/sort.c: Include md5.h, randread.h, xmemxfrm.h.
6761         (longopts, usage, main): Remove undocumented --seed option;
6762         it's now replaced by --random-source.
6763         (rand_state, get_hash): Remove.
6764         (randread_source): New static var.
6765         (random_state, cmp_hashes, compare_random): New functions; they guarantee
6766         no collisions in the random hash function.
6767         (keycompare): Use compare_random for -R; don't fall back on comparing
6768         via memcoll, since compare_random does the right thing.
6769         * tests/misc/Makefile.am (TESTS): Add shuf.
6770         * tests/misc/shuf: New file.
6771
6772 2006-07-29  Paul Eggert  <eggert@cs.ucla.edu>
6773
6774         * src/copy.c (set_author): Preserve the st_author field via the
6775         file descriptor dest_desc.
6776
6777 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
6778
6779         * NEWS: chmod now preserves setuid and setgid bits on directories
6780         if you use a numeric mode with them clear, e.g., "chmod 755 DIR".
6781
6782         Fix test case problems if working directory is setgid,
6783         reported by Bob Proulx.
6784         * tests/cp/fail-perm: Use symbolic mode so that we clear
6785         setgid bit more reliably on directories.
6786         * tests/mkdir/special-1 (set_mode_string): Likewise.
6787
6788 2006-07-27  Jim Meyering  <jim@meyering.net>
6789
6790         * src/chgrp.c (usage): Use correct grammar in description of the
6791         --reference option
6792         * src/chown.c (usage): Likewise.
6793
6794 2006-07-26  Thomas Schwinge  <tschwinge@gnu.org>  (tiny change)
6795
6796         * src/copy.c (set_author) [HAVE_STRUCT_STAT_ST_AUTHOR]:
6797         Correctly access SRC_SB's element ST_AUTHOR.
6798
6799 2006-07-26  Jim Meyering  <jim@meyering.net>
6800
6801         * tests/ls/stat-failed: Adapt to match new expected output.
6802         From Paul Eggert.
6803
6804         * src/ls.c (print_color_indicator): Test for S_IFREG first, rather
6805         than having the code test for all of the other types first.
6806         Hoist the set-uid/gid-testing code "up" into this new block.
6807         Classify any other type of file (e.g., S_TYPEISSHM, etc.) as
6808         C_ORPHAN, not as C_FILE.
6809
6810 2006-07-26  Jim Meyering  <jim@meyering.net>
6811
6812         Checking in a change from Paul.
6813
6814         2006-07-25  Paul Eggert  <eggert@cs.ucla.edu>
6815
6816         * src/ls.c (DT_INIT): Remove.  All uses removed.
6817         (enum filetype): Use an ordinary enum rather than trying to keep
6818         the values in sync with DT_FIFO etc.  That way, we don't have
6819         to make special assumptions about them.  All uses changed.
6820         (whiteout): New constant member of enum filetype.
6821         (filetype_letter): New constant, for use with enum filetype.
6822         (FILETYPE_INDICATORS): New initializer list.
6823         (print_dir): Add case for DT_WHT.
6824         (gobble_file): If stat fails, don't discard information from
6825         readdir; instead, preserve it so it can be printed.
6826         (print_long_format): Fall back on readdir result if stat info
6827         is not available.  Use "?" to denote each unknown mode char,
6828         instead of an overall "?", since we now know some of the mode
6829         typically.
6830         (print_type_indicator): Now that MODE isn't necessarily
6831         useful, guard all uses.
6832         Now that two blocks in the type-checking tree can set "type = C_FILE",
6833         move the suffix-handling code out and down.
6834
6835 2006-07-26  Jim Meyering  <jim@meyering.net>
6836
6837         Prepare for the above change.
6838         * src/ls.c [struct fileinfo] (stat_ok): Rename from stat_failed,
6839         and adjust uses.  From a patch by Paul Eggert.
6840
6841 2006-07-26  Jim Meyering  <jim@meyering.net>
6842
6843         * src/ls.c: Correct indentation/formatting in a few places.
6844
6845 2006-07-25  Paul Eggert  <eggert@cs.ucla.edu>
6846
6847         * tests/cp/fail-perm: Use "chmod 0500" rather than "chmod 500".
6848         Problem report and fix from Bob Proulx.
6849         * NEWS: Clarify the "chmod 0500" news, and correct the vague
6850         statements about compatibility with BSD.
6851
6852 2006-07-25  Jim Meyering  <jim@meyering.net>
6853
6854         * src/ls.c (gobble_file): When handling a stat-failed entry,
6855         print the entry name not the absolute_name -- to be consistent
6856         with the usual case.
6857         * tests/ls/stat-failed: Update accordingly.
6858
6859         * src/ls.c: Add parens around the new uses of ?: ternary operator.
6860
6861         * src/dircolors.hin: Mention that ORPHAN refers not just to dangling
6862         symlinks.
6863
6864         Get --dired offsets right when handling stat-failed entries.
6865         * src/ls.c (print_long_format): Be careful to increment P by the
6866         appropriate amount, even when inode_number_width and nlink_width
6867         are zero.
6868         * tests/ls/stat-failed: Test for the above.
6869
6870         * src/ls.c (gobble_file) [USE_ACL]: Don't use-uninitialized the
6871         have_acl member.  That would happen for a directory with both a
6872         non-stat'able entry and one with an ACL.
6873
6874         * src/ls.c (gobble_file): Make it so failure to stat a
6875         non-command-line file provokes an exit status of 1, not 0.
6876         Say "cannot access" rather than "cannot stat".
6877         * tests/ls/stat-failed: New file/test, for the above.
6878         * tests/ls/Makefile.am (TESTS): Add stat-failed.
6879         * tests/ls-2/tests (no-a-isdir-b): Update to reflect addition
6880         of "cannot access " to diagnostic.
6881
6882         * src/ls.c: Declare stat_failed to be "bool", not "int" everywhere.
6883
6884         * src/ls.c [enum filetype] (command_line): Remove member.  Not needed.
6885         Replace all occurrences of "type == command_line" with the
6886         equivalent, "command_line_arg".
6887
6888         * src/ls.c: Apply the stat-failed parts of Red Hat's
6889         coreutils-selinux.patch.  From Ulrich Drepper.
6890         This makes it so files not mentioned on the command line (e.g.,
6891         names read from a directory that *is* mentioned on the command
6892         line) for which stat fails are still listed.  With --color,
6893         such files are colored just like ORPHANs (aka dangling symlinks).
6894
6895         * src/df.c (n_valid_args): Declare global to be static.
6896
6897 2006-07-24  Jim Meyering  <jim@meyering.net>
6898
6899         * tests/ls/stat-dtype: Skip this test on reiserfs, since that file
6900         system lacks d_type support.
6901
6902 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
6903
6904         * man/chmod.x: Update to reflect recent changes to coreutils.texi.
6905
6906 2006-07-21  Jim Meyering  <jim@meyering.net>
6907
6908         * src/su.c (usage): Correct typo in --help output: s/commmand/command/
6909         Reported by Tim Waugh.
6910         Also remove the comment duplicating much of --help output.
6911
6912         * src/ls.c (FILE_TYPE_INDICATOR_OPTION): Reposition this new
6913         name so the list remains alphabetized.
6914
6915         Fix another bug: ls --indicator-style=file-type would call
6916         stat for a symlink, even though it wasn't always needed.
6917         In some cases, that unnecessary stat would cause ls to fail.
6918         * src/ls.c (gobble_file): Don't treat symlinks specially (in
6919         requiring a stat syscall).  Remove the offending exclusion.
6920
6921         * NEWS: Mention the fix.
6922
6923         * tests/ls/stat-dtype: New file/test, for the above fix.
6924         Also exercises the new df feature, below.
6925
6926         * src/df.c (main): Fail and don't print the headers if no
6927         file system is processed.  This makes it easy to test whether
6928         a specified directory is on a file system of a given type or types.
6929         Otherwise, applications would have had to parse df's output.
6930         E.g., is "." either ext3 or reiserfs: df -t ext3 -t reiserfs .
6931
6932         Fix a bug: ls --file-type worked like --indicator-style=slash,
6933         rather than like --indicator-style=file-type.
6934         * src/ls.c (FILE_TYPE_INDICATOR_OPTION): New enum member.
6935         (long_options): Map "file-type" to FILE_TYPE_INDICATOR_OPTION,
6936         not to 'p'.
6937         (decode_switches): Handle new case: FILE_TYPE_INDICATOR_OPTION.
6938         * NEWS: Mention the fix.
6939         * tests/ls-2/tests (file-type): New test, for the above fix.
6940
6941 2006-07-19  Jim Meyering  <jim@meyering.net>
6942
6943         * src/ls.c (print_dir): Give a better diagnostic for failed opendir.
6944
6945         * Makefile.am (EXTRA_DIST): Add build-aux/vc-list-files.
6946
6947 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
6948
6949         * NEWS: chmod, install, and mkdir now leave setgid and setuid bits
6950         of directories alone unless you specify them explicitly.
6951         install and mkdir now implement X correctly.
6952         install now creates parent directories with mode 755, without
6953         changing their owner or group.
6954         * src/chmod.c (process_file): Adjust to mode_adjust API change.
6955         * src/install.c: Include mkancesdirs.h.
6956         (announce_mkdir, make_ancestor): New functions.
6957         (DEFAULT_MODE): New macro, specifying initial value of 'mode'.
6958         (mode): Use it.
6959         (dir_mode, dir_mode_bits): New vars.
6960         (main): Set dir modes separately from nondir, so that the X
6961         op of -m works correctly.
6962         (main): Remove cwd_errno cruft, since make_dir_parents no longer
6963         affects cwd.  Adjust to new make_dir_parents API.
6964         (install_file_in_file_parents): 2nd arg is now char *, not char
6965         const *.  Use mkancesdirs instead of rolling our own code.
6966         (change_attributes): Don't worry about AFS, since that kludge
6967         should not be needed any more.
6968         * src/mkdir.c (struct mkdir_options): New struct.
6969         (announce_mkdir, make_ancestor): New functions.
6970         (main): Use them.  Adjust to mode_adjust API change.  Stick with
6971         umask 0.  Use make_dir_parents for all the work.
6972         * src/mkfifo.c (main): Adjust to new mode_adjust API.
6973         * src/mknod.c (main): Likewise.
6974         * tests/chmod/setgid: Do the setgid test instead of bailing.
6975         * tests/mkdir/p-3: Remove re_protect case that no longer applies.
6976         GNU chmod now behaves like other versions of chmod.
6977         * tests/mkdir/perm: Add a test for the X bug.
6978
6979 2006-07-14  Paul Eggert  <eggert@cs.ucla.edu>
6980
6981         * src/base64.c (do_decode): Output to parameter OUT, not to stdout.
6982         This doesn't fix any bugs, since OUT always equals stdout, but it
6983         makes the code easier to understand.
6984
6985 2006-07-14  Jim Meyering  <jim@meyering.net>
6986
6987         * Makefile.maint (CVS_LIST): Use new file, build-aux/vc-list-files,
6988         rather than open-coding it.  Now supports mercurial, too.
6989         * .hgignore: New file.
6990         * Makefile.am (EXTRA_DIST): Add .hgignore, which ignores nearly
6991         all generated files, including ones like configure and po/*.po
6992         that are currently version-controlled in cvs.
6993
6994         * Makefile.am (EXTRA_DIST): Add a few more .??* files.
6995         They've been in CVS, just haven't been distributed before this.
6996         Distribute ChangeLog-2005, too.
6997         (MAINTAINERCLEANFILES): Add THANKS-to-translators.
6998
6999 2006-07-11  Paul Eggert  <eggert@cs.ucla.edu>
7000
7001         * src/system.h: Assume <dirent.h> exists, since gnulib assumes
7002         this now as well.
7003
7004 2006-07-09  Jim Meyering  <jim@meyering.net>
7005
7006         * tests/mv/dir2dir: Adjust so failing with ENOTEMPTY is ok, too.
7007         That happens with Linux/tmpfs.
7008         * tests/mv/Makefile.am (TESTS): Add dir2dir.
7009
7010 2006-07-09  Paul Eggert  <eggert@cs.ucla.edu>
7011
7012         Adjust to recent updates from gnulib.
7013         * src/dd.c (apply_translations): Use toupper rather than
7014         islower followed by toupper; it's simpler and typically
7015         faster now that we assume at least C89 semantics.  Similarly
7016         for tolower.
7017         * src/sort.c (inittables): Likewise.
7018         * src/expand.c (expand): Don't assume that isprint etc. return
7019         booleans (needed for pre-C99 hosts).
7020         * src/fmt.c (check_punctuation): Likewise.
7021         * src/ptx.c (initialize_regex, fix_output_parameters): Likewise.
7022         * src/tr.c (is_char_class_member): Likewise.
7023         * src/unexpand.c (unexpand): Likewise.
7024         * src/join.c (is_blank): Remove; no longer needed.  All uses
7025         replaced by isblank (to_uchar (...)).
7026         * src/pinky.c (create_fullname): Don't assume char is unsigned.
7027         * src/printf.c (print_esc): Likewise.
7028         * src/ptx.c (SKIP_NON_WHITE, SKIP_WHITE, SKIP_WHITE_BACKWARDS):
7029         (copy_unescaped_string): Likewise.
7030         * src/stat.c (print_it): Likewise.
7031         * src/system.h (_D_EXACT_NAMELEN): Renamed from NLENGTH, for
7032         convenience on GNU systems.  All uses changed.  Don't bother
7033         looking for any dirent.h substitute other than ndir.h.
7034         (D_INO): Remove unnecessary parentheses.
7035         (IN_CTYPE_DOMAIN, ISGRAPH, ISPRINT, ISALNUM, ISALPHA):
7036         (ISCNTRL, ISLOWER, ISPUNCT, ISSPACE, ISUPPER, ISXDIGIT):
7037         (ISDIGIT_LOCALE, TOLOWER, TOUPPER): Remove.  All uses changed
7038         to ctype.h equivalents.
7039         (isblank): Renamed from ISBLANK.  Check for HAVE_DECL_ISBLANK too.
7040         All uses changed.
7041
7042 2006-07-08  Jim Meyering  <jim@meyering.net>
7043
7044         * tests/mv/dir2dir: New file, test for 2006-07-05 fix in copy.c.
7045
7046         * Makefile.maint (sc_the_the): New rule.
7047
7048         * src/dd.c (skip): Remove one of two adjacent "the"s in a comment.
7049         * tests/Coreutils.pm (run_tests): Remove one of two adjacent "then"s
7050         in a comment.
7051
7052 2006-07-07  Jim Meyering  <jim@meyering.net>
7053
7054         * NEWS: Mention that mv can now remove an empty destination directory,
7055         and give an example.  Prompted by a report from Florent Bayle.
7056
7057 2006-07-05  Jim Meyering  <jim@meyering.net>
7058
7059         * src/ls.c (usage): Correct the description of -G: it is useful
7060         only in a long listing.  Reported by Martin Pool in
7061         <https://launchpad.net/distros/ubuntu/+source/coreutils/+bug/51653>.
7062
7063         * man/chmod.x: Correct the description of the sticky bit.  Reported
7064         by Chris Moore via Ian Jackson in <http://bugs.debian.org/376745>.
7065
7066         * src/copy.c (copy_internal): Don't work around old NFS clients like
7067         SunOS-4.1.4 and Irix 5.3 that set errno to values like EIO and
7068         ENOTEMPTY upon failed rename.  Otherwise, we risk misinterpreting
7069         a banal failure as a recursive move-into-self failure.
7070         Reported by Florent Bayle in <http://bugs.debian.org/376749>.
7071
7072         * src/c99-to-c89.diff: Regenerate, to remove fuzz.
7073
7074 2006-07-03  Jim Meyering  <jim@meyering.net>
7075
7076         Plug another unusual leak.
7077         (AD_mark_helper): Free malloc'd filename if hash_insert says
7078         that string is already in the hash table.
7079
7080         The dev/inode of the topmost directory in each hierarchy were not
7081         being recorded.
7082         * src/remove.c (remove_cwd_entries): Don't call cycle_check here.
7083         (AD_push): Call it from here instead.
7084
7085         Fix two small leaks.
7086         * src/remove.c (AD_stack_clear): New function.
7087         (rm_1): Use it.
7088         (AD_pop_and_chdir): Free *prev_dir just before longjmp.
7089
7090         * tests/Makefile.am, tests/*/Makefile.am: (TESTS_ENVIRONMENT):
7091         Add $VG_PATH_PREFIX as a prefix to $PATH
7092
7093         * tests/envvar-check (vars): Add CDPATH and POSIXLY_CORRECT.
7094         * tests/Makefile.am (evar-check): Remove rule.
7095         (EXTRA_DIST): Remove .env-warn.
7096         * tests/.env-warn: Remove file.  No longer used.
7097         Suggestion from Eric Blake.
7098
7099 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
7100
7101         * src/system.h: Include <stdint.h> unconditionally, since we
7102         now assume the stdint module.
7103
7104 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
7105
7106         * NEWS: With no operand, 'tail -f' now silently ignores the '-f'
7107         only if standard input is a FIFO or pipe and POSIXLY_CORRECT is set.
7108         * src/tail.c (main): Implement this.
7109         * tests/tail/Test.pm (f-pipe-1): Renamed from f-1.
7110         (test_vector): Set POSIXLY_CORRECT for the f-pipe-* tests.
7111
7112 2006-07-01  Jim Meyering  <jim@meyering.net>
7113
7114         * src/ln.c (do_link): Use new, shorter URL, for ag-review link.
7115
7116         * .x-sc_require_config_h: Add ^lib/xstrtold\.c$, so make distcheck
7117         passes once again.
7118
7119 2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
7120
7121         * NEWS: seq now uses long double internally rather than double.
7122         It now defaults to a minimal fixed point format if possible.
7123         It lets you use %a, %A, %E, %F, %G.
7124         * src/Makefile.am (seq_LDADD): Remove $(SEQ_LIBM); add $(POW_LIB).
7125         * src/seq.c: Don't include <math.h> or <xstrtol.h>; no longer needed.
7126         (isfinite) [!defined isfinite]: New macro.
7127         (separator, terminator): Now points to const.
7128         (first, step, last): Remove.
7129         (usage): Update to match new behavior.
7130         (struct operand, operand): New type.
7131         (scan_arg): Renamed from scan_double_arg, since we no longer use double.
7132         All uses changed.
7133         Compute and return a value of type operand, not double.
7134         (long_double_format): Renamed from valid_format, and now returns a
7135         new format with an "L" added if needed, if the original format was
7136         valid.  Allow %a, %A, %E, %F, and %G formats.
7137         (print_numbers): Take numeric values as args rather than from globals.
7138         Print long double, not double.
7139         (get_width_format): Remove.
7140         (get_default_format): New function.
7141         (main): Implement new way of calculating default format.
7142         Don't worry about locale's representation of the decimal point, since
7143         the arguments are always processed in the C locale.
7144         * tests/seq/basic (neg-2): Adjust to new default format.
7145         (eq-wid-1, eq-wid-2): Resurrect these tests, since the new
7146         implementation should do the right thing.
7147
7148 2006-06-30  Jim Meyering  <jim@meyering.net>
7149
7150         * tests/stty/basic-1: Work around an intermittent test failure
7151         on HP-UX 11.11.  Report and analysis from Bob Proulx.
7152         http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7475
7153
7154 2006-06-28  Paul Eggert  <eggert@cs.ucla.edu>
7155
7156         * NEWS: Support obsolete usages like "sort +1 -2" even when
7157         conforming to POSIX 1003.1-2001, since this is a pure extension to
7158         POSIX.  Problem reported by Christian in:
7159         http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00220.html
7160         * src/sort.c (main): Implement this.
7161
7162         * src/system.h (CLOSEDIR): Remove.  All uses changed to closedir.
7163         Autoconf 2.60 says this stuff was obsolete.
7164
7165 2006-06-28  Jim Meyering  <jim@meyering.net>
7166
7167         * src/c99-to-c89.diff: Regenerate, to remove fuzz.
7168
7169 2006-06-28  Bob Proulx  <bob@proulx.com>  (tiny change)
7170
7171         * tests/mv/i-link-no: Work around HP-UX /bin/sh tracing problem
7172         (set -x when VERBOSE=yes) when stderr is redirected before stdout
7173         causing shell tracing of the stdout redirection to be written to
7174         the stderr file.  Avoid problem and test failure on HP-UX by
7175         redirecting stderr last.
7176         * tests/dd/unblock-sync: Order shell file redirections for
7177         stderr and stdout in the common style.
7178         tests/acl: Likewise.
7179
7180 2006-06-27  Jim Meyering  <jim@meyering.net>
7181
7182         * tests/misc/cat-proc: Try to avoid any spurious numeric
7183         differences in frequently-changing /proc/cpuinfo.
7184         Reported by Nelson Beebe.
7185
7186 2006-06-26  Jim Meyering  <jim@meyering.net>
7187
7188         Attempt rmdir (actually, unlinkat-with-AT_REMOVEDIR) upon any
7189         fd_to_subdirp failure, not just when errno == EACCES.
7190         * src/remove.c (remove_dir): Use unlinkat-with-AT_REMOVEDIR, not
7191         rmdir, here, even though rmdir may happen to be adequate.
7192
7193         * NEWS: rm no longer fails to remove an empty, unreadable directory
7194         * src/remove.c (remove_cwd_entries): If we can't open a directory,
7195         and the failure is not being ignored, try to remove the directory
7196         with rmdir (aka unlinkat-with-AT_REMOVEDIR), in case it's empty.
7197         Problem report and test case from Paul Eggert in
7198         <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7425>.
7199
7200         * tests/rm/empty-inacc: New test, for the above.
7201
7202         Avoid a segfault for wc --files0=- < /dev/null.
7203         * src/wc.c (compute_number_width): Return right away if nfiles == 0.
7204
7205 2006-06-25  Jim Meyering  <jim@meyering.net>
7206
7207         * NEWS: wc accepts a new option --files0-from=FILE, where FILE
7208         contains a list of NUL-separated file names.
7209
7210         * src/wc.c: Include "readtokens.h".
7211         (usage): Describe the new option, and adjust the `Usage':
7212         with this option, no FILE may be specified on the command line.
7213         (main): Handle the new option.
7214         * tests/misc/wc-files0: New tests, for the above.
7215         * tests/misc/wc-files0-from: Likewise.
7216         * tests/misc/Makefile.am (TESTS): Add wc-files0.
7217
7218 2006-06-24  Jim Meyering  <jim@meyering.net>
7219
7220         * src/md5sum.c (DIGEST_BUFFER): Remove now-unused definitions.
7221
7222 2006-06-22  Jim Meyering  <jim@meyering.net>
7223
7224         * src/tee.c (tee_files): Rename from tee, to avoid conflict with
7225         the function in glibc's <fcntl.h>.  Reported by Andreas Schwab.
7226
7227 2006-06-19  Jim Meyering  <jim@meyering.net>
7228
7229         * Makefile.cfg (local-checks-to-skip): Add changelog-check,
7230         so this check is not run as part of "make distcheck".
7231
7232 2006-06-18  Bob Proulx  <bob@proulx.com>  (tiny change)
7233
7234         * tests/misc/pwd-long: Fix typo (s/neq/ne/) in previous change.
7235
7236 2006-06-18  Jim Meyering  <jim@meyering.net>
7237
7238         * tests/misc/pwd-long: Make error output a little clearer.
7239
7240 2006-06-17  Jim Meyering  <jim@meyering.net>
7241
7242         * tests/rm/inaccessible: Skip this test on systems without openat
7243         support.  Reported by Bob Proulx.
7244
7245 2006-06-15  Bob Proulx  <bob@proulx.com>  (tiny change)
7246
7247         * tests/misc/mknod: Improve permission checks to handle
7248         running mkdir test in set-gid directories.
7249
7250 2006-06-14  Jim Meyering  <jim@meyering.net>
7251
7252         * tests/du/basic: Revamp not to hard-code file system block sizes.
7253
7254 2006-06-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
7255
7256         * tests/du/Makefile.am (TESTS_ENVIRONMENT): Pass $(PERL), for
7257         files0-from test.
7258
7259 2006-06-11  Jim Meyering  <jim@meyering.net>
7260
7261         * .gitignore: New file.
7262         * Makefile.am (EXTRA_DIST): Add .gitignore.
7263
7264         Setting TIME_STYLE=long-iso in the environment would make the
7265         cp/same-file test fail.
7266         * tests/envvar-check (vars): Add TIME_STYLE to the list.
7267         * tests/cp/same-file: Revert last change.
7268         Source the envvar-check script, to ensure that TIME_STYLE
7269         settings don't affect these tests.
7270
7271 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
7272
7273         * tests/cp/same-file: Execute 'ls' in the C locale, so that it
7274         uses POSIX time stamp formats.  Problem reported by John Nixon in
7275         <http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00062.html>.
7276
7277 2006-06-10  Jim Meyering  <jim@meyering.net>
7278
7279         * NEWS: Mention the AIX-strndup-bug vs. dircolors workaround.
7280
7281         Require a "Version N.M" line at the top of the ChangeLog
7282         file only when making the actual release, not when running
7283         "make distcheck".
7284         * Makefile.maint (maintainer-distcheck): Don't depend on
7285         changelog-check.
7286         (alpha beta major): Depend on it here, instead.
7287
7288 2006-06-08  Jim Meyering  <jim@meyering.net>
7289
7290         Ensure that cat works with any of the options, -A -v -e -E -T,
7291         when applied to files in /proc and /sys, even when the FIONREAD
7292         ioctl produces nonsensical results.  Before this change, cat would
7293         produce no output (or truncated output), for some linux kernels.
7294
7295         * src/cat.c (write_pending): New function, factored out of cat.
7296         (cat): Also interpret a negative ioctl/FIONREAD count as indicating
7297         that there are bytes to read.  Some versions of linux-2.6.16 do that.
7298         Write any pending output before returning.
7299         Reported by Dan Jacobson in <http://bugs.debian.org/370583>.
7300         * NEWS: Mention this bug fix.
7301         * tests/misc/cat-proc: New file.  Test for the above.
7302         * tests/misc/Makefile.am (TESTS): Add cat-proc.
7303
7304 2006-06-07  Paul Eggert  <eggert@cs.ucla.edu>
7305
7306         * src/expr.c (eval4): Detect overflow properly when multiplying
7307         INTMAX_MIN * -1.
7308
7309 2006-06-06  Paul Eggert  <eggert@cs.ucla.edu>
7310
7311         * NEWS: The 'expr' command now detects and reports integer overflow.
7312         (It would be better to use extended precision instead, but that
7313         would be more work.)
7314         * src/expr.c (integer_overflow): New function.
7315         (eval4, eval3): Check for integer overflow.
7316
7317 2006-06-05  Paul Eggert  <eggert@cs.ucla.edu>
7318
7319         Fix problems when building with Solaris/SVR4/etc. make, which uses a
7320         different and somewhat bogus implementation of VPATH.  In the
7321         directory tests/misc, rename tests whose names might appear in the
7322         Automake-generated rules.  For example, we can't use a test named
7323         'test', since Automake generates a rule that contains the text
7324         "if test -f ./$$tst; ...", and this might expand to something like
7325         "if ../../../coreutils-6.0/tests/misc/test -f ./$$test; ...",
7326         which executes the 'test' script rather than the 'test' command.
7327         * tests/misc/false-status: Renamed from tests/misc/false.
7328         * tests/misc/pwd-long: Renamed from tests/misc/pwd.
7329         * tests/misc/sort-merge: Renamed from tests/misc/sort.
7330         ($prog): Set to 'sort' rather than to $PROG.
7331         * tests/misc/test-diag: Renamed from tests/misc/test.
7332         * tests/misc/Makefile.am (PROG): Take the basename of $$tst,
7333         in case Solaris make has prepended the directory.
7334         (TESTS): Adjust to above renamings.
7335         * tests/misc/expand: Don't assign to PROG; no longer needed
7336         now that Makefile.am sets PROG to the basename.
7337         * tests/misc/fold: Likewise.
7338
7339 2006-06-03  Jim Meyering  <jim@meyering.net>
7340
7341         Make `cp --link --no-dereference' work also on systems where the
7342         link system call cannot create a hard link to a symbolic link.
7343         * src/copy.c (copy_internal) [LINK_FOLLOWS_SYMLINKS]: Don't use
7344         the link syscall on a symlink when it would do the wrong thing.
7345         Based on the patch by Aurelien Jarno: <http://bugs.debian.org/329451>
7346         * tests/cp/link-no-deref: New file/test for the above.
7347         * tests/cp/Makefile.am (TESTS): Add link-no-deref.
7348         * NEWS: Mention the change (doesn't affect Linux).
7349
7350 2006-06-01  Paul Eggert  <eggert@cs.ucla.edu>
7351
7352         Fix some porting problems in the test cases reported by
7353         Ralf Wildenhues for HP-UX 11.23 in:
7354         http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00238.html
7355         * tests/help-version: Don't assume that \< \> works in sed.
7356         * tests/misc/close-stdout: Don't assume that >&- works.
7357         Add a /dev/full test.
7358         * tests/touch/no-create-missing: Don't assume that >&- works.
7359
7360 2006-05-30  Jim Meyering  <jim@meyering.net>
7361
7362         * src/ls.c (usage): Add `v' to the list of sorting-related options.
7363         From Justin Pryzby.
7364
7365 2006-05-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
7366
7367         * tests/cp/fail-perm: source lang-default.
7368         * tests/rm/inaccessible: Likewise.
7369
7370 2006-05-28  Jim Meyering  <jim@meyering.net>
7371
7372         * tests/rm/inaccessible: AIX 4.3.3 gives a different diagnostic.
7373         Recognize it, too.  Reported by Ralf Wildenhues, in
7374         http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html
7375
7376 2006-05-27  Jim Meyering  <jim@meyering.net>
7377
7378         * src/chgrp.c: Support new options: --preserve-root and
7379         --no-preserve-root.  Somehow this program was skipped when those
7380         options were added to chown, chmod, and rm.  Reported by
7381         vaqflabuopac@spammotel.com in <http://bugs.debian.org/365656>.
7382         * NEWS: Mention this.
7383
7384 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
7385
7386         * NEWS: Remove mention of --seed.  We'll replace it with something
7387         better, and don't want to indicate that it is supported.
7388         * src/sort.c (usage): Likewise.
7389
7390 2006-05-20  Jim Meyering  <jim@meyering.net>
7391
7392         * src/chmod.c (main): Use FTS_PHYSICAL here, too.
7393
7394         * src/du.c (main): Rename local, s/symlink_deref_bit/symlink_deref_bits/
7395         and arrange for -D to set fts' FTS_PHYSICAL bit as well as
7396         FTS_COMFOLLOW.  Spotted by Justin Pryzby.
7397
7398         * gnupload: Merge changes from automake, retaining the ""--to...
7399         kludge to placate overzealous `make distcheck' check.
7400
7401 2006-05-19  Jim Meyering  <jim@meyering.net>
7402
7403         * src/du.c (main): Don't let -D, -L, or -P turn off the internal
7404         FTS_TIGHT_CYCLE_CHECK directory traversal option.
7405         Reported by Justin Pryzby in http://bugs.debian.org/367691
7406
7407 2006-05-15  Jim Meyering  <jim@meyering.net>
7408
7409         * src/cp.c (usage): Correct description of -a: s/-dpR/-dpPR/.
7410         From Tomas Pospisek.
7411
7412 2006-05-13  Jim Meyering  <jim@meyering.net>
7413
7414         * tests/mv/no-target-dir: Test two more cases.
7415
7416 2006-05-11  Jim Meyering  <jim@meyering.net>
7417
7418         mv -T DIR EMPTY_DIR no longer fails unconditionally
7419         * src/copy.c (copy_internal): Don't manually prohibit a move where
7420         the destination is an existing directory.  Sometimes doing that is
7421         valid.  Let the rename system call enforce the rules.  That is
7422         allowed only when the source is a directory and the destination
7423         directory (to be replaced) is empty.  Reported by Eric Blake.
7424         * tests/mv/no-target-dir: New file/test for this.
7425         * tests/mv/Makefile.am (TESTS): Add no-target-dir.
7426         * NEWS: Mention this.
7427
7428         * tests/mv/atomic: New file/test for yesterday's fix.
7429         * tests/mv/Makefile.am (TESTS): Add atomic.
7430
7431         * tests/du/long-sloop: Avoid harmless `ambiguous redirect' diagnostic.
7432
7433 2006-05-10  Jim Meyering  <jim@meyering.net>
7434
7435         * src/copy.c (copy_internal): Don't explicitly unlink the destination
7436         when moving a symlink into the place of an existing non-directory.
7437         Reported by Joshua Hudson.
7438         * NEWS: mention this.
7439
7440 2006-05-07  Jim Meyering  <jim@meyering.net>
7441
7442         * Makefile.maint (patch-check): Fail if patch generates any output,
7443         even merely for changed offsets.
7444
7445         * src/c99-to-c89.diff: Adjust to reflect new offsets.
7446
7447         * NEWS: Mention changes affecting df, pwd, shred.
7448
7449 2006-05-06  Jim Meyering  <jim@meyering.net>
7450
7451         * tests/ls/stat-vs-dirent: New test, to detect the bogus file
7452         system condition where dirent.d_ino != stat.st_ino.
7453         * tests/ls/Makefile.am (TESTS): Add stat-vs-dirent.
7454
7455 2006-05-06  Eric Blake  <ebb9@byu.net>
7456
7457         * tests/ls/inode: Expand to test inode from readdir case.
7458         * tests/ls/follow-slink: Expand to test broken links encountered
7459         implicitly, favoring Solaris 9 and OpenBSD 3.4 behavior.
7460
7461 2006-05-06  Eric Blake  <ebb9@byu.net>
7462
7463         * tests/mv/leak-fd: Work even on case-insensitive file system.
7464
7465 2006-05-04  Jim Meyering  <jim@meyering.net>
7466
7467         * NEWS: Mention the 2006-03-19 pwd-related change that makes
7468         lib/getcwd.c work around inconsistent file system dirent.d_ino data.
7469
7470 2006-05-03  Jim Meyering  <jim@meyering.net>
7471
7472         * src/ls.c (DEFINE_SORT_FUNCTIONS, LIST_SORTFUNCTION_VARIANTS):
7473         Use better macro parameter names: s/basename/key_name/,
7474         s/basefunc/key_cmp_func.  Fix typo in comment.
7475
7476 2006-04-29  Eric Blake  <ebb9@byu.net>
7477
7478         * src/ls.c (main): On systems with d_type, directories_first only
7479         implies format_needs_type, not format_needs_stat.
7480
7481 2006-05-03  Jim Meyering  <jim@meyering.net>
7482
7483         * src/ls.c (xstrcoll_df_version, rev_xstrcoll_df_version): Add space
7484         after comma in arg list, from Eric Blake.
7485
7486 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
7487
7488         * tests/misc/date (relative-3): New test, derived from a bug
7489         report by John Thomas McDole.
7490
7491 2006-04-23  Francesco Montorsi  <fr_m@hotmail.com>
7492
7493         New option for ls: --group-directories-first.
7494         It makes ls list directories before files.
7495         * NEWS [New features]: Mention it.
7496         * src/ls.c (sort_type): Rearrange to use as an array index when
7497         choosing sort function; added new sort_numtypes member for
7498         compile-time check.
7499         (time_type): Add new time_numtypes member for compile-time check.
7500         (directories_first): New global variable.
7501         (GROUP_DIRECTORIES_FIRST_OPTION): New enum.
7502         (long_options): Add --directories-first.
7503         (main): Support new option.
7504         (is_directory): New function.
7505         (extract_dirs_from_files): Use it.
7506         (DIRFIRST_CHECK, DEFINE_SORT_FUNCTIONS)
7507         (LIST_SORTFUNCTION_VARIANTS): New macros.
7508         (sort_functions): New global variable.
7509         (sort_files): Use it.
7510         (usage): Document new option.
7511
7512 2006-04-18  Paul Eggert  <eggert@cs.ucla.edu>
7513
7514         * src/shred.c (fillrand): The assertion was way too weak, due to
7515         what must be a typo.  Strengthen it to its intended value.
7516         (dopass): Don't use alloca; it's not worth the aggravation here,
7517         since it's used only to get a page-aligned buffer, and page
7518         alignment doesn't buy us much here.  I'm suspicious that alloca
7519         causes problems on some hosts, due to a recent bug report by Adam
7520         Waltman: http://bugs.gentoo.org/130246.
7521
7522 2006-04-18  Jim Meyering  <jim@meyering.net>
7523
7524         * tests/misc/tty-eof: Add new programs, base64, sha224sum, sha256sum,
7525         sha384sum, sha512sum.
7526
7527 2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
7528
7529         * src/chmod.c (describe_change): Adjust to filemode changes.
7530         * src/ls.c (HAVE_ST_DM_MODE): Remove; moved to ../lib/filemode.c.
7531         (print_long_format): Use (new) filemodestring rather than
7532         (old) mode_string, so that we get more file types right, at least
7533         in theory.  Adjust to filemode changes.
7534         * src/stat.c (human_access): Likewise.
7535
7536 2006-04-18  Jim Meyering  <jim@meyering.net>
7537
7538         * src/ptx.c (main) [DEFAULT_IGNORE_FILE]: Remove code to use a default
7539         ignore file.  This has never been enabled.  Reported by Eric Blake.
7540
7541 2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
7542
7543         * src/ln.c (linkfunc): Remove.  This method ran into a compiler/linker
7544         bug in Interix.  Just call symlink or link directly.  All uses changed.
7545         * src/setuidgid.c (main) [! HAVE_SETGROUPS]: Don't call setgroups.
7546         * src/stat.c (USE_STATVFS): New macro.
7547         Include <sys/statvfs.h> and use statvfs only if USE_STATVFS.
7548         (NAMEMAX_FORMAT): define a bit more clearly, now that the
7549         statvfs-using code is a bit more regular.
7550         * src/system.h (sync) [!HAVE_SYNC]: New macro.
7551
7552 2006-04-11  Paul Eggert  <eggert@cs.ucla.edu>
7553
7554         * NEWS: csplit, nl, expr now conform to POSIX better, and are
7555         more-compatible with traditional Unix, with respect to regular
7556         expressions.
7557         * src/csplit.c (extract_regexp): Set re_syntax_options to a
7558         value that is compatible with what POSIX requires.
7559         * src/nl.c (build_type_arg): Likewise.
7560         * src/expr.c (docolon): Likewise.  Also, don't let anchors match
7561         newline; this fixes an incompatibility with tradition and with POSIX.
7562         Don't warn about leading ^.  POSIX says it is unspecified whether
7563         ^ is a special character, which means that implementations can
7564         either treat it as special or not, but either way a warning is not
7565         allowed (unless the regexp is otherwise invalid).  Instead, anchor
7566         the expression but treat ^ as an anchor; this is the traditional
7567         behavior (e.g., Solaris 10).
7568         (eval4, eval3, eval2): Treat non-numeric args, division by zero,
7569         and the like as invalid expressions (exit status 2), not as
7570         failure of 'expr' (exit status 3).  This is more consistent with
7571         how Solaris behaves.
7572         * tests/expr/basic (fail-a): Adjust exit status to match new expr
7573         behavior, for status 2 versus 3.
7574         (anchor): New test.
7575         (bre1, bre2, bre3, bre4, bre5, bre6, bre7, bre8, bre9, bre10):
7576         (bre11, bre12, bre13, bre14, bre15, bre16, bre17, bre18, bre19, bre20):
7577         (bre21, bre22, bre23, bre24, bre25, bre26, bre27, bre28, bre29, bre30):
7578         (bre31, bre32, bre33, bre34, bre35, bre36, bre37, bre38, bre39, bre40):
7579         (bre41, bre42, bre43, bre44, bre45, bre46, bre47, bre48, bre49, bre50):
7580         (bre51, bre52, bre53, bre54, bre55, bre56, bre57, bre58, bre59, bre60):
7581         (bre61, bre62): New tests.
7582         * tests/misc/csplit: Use \{...\} in test RE, to test that we're
7583         conforming to POSIX.
7584
7585         Port to Solaris 8.
7586         * tests/du/long-from-unreachable: Solaris 8 sh doesn't understand
7587         "if !".  Do not assume that 'sed' can handle long, newline-free input.
7588         * tests/du/long-sloop: Likewise.  Evaluate expr once, not $n times.
7589
7590 2006-04-10  Paul Eggert  <eggert@cs.ucla.edu>
7591
7592         Adjust to new regex.h API (with new fastmap type), and clean
7593         up the regex storage allocation a bit.
7594
7595         * src/csplit.c (struct control): Put re_compiled member at the
7596         end, since it's large.  Change regexpr member from char * to bool;
7597         all uses changed.  Add new member fastmap.
7598         (extract_regexp): regexp arg is now char const *, not char *.
7599         Don't bother duplicating the regular expression; it's not needed.
7600         Set fastmap from new fastmap member.  Don't bother allocating
7601         a buffer, as the regexp code does a better job than we do.
7602         * src/expr.c (docolon): Allocate and use a fastmap.
7603         Don't bother allocating a buffer.
7604         * src/nl.c (body_fastmap, header_fastmap, footer_fastmap):
7605         New vars.
7606         (build_type_arg): New fastmap arg.  All uses changed.
7607         Don't bother allocating a buffer, but set a fastmap.
7608         * src/ptx.c (context_regex_string, word_regex_string): Remove.
7609         (context_regex, word_regex): New vars, replacing the above.
7610         All uses changed.
7611         (struct regex_data): New type.
7612         (compile_regex): Renamed from alloc_and_compile_regex, since
7613         we no longer allocate storage.  Arg is now a struct regex_data *,
7614         not a const char *.  All uses changed.  Don't allocate the fastmap;
7615         instead, take it from the caller.  Don't convert size_t to int,
7616         to avoid arithmetic overflow problems.  Don't bother freeing
7617         storage afterwards; it's not worth the aggravation.
7618         * src/tac.c (compiled_separator_fastmap): New ver.
7619         (main): Use it.  Don't bother allocating a buffer.
7620
7621 2006-03-30  Jim Meyering  <jim@meyering.net>
7622
7623         * src/dd.c (iwrite): Remove assignment without effect.
7624         Reported by Felix Rauch Valenti.
7625
7626 2006-03-22  Eric Blake  <ebb9@byu.net>
7627
7628         * src/ptx.c (usage): Remove mention of --copyright/-C.
7629         (main): Alias --copyright to --version plus a deprecation warning.
7630         * NEWS: Mention this.
7631
7632 2006-03-27  Jim Meyering  <jim@meyering.net>
7633
7634         * src/Makefile.am (uptime_LDADD): Add $(POW_LIB), for uptime's
7635         use of strtod.  Tiny patch from Nickolai Zeldovich.
7636
7637 2006-03-11  Eric Blake  <ebb9@byu.net>
7638
7639         * tests/misc/dirname: New file.
7640         * tests/basename/Makefile.am: Delete.
7641         * tests/basename/basic: Move to...
7642         * tests/misc/basename: ... this new file.  Add some tests,
7643         including fixed behavior for //.
7644         * tests/misc/Makefile.am (TESTS): Sort.  Add basename, dirname.
7645         * tests/Makefile.am (SUBDIRS): Remove basename.
7646         * configure.ac (AC_CONFIG_FILES): Remove tests/basename.
7647
7648         Improvements to dirname/basename handling on platforms like
7649         cygwin with distinct // and with drive letters.
7650         * NEWS: Document new behavior.
7651         * src/basename.c (main): Don't strip suffix from file system
7652         roots.
7653         * src/cp.c (target_directory_operand): Use new last_component.
7654         (ASSIGN_BASENAME_STRDUPA): Likewise.  Reduce time spent
7655         traversing the string.
7656         * src/dircolors.c (guess_shell_syntax): Use new last_component.
7657         * src/install.c (target_directory_operand, install_file_in_dir):
7658         Likewise.
7659         * src/ln.c (target_directory_operand, main): Likewise.
7660         * src/ls.c (basename_is_dot_or_dotdot): Likewise.
7661         * src/mv.c (target_directory_operand, movefile): Likewise.
7662         * src/remove.c (rm_1): Likewise.
7663         * src/shred.c (wipename): Likewise.
7664         * src/split.c (next_file_name): Likewise.
7665         * src/su.c (log_su, run_shell): Likewise.
7666
7667 2006-03-23  Paul Eggert  <eggert@cs.ucla.edu>
7668
7669         * NEWS: nohup diagnostics are now more precise, and nohup now
7670         redirects stderr to nohup.out if stdout is closed and stderr is a tty.
7671         * src/nohup.c (main): Implement this.
7672         * tests/misc/nohup: Test the new behavior.
7673
7674 2006-03-12  Jim Meyering  <jim@meyering.net>
7675
7676         * src/copy.c (set_author): Rename function, from preserve_author.
7677
7678         * src/remove.c (AD_pop_and_chdir): Use new macro,
7679         CYCLE_CHECK_REFLECT_CHDIR_UP, rather than open-coding it.
7680
7681         * src/system.h (SAME_INODE): Remove definition.
7682         Include "same-inode.h", instead.
7683
7684 2006-03-11  Eric Blake  <ebb9@byu.net>
7685
7686         * src/pwd.c (robust_getcwd): Prepend only one slash, not two.
7687
7688 2006-03-10  Jim Meyering  <jim@meyering.net>
7689
7690         Fix a bug whereby a user with write access to a directory being removed
7691         could cause the removal of that directory to fail with an erroneous
7692         diagnostic about a directory cycle.  Reported by Vineet Chadha.
7693
7694         * NEWS: Mention this.
7695         * src/remove.c (AD_pop_and_chdir): If the directory we're about to
7696         leave (and try to rmdir) is the one whose dev_ino is being used to
7697         detect a cycle, reset cycle_check_state.dev_ino to that of the parent.
7698
7699 2006-03-08  Paul Eggert  <eggert@cs.ucla.edu>
7700
7701         * NEWS: Document dd's new 'directory' and 'nolinks' flags.
7702         * src/dd.c (set_fd_flags): Handle file-creation flags on file
7703         descriptors, rather than ignoring them.
7704         * tests/dd/misc: Add test cases for append, nofollow, directory,
7705         and nolinks flags.  Simplify redirection to /dev/null in some cases.
7706
7707         * tests/dd/misc: iflags->iflag.  This fixes a typo that meant the
7708         noatime test never tested anything.
7709
7710 2006-03-05  Paul Eggert  <eggert@cs.ucla.edu>
7711
7712         * src/dd.c (flags, usage): New flags directory, nolinks.
7713         * src/system.h (O_NOLINKS): Define to 0 if not already defined.
7714
7715         * src/ls.c (usage): Mention that -f disables --color.
7716         Problem reported by Niels Möller.
7717
7718 2006-03-03  Justin Pryzby  <pryzbyj@justinpryzby.com>
7719
7720         * man/*.x: Add references to syscalls from utilities of the same name.
7721
7722 2006-03-05  Jim Meyering  <jim@meyering.net>
7723
7724         * tests/help-version: Set SHELL, if not already set, in order to
7725         avoid failure when `make check' is run through debuild;  dircolors
7726         would fail due to lack of $SHELL.  Reported by Sven Joachim.
7727
7728         Make `base64 --wrap=N' work for N=0, and for N larger than SIZE_MAX.
7729         * src/base64.c (wrap_write, do_encode, main): Change type of
7730         parameters and locals, wrap_column, form size_t to uintmax_t.
7731         (main): Adjust to use xstrtoumax, accordingly.
7732
7733 2006-03-03  Jim Meyering  <jim@meyering.net>
7734
7735         Don't fail when run from an environment with SHELL not a Bourne
7736         shell, e.g. `env SHELL=/bin/csh make check' would fail this test.
7737         * tests/dircolors/simple: Invoke each non-failing test with -b.
7738         Reported by Michael Stone.
7739
7740 2006-02-27  Jim Meyering  <jim@meyering.net>
7741
7742         * tests/misc/base64: Derive --decode-using tests from the
7743         encode-based ones.
7744
7745         * tests/misc/base64: Factor out a long constant string.
7746         Split lines to stay within 80 columns.
7747
7748         * tests/misc/Makefile.am (TESTS): Add base64.
7749         * tests/misc/base64: Test base64.  From Simon Josefsson.
7750
7751         * src/base64.c (do_decode): Use correct type for parameter,
7752         ignore_garbage: s/size_t/bool/.
7753
7754         * src/base64.c: Don't include .h files already included by system.h:
7755         <string.h>, <stdlib.h>, <stdbool.h>, <limits.h>, <errno.h>.
7756         Include "system.h" before the other lib/*.h header files.
7757         Include <sys/types.h> before "system.h".
7758         (wrap_write): Remove declaration of unused local, initial_column.
7759         (wrap_write): Correct declaration syntax: s/size_t * V/size_t *V/.
7760
7761         * README: Add base64 to the list.
7762
7763 2006-02-17  Simon Josefsson  <jas@extundo.com>
7764
7765         New program: base64.
7766         * AUTHORS: Mention base64.
7767         * NEWS: Likewise.
7768         * man/Makefile.am: Build base64.1.
7769         * man/base64.x: New file.
7770         * src/Makefile.am (bin_PROGRAMS): Add base64.
7771         * src/base64.c: New file.
7772
7773 2006-02-25  Eric Blake  <ebb9@byu.net>
7774
7775         In ls, avoid calling stat for --inode (-i), when possible.
7776         * src/pwd.c (NOT_AN_INODE_NUMBER, D_INO): Move to ...
7777         * src/system.h: ... here, for use in ...
7778         * src/ls.c (main): ... here.  Prefer dirent.d_ino to stat when
7779         possible.
7780         (gobble_file): Add inode argument.
7781         (print_dir): Pass inode if available.
7782         (usage): Remove inaccuracy.
7783
7784 2006-02-23  Jim Meyering  <jim@meyering.net>
7785
7786         * TODO: Update/correct some obsolete entries.
7787
7788 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
7789
7790         * doc/coreutils.texi (join invocation): Mention `sort -k 1b,1'.
7791         * src/join.c (usage): Likewise.
7792         Documentation problem reported by Philip Kensche.
7793
7794 2006-02-20  Eric Blake  <ebb9@byu.net>
7795
7796         * man/rm.x: Update documentation to match previous patch.
7797
7798 2006-02-18  Eric Blake  <ebb9@byu.net>
7799
7800         New option for rm: --interactive=once (-I).
7801         * NEWS: Document it, along with change to rm --interactive.
7802         * TODO: Remove entry for implementing rm -I
7803         * src/rm.c (INTERACTIVE_OPTION): New enum value.
7804         (interactive_type): New enum.
7805         (long_opts): Let interactive take an optional argument.
7806         (interactive_args, interactive_types): New option arguments.
7807         (usage): Document -I, --interactive=WHEN.  Use program_name
7808         instead of a basename.
7809         (main): New -I option, new behavior to --interactive.
7810         * tests/rm/interactive-once: New tests.
7811         * tests/rm/interactive-always: Ditto.
7812         * tests/rm/Makefile.am (TESTS): Run them.
7813
7814 2006-02-18  Jim Meyering  <jim@meyering.net>
7815
7816         * Makefile.maint (sc_two_space_separator_in_usage): Make the regular
7817         expression match more of the target lines, e.g., those that start with
7818         `-S,' (short option followed by a comma) or that include `=[...]'.
7819         Patch by Nicolas François.
7820         Fix the four offenders thus exposed:
7821         * src/join.c (usage): Use two spaces (not one) to separate the
7822         --first-only option string from its description, so help2man formats
7823         the derived man page properly.
7824         * src/pr.c (usage): Likewise.
7825         * src/uniq.c (usage): Likewise.
7826         * src/install.c (usage): Likewise.
7827
7828 2006-02-15  Jim Meyering  <jim@meyering.net>
7829
7830         * Makefile.maint (alpha beta major): For `make major', ensure that the
7831         version string is of the form N.N[.N]*, where N is one or more digits.
7832
7833 2006-02-14  Jim Meyering  <jim@meyering.net>
7834
7835         * INSTALL: Update from gnulib.
7836
7837 2006-02-13  Jim Meyering  <jim@meyering.net>
7838
7839         * GNUmakefile (all): Emit diagnostics to stderr, not stdout.
7840
7841 2006-02-12  Jim Meyering  <jim@meyering.net>
7842
7843         * Makefile.maint (patch-check): New target.
7844         (local-checks-available): Add to the list.
7845
7846 2006-02-11  Jim Meyering  <jim@meyering.net>
7847
7848         * src/c99-to-c89.diff: New file.
7849         * src/Makefile.am (EXTRA_DIST): Add c99-to-c89.diff.
7850
7851         * .x-po-check: New file, with exclusions so that `make distcheck'
7852         passes once again.
7853         * Makefile.am (EXTRA_DIST): Add .x-po-check.
7854
7855         rm -r must remove an empty directory, even if it is inaccessible.
7856         * src/remove.c (close_preserve_errno): New function.
7857         (fd_to_subdirp): Don't print a diagnostic in this function.
7858         Do it from the callers instead, unless rmdir succeeds.
7859         (remove_cwd_entries, remove_dir): Adjust callers.
7860         * tests/rm/empty-inacc: New test for the above.
7861         * tests/rm/Makefile.am (TESTS): Add empty-inacc.
7862         * NEWS: Mention this bug fix.
7863         * tests/rm/rm2: Adjust two expected diagnostics, now that they're
7864         a tiny bit less precise: cannot remove `a/1': ... instead of
7865         cannot open directory `a/1': ...
7866
7867         * Makefile.maint (syntax-check-rules): Automatically derive this
7868         list of sc_-prefixed rule names.
7869
7870 2006-02-10  Paul Eggert  <eggert@cs.ucla.edu>
7871
7872         * Makefile.maint (CVS_LIST): Don't assume cvsu is available.
7873         (CVS_LIST_EXCEPT): New macro, to simplify exception-processing.
7874         Most uses of CVS_LIST changed to use CVS_LIST_EXCEPT.
7875         (syntax-check-rules): Bring back sc_changelong.  (Hmm, why did it
7876         go away? was that an accident?)
7877         (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
7878         (sc_cast_of_alloca_return_value, sc_space_tab, sc_prohibit_atoi_atof):
7879         (sc_error_exit_success, sc_file_system, sc_no_if_have_config_h):
7880         (sc_system_h_headers, sc_sun_os_names, sc_trailing_blank):
7881         (sc_two_space_separator_in_usage, sc_unmarked_diagnostics):
7882         (sc_obsolete_symbols, sc_changelog, sc_prohibit_jm_in_m4):
7883         (sc_useless_cpp_parens, makefile-check, m4-check, po-check):
7884         (author_mark_check, makefile_path_separator_check):
7885         Output line numbers, to simplify navigation of Emacs *compilation*
7886         buffers.
7887         (sc_prohibit_atoi_atof, sc_file_system):
7888         Rework slightly so that Makefile.maint doesn't get reported as a
7889         violation of its own syntax rules.
7890         (sc_dd_max_sym_length): Use ifneq to do nothing, instead of doing
7891         it at run-time (which didn't work with Bison).  Fix a makefile typo,
7892         caught by Makefile.maint itself: spaces where a tab should be.
7893         (po-check): Check lib/*.[ch] even if not in CVS; used by Bison,
7894         which copies from ../gnulib/lib/*.[ch] to lib/*.[ch].
7895         Ignore djgpp and man subdirectories, to avoid false matches with
7896         Bison and coreutils, respectively.  Use sort -u to remove the
7897         resulting duplicates.
7898         * gnupload: Rework slightly to avoid bogus warning from
7899         sc_two_space_separator_in_usage.
7900
7901 2006-02-10  Jim Meyering  <jim@meyering.net>
7902
7903         Use gzip's --rsyncable option only if it's available.
7904         * Makefile.maint (gzip_rsyncable): New variable.
7905         (GZIP_ENV): Use it.
7906
7907 2006-02-08  Jim Meyering  <jim@meyering.net>
7908
7909         * Makefile.maint (local-checks-available): Define in terms of
7910         the expansion, $(syntax-check-rules), rather than the single,
7911         top-level target `syntax-check', so that it's easier to exclude
7912         individual rules (via $(local-checks-to-skip)).
7913         (tgz-md5, tgz-sha1, ...): Remove now-unused definitions.
7914
7915 2006-02-07  Jim Meyering  <jim@meyering.net>
7916
7917         * src/system.h (!defined O_DIRECT): If O_DIRECTIO is defined (as it
7918         is on Tru64), define O_DIRECT to that.  Patch From James Lemley.
7919
7920         * tests/help-version (expected_failure_status_vdir):
7921         Redirect an expected disk-full diagnostic to /dev/null.
7922
7923 2006-02-06  Jim Meyering  <jim@meyering.net>
7924
7925         * src/unexpand.c (usage): Use two spaces (not one) to separate the
7926         --first-only option string from its description, so help2man formats
7927         the derived man page properly.
7928         * src/rm.c (usage): Likewise for --no-preserve-root.
7929         * src/chown.c (usage): Likewise.
7930         * src/chgrp.c (usage): Likewise.
7931
7932         Add a rule to ensure that the above doesn't happen again.
7933         * Makefile.maint (sc_two_space_separator_in_usage): New rule.
7934         (syntax-check-rules): Add it.
7935         * .x-sc_two_space_separator_in_usage: New empty file.
7936         * Makefile.am (EXTRA_DIST): Add .x-sc_two_space_separator_in_usage.
7937
7938 2006-02-06  Jim Meyering  <jim@meyering.net>
7939
7940         * src/cp.c (usage): Use two spaces (not one) to separate each
7941         option string from its description, so help2man formats the
7942         derived man page properly.
7943         * src/mv.c (usage): Likewise.
7944         Patch from Nicolas François in http://bugs.debian.org/351601.
7945
7946 2006-02-04  Jim Meyering  <jim@meyering.net>
7947
7948         * src/copy.c (copy_internal): cp -RL would fail when encountering
7949         the same directory more than once in the hierarchy beneath a single
7950         command-line argument.  That is legitimate, e.g. when there are
7951         two or more symbolic links, each pointing to some directory that
7952         would not otherwise be copied.  Reported by Christophe LYON.
7953         * tests/cp/cp-deref: New file.  Test for today's fix.
7954         * tests/cp/Makefile.am (TESTS): Add cp-deref.
7955         * NEWS: Document this.
7956
7957 2006-02-03  Jim Meyering  <jim@meyering.net>
7958
7959         * configure.ac: Require automake-1.9.6, not 1.8.3.
7960
7961 2006-02-01  Paul Eggert  <eggert@cs.ucla.edu>
7962
7963         * src/od.c (usage): Mention that -t a ignores high order bit.
7964         Documentation problem reported by Ed Avis.
7965
7966 2006-02-01  Jim Meyering  <jim@meyering.net>
7967
7968         * src/pwd.c (find_dir_entry): Remove unused local, `ent_sb_valid'.
7969
7970 2006-01-30  Paul Eggert  <eggert@cs.ucla.edu>
7971
7972         * src/head.c (main): Use a better diagnostic when someone uses a
7973         trailing numeric option in an invalid way.  Problem reported by
7974         Karl Berry.
7975         * src/tail.c (parse_options): Likewise.
7976
7977 2006-01-30  Jim Meyering  <jim@meyering.net>
7978
7979         * man/wc.x: Include `count' keyword in man page synopsis,
7980         per suggestion from http://bugs.debian.org/181585.
7981
7982 2006-01-24  Paul Eggert  <eggert@cs.ucla.edu>
7983
7984         * src/df.c (show_dev): If the file system claims to have
7985         more available than total blocks, report the number of used
7986         blocks as being total - available (a negative number) rather
7987         than as garbage.  Problem reported by Toralf Foerster.
7988
7989 2006-01-24  Jim Meyering  <jim@meyering.net>
7990
7991         * src/tail.c (tail_forever): Don't exit-nonzero when an attempt
7992         to put a regular file in O_NONBLOCK mode fails with EPERM.
7993         That happens on Linux (up to 2.6.15) when using tail -f on a file with
7994         the append-only attribute.  Reported by Dean Gaudet.  For details,
7995         see http://savannah.gnu.org/bugs/?func=detailitem&item_id=15473.
7996         * NEWS: Mention this fix.
7997         * tests/tail-2/append-only: New file.  Test for the above.
7998         * tests/tail-2/Makefile.am (TESTS): Add append-only.
7999         * tests/Makefile.am (check-root): Add tail-2/append-only
8000
8001 2006-01-21  Jim Meyering  <jim@meyering.net>
8002
8003         * NEWS: Mention fts-related improvements and bug fixes.
8004
8005 2006-01-19  Jim Meyering  <jim@meyering.net>
8006
8007         * tests/fmt/basic (pfx-1, pfx-2): New tests, to demonstrate the bug
8008         reported as http://bugs.debian.org/147577.  Forwarded by Thomas Hood.
8009
8010 2006-01-18  Jim Meyering  <jim@meyering.net>
8011
8012         * tests/du/Makefile.am (TESTS): Add long-from-unreadable.
8013
8014 2006-01-17  Jim Meyering  <jim@meyering.net>
8015
8016         Now that fts no longer changes the current working directory, adjust
8017         its clients accordingly -- note that du.c uses fts but doesn't need
8018         any adjustment, since it doesn't operate on the actual files,
8019         but rather just uses the stat buffers provided by fts.
8020
8021         * src/chown-core.c: Include "openat.h".
8022         Don't include "lchown.h".
8023         (restricted_chown): Accept a new parameter, CWD_FD, and use it in
8024         calling openat, lchownat, chownat, rather than open, lchown, chown.
8025         Update caller.
8026         * src/chmod.c: Include "openat.h".
8027         (process_file): Use chmodat (fts->fts_cwd_fd,... in place of chmod (...
8028
8029         * tests/du/long-from-unreadable: New test, to exercise one small
8030         corner of fts.c.
8031
8032 2006-01-13  Jim Meyering  <jim@meyering.net>
8033
8034         * tests/Makefile.am (SUBDIRS): Add comments discouraging the
8035         addition of new directories under tests/.
8036
8037         * tests/acl: Redirect stdin to /dev/null.  Otherwise, FreeBSD 5.0's
8038         getfacl would hang.
8039
8040 2006-01-12  Jim Meyering  <jim@meyering.net>
8041
8042         * tests/du/long-sloop: Adjust not to hard-code the expected
8043         diagnostic corresponding to ELOOP.  Solaris' diagnostic differs
8044         from that of GNU libc.  Reported by Paul Eggert.
8045
8046         * tests/du/long-sloop: Create file at end of symlink chain.
8047
8048         * tests/misc/test: New file, with a test for one of the
8049         bugs fixed by yesterday's test.c changes.
8050         * tests/misc/Makefile.am (TESTS): Add test.
8051
8052 2006-01-11  Jim Meyering  <jim@meyering.net>
8053
8054         * tests/du/long-sloop: New file.  Test for today's fts.c bug fix.
8055         That bug could make du -L, chgrp -L, or chown -L fail to diagnose
8056         a very long sequence of symbolic links (not necessarily a loop).
8057         * tests/du/Makefile.am (TESTS): Add long-sloop.
8058
8059 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
8060
8061         * src/test.c (test_syntax_error): Append a newline.  All callers
8062         changed, except for the ones that didn't already append a newline.
8063         Bug reported by Eric Blake.
8064
8065 2006-01-11  Jim Meyering  <jim@meyering.net>
8066
8067         * src/system.h (X2NREALLOC): Now that verify_true is no longer
8068         void, cast its result to void, to avoid gcc's warning that
8069         ``left-hand operand of comma expression has no effect''.
8070         (DECIMAL_DIGIT_ACCUMULATE, X2REALLOC): Likewise.
8071
8072 2006-01-10  Jim Meyering  <jim@meyering.net>
8073
8074         * tests/chmod/no-x: Add a test for today's fts.c fix.
8075
8076 2006-01-10  Jim Meyering  <jim@meyering.net>  (tiny change)
8077
8078         * src/ls.c (gobble_file): Use DTTOIF only if it's defined.
8079         This is necessary for Dragonfly.  Patch by Joerg Sonnenberger.
8080
8081 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
8082
8083         * src/system.h (X2NREALLOC, X2REALLOC, DECIMAL_DIGIT_ACCUMULATE):
8084         Use verify_true instead of verify_expr, to sync with gnulib.
8085
8086 2006-01-08  Jim Meyering  <jim@meyering.net>
8087
8088         * src/date.c (usage): Adjust the formatting of the entries for
8089         %::z and %:::z (separate with two spaces, not one) so that help2man
8090         formats them properly.  Reported by Philip Rowlands.
8091
8092 2006-01-06  Paul Eggert  <eggert@cs.ucla.edu>
8093
8094         * configure.ac (gl_IGNORE_UNUSED_LIBRARIES): Add.
8095
8096 2006-01-06  Jim Meyering  <jim@meyering.net>
8097
8098         * Makefile.maint (copyright-check): Use date +%Y in place of
8099         hard-coded 2005.
8100
8101         * src/remove.c (rm_1): Remove `static' attribute on local `status'.
8102         First off, the attribute should have been `volatile' (not static)
8103         to avoid longjmp-related risk of clobber.  Secondly, now there is
8104         no longer any risk of a local variable being clobbered, so there's
8105         no need for any attribute at all.
8106
8107 2006-01-05  Jim Meyering  <jim@meyering.net>
8108
8109         * src/remove.c: Give a few functions the inline attribute.
8110         (AD_pop_and_chdir): Use gotos to avoid some duplication.
8111         (AD_push): Rewrite an assertion so that the entire computation
8112         goes away when assertions are turned off.
8113
8114         * src/tail.c (ENOSYS) [!defined ENOSYS]: Don't define here.
8115         It's already defined in "system.h".
8116         * Makefile.maint: Add a FIXME comment.
8117
8118 2006-01-04  Jim Meyering  <jim@meyering.net>
8119
8120         * ChangeLog: Remove entries from 2005-10-22 and earlier.
8121         * ChangeLog-2005: New file, for entries up to version 5.92.
8122
8123 2006-01-03  Jim Meyering  <jim@meyering.net>
8124
8125         * tests/du/no-x: Also allow a slightly different diagnostic -- the
8126         one you get when using openat-enabled fts.c and du (coming soon).
8127         * tests/chmod/no-x: Likewise.
8128         * tests/chgrp/no-x: Likewise.
8129
8130         * src/system.h (O_DIRECTORY) [!defined O_DIRECTORY]: Define.
8131
8132 2006-01-02  Paul Eggert  <eggert@cs.ucla.edu>
8133
8134         * src/chown-core.c (RC_do_ordinary_chown): New enum value.
8135         (restricted_chown): Return it, if the file cannot be accessed due
8136         to EPERM, or if no uid or gid are required, or if the file is
8137         neither a directory nor a regular file.  Rewrite to avoid gotos.
8138         (change_file_owner): Handle RC_do_ordinary_chown case.
8139         Rewrite to avoid gotos.
8140         * tests/chgrp/basic: Make sure we can change the group of
8141         inaccessible files.
8142
8143         * src/date.c (usage): Explain %g, %G, and %V a bit better.
8144
8145 2006-01-02  Jim Meyering  <jim@meyering.net>
8146
8147         * src/copy.c (set_owner): Correct a comment.
8148
8149         * src/tail.c (parse_options): Change warning to say that --retry
8150         is useful `mainly' (not `only') when following by name.
8151         Reported here: http://bugs.debian.org/273781
8152
8153 2006-01-01  Paul Eggert  <eggert@cs.ucla.edu>
8154
8155         * NEWS: Document that mkfifo and mknod -m no longer set special bits.
8156         * src/copy.c: Include lchmod.h.
8157         (copy_internal): Use lchmod rather than chmod.
8158         * src/cp.c: Include lchmod.h.
8159         (re_protect, make_dir_parents_private): Use lchmod rather than chmod.
8160         * src/mkdir.c: Include lchmod.h.
8161         (usage): Clarify -m's operation.
8162         (main): Use lchmod rather than chmod.  Don't use lchmod unless the
8163         new mode contains bits outside the 777 range.
8164         * src/mkfifo.c (usage): Clarify -m's operation.
8165         (main): If -m is given, don't invoke chmod; use umask 0 instead.
8166         Report an error if -m asks for bits outside the 777 range.
8167         * src/mknod.c (usage, main): Likewise.
8168
8169         * src/mkdir.c, src/mkfifo.c, src/mknod.c: Undo 2005-12-19 changes.
8170
8171 2005-12-27  Jim Meyering  <jim@meyering.net>
8172
8173         * Makefile.maint (sc_obsolete_symbols): Prohibit use of O_NDELAY.
8174         (sc_prohibit_assert_without_use): New rule.
8175         (syntax-check-rules): Add it to the list.
8176         * .x-sc_prohibit_assert_without_use: New empty file.
8177         * Makefile.am (EXTRA_DIST): Add it.
8178
8179         * Makefile.maint (CVS_LIST): Define in terms of $(srcdir).
8180
8181         * cp.c, df.c, link.c, mknod.c, nice.c, sleep.c, unlink.c:
8182         Don't include <assert.h>; it wasn't used.
8183
8184 2005-12-26  Paul Eggert  <eggert@cs.ucla.edu>
8185
8186         * src/chown-core.c (restricted_chown):
8187         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
8188         * src/remove.c (fd_to_subdirp): Open with O_DIRECTORY | O_NOCTTY
8189         | O_NOFOLLOW too, for consistency with other dir-openers.
8190         Use POSIX-preferred O_NONBLOCK rather than O_NDELAY.
8191         (is_empty_dir): Likewise.
8192         * src/shred.c (wipename): Likewise.  Don't bother trying to open
8193         dir for writing, since POSIX prohibits it.
8194
8195 2005-12-22  Jim Meyering  <jim@meyering.net>
8196
8197         * tests/help-version: Redirect stderr to /dev/full, to suppress
8198         write error diagnostic.
8199
8200 2005-12-19  Jim Meyering  <jim@meyering.net>
8201
8202         * src/mkdir.c, src/mknod.c, src/mkfifo.c (main)
8203         Avoid a minor race condition when `-m MODE' is specified, by using
8204         open, fchown, and close rather than just chown.  To do that reliably --
8205         even with an overly restrictive umask -- ensure that each mkdir,
8206         mknod and mkfifo call uses a mode including at least owner-read access.
8207         * src/mknod.c (main): When `-m MODE' is specified, exit nonzero if
8208         the subsequent chown (or equivalent open,fchown,close) fails.
8209         * tests/misc/mknod: New tests.
8210         * tests/misc/Makefile.am (TESTS): Add mknod.
8211
8212 2005-12-17  Jim Meyering  <jim@meyering.net>
8213
8214         * src/remove.c (is_empty_dir): Open with O_NDELAY, so we don't hang,
8215         e.g., on a named pipe.
8216         (OPEN_NO_FOLLOW_SYMLINK): Remove definition.  Use O_NOFOLLOW in
8217         place of all uses, since it is guaranteed (system.h) to be defined.
8218
8219 2005-12-05  Andreas Gruenbacher  <agruen@suse.de>
8220
8221         Add POSIX ACL support
8222         * src/ls.c: Switch back from HAVE_ACL to USE_ACL: The acl() syscall
8223         is no requirement for ACL support; particularly, it does not exist
8224         on systems that have POSIX ACLs.
8225         * src/copy.h (cp_option_init) [umask_kill]: Remove member.
8226         * src/cp.c (umask_kill): With default acls, the umask is not to be
8227         applied.  Remove umask_kill, don't change the process umask, and let
8228         the kernel apply the umask where appropriate.
8229         * src/cp.c (make_dir_parents_private): Fix logic for POSIX ACLs.
8230         * src/copy.c (get_dest_mode): Remove; it is obsolete after removing
8231         umask_kill.
8232         (copy_reg, copy_internal): Use copy_acl and set_acl
8233         instead of fchown/chown. Fix the logic for POSIX ACLs.
8234         (chown_succeded): Remove; we now always copy acls and
8235         preserve S_ISUID, S_ISGID, and S_ISVTX when needed, no matter if we
8236         did a chown before or not.
8237         * src/mv.c, src/install.c (cp_option_init): Don't set umask_kill member.
8238         * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD, cp_LDADD,
8239         mv_LDADD, ginstall_LDADD): On systems with an ACL library, arrange
8240         to link with it via $(LIB_ACL), for the utilities that need it.
8241
8242 2005-12-16  Paul Eggert  <eggert@cs.ucla.edu>
8243
8244         * src/remove.c (OPENAT_CWD_RESTORE__REQUIRE): Remove.
8245         (OPENAT_CWD_RESTORE__ALLOW_FAILURE): Likewise.
8246         (fd_to_subdirp): Remove openat_cwd_restore_allow_failure arg; its
8247         value is now signified by whether cwd_errno is null.
8248         (fd_to_subdirp, remove_dir, rm_1); Change cwd failure indicator from
8249         pointer-to-bool to pointer-to-errno-value.  All callers changed.
8250         (rm_1): Don't bother setting a local cwd failure flag and then
8251         ORing it into the caller's.  Just set the caller's.
8252         (rm): Use cwd failure errno value to print a slightly-better
8253         diagnostic.
8254
8255 2005-12-15  Jim Meyering  <jim@meyering.net>
8256
8257         * src/stat.c (print_it): Properly handle a backslash at the
8258         end of a --printf format string.  Reported by Paul Eggert.
8259         * tests/misc/stat-printf (end-bs): Add a test for the above.
8260
8261 2005-12-15  Paul Eggert  <eggert@cs.ucla.edu>
8262
8263         * tests/acl: Port to pre-POSIX shells like Solaris 8 /bin/sh.
8264         Don't assume /etc/passwd contains user names; use 'id' instead.
8265
8266 2005-12-15  Jim Meyering  <jim@meyering.net>
8267
8268         stat: revert behavior of --format=FMT (-c)
8269         stat: add new option: --printf=FMT
8270         * NEWS: Mention this.
8271         * src/stat.c (isodigit, octtobin, hextobin): Define.
8272         (PRINTF_OPTION): Define.
8273         (interpret_backslash_escapes, trailing_delim): New globals.
8274         (usage): Document them.  Alphabetize on long option names.
8275         (print_esc_char): New function.
8276         (print_it): Rewrite, in order to handle backslash escapes.
8277         (main): Handle new option.  Set globals for --format, too.
8278
8279         * tests/misc/stat-printf: Test --printf and --format.
8280         * tests/misc/Makefile.am (TESTS): Add stat-printf.
8281
8282 2005-12-14  Paul Eggert  <eggert@cs.ucla.edu>
8283
8284         * NEWS: sort now reports incompatible options.
8285         * src/sort.c (incompatible_options, check_ordering_compatibility):
8286         New functions.
8287         (main): Use them.  Don't bother with a usage message for
8288         "sort -c a b", for consistency with other error diagnostics.
8289         * tests/sort/Test.pm (incompat1, incompat2, incompat3, incompat4):
8290         New tests.
8291
8292         * src/cat.c (main): Undo previous change.  close_stdout already
8293         does the check, so the previous change wasn't necessary.
8294
8295 2005-12-13  Paul Eggert  <eggert@cs.ucla.edu>
8296
8297         * src/cat.c (main): Check for close (STDOUT_FILENO) failure.
8298
8299 2005-12-12  Paul Eggert  <eggert@cs.ucla.edu>
8300
8301         Install a more-conservative approach for sort -R.  It's the
8302         same basic idea as the existing code, except it uses the full ISAAC
8303         approach (called the "more kosher" approach in the existing comments).
8304         This makes "sort -R" quite a bit slower (about a factor of 2 on my
8305         little tests involving 10000 lines on a 2.4 GHz P4), but I think it's
8306         better to be conservative here at first, and review any performance
8307         improvements carefully.
8308         * .x-sc_require_config_h: Add src/rand-isaac.c.
8309         * src/rand-isaac.h: Remove.  All uses now simply include rand-isaac.c.
8310         * src/Makefile.am (noinst_HEADERS): Remove rand-isaac.h.
8311         (shred_SOURCES, sort_SOURCES): Remove.
8312         (EXTRA_DIST): Add rand-isaac.c.
8313         * src/rand-isaac.c: Revert to what used to be in shred.c, without
8314         changing it to allow for varying numbers of words in the state.
8315         Alter so that we include rand-isaac.c directly rather than
8316         compiling it and linking to it.  Don't include config.h or
8317         system.h; that's the includer's responsibility.
8318         Omit functions that are specific to shred.
8319         (ISAAC_LOG, ISAAC_WORDS, ISAAC_BYTES, struct isaac_state, ind):
8320         (isaac_step, struct irand_state):
8321         Resurrect these, with the same defns that used to be in shred.c.
8322         (ISAAC_SIZE, isaac_new, isaac_copy): Remove.
8323         (isaac_refill, isaac_seed_start, isaac_seed_data, irand_init, irand32):
8324         static again.
8325         (struct isaac_state, isaac_refill, isaac_mix, isaac_init):
8326         (isaac_seed_start, isaac_seed_data, isaac_seed_finish, isaac_seed):
8327         (irand_init, irand32, irand_mod):
8328         Number of words is constant again.
8329         (struct irand_state, irand_init, irand32, irand_mod): Move to shred.c.
8330         * src/shred.c: Include rand-isaac.c rather than rand-isaac.h.
8331         * src/sort.c: Likewise.
8332         * src/shred.c (fillrand, dopass, main): Undo previous change.
8333         (struct irand_state, irand_init, irand32, irand_mod): Moved back here,
8334         from rand-isaac.c.
8335         * src/sort.c: Don't include md5.h; it wasn't needed.
8336         (struct keyfield): Rename random_hash to random, for consistency
8337         with the other member names.  All uses changed.
8338         (usage): Tweak wording to mention STRING for --seed option.
8339         (short_options): Rorder for consistency with other programs.
8340         (rand_state): Now a struct, not a pointer to one.  All uses changed.
8341         (HASH_WORDS, HASH_SIZE): Remove.
8342         (get_hash): Remove comments around resbuf size, since we can assume C89.
8343         Use a "more-kosher" (but slower) approach of invoking isaac_refill.
8344         (keycompare): Adjust to the new get_hash.
8345         Add a FIXME.
8346         (badfieldspec): Omit recently-introduced comment; it isn't needed.
8347         (main): Don't set need_random simply because gkey has it set; that
8348         doesn't necessarily mean we'll need random numbers.
8349         Redo seeding to match new get_hash approach.
8350
8351 2005-12-10  Jim Meyering  <jim@meyering.net>
8352
8353         * src/Makefile.am (noinst_HEADERS): Add rand-isaac.h.
8354
8355         Avoid shred segfault on 64-bit systems.
8356         * src/rand-isaac.c (isaac_refill): Don't try to negate a
8357         local of type uint32_t.  Make the local an `int' instead.
8358
8359         * NEWS: Mention sort's new options.
8360
8361         * src/rand-isaac.c (isaac_mix): Declare to be static.
8362         Mark all other functions as `extern' so the tight-scope
8363         part of `make distcheck' passes once again.
8364         * src/rand-isaac.h (isaac_mix): Remove declaration.
8365
8366         * src/sort.c (get_hash): Change position of `*' in parameter
8367         type to conform with convention.
8368         (main): Split a long line so it fits in 80 columns.
8369         (keycompare): Remove stray SPACE before TAB that was
8370         causing `make distcheck' to fail.
8371
8372         * src/shred.c: Don't include gethrxtime.h.  No longer needed.
8373
8374         * tests/misc/sort-rand: New file: basic tests for the new options.
8375         * tests/misc/Makefile.am (TESTS): Add sort-rand.
8376
8377 2005-12-10  Frederik Eaton  <frederik@ofb.net>
8378
8379         * src/Makefile.am (sort_LDADD): Add $(LIB_GETHRXTIME).
8380         (shred_SOURCES, sort_SOURCES): New macros, so we compile rand-isaac.c.
8381         * src/rand-isaac.c: New file, containing ISAAC code that was in shred.c.
8382         Make state size runtime-configurable.
8383         (isaac_new, isaac_copy): New functions.
8384         * src/rand-isaac.h: New file.
8385         * src/shred.c: Include rand-isaac.h.  Move ISAAC code to rand-isaac.c.
8386         (fillrand, main): Adjust to the fact that the state size is now
8387         runtime-configurable.
8388         * src/sort.c (short_options, long_options, WORDS, keycompare, main):
8389         (usage): Add options --random-sort and --seed to implement a random
8390         shuffle.
8391         Include md5.h and rand-isaac.h.
8392         (get_hash): New function.
8393         (rand_state): New var.
8394         (HASH_WORDS, HASH_SIZE): New macros.
8395
8396 2005-12-09  Paul Eggert  <eggert@cs.ucla.edu>
8397
8398         * tests/dd/misc: Add test for dd iflags=noatime.
8399
8400 2005-12-09  Jim Meyering  <jim@meyering.net>
8401
8402         * src/sort.c (usage): Mention white space vs -b and -t options.
8403         From The Wanderer.
8404
8405 2005-12-09  Eric Blake  <ebb9@byu.net>
8406
8407         * src/test.c (main): Fix misleading comment.
8408
8409 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
8410
8411         * NEWS: Mention dd's new noatime flag.
8412         * src/system.h (O_NOATIME): Define to 0 if not already defined.
8413         * src/dd.c (flags, usage): Add support for noatime flag.
8414
8415 2005-12-07  Jim Meyering  <jim@meyering.net>
8416
8417         Distribute the cvsu script, used only by `make syntax-check'.
8418         * Makefile.am (EXTRA_DIST): Add build-aux/cvsu.
8419         * Makefile.maint (CVS_LIST): Use build-aux/cvsu, now that we
8420         distribute a copy of this script.
8421         * .x-sc_unmarked_diagnostics: Add build-aux/cvsu.
8422
8423         * tests/mv/acl: exit-77 before the trap, not after, if we fail
8424         to create a temporary directory on another partition.
8425         From Andreas Gruenbacher.
8426
8427 2005-12-06  Tomas Pospisek  <tpo@sourcepole.ch>  (tiny change)
8428
8429         * man/basename.x: Cross-reference to dirname and readlink.
8430         * man/dirname.x: Cross-reference to basename and readlink.
8431
8432 2005-12-05  Andreas Gruenbacher
8433
8434         * src/copy.c [!HAVE_FCHOWN]: Define fchown(...) to -1.
8435         (set_owner, preserve_author): New functions, factored out of copy_reg.
8436         (copy_reg): Use them.
8437         (copy_internal): Use them here, too.
8438
8439 2005-12-04  Jim Meyering  <jim@meyering.net>
8440
8441         * src/sleep.c (usage): Say what happens with two or more arguments.
8442         Suggested by Justin Pryzby.
8443
8444         * src/uptime.c (print_uptime): Move decl of `upsecs' into scope
8445         where it's used.
8446
8447 2005-12-03  Jim Meyering  <jim@meyering.net>
8448
8449         * src/rm.c (long_opts): Change the name of each undocumented, for-
8450         testing-only option to start with `-', so that it cannot render
8451         ambiguous any prefix it happens to share with some other option name.
8452         Problem reported by Eric Blake.
8453         * src/head.c (long_options): Likewise.
8454         * src/tail.c (long_options): Likewise.
8455
8456         * tests/misc/head-elide-tail: Update uses of undocumented, for-
8457         testing-only --presume* options to start with `---'.
8458         * tests/rm/dangling-symlink: Likewise.
8459         * tests/rm/dir-no-w: Likewise.
8460         * tests/rm/isatty: Likewise.
8461
8462 2005-11-30  Jim Meyering  <jim@meyering.net>
8463
8464         * Makefile.maint: Add a comment about cvsu.
8465
8466 2005-11-25  Paul Eggert  <eggert@cs.ucla.edu>
8467
8468         * NEWS: df updates for "none", "proc", inaccessible file systems.
8469         * src/df.c (show_point): Ignore inaccessible file systems.
8470         (usage): -a includes dummy file systems, not size-0 file systems.
8471
8472         * src/od.c (unsigned_long_long_int): Renamed from ulonglong_t,
8473         to avoid collision with POSIX name space.  All uses changed.
8474
8475 2005-11-24  Jim Meyering  <jim@meyering.net>
8476
8477         * tests/Makefile.am (EXTRA_DIST): Add acl to the list.
8478         * tests/acl: Add `$0: ' prefix to diagnostics.
8479
8480         * .x-sc_require_config_h: Add lib/buffer-lcm.c to the list.
8481
8482 2005-11-23  Paul Eggert  <eggert@cs.ucla.edu>
8483
8484         * src/copy.c: Improve performance a bit by optimizing away
8485         unnecessary system calls and going to a block size of at least
8486         8192 (on normal hosts, anyway).  This improved performance 5% on my
8487         Debian stable host (2.4.27 kernel, x86, copying from root
8488         ext3 file system to itself).
8489         Include "buffer-lcm.h".
8490         (copy_reg): Omit last argument.  All callers changed.
8491         Use xmalloc to allocate rather than trusting alloca
8492         (which is unwise with large block sizes).
8493         Declare locals more locally, if possible.
8494         Use uintptr_t words instead of int words, for a bit more speed
8495         when looking for null blocks on 64-bit hosts.
8496         Optimize away reads of zero bytes on regular files.
8497         In the typical case, insist on 8 KiB buffers, at least.
8498         Avoid unnecessary extra call to fstat when checking for sparse files.
8499         Avoid now-unnecessary cast to off_t, and "0L".
8500         Avoid unnecessary test of *new_dst when checking for same owner
8501         and group.
8502
8503 2005-11-22  Paul Eggert  <eggert@cs.ucla.edu>
8504
8505         * src/remove.c (rm): Don't assume C99 for-loop syntax.
8506
8507 2005-11-22  Jim Meyering  <jim@meyering.net>
8508
8509         * src/remove.c (AD_push): Remove debugging cruft.
8510
8511         * tests/rm/unread2 (rm): Change expected diagnostic,
8512         `cannot open directory' to `cannot remove', to align with
8513         new version of rm.
8514         * tests/rm/rm2: Ensure that rm now continues removing entries
8515         even after certain types of failure.
8516
8517         * src/remove.c: Rewrite.  Now, this module is reentrant on systems
8518         that provide openat (Solaris), and on systems like Linux+procfs
8519         where our openat emulation code is reentrant.  This also fixes a
8520         few low-probability leaks and eliminates some code that could,
8521         in very unusual circumstances, cause rm() (via a callee) to exit.
8522         * NEWS: Mention this.
8523
8524         * configure.ac: Put copyright dates all on one line so the
8525         emacs function that updates them works properly.
8526
8527 2005-11-18  Paul Eggert  <eggert@cs.ucla.edu>
8528
8529         * configure.ac (AM_PROG_CC_C_O): Add.  Needed for CVS Automake.
8530         Problem reported by Eric Blake.
8531         (AC_PROG_CC_STDC): Use this instead of AC_PROG_CC, so that
8532         we get a standard-conforming compiler.  This relies on the new
8533         m4/c.m4 file.  Note that it's a bit tricky, since c.m4 doesn't
8534         define AC_PROG_CC_STDC; we are relying on Autoconf 2.59 internals.
8535         m4/c.m4 can go away with Autoconf 2.60 comes out.
8536
8537 2005-11-17  Jim Meyering  <jim@meyering.net>
8538
8539         * src/remove.c (AD_mark_helper): Make a `char *' parameter `const'.
8540         (AD_mark_current_as_unremovable): Likewise, but for a local.
8541         (rm_1): Likewise.
8542
8543         * tests/mv/acl: Let traps handle removing temporary directories.
8544
8545         Expect acl-related tests to fail, until the corresponding
8546         patches are committed.
8547         * tests/mv/Makefile.am (XFAIL_TESTS): Add acl.
8548         * tests/cp/Makefile.am (XFAIL_TESTS): Likewise.
8549
8550         ACL tests, from Andreas Gruenbacher.
8551         * tests/acl, tests/mv/acl, tests/cp/acl: New files.
8552         * tests/mv/Makefile.am (TESTS): Add acl.
8553         * tests/cp/Makefile.am (TESTS): Add acl.
8554
8555         * src/ls.c (basename_is_dot_or_dotdot): Correct wording in comment.
8556
8557 2005-11-16  Paul Eggert  <eggert@cs.ucla.edu>
8558
8559         * NEWS: Improve quality of ln's diagnostics.
8560         * src/ln.c (do_link, usage): Likewise.
8561         (do_link): Don't use alloca on a buffer of unbounded size.
8562
8563 2005-11-16  Jim Meyering  <jim@meyering.net>
8564
8565         * tests/cp/fail-perm: Accommodate HPUX.  It appears to fail
8566         with EACCES rather than EPERM.  Reported by Peter O'Gorman here:
8567         http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/5766
8568         This also affects AIX 4.3.3, according to Ralf Wildenhues, in
8569         http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html
8570
8571 2005-11-14  Jim Meyering  <jim@meyering.net>
8572
8573         * NEWS (sort): Mention consequences of today's mkstemp-safer.c fix.
8574
8575 2005-11-13  Jim Meyering  <jim@meyering.net>
8576
8577         * announce-gen: Accept new option, --gpg-key-id=ID and
8578         emit a blurb telling how to use the .sig files.
8579         * Makefile.cfg (gpg_key_ID): Define.
8580         * Makefile.maint (announcement): Use new option and key.
8581
8582         Require that most .c files include <config.h>.
8583         * Makefile.maint (sc_require_config_h): New rule.
8584         (syntax-check-rules): Add it.
8585         * .x-sc_require_config_h: New file listing exceptions to the
8586         above rule.  Some are legit, others are simply grandfathered in.
8587         * Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h here, too.
8588
8589 2005-11-12  Jim Meyering  <jim@meyering.net>
8590
8591         * src/checksum.h, src/md5.c, src/sha1sum.c: Remove now-unused files.
8592
8593 2005-11-11  Jim Meyering  <jim@meyering.net>
8594
8595         * NEWS: Mention `readlink -f' bug fix in 5.3.0 news.
8596         Mention new readlink options in 5.3.0's `New features' section.
8597         Spotted by Thomas Hood.
8598
8599 2005-11-08  Jim Meyering  <jim@meyering.net>
8600
8601         * NEWS: Merge in changes from b5_9x branch.
8602
8603 2005-11-08  Paul Eggert  <eggert@cs.ucla.edu>
8604
8605         * NEWS: ls now defaults to --time-style='locale', which in turn acts
8606         like --time-style='posix-long-iso' if the locale settings are messed up.
8607         * src/ls.c (decode_switches): Implement this.
8608
8609 2005-11-08  Jim Meyering  <jim@meyering.net>
8610
8611         * tests/du/2g: s/expensive/very expensive/ in a comment.
8612         From Paul Townsend.
8613
8614 2005-10-17  Eric Blake  <ebb9@byu.net>
8615
8616         * src/ls.c (usage): Fix descriptions of --sort, --time.
8617         Reported by Vitaly A. Ostanin.
8618
8619 2005-11-04  Paul Eggert  <eggert@cs.ucla.edu>
8620
8621         * src/ln.c: Include filenamecat.c.
8622         (FILE_BASENAME_CONCAT): Remove.
8623         (do_link): Remove last arg DEST_IS_DIR.  All callers changed.
8624         (main): Use file_name_concat, base_name, and strip_trailing_slashes
8625         instead of FILE_BASENAME_CONCAT.  This simplifies the code, and avoids
8626         the use of alloca.
8627
8628 2005-11-04  Jim Meyering  <jim@meyering.net>
8629
8630         * src/du.c (process_file): Don't overflow for files of size >= 2^31
8631         on systems with stat.st_blocks of a signed 32-bit type.
8632         This bug causes trouble on some AIX 5.1 systems.
8633         Report and trivial patch from Paul Townsend:
8634         <http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00033.html>
8635         * NEWS: Mention this.
8636
8637         * tests/du/2g: New (very-expensive) test for the above-fixed bug.
8638         * tests/du/Makefile.am (TESTS): Add it here.
8639         * tests/very-expensive: New file.
8640         * tests/Makefile.am (EXTRA_DIST): Add it here.
8641         * tests/cp/perm: Mark this test as `very-expensive', too.
8642
8643 2005-11-02  Paul Eggert  <eggert@cs.ucla.edu>
8644
8645         * NEWS: Mention that rm -d and maybe ln -d are scheduled for
8646         removal in 2006.
8647         * src/remove.h (struct rm_options): Remove unlink_dirs.  All uses
8648         removed.
8649         * src/rm.c (usage): Don't mention rm -d.
8650
8651 2005-11-02  Jim Meyering  <jim@meyering.net>
8652
8653         * tests/dd/skip-seek: Fix typo in comment: s/fileutils/coreutils.
8654         From Andreas Schwab.
8655
8656         * tests/dd/unblock-sync: Redirect stderr to /dev/null so the
8657         `M+N records in/out' lines don't pollute `make check' output.
8658
8659         * tests/dd/skip-seek (sk-seek4): New test, to exercise the bug
8660         fixed on 2005-10-31.  This test uses the new, IN_PIPE specifier.
8661         * tests/Coreutils.pm: Accept a new type of input specifier: IN_PIPE,
8662         to indicate that the input file should be piped into the command
8663         under test (via `cat FILE | $prog ...').
8664
8665         * src/remove.c (remove_entry): Emit a better diagnostic when rm
8666         (without -r) fails to remove a directory on a non-Linux system.
8667         This change affects only newer Solaris systems (with priv_*
8668         functions like priv_allocset).  Reported by Keith Thompson.
8669
8670         * tests/rm/dir-nonrecur: New file/test for the above fix.
8671         * tests/rm/Makefile.am (TESTS): Add dir-nonrecur.
8672
8673 2005-11-01  Paul Eggert  <eggert@cs.ucla.edu>
8674
8675         * NEWS: "tail -c 2 FILE" and "touch 0101000000" now operate as
8676         POSIX 1002.1-2001 requires.
8677         * src/tail.c (parse_obsolete_option): Implement this.
8678         Problem reported by Vincent Lefevre.
8679         * src/touch.c (main): Pass PDS_PRE_2000 to posixtime.
8680         * tests/tail/Test.pm (c-2, c-2-minus, c2, c2-minus): New tests.
8681         (test_vector): Add special cases for _POSIX2_VERSION, and
8682         regularize the old ones a bit.
8683         * tests/touch/obsolescent: Add y2000 test.
8684
8685 2005-10-31  Paul Eggert  <eggert@cs.ucla.edu>
8686
8687         * src/dd.c (skip): Fix off-by-one error reported by
8688         Theodoros V. Kalamatianos.
8689
8690 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
8691
8692         * tests/mkdir/p-3: Require that the test be run as non-root.
8693         Problem and trivial fix reported by Theodoros V. Kalamatianos.
8694
8695 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
8696
8697         * src/ln.c (FILE_BASENAME_CONCAT): Omit unnecessary slashes in the
8698         boundary between DEST and SOURCE in the result.
8699
8700 2005-10-26  Dmitry V. Levin  <ldv@altlinux.org>
8701
8702         * src/md5sum.c (main) [!O_BINARY]: Changed default read mode
8703         back to text, to sync with documentation and for backwards
8704         compatibility.
8705
8706 2005-10-25  Jim Meyering  <jim@meyering.net>
8707
8708         * tests/dircolors/simple (other-wr): Add an explicit test for
8709         the dircolors bug (NULL-dereference) fixed yesterday.
8710
8711 2005-10-24  Jim Meyering  <jim@meyering.net>
8712
8713         * src/tac.c (tac_file): When determining whether a file is seekable,
8714         also test whether it is a tty.  Using only the lseek-based test would
8715         give a false positive on Solaris.  Reported by Peter Fales.
8716
8717 2005-10-24  Dmitry V. Levin  <ldv@altlinux.org>
8718
8719         * tests/install/d-slashdot: New test, for "install -d" failure.
8720         * tests/install/Makefile.am (TESTS): Add d-slashdot.
8721         * tests/mkdir/p-slashdot: New test, for "mkdir -p" failure.
8722         * tests/mkdir/Makefile.am (TESTS): Add p-slashdot.
8723
8724 2005-10-24  Jim Meyering  <jim@meyering.net>
8725
8726         * src/dircolors.c (ls_codes): Add missing comma.
8727         Anonymous report and patch from
8728         http://savannah.gnu.org/bugs/?func=detailitem&item_id=14849
8729
8730         * src/dircolors.c: Add compile-time assertion that the slack_codes
8731         and ls_codes arrays have the same number of elements.  This would
8732         have prevented the above-fixed bug.
8733
8734         * src/expand.c (parse_tab_stops): Add a comment to make this function
8735         identical to the one in unexpand.c.
8736         * src/unexpand.c (parse_tab_stops): Adjust syntax to make this function
8737         identical to the one in expand.c.
8738
8739         * src/expand.c (next_file): Don't assume fopen cannot return stdin.
8740
8741 2005-10-23  Jim Meyering  <jim@meyering.net>
8742
8743         * src/md5sum.c (digest_check, main): Use ptr_align rather than
8744         a dangerous pointer-value-to-`unsigned' cast.
8745         * NEWS: mention the new sha* programs.
8746         * AUTHORS: Add new sha* programs.
8747
8748 2005-08-28  David Madore  <david.madore@ens.fr>
8749
8750         Add new programs: sha224sum, sha256sum, sha384sum, sha512sum.
8751         * README: Add their names to the list.
8752         * src/md5sum.c: Provide framework for computing sha-2 hashes.
8753         * src/Makefile.am (sha224sum, sha256sum, sha384sum, sha512sum):
8754         Rules for compiling sha-2 utilities
8755         (noinst_HEADERS): Remove checksum.h.
8756         * man/sha512sum.x, man/sha384sum.x, man/sha256sum.x, man/sha224sum.x:
8757         New files.
8758         * man/Makefile.am (dist_man_MANS): Add the corresponding .1 names.
8759         (sha224sum.1, sha256sum.1, sha384sum.1, sha512sum.1): New dependencies.
8760         * tests/misc/sha224sum, tests/misc/sha256sum: New files.
8761         * tests/misc/sha384sum, tests/misc/sha512sum: New files.
8762         * tests/misc/Makefile.am (TESTS): Add new sha224sum, sha256sum,
8763         sha384sum, sha512sum test scripts here rather that each in its
8764         own directory.
8765
8766 2005-08-28  David Madore  <david.madore@ens.fr>
8767
8768         * tests/sha1sum/basic-1 (million-a): Add the "million a's" test (one
8769         of the FIPS test vectors).
8770
8771 2005-10-23  Jim Meyering  <jim@meyering.net>
8772
8773         * configure.ac: Use 6.0-cvs as the version string.
8774         * NEWS: Adjust accordingly.
8775
8776
8777         -----
8778
8779         Copyright (C) 2005, 2006 Free Software Foundation, Inc.
8780
8781         Copying and distribution of this file, with or without
8782         modification, are permitted provided the copyright notice
8783         and this notice are preserved.