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