*** empty log message ***
[platform/upstream/coreutils.git] / ChangeLog
1 2006-07-21  Jim Meyering  <jim@meyering.net>
2
3         Fix another bug: ls --indicator-style=file-type would call
4         stat for a symlink, even though it wasn't always needed.
5         In some cases, that unnecessary stat would cause ls to fail.
6         * src/ls.c (gobble_file): Don't treat symlinks specially (in
7         requiring a stat syscall).  Remove the offending exclusion.
8         * NEWS: Mention the fix.
9
10         * tests/ls/stat-dtype: New file/test, for the above fix.
11         Also exercises the new df feature, below.
12
13         * src/df.c (main): Fail and don't print the headers if no
14         file system is processed.  This makes it easy to test whether
15         a specified directory is on a file system of a given type or types.
16         Otherwise, applications would have had to parse df's output.
17         E.g., is "." either ext3 or reiserfs: df -t ext3 -t reiserfs .
18
19         Fix a bug: ls --file-type worked like --indicator-style=slash,
20         rather than like --indicator-style=file-type.
21         * src/ls.c (FILE_TYPE_INDICATOR_OPTION): New enum member.
22         (long_options): Map "file-type" to FILE_TYPE_INDICATOR_OPTION,
23         not to 'p'.
24         (decode_switches): Handle new case: FILE_TYPE_INDICATOR_OPTION.
25         * NEWS: Mention the fix.
26         * tests/ls-2/tests (file-type): New test, for the above fix.
27
28 2006-07-19  Jim Meyering  <jim@meyering.net>
29
30         * src/ls.c (print_dir): Give a better diagnostic for failed opendir.
31
32         * Makefile.am (EXTRA_DIST): Add build-aux/vc-list-files.
33
34 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
35
36         * NEWS: chmod, install, and mkdir now leave setgid and setuid bits
37         of directories alone unless you specify them explicitly.
38         install and mkdir now implement X correctly.
39         install now creates parent directories with mode 755, without
40         changing their owner or group.
41         * src/chmod.c (process_file): Adjust to mode_adjust API change.
42         * src/install.c: Include mkancesdirs.h.
43         (announce_mkdir, make_ancestor): New functions.
44         (DEFAULT_MODE): New macro, specifying initial value of 'mode'.
45         (mode): Use it.
46         (dir_mode, dir_mode_bits): New vars.
47         (main): Set dir modes separately from nondir, so that the X
48         op of -m works correctly.
49         (main): Remove cwd_errno cruft, since make_dir_parents no longer
50         affects cwd.  Adjust to new make_dir_parents API.
51         (install_file_in_file_parents): 2nd arg is now char *, not char
52         const *.  Use mkancesdirs instead of rolling our own code.
53         (change_attributes): Don't worry about AFS, since that kludge
54         should not be needed any more.
55         * src/mkdir.c (struct mkdir_options): New struct.
56         (announce_mkdir, make_ancestor): New functions.
57         (main): Use them.  Adjust to mode_adjust API change.  Stick with
58         umask 0.  Use make_dir_parents for all the work.
59         * src/mkfifo.c (main): Adjust to new mode_adjust API.
60         * src/mknod.c (main): Likewise.
61         * tests/chmod/setgid: Do the setgid test instead of bailing.
62         * tests/mkdir/p-3: Remove re_protect case that no longer applies.
63         GNU chmod now behaves like other versions of chmod.
64         * tests/mkdir/perm: Add a test for the X bug.
65
66 2006-07-14  Paul Eggert  <eggert@cs.ucla.edu>
67
68         * src/base64.c (do_decode): Output to parameter OUT, not to stdout.
69         This doesn't fix any bugs, since OUT always equals stdout, but it
70         makes the code easier to understand.
71
72 2006-07-14  Jim Meyering  <jim@meyering.net>
73
74         * Makefile.maint (CVS_LIST): Use new file, build-aux/vc-list-files,
75         rather than open-coding it.  Now supports mercurial, too.
76         * .hgignore: New file.
77         * Makefile.am (EXTRA_DIST): Add .hgignore, which ignores nearly
78         all generated files, including ones like configure and po/*.po
79         that are currently version-controlled in cvs.
80
81         * Makefile.am (EXTRA_DIST): Add a few more .??* files.
82         They've been in CVS, just haven't been distributed before this.
83         Distribute ChangeLog-2005, too.
84         (MAINTAINERCLEANFILES): Add THANKS-to-translators.
85
86 2006-07-11  Paul Eggert  <eggert@cs.ucla.edu>
87
88         * src/system.h: Assume <dirent.h> exists, since gnulib assumes
89         this now as well.
90
91 2006-07-09  Jim Meyering  <jim@meyering.net>
92
93         * tests/mv/dir2dir: Adjust so failing with ENOTEMPTY is ok, too.
94         That happens with Linux/tmpfs.
95         * tests/mv/Makefile.am (TESTS): Add dir2dir.
96
97 2006-07-09  Paul Eggert  <eggert@cs.ucla.edu>
98
99         Adjust to recent updates from gnulib.
100         * src/dd.c (apply_translations): Use toupper rather than
101         islower followed by toupper; it's simpler and typically
102         faster now that we assume at least C89 semantics.  Similarly
103         for tolower.
104         * src/sort.c (inittables): Likewise.
105         * src/expand.c (expand): Don't assume that isprint etc. return
106         booleans (needed for pre-C99 hosts).
107         * src/fmt.c (check_punctuation): Likewise.
108         * src/ptx.c (initialize_regex, fix_output_parameters): Likewise.
109         * src/tr.c (is_char_class_member): Likewise.
110         * src/unexpand.c (unexpand): Likewise.
111         * src/join.c (is_blank): Remove; no longer needed.  All uses
112         replaced by isblank (to_uchar (...)).
113         * src/pinky.c (create_fullname): Don't assume char is unsigned.
114         * src/printf.c (print_esc): Likewise.
115         * src/ptx.c (SKIP_NON_WHITE, SKIP_WHITE, SKIP_WHITE_BACKWARDS):
116         (copy_unescaped_string): Likewise.
117         * src/stat.c (print_it): Likewise.
118         * src/system.h (_D_EXACT_NAMELEN): Renamed from NLENGTH, for
119         convenience on GNU systems.  All uses changed.  Don't bother
120         looking for any dirent.h substitute other than ndir.h.
121         (D_INO): Remove unnecessary parentheses.
122         (IN_CTYPE_DOMAIN, ISGRAPH, ISPRINT, ISALNUM, ISALPHA):
123         (ISCNTRL, ISLOWER, ISPUNCT, ISSPACE, ISUPPER, ISXDIGIT):
124         (ISDIGIT_LOCALE, TOLOWER, TOUPPER): Remove.  All uses changed
125         to ctype.h equivalents.
126         (isblank): Renamed from ISBLANK.  Check for HAVE_DECL_ISBLANK too.
127         All uses changed.
128
129 2006-07-08  Jim Meyering  <jim@meyering.net>
130
131         * tests/mv/dir2dir: New file, test for 2006-07-05 fix in copy.c.
132
133         * Makefile.maint (sc_the_the): New rule.
134
135         * src/dd.c (skip): Remove one of two adjacent "the"s in a comment.
136         * tests/Coreutils.pm (run_tests): Remove one of two adjacent "then"s
137         in a comment.
138
139 2006-07-07  Jim Meyering  <jim@meyering.net>
140
141         * NEWS: Mention that mv can now remove an empty destination directory,
142         and give an example.  Prompted by a report from Florent Bayle.
143
144 2006-07-05  Jim Meyering  <jim@meyering.net>
145
146         * src/ls.c (usage): Correct the description of -G: it is useful
147         only in a long listing.  Reported by Martin Pool in
148         <https://launchpad.net/distros/ubuntu/+source/coreutils/+bug/51653>.
149
150         * man/chmod.x: Correct the description of the sticky bit.  Reported
151         by Chris Moore via Ian Jackson in <http://bugs.debian.org/376745>.
152
153         * src/copy.c (copy_internal): Don't work around old NFS clients like
154         SunOS-4.1.4 and Irix 5.3 that set errno to values like EIO and
155         ENOTEMPTY upon failed rename.  Otherwise, we risk misinterpreting
156         a banal failure as a recursive move-into-self failure.
157         Reported by Florent Bayle in <http://bugs.debian.org/376749>.
158
159         * src/c99-to-c89.diff: Regenerate, to remove fuzz.
160
161 2006-07-03  Jim Meyering  <jim@meyering.net>
162
163         Plug another unusual leak.
164         (AD_mark_helper): Free malloc'd filename if hash_insert says
165         that string is already in the hash table.
166
167         The dev/inode of the topmost directory in each hierarchy were not
168         being recorded.
169         * src/remove.c (remove_cwd_entries): Don't call cycle_check here.
170         (AD_push): Call it from here instead.
171
172         Fix two small leaks.
173         * src/remove.c (AD_stack_clear): New function.
174         (rm_1): Use it.
175         (AD_pop_and_chdir): Free *prev_dir just before longjmp.
176
177         * tests/Makefile.am, tests/*/Makefile.am: (TESTS_ENVIRONMENT):
178         Add $VG_PATH_PREFIX as a prefix to $PATH
179
180         * tests/envvar-check (vars): Add CDPATH and POSIXLY_CORRECT.
181         * tests/Makefile.am (evar-check): Remove rule.
182         (EXTRA_DIST): Remove .env-warn.
183         * tests/.env-warn: Remove file.  No longer used.
184         Suggestion from Eric Blake.
185
186 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
187
188         * src/system.h: Include <stdint.h> unconditionally, since we
189         now assume the stdint module.
190
191 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
192
193         * NEWS: With no operand, 'tail -f' now silently ignores the '-f'
194         only if standard input is a FIFO or pipe and POSIXLY_CORRECT is set.
195         * src/tail.c (main): Implement this.
196         * tests/tail/Test.pm (f-pipe-1): Renamed from f-1.
197         (test_vector): Set POSIXLY_CORRECT for the f-pipe-* tests.
198
199 2006-07-01  Jim Meyering  <jim@meyering.net>
200
201         * src/ln.c (do_link): Use new, shorter URL, for ag-review link.
202
203         * .x-sc_require_config_h: Add ^lib/xstrtold\.c$, so make distcheck
204         passes once again.
205
206 2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
207
208         * NEWS: seq now uses long double internally rather than double.
209         It now defaults to a minimal fixed point format if possible.
210         It lets you use %a, %A, %E, %F, %G.
211         * src/Makefile.am (seq_LDADD): Remove $(SEQ_LIBM); add $(POW_LIB).
212         * src/seq.c: Don't include <math.h> or <xstrtol.h>; no longer needed.
213         (isfinite) [!defined isfinite]: New macro.
214         (separator, terminator): Now points to const.
215         (first, step, last): Remove.
216         (usage): Update to match new behavior.
217         (struct operand, operand): New type.
218         (scan_arg): Renamed from scan_double_arg, since we no longer use double.
219         All uses changed.
220         Compute and return a value of type operand, not double.
221         (long_double_format): Renamed from valid_format, and now returns a
222         new format with an "L" added if needed, if the original format was
223         valid.  Allow %a, %A, %E, %F, and %G formats.
224         (print_numbers): Take numeric values as args rather than from globals.
225         Print long double, not double.
226         (get_width_format): Remove.
227         (get_default_format): New function.
228         (main): Implement new way of calculating default format.
229         Don't worry about locale's representation of the decimal point, since
230         the arguments are always processed in the C locale.
231         * tests/seq/basic (neg-2): Adjust to new default format.
232         (eq-wid-1, eq-wid-2): Resurrect these tests, since the new
233         implementation should do the right thing.
234
235 2006-06-30  Jim Meyering  <jim@meyering.net>
236
237         * tests/stty/basic-1: Work around an intermittent test failure
238         on HP-UX 11.11.  Report and analysis from Bob Proulx.
239         http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7475
240
241 2006-06-28  Paul Eggert  <eggert@cs.ucla.edu>
242
243         * NEWS: Support obsolete usages like "sort +1 -2" even when
244         conforming to POSIX 1003.1-2001, since this is a pure extension to
245         POSIX.  Problem reported by Christian in:
246         http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00220.html
247         * src/sort.c (main): Implement this.
248
249         * src/system.h (CLOSEDIR): Remove.  All uses changed to closedir.
250         Autoconf 2.60 says this stuff was obsolete.
251
252 2006-06-28  Jim Meyering  <jim@meyering.net>
253
254         * src/c99-to-c89.diff: Regenerate, to remove fuzz.
255
256 2006-06-28  Bob Proulx  <bob@proulx.com>  (tiny change)
257
258         * tests/mv/i-link-no: Work around HP-UX /bin/sh tracing problem
259         (set -x when VERBOSE=yes) when stderr is redirected before stdout
260         causing shell tracing of the stdout redirection to be written to
261         the stderr file.  Avoid problem and test failure on HP-UX by
262         redirecting stderr last.
263         * tests/dd/unblock-sync: Order shell file redirections for
264         stderr and stdout in the common style.
265         tests/acl: Likewise.
266
267 2006-06-27  Jim Meyering  <jim@meyering.net>
268
269         * tests/misc/cat-proc: Try to avoid any spurious numeric
270         differences in frequently-changing /proc/cpuinfo.
271         Reported by Nelson Beebe.
272
273 2006-06-26  Jim Meyering  <jim@meyering.net>
274
275         Attempt rmdir (actually, unlinkat-with-AT_REMOVEDIR) upon any
276         fd_to_subdirp failure, not just when errno == EACCES.
277         * src/remove.c (remove_dir): Use unlinkat-with-AT_REMOVEDIR, not
278         rmdir, here, even though rmdir may happen to be adequate.
279
280         * NEWS: rm no longer fails to remove an empty, unreadable directory
281         * src/remove.c (remove_cwd_entries): If we can't open a directory,
282         and the failure is not being ignored, try to remove the directory
283         with rmdir (aka unlinkat-with-AT_REMOVEDIR), in case it's empty.
284         Problem report and test case from Paul Eggert in
285         <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7425>.
286
287         * tests/rm/empty-inacc: New test, for the above.
288
289         Avoid a segfault for wc --files0=- < /dev/null.
290         * src/wc.c (compute_number_width): Return right away if nfiles == 0.
291
292 2006-06-25  Jim Meyering  <jim@meyering.net>
293
294         * NEWS: wc accepts a new option --files0-from=FILE, where FILE
295         contains a list of NUL-separated file names.
296
297         * src/wc.c: Include "readtokens.h".
298         (usage): Describe the new option, and adjust the `Usage':
299         with this option, no FILE may be specified on the command line.
300         (main): Handle the new option.
301         * tests/misc/wc-files0: New tests, for the above.
302         * tests/misc/wc-files0-from: Likewise.
303         * tests/misc/Makefile.am (TESTS): Add wc-files0.
304
305 2006-06-24  Jim Meyering  <jim@meyering.net>
306
307         * src/md5sum.c (DIGEST_BUFFER): Remove now-unused definitions.
308
309 2006-06-22  Jim Meyering  <jim@meyering.net>
310
311         * src/tee.c (tee_files): Rename from tee, to avoid conflict with
312         the function in glibc's <fcntl.h>.  Reported by Andreas Schwab.
313
314 2006-06-19  Jim Meyering  <jim@meyering.net>
315
316         * Makefile.cfg (local-checks-to-skip): Add changelog-check,
317         so this check is not run as part of "make distcheck".
318
319 2006-06-18  Bob Proulx  <bob@proulx.com>  (tiny change)
320
321         * tests/misc/pwd-long: Fix typo (s/neq/ne/) in previous change.
322
323 2006-06-18  Jim Meyering  <jim@meyering.net>
324
325         * tests/misc/pwd-long: Make error output a little clearer.
326
327 2006-06-17  Jim Meyering  <jim@meyering.net>
328
329         * tests/rm/inaccessible: Skip this test on systems without openat
330         support.  Reported by Bob Proulx.
331
332 2006-06-15  Bob Proulx  <bob@proulx.com>  (tiny change)
333
334         * tests/misc/mknod: Improve permission checks to handle
335         running mkdir test in set-gid directories.
336
337 2006-06-14  Jim Meyering  <jim@meyering.net>
338
339         * tests/du/basic: Revamp not to hard-code file system block sizes.
340
341 2006-06-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
342
343         * tests/du/Makefile.am (TESTS_ENVIRONMENT): Pass $(PERL), for
344         files0-from test.
345
346 2006-06-11  Jim Meyering  <jim@meyering.net>
347
348         * .gitignore: New file.
349         * Makefile.am (EXTRA_DIST): Add .gitignore.
350
351         Setting TIME_STYLE=long-iso in the environment would make the
352         cp/same-file test fail.
353         * tests/envvar-check (vars): Add TIME_STYLE to the list.
354         * tests/cp/same-file: Revert last change.
355         Source the envvar-check script, to ensure that TIME_STYLE
356         settings don't affect these tests.
357
358 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
359
360         * tests/cp/same-file: Execute 'ls' in the C locale, so that it
361         uses POSIX time stamp formats.  Problem reported by John Nixon in
362         <http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00062.html>.
363
364 2006-06-10  Jim Meyering  <jim@meyering.net>
365
366         * NEWS: Mention the AIX-strndup-bug vs. dircolors workaround.
367
368         Require a "Version N.M" line at the top of the ChangeLog
369         file only when making the actual release, not when running
370         "make distcheck".
371         * Makefile.maint (maintainer-distcheck): Don't depend on
372         changelog-check.
373         (alpha beta major): Depend on it here, instead.
374
375 2006-06-08  Jim Meyering  <jim@meyering.net>
376
377         Ensure that cat works with any of the options, -A -v -e -E -T,
378         when applied to files in /proc and /sys, even when the FIONREAD
379         ioctl produces nonsensical results.  Before this change, cat would
380         produce no output (or truncated output), for some linux kernels.
381
382         * src/cat.c (write_pending): New function, factored out of cat.
383         (cat): Also interpret a negative ioctl/FIONREAD count as indicating
384         that there are bytes to read.  Some versions of linux-2.6.16 do that.
385         Write any pending output before returning.
386         Reported by Dan Jacobson in <http://bugs.debian.org/370583>.
387         * NEWS: Mention this bug fix.
388         * tests/misc/cat-proc: New file.  Test for the above.
389         * tests/misc/Makefile.am (TESTS): Add cat-proc.
390
391 2006-06-07  Paul Eggert  <eggert@cs.ucla.edu>
392
393         * src/expr.c (eval4): Detect overflow properly when multiplying
394         INTMAX_MIN * -1.
395
396 2006-06-06  Paul Eggert  <eggert@cs.ucla.edu>
397
398         * NEWS: The 'expr' command now detects and reports integer overflow.
399         (It would be better to use extended precision instead, but that
400         would be more work.)
401         * src/expr.c (integer_overflow): New function.
402         (eval4, eval3): Check for integer overflow.
403
404 2006-06-05  Paul Eggert  <eggert@cs.ucla.edu>
405
406         Fix problems when building with Solaris/SVR4/etc. make, which uses a
407         different and somewhat bogus implementation of VPATH.  In the
408         directory tests/misc, rename tests whose names might appear in the
409         Automake-generated rules.  For example, we can't use a test named
410         'test', since Automake generates a rule that contains the text
411         "if test -f ./$$tst; ...", and this might expand to something like
412         "if ../../../coreutils-6.0/tests/misc/test -f ./$$test; ...",
413         which executes the 'test' script rather than the 'test' command.
414         * tests/misc/false-status: Renamed from tests/misc/false.
415         * tests/misc/pwd-long: Renamed from tests/misc/pwd.
416         * tests/misc/sort-merge: Renamed from tests/misc/sort.
417         ($prog): Set to 'sort' rather than to $PROG.
418         * tests/misc/test-diag: Renamed from tests/misc/test.
419         * tests/misc/Makefile.am (PROG): Take the basename of $$tst,
420         in case Solaris make has prepended the directory.
421         (TESTS): Adjust to above renamings.
422         * tests/misc/expand: Don't assign to PROG; no longer needed
423         now that Makefile.am sets PROG to the basename.
424         * tests/misc/fold: Likewise.
425
426 2006-06-03  Jim Meyering  <jim@meyering.net>
427
428         Make `cp --link --no-dereference' work also on systems where the
429         link system call cannot create a hard link to a symbolic link.
430         * src/copy.c (copy_internal) [LINK_FOLLOWS_SYMLINKS]: Don't use
431         the link syscall on a symlink when it would do the wrong thing.
432         Based on the patch by Aurelien Jarno: <http://bugs.debian.org/329451>
433         * tests/cp/link-no-deref: New file/test for the above.
434         * tests/cp/Makefile.am (TESTS): Add link-no-deref.
435         * NEWS: Mention the change (doesn't affect Linux).
436
437 2006-06-01  Paul Eggert  <eggert@cs.ucla.edu>
438
439         Fix some porting problems in the test cases reported by
440         Ralf Wildenhues for HP-UX 11.23 in:
441         http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00238.html
442         * tests/help-version: Don't assume that \< \> works in sed.
443         * tests/misc/close-stdout: Don't assume that >&- works.
444         Add a /dev/full test.
445         * tests/touch/no-create-missing: Don't assume that >&- works.
446
447 2006-05-30  Jim Meyering  <jim@meyering.net>
448
449         * src/ls.c (usage): Add `v' to the list of sorting-related options.
450         From Justin Pryzby.
451
452 2006-05-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
453
454         * tests/cp/fail-perm: source lang-default.
455         * tests/rm/inaccessible: Likewise.
456
457 2006-05-28  Jim Meyering  <jim@meyering.net>
458
459         * tests/rm/inaccessible: AIX 4.3.3 gives a different diagnostic.
460         Recognize it, too.  Reported by Ralf Wildenhues, in
461         http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html
462
463 2006-05-27  Jim Meyering  <jim@meyering.net>
464
465         * src/chgrp.c: Support new options: --preserve-root and
466         --no-preserve-root.  Somehow this program was skipped when those
467         options were added to chown, chmod, and rm.  Reported by
468         vaqflabuopac@spammotel.com in <http://bugs.debian.org/365656>.
469         * NEWS: Mention this.
470
471 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
472
473         * NEWS: Remove mention of --seed.  We'll replace it with something
474         better, and don't want to indicate that it is supported.
475         * src/sort.c (usage): Likewise.
476
477 2006-05-20  Jim Meyering  <jim@meyering.net>
478
479         * src/chmod.c (main): Use FTS_PHYSICAL here, too.
480
481         * src/du.c (main): Rename local, s/symlink_deref_bit/symlink_deref_bits/
482         and arrange for -D to set fts' FTS_PHYSICAL bit as well as
483         FTS_COMFOLLOW.  Spotted by Justin Pryzby.
484
485         * gnupload: Merge changes from automake, retaining the ""--to...
486         kludge to placate overzealous `make distcheck' check.
487
488 2006-05-19  Jim Meyering  <jim@meyering.net>
489
490         * src/du.c (main): Don't let -D, -L, or -P turn off the internal
491         FTS_TIGHT_CYCLE_CHECK directory traversal option.
492         Reported by Justin Pryzby in http://bugs.debian.org/367691
493
494 2006-05-15  Jim Meyering  <jim@meyering.net>
495
496         * src/cp.c (usage): Correct description of -a: s/-dpR/-dpPR/.
497         From Tomas Pospisek.
498
499 2006-05-13  Jim Meyering  <jim@meyering.net>
500
501         * tests/mv/no-target-dir: Test two more cases.
502
503 2006-05-11  Jim Meyering  <jim@meyering.net>
504
505         mv -T DIR EMPTY_DIR no longer fails unconditionally
506         * src/copy.c (copy_internal): Don't manually prohibit a move where
507         the destination is an existing directory.  Sometimes doing that is
508         valid.  Let the rename system call enforce the rules.  That is
509         allowed only when the source is a directory and the destination
510         directory (to be replaced) is empty.  Reported by Eric Blake.
511         * tests/mv/no-target-dir: New file/test for this.
512         * tests/mv/Makefile.am (TESTS): Add no-target-dir.
513         * NEWS: Mention this.
514
515         * tests/mv/atomic: New file/test for yesterday's fix.
516         * tests/mv/Makefile.am (TESTS): Add atomic.
517
518         * tests/du/long-sloop: Avoid harmless `ambiguous redirect' diagnostic.
519
520 2006-05-10  Jim Meyering  <jim@meyering.net>
521
522         * src/copy.c (copy_internal): Don't explicitly unlink the destination
523         when moving a symlink into the place of an existing non-directory.
524         Reported by Joshua Hudson.
525         * NEWS: mention this.
526
527 2006-05-07  Jim Meyering  <jim@meyering.net>
528
529         * Makefile.maint (patch-check): Fail if patch generates any output,
530         even merely for changed offsets.
531
532         * src/c99-to-c89.diff: Adjust to reflect new offsets.
533
534         * NEWS: Mention changes affecting df, pwd, shred.
535
536 2006-05-06  Jim Meyering  <jim@meyering.net>
537
538         * tests/ls/stat-vs-dirent: New test, to detect the bogus file
539         system condition where dirent.d_ino != stat.st_ino.
540         * tests/ls/Makefile.am (TESTS): Add stat-vs-dirent.
541
542 2006-05-06  Eric Blake  <ebb9@byu.net>
543
544         * tests/ls/inode: Expand to test inode from readdir case.
545         * tests/ls/follow-slink: Expand to test broken links encountered
546         implicitly, favoring Solaris 9 and OpenBSD 3.4 behavior.
547
548 2006-05-06  Eric Blake  <ebb9@byu.net>
549
550         * tests/mv/leak-fd: Work even on case-insensitive file system.
551
552 2006-05-04  Jim Meyering  <jim@meyering.net>
553
554         * NEWS: Mention the 2006-03-19 pwd-related change that makes
555         lib/getcwd.c work around inconsistent file system dirent.d_ino data.
556
557 2006-05-03  Jim Meyering  <jim@meyering.net>
558
559         * src/ls.c (DEFINE_SORT_FUNCTIONS, LIST_SORTFUNCTION_VARIANTS):
560         Use better macro parameter names: s/basename/key_name/,
561         s/basefunc/key_cmp_func.  Fix typo in comment.
562
563 2006-04-29  Eric Blake  <ebb9@byu.net>
564
565         * src/ls.c (main): On systems with d_type, directories_first only
566         implies format_needs_type, not format_needs_stat.
567
568 2006-05-03  Jim Meyering  <jim@meyering.net>
569
570         * src/ls.c (xstrcoll_df_version, rev_xstrcoll_df_version): Add space
571         after comma in arg list, from Eric Blake.
572
573 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
574
575         * tests/misc/date (relative-3): New test, derived from a bug
576         report by John Thomas McDole.
577
578 2006-04-23  Francesco Montorsi  <fr_m@hotmail.com>
579
580         New option for ls: --group-directories-first.
581         It makes ls list directories before files.
582         * NEWS [New features]: Mention it.
583         * src/ls.c (sort_type): Rearrange to use as an array index when
584         choosing sort function; added new sort_numtypes member for
585         compile-time check.
586         (time_type): Add new time_numtypes member for compile-time check.
587         (directories_first): New global variable.
588         (GROUP_DIRECTORIES_FIRST_OPTION): New enum.
589         (long_options): Add --directories-first.
590         (main): Support new option.
591         (is_directory): New function.
592         (extract_dirs_from_files): Use it.
593         (DIRFIRST_CHECK, DEFINE_SORT_FUNCTIONS)
594         (LIST_SORTFUNCTION_VARIANTS): New macros.
595         (sort_functions): New global variable.
596         (sort_files): Use it.
597         (usage): Document new option.
598
599 2006-04-18  Paul Eggert  <eggert@cs.ucla.edu>
600
601         * src/shred.c (fillrand): The assertion was way too weak, due to
602         what must be a typo.  Strengthen it to its intended value.
603         (dopass): Don't use alloca; it's not worth the aggravation here,
604         since it's used only to get a page-aligned buffer, and page
605         alignment doesn't buy us much here.  I'm suspicious that alloca
606         causes problems on some hosts, due to a recent bug report by Adam
607         Waltman: http://bugs.gentoo.org/130246.
608
609 2006-04-18  Jim Meyering  <jim@meyering.net>
610
611         * tests/misc/tty-eof: Add new programs, base64, sha224sum, sha256sum,
612         sha384sum, sha512sum.
613
614 2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
615
616         * src/chmod.c (describe_change): Adjust to filemode changes.
617         * src/ls.c (HAVE_ST_DM_MODE): Remove; moved to ../lib/filemode.c.
618         (print_long_format): Use (new) filemodestring rather than
619         (old) mode_string, so that we get more file types right, at least
620         in theory.  Adjust to filemode changes.
621         * src/stat.c (human_access): Likewise.
622
623 2006-04-18  Jim Meyering  <jim@meyering.net>
624
625         * src/ptx.c (main) [DEFAULT_IGNORE_FILE]: Remove code to use a default
626         ignore file.  This has never been enabled.  Reported by Eric Blake.
627
628 2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
629
630         * src/ln.c (linkfunc): Remove.  This method ran into a compiler/linker
631         bug in Interix.  Just call symlink or link directly.  All uses changed.
632         * src/setuidgid.c (main) [! HAVE_SETGROUPS]: Don't call setgroups.
633         * src/stat.c (USE_STATVFS): New macro.
634         Include <sys/statvfs.h> and use statvfs only if USE_STATVFS.
635         (NAMEMAX_FORMAT): define a bit more clearly, now that the
636         statvfs-using code is a bit more regular.
637         * src/system.h (sync) [!HAVE_SYNC]: New macro.
638
639 2006-04-11  Paul Eggert  <eggert@cs.ucla.edu>
640
641         * NEWS: csplit, nl, expr now conform to POSIX better, and are
642         more-compatible with traditional Unix, with respect to regular
643         expressions.
644         * src/csplit.c (extract_regexp): Set re_syntax_options to a
645         value that is compatible with what POSIX requires.
646         * src/nl.c (build_type_arg): Likewise.
647         * src/expr.c (docolon): Likewise.  Also, don't let anchors match
648         newline; this fixes an incompatibility with tradition and with POSIX.
649         Don't warn about leading ^.  POSIX says it is unspecified whether
650         ^ is a special character, which means that implementations can
651         either treat it as special or not, but either way a warning is not
652         allowed (unless the regexp is otherwise invalid).  Instead, anchor
653         the expression but treat ^ as an anchor; this is the traditional
654         behavior (e.g., Solaris 10).
655         (eval4, eval3, eval2): Treat non-numeric args, division by zero,
656         and the like as invalid expressions (exit status 2), not as
657         failure of 'expr' (exit status 3).  This is more consistent with
658         how Solaris behaves.
659         * tests/expr/basic (fail-a): Adjust exit status to match new expr
660         behavior, for status 2 versus 3.
661         (anchor): New test.
662         (bre1, bre2, bre3, bre4, bre5, bre6, bre7, bre8, bre9, bre10):
663         (bre11, bre12, bre13, bre14, bre15, bre16, bre17, bre18, bre19, bre20):
664         (bre21, bre22, bre23, bre24, bre25, bre26, bre27, bre28, bre29, bre30):
665         (bre31, bre32, bre33, bre34, bre35, bre36, bre37, bre38, bre39, bre40):
666         (bre41, bre42, bre43, bre44, bre45, bre46, bre47, bre48, bre49, bre50):
667         (bre51, bre52, bre53, bre54, bre55, bre56, bre57, bre58, bre59, bre60):
668         (bre61, bre62): New tests.
669         * tests/misc/csplit: Use \{...\} in test RE, to test that we're
670         conforming to POSIX.
671
672         Port to Solaris 8.
673         * tests/du/long-from-unreachable: Solaris 8 sh doesn't understand
674         "if !".  Do not assume that 'sed' can handle long, newline-free input.
675         * tests/du/long-sloop: Likewise.  Evaluate expr once, not $n times.
676
677 2006-04-10  Paul Eggert  <eggert@cs.ucla.edu>
678
679         Adjust to new regex.h API (with new fastmap type), and clean
680         up the regex storage allocation a bit.
681
682         * src/csplit.c (struct control): Put re_compiled member at the
683         end, since it's large.  Change regexpr member from char * to bool;
684         all uses changed.  Add new member fastmap.
685         (extract_regexp): regexp arg is now char const *, not char *.
686         Don't bother duplicating the regular expression; it's not needed.
687         Set fastmap from new fastmap member.  Don't bother allocating
688         a buffer, as the regexp code does a better job than we do.
689         * src/expr.c (docolon): Allocate and use a fastmap.
690         Don't bother allocating a buffer.
691         * src/nl.c (body_fastmap, header_fastmap, footer_fastmap):
692         New vars.
693         (build_type_arg): New fastmap arg.  All uses changed.
694         Don't bother allocating a buffer, but set a fastmap.
695         * src/ptx.c (context_regex_string, word_regex_string): Remove.
696         (context_regex, word_regex): New vars, replacing the above.
697         All uses changed.
698         (struct regex_data): New type.
699         (compile_regex): Renamed from alloc_and_compile_regex, since
700         we no longer allocate storage.  Arg is now a struct regex_data *,
701         not a const char *.  All uses changed.  Don't allocate the fastmap;
702         instead, take it from the caller.  Don't convert size_t to int,
703         to avoid arithmetic overflow problems.  Don't bother freeing
704         storage afterwards; it's not worth the aggravation.
705         * src/tac.c (compiled_separator_fastmap): New ver.
706         (main): Use it.  Don't bother allocating a buffer.
707
708 2006-03-30  Jim Meyering  <jim@meyering.net>
709
710         * src/dd.c (iwrite): Remove assignment without effect.
711         Reported by Felix Rauch Valenti.
712
713 2006-03-22  Eric Blake  <ebb9@byu.net>
714
715         * src/ptx.c (usage): Remove mention of --copyright/-C.
716         (main): Alias --copyright to --version plus a deprecation warning.
717         * NEWS: Mention this.
718
719 2006-03-27  Jim Meyering  <jim@meyering.net>
720
721         * src/Makefile.am (uptime_LDADD): Add $(POW_LIB), for uptime's
722         use of strtod.  Tiny patch from Nickolai Zeldovich.
723
724 2006-03-11  Eric Blake  <ebb9@byu.net>
725
726         * tests/misc/dirname: New file.
727         * tests/basename/Makefile.am: Delete.
728         * tests/basename/basic: Move to...
729         * tests/misc/basename: ... this new file.  Add some tests,
730         including fixed behavior for //.
731         * tests/misc/Makefile.am (TESTS): Sort.  Add basename, dirname.
732         * tests/Makefile.am (SUBDIRS): Remove basename.
733         * configure.ac (AC_CONFIG_FILES): Remove tests/basename.
734
735         Improvements to dirname/basename handling on platforms like
736         cygwin with distinct // and with drive letters.
737         * NEWS: Document new behavior.
738         * src/basename.c (main): Don't strip suffix from file system
739         roots.
740         * src/cp.c (target_directory_operand): Use new last_component.
741         (ASSIGN_BASENAME_STRDUPA): Likewise.  Reduce time spent
742         traversing the string.
743         * src/dircolors.c (guess_shell_syntax): Use new last_component.
744         * src/install.c (target_directory_operand, install_file_in_dir):
745         Likewise.
746         * src/ln.c (target_directory_operand, main): Likewise.
747         * src/ls.c (basename_is_dot_or_dotdot): Likewise.
748         * src/mv.c (target_directory_operand, movefile): Likewise.
749         * src/remove.c (rm_1): Likewise.
750         * src/shred.c (wipename): Likewise.
751         * src/split.c (next_file_name): Likewise.
752         * src/su.c (log_su, run_shell): Likewise.
753
754 2006-03-23  Paul Eggert  <eggert@cs.ucla.edu>
755
756         * NEWS: nohup diagnostics are now more precise, and nohup now
757         redirects stderr to nohup.out if stdout is closed and stderr is a tty.
758         * src/nohup.c (main): Implement this.
759         * tests/misc/nohup: Test the new behavior.
760
761 2006-03-12  Jim Meyering  <jim@meyering.net>
762
763         * src/copy.c (set_author): Rename function, from preserve_author.
764
765         * src/remove.c (AD_pop_and_chdir): Use new macro,
766         CYCLE_CHECK_REFLECT_CHDIR_UP, rather than open-coding it.
767
768         * src/system.h (SAME_INODE): Remove definition.
769         Include "same-inode.h", instead.
770
771 2006-03-11  Eric Blake  <ebb9@byu.net>
772
773         * src/pwd.c (robust_getcwd): Prepend only one slash, not two.
774
775 2006-03-10  Jim Meyering  <jim@meyering.net>
776
777         Fix a bug whereby a user with write access to a directory being removed
778         could cause the removal of that directory to fail with an erroneous
779         diagnostic about a directory cycle.  Reported by Vineet Chadha.
780
781         * NEWS: Mention this.
782         * src/remove.c (AD_pop_and_chdir): If the directory we're about to
783         leave (and try to rmdir) is the one whose dev_ino is being used to
784         detect a cycle, reset cycle_check_state.dev_ino to that of the parent.
785
786 2006-03-08  Paul Eggert  <eggert@cs.ucla.edu>
787
788         * NEWS: Document dd's new 'directory' and 'nolinks' flags.
789         * src/dd.c (set_fd_flags): Handle file-creation flags on file
790         descriptors, rather than ignoring them.
791         * tests/dd/misc: Add test cases for append, nofollow, directory,
792         and nolinks flags.  Simplify redirection to /dev/null in some cases.
793
794         * tests/dd/misc: iflags->iflag.  This fixes a typo that meant the
795         noatime test never tested anything.
796
797 2006-03-05  Paul Eggert  <eggert@cs.ucla.edu>
798
799         * src/dd.c (flags, usage): New flags directory, nolinks.
800         * src/system.h (O_NOLINKS): Define to 0 if not already defined.
801
802         * src/ls.c (usage): Mention that -f disables --color.
803         Problem reported by Niels Möller.
804
805 2006-03-03  Justin Pryzby  <pryzbyj@justinpryzby.com>
806
807         * man/*.x: Add references to syscalls from utilities of the same name.
808
809 2006-03-05  Jim Meyering  <jim@meyering.net>
810
811         * tests/help-version: Set SHELL, if not already set, in order to
812         avoid failure when `make check' is run through debuild;  dircolors
813         would fail due to lack of $SHELL.  Reported by Sven Joachim.
814
815         Make `base64 --wrap=N' work for N=0, and for N larger than SIZE_MAX.
816         * src/base64.c (wrap_write, do_encode, main): Change type of
817         parameters and locals, wrap_column, form size_t to uintmax_t.
818         (main): Adjust to use xstrtoumax, accordingly.
819
820 2006-03-03  Jim Meyering  <jim@meyering.net>
821
822         Don't fail when run from an environment with SHELL not a Bourne
823         shell, e.g. `env SHELL=/bin/csh make check' would fail this test.
824         * tests/dircolors/simple: Invoke each non-failing test with -b.
825         Reported by Michael Stone.
826
827 2006-02-27  Jim Meyering  <jim@meyering.net>
828
829         * tests/misc/base64: Derive --decode-using tests from the
830         encode-based ones.
831
832         * tests/misc/base64: Factor out a long constant string.
833         Split lines to stay within 80 columns.
834
835         * tests/misc/Makefile.am (TESTS): Add base64.
836         * tests/misc/base64: Test base64.  From Simon Josefsson.
837
838         * src/base64.c (do_decode): Use correct type for parameter,
839         ignore_garbage: s/size_t/bool/.
840
841         * src/base64.c: Don't include .h files already included by system.h:
842         <string.h>, <stdlib.h>, <stdbool.h>, <limits.h>, <errno.h>.
843         Include "system.h" before the other lib/*.h header files.
844         Include <sys/types.h> before "system.h".
845         (wrap_write): Remove declaration of unused local, initial_column.
846         (wrap_write): Correct declaration syntax: s/size_t * V/size_t *V/.
847
848         * README: Add base64 to the list.
849
850 2006-02-17  Simon Josefsson  <jas@extundo.com>
851
852         New program: base64.
853         * AUTHORS: Mention base64.
854         * NEWS: Likewise.
855         * man/Makefile.am: Build base64.1.
856         * man/base64.x: New file.
857         * src/Makefile.am (bin_PROGRAMS): Add base64.
858         * src/base64.c: New file.
859
860 2006-02-25  Eric Blake  <ebb9@byu.net>
861
862         In ls, avoid calling stat for --inode (-i), when possible.
863         * src/pwd.c (NOT_AN_INODE_NUMBER, D_INO): Move to ...
864         * src/system.h: ... here, for use in ...
865         * src/ls.c (main): ... here.  Prefer dirent.d_ino to stat when
866         possible.
867         (gobble_file): Add inode argument.
868         (print_dir): Pass inode if available.
869         (usage): Remove inaccuracy.
870
871 2006-02-23  Jim Meyering  <jim@meyering.net>
872
873         * TODO: Update/correct some obsolete entries.
874
875 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
876
877         * doc/coreutils.texi (join invocation): Mention `sort -k 1b,1'.
878         * src/join.c (usage): Likewise.
879         Documentation problem reported by Philip Kensche.
880
881 2006-02-20  Eric Blake  <ebb9@byu.net>
882
883         * man/rm.x: Update documentation to match previous patch.
884
885 2006-02-18  Eric Blake  <ebb9@byu.net>
886
887         New option for rm: --interactive=once (-I).
888         * NEWS: Document it, along with change to rm --interactive.
889         * TODO: Remove entry for implementing rm -I
890         * src/rm.c (INTERACTIVE_OPTION): New enum value.
891         (interactive_type): New enum.
892         (long_opts): Let interactive take an optional argument.
893         (interactive_args, interactive_types): New option arguments.
894         (usage): Document -I, --interactive=WHEN.  Use program_name
895         instead of a basename.
896         (main): New -I option, new behavior to --interactive.
897         * tests/rm/interactive-once: New tests.
898         * tests/rm/interactive-always: Ditto.
899         * tests/rm/Makefile.am (TESTS): Run them.
900
901 2006-02-18  Jim Meyering  <jim@meyering.net>
902
903         * Makefile.maint (sc_two_space_separator_in_usage): Make the regular
904         expression match more of the target lines, e.g., those that start with
905         `-S,' (short option followed by a comma) or that include `=[...]'.
906         Patch by Nicolas François.
907         Fix the four offenders thus exposed:
908         * src/join.c (usage): Use two spaces (not one) to separate the
909         --first-only option string from its description, so help2man formats
910         the derived man page properly.
911         * src/pr.c (usage): Likewise.
912         * src/uniq.c (usage): Likewise.
913         * src/install.c (usage): Likewise.
914
915 2006-02-15  Jim Meyering  <jim@meyering.net>
916
917         * Makefile.maint (alpha beta major): For `make major', ensure that the
918         version string is of the form N.N[.N]*, where N is one or more digits.
919
920 2006-02-14  Jim Meyering  <jim@meyering.net>
921
922         * INSTALL: Update from gnulib.
923
924 2006-02-13  Jim Meyering  <jim@meyering.net>
925
926         * GNUmakefile (all): Emit diagnostics to stderr, not stdout.
927
928 2006-02-12  Jim Meyering  <jim@meyering.net>
929
930         * Makefile.maint (patch-check): New target.
931         (local-checks-available): Add to the list.
932
933 2006-02-11  Jim Meyering  <jim@meyering.net>
934
935         * src/c99-to-c89.diff: New file.
936         * src/Makefile.am (EXTRA_DIST): Add c99-to-c89.diff.
937
938         * .x-po-check: New file, with exclusions so that `make distcheck'
939         passes once again.
940         * Makefile.am (EXTRA_DIST): Add .x-po-check.
941
942         rm -r must remove an empty directory, even if it is inaccessible.
943         * src/remove.c (close_preserve_errno): New function.
944         (fd_to_subdirp): Don't print a diagnostic in this function.
945         Do it from the callers instead, unless rmdir succeeds.
946         (remove_cwd_entries, remove_dir): Adjust callers.
947         * tests/rm/empty-inacc: New test for the above.
948         * tests/rm/Makefile.am (TESTS): Add empty-inacc.
949         * NEWS: Mention this bug fix.
950         * tests/rm/rm2: Adjust two expected diagnostics, now that they're
951         a tiny bit less precise: cannot remove `a/1': ... instead of
952         cannot open directory `a/1': ...
953
954         * Makefile.maint (syntax-check-rules): Automatically derive this
955         list of sc_-prefixed rule names.
956
957 2006-02-10  Paul Eggert  <eggert@cs.ucla.edu>
958
959         * Makefile.maint (CVS_LIST): Don't assume cvsu is available.
960         (CVS_LIST_EXCEPT): New macro, to simplify exception-processing.
961         Most uses of CVS_LIST changed to use CVS_LIST_EXCEPT.
962         (syntax-check-rules): Bring back sc_changelong.  (Hmm, why did it
963         go away? was that an accident?)
964         (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
965         (sc_cast_of_alloca_return_value, sc_space_tab, sc_prohibit_atoi_atof):
966         (sc_error_exit_success, sc_file_system, sc_no_if_have_config_h):
967         (sc_system_h_headers, sc_sun_os_names, sc_trailing_blank):
968         (sc_two_space_separator_in_usage, sc_unmarked_diagnostics):
969         (sc_obsolete_symbols, sc_changelog, sc_prohibit_jm_in_m4):
970         (sc_useless_cpp_parens, makefile-check, m4-check, po-check):
971         (author_mark_check, makefile_path_separator_check):
972         Output line numbers, to simplify navigation of Emacs *compilation*
973         buffers.
974         (sc_prohibit_atoi_atof, sc_file_system):
975         Rework slightly so that Makefile.maint doesn't get reported as a
976         violation of its own syntax rules.
977         (sc_dd_max_sym_length): Use ifneq to do nothing, instead of doing
978         it at run-time (which didn't work with Bison).  Fix a makefile typo,
979         caught by Makefile.maint itself: spaces where a tab should be.
980         (po-check): Check lib/*.[ch] even if not in CVS; used by Bison,
981         which copies from ../gnulib/lib/*.[ch] to lib/*.[ch].
982         Ignore djgpp and man subdirectories, to avoid false matches with
983         Bison and coreutils, respectively.  Use sort -u to remove the
984         resulting duplicates.
985         * gnupload: Rework slightly to avoid bogus warning from
986         sc_two_space_separator_in_usage.
987
988 2006-02-10  Jim Meyering  <jim@meyering.net>
989
990         Use gzip's --rsyncable option only if it's available.
991         * Makefile.maint (gzip_rsyncable): New variable.
992         (GZIP_ENV): Use it.
993
994 2006-02-08  Jim Meyering  <jim@meyering.net>
995
996         * Makefile.maint (local-checks-available): Define in terms of
997         the expansion, $(syntax-check-rules), rather than the single,
998         top-level target `syntax-check', so that it's easier to exclude
999         individual rules (via $(local-checks-to-skip)).
1000         (tgz-md5, tgz-sha1, ...): Remove now-unused definitions.
1001
1002 2006-02-07  Jim Meyering  <jim@meyering.net>
1003
1004         * src/system.h (!defined O_DIRECT): If O_DIRECTIO is defined (as it
1005         is on Tru64), define O_DIRECT to that.  Patch From James Lemley.
1006
1007         * tests/help-version (expected_failure_status_vdir):
1008         Redirect an expected disk-full diagnostic to /dev/null.
1009
1010 2006-02-06  Jim Meyering  <jim@meyering.net>
1011
1012         * src/unexpand.c (usage): Use two spaces (not one) to separate the
1013         --first-only option string from its description, so help2man formats
1014         the derived man page properly.
1015         * src/rm.c (usage): Likewise for --no-preserve-root.
1016         * src/chown.c (usage): Likewise.
1017         * src/chgrp.c (usage): Likewise.
1018
1019         Add a rule to ensure that the above doesn't happen again.
1020         * Makefile.maint (sc_two_space_separator_in_usage): New rule.
1021         (syntax-check-rules): Add it.
1022         * .x-sc_two_space_separator_in_usage: New empty file.
1023         * Makefile.am (EXTRA_DIST): Add .x-sc_two_space_separator_in_usage.
1024
1025 2006-02-06  Jim Meyering  <jim@meyering.net>
1026
1027         * src/cp.c (usage): Use two spaces (not one) to separate each
1028         option string from its description, so help2man formats the
1029         derived man page properly.
1030         * src/mv.c (usage): Likewise.
1031         Patch from Nicolas François in http://bugs.debian.org/351601.
1032
1033 2006-02-04  Jim Meyering  <jim@meyering.net>
1034
1035         * src/copy.c (copy_internal): cp -RL would fail when encountering
1036         the same directory more than once in the hierarchy beneath a single
1037         command-line argument.  That is legitimate, e.g. when there are
1038         two or more symbolic links, each pointing to some directory that
1039         would not otherwise be copied.  Reported by Christophe LYON.
1040         * tests/cp/cp-deref: New file.  Test for today's fix.
1041         * tests/cp/Makefile.am (TESTS): Add cp-deref.
1042         * NEWS: Document this.
1043
1044 2006-02-03  Jim Meyering  <jim@meyering.net>
1045
1046         * configure.ac: Require automake-1.9.6, not 1.8.3.
1047
1048 2006-02-01  Paul Eggert  <eggert@cs.ucla.edu>
1049
1050         * src/od.c (usage): Mention that -t a ignores high order bit.
1051         Documentation problem reported by Ed Avis.
1052
1053 2006-02-01  Jim Meyering  <jim@meyering.net>
1054
1055         * src/pwd.c (find_dir_entry): Remove unused local, `ent_sb_valid'.
1056
1057 2006-01-30  Paul Eggert  <eggert@cs.ucla.edu>
1058
1059         * src/head.c (main): Use a better diagnostic when someone uses a
1060         trailing numeric option in an invalid way.  Problem reported by
1061         Karl Berry.
1062         * src/tail.c (parse_options): Likewise.
1063
1064 2006-01-30  Jim Meyering  <jim@meyering.net>
1065
1066         * man/wc.x: Include `count' keyword in man page synopsis,
1067         per suggestion from http://bugs.debian.org/181585.
1068
1069 2006-01-24  Paul Eggert  <eggert@cs.ucla.edu>
1070
1071         * src/df.c (show_dev): If the file system claims to have
1072         more available than total blocks, report the number of used
1073         blocks as being total - available (a negative number) rather
1074         than as garbage.  Problem reported by Toralf Foerster.
1075
1076 2006-01-24  Jim Meyering  <jim@meyering.net>
1077
1078         * src/tail.c (tail_forever): Don't exit-nonzero when an attempt
1079         to put a regular file in O_NONBLOCK mode fails with EPERM.
1080         That happens on Linux (up to 2.6.15) when using tail -f on a file with
1081         the append-only attribute.  Reported by Dean Gaudet.  For details,
1082         see http://savannah.gnu.org/bugs/?func=detailitem&item_id=15473.
1083         * NEWS: Mention this fix.
1084         * tests/tail-2/append-only: New file.  Test for the above.
1085         * tests/tail-2/Makefile.am (TESTS): Add append-only.
1086         * tests/Makefile.am (check-root): Add tail-2/append-only
1087
1088 2006-01-21  Jim Meyering  <jim@meyering.net>
1089
1090         * NEWS: Mention fts-related improvements and bug fixes.
1091
1092 2006-01-19  Jim Meyering  <jim@meyering.net>
1093
1094         * tests/fmt/basic (pfx-1, pfx-2): New tests, to demonstrate the bug
1095         reported as http://bugs.debian.org/147577.  Forwarded by Thomas Hood.
1096
1097 2006-01-18  Jim Meyering  <jim@meyering.net>
1098
1099         * tests/du/Makefile.am (TESTS): Add long-from-unreadable.
1100
1101 2006-01-17  Jim Meyering  <jim@meyering.net>
1102
1103         Now that fts no longer changes the current working directory, adjust
1104         its clients accordingly -- note that du.c uses fts but doesn't need
1105         any adjustment, since it doesn't operate on the actual files,
1106         but rather just uses the stat buffers provided by fts.
1107
1108         * src/chown-core.c: Include "openat.h".
1109         Don't include "lchown.h".
1110         (restricted_chown): Accept a new parameter, CWD_FD, and use it in
1111         calling openat, lchownat, chownat, rather than open, lchown, chown.
1112         Update caller.
1113         * src/chmod.c: Include "openat.h".
1114         (process_file): Use chmodat (fts->fts_cwd_fd,... in place of chmod (...
1115
1116         * tests/du/long-from-unreadable: New test, to exercise one small
1117         corner of fts.c.
1118
1119 2006-01-13  Jim Meyering  <jim@meyering.net>
1120
1121         * tests/Makefile.am (SUBDIRS): Add comments discouraging the
1122         addition of new directories under tests/.
1123
1124         * tests/acl: Redirect stdin to /dev/null.  Otherwise, FreeBSD 5.0's
1125         getfacl would hang.
1126
1127 2006-01-12  Jim Meyering  <jim@meyering.net>
1128
1129         * tests/du/long-sloop: Adjust not to hard-code the expected
1130         diagnostic corresponding to ELOOP.  Solaris' diagnostic differs
1131         from that of GNU libc.  Reported by Paul Eggert.
1132
1133         * tests/du/long-sloop: Create file at end of symlink chain.
1134
1135         * tests/misc/test: New file, with a test for one of the
1136         bugs fixed by yesterday's test.c changes.
1137         * tests/misc/Makefile.am (TESTS): Add test.
1138
1139 2006-01-11  Jim Meyering  <jim@meyering.net>
1140
1141         * tests/du/long-sloop: New file.  Test for today's fts.c bug fix.
1142         That bug could make du -L, chgrp -L, or chown -L fail to diagnose
1143         a very long sequence of symbolic links (not necessarily a loop).
1144         * tests/du/Makefile.am (TESTS): Add long-sloop.
1145
1146 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
1147
1148         * src/test.c (test_syntax_error): Append a newline.  All callers
1149         changed, except for the ones that didn't already append a newline.
1150         Bug reported by Eric Blake.
1151
1152 2006-01-11  Jim Meyering  <jim@meyering.net>
1153
1154         * src/system.h (X2NREALLOC): Now that verify_true is no longer
1155         void, cast its result to void, to avoid gcc's warning that
1156         ``left-hand operand of comma expression has no effect''.
1157         (DECIMAL_DIGIT_ACCUMULATE, X2REALLOC): Likewise.
1158
1159 2006-01-10  Jim Meyering  <jim@meyering.net>
1160
1161         * tests/chmod/no-x: Add a test for today's fts.c fix.
1162
1163 2006-01-10  Jim Meyering  <jim@meyering.net>  (tiny change)
1164
1165         * src/ls.c (gobble_file): Use DTTOIF only if it's defined.
1166         This is necessary for Dragonfly.  Patch by Joerg Sonnenberger.
1167
1168 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
1169
1170         * src/system.h (X2NREALLOC, X2REALLOC, DECIMAL_DIGIT_ACCUMULATE):
1171         Use verify_true instead of verify_expr, to sync with gnulib.
1172
1173 2006-01-08  Jim Meyering  <jim@meyering.net>
1174
1175         * src/date.c (usage): Adjust the formatting of the entries for
1176         %::z and %:::z (separate with two spaces, not one) so that help2man
1177         formats them properly.  Reported by Philip Rowlands.
1178
1179 2006-01-06  Paul Eggert  <eggert@cs.ucla.edu>
1180
1181         * configure.ac (gl_IGNORE_UNUSED_LIBRARIES): Add.
1182
1183 2006-01-06  Jim Meyering  <jim@meyering.net>
1184
1185         * Makefile.maint (copyright-check): Use date +%Y in place of
1186         hard-coded 2005.
1187
1188         * src/remove.c (rm_1): Remove `static' attribute on local `status'.
1189         First off, the attribute should have been `volatile' (not static)
1190         to avoid longjmp-related risk of clobber.  Secondly, now there is
1191         no longer any risk of a local variable being clobbered, so there's
1192         no need for any attribute at all.
1193
1194 2006-01-05  Jim Meyering  <jim@meyering.net>
1195
1196         * src/remove.c: Give a few functions the inline attribute.
1197         (AD_pop_and_chdir): Use gotos to avoid some duplication.
1198         (AD_push): Rewrite an assertion so that the entire computation
1199         goes away when assertions are turned off.
1200
1201         * src/tail.c (ENOSYS) [!defined ENOSYS]: Don't define here.
1202         It's already defined in "system.h".
1203         * Makefile.maint: Add a FIXME comment.
1204
1205 2006-01-04  Jim Meyering  <jim@meyering.net>
1206
1207         * ChangeLog: Remove entries from 2005-10-22 and earlier.
1208         * ChangeLog-2005: New file, for entries up to version 5.92.
1209
1210 2006-01-03  Jim Meyering  <jim@meyering.net>
1211
1212         * tests/du/no-x: Also allow a slightly different diagnostic -- the
1213         one you get when using openat-enabled fts.c and du (coming soon).
1214         * tests/chmod/no-x: Likewise.
1215         * tests/chgrp/no-x: Likewise.
1216
1217         * src/system.h (O_DIRECTORY) [!defined O_DIRECTORY]: Define.
1218
1219 2006-01-02  Paul Eggert  <eggert@cs.ucla.edu>
1220
1221         * src/chown-core.c (RC_do_ordinary_chown): New enum value.
1222         (restricted_chown): Return it, if the file cannot be accessed due
1223         to EPERM, or if no uid or gid are required, or if the file is
1224         neither a directory nor a regular file.  Rewrite to avoid gotos.
1225         (change_file_owner): Handle RC_do_ordinary_chown case.
1226         Rewrite to avoid gotos.
1227         * tests/chgrp/basic: Make sure we can change the group of
1228         inaccessible files.
1229
1230         * src/date.c (usage): Explain %g, %G, and %V a bit better.
1231
1232 2006-01-02  Jim Meyering  <jim@meyering.net>
1233
1234         * src/copy.c (set_owner): Correct a comment.
1235
1236         * src/tail.c (parse_options): Change warning to say that --retry
1237         is useful `mainly' (not `only') when following by name.
1238         Reported here: http://bugs.debian.org/273781
1239
1240 2006-01-01  Paul Eggert  <eggert@cs.ucla.edu>
1241
1242         * NEWS: Document that mkfifo and mknod -m no longer set special bits.
1243         * src/copy.c: Include lchmod.h.
1244         (copy_internal): Use lchmod rather than chmod.
1245         * src/cp.c: Include lchmod.h.
1246         (re_protect, make_dir_parents_private): Use lchmod rather than chmod.
1247         * src/mkdir.c: Include lchmod.h.
1248         (usage): Clarify -m's operation.
1249         (main): Use lchmod rather than chmod.  Don't use lchmod unless the
1250         new mode contains bits outside the 777 range.
1251         * src/mkfifo.c (usage): Clarify -m's operation.
1252         (main): If -m is given, don't invoke chmod; use umask 0 instead.
1253         Report an error if -m asks for bits outside the 777 range.
1254         * src/mknod.c (usage, main): Likewise.
1255
1256         * src/mkdir.c, src/mkfifo.c, src/mknod.c: Undo 2005-12-19 changes.
1257
1258 2005-12-27  Jim Meyering  <jim@meyering.net>
1259
1260         * Makefile.maint (sc_obsolete_symbols): Prohibit use of O_NDELAY.
1261         (sc_prohibit_assert_without_use): New rule.
1262         (syntax-check-rules): Add it to the list.
1263         * .x-sc_prohibit_assert_without_use: New empty file.
1264         * Makefile.am (EXTRA_DIST): Add it.
1265
1266         * Makefile.maint (CVS_LIST): Define in terms of $(srcdir).
1267
1268         * cp.c, df.c, link.c, mknod.c, nice.c, sleep.c, unlink.c:
1269         Don't include <assert.h>; it wasn't used.
1270
1271 2005-12-26  Paul Eggert  <eggert@cs.ucla.edu>
1272
1273         * src/chown-core.c (restricted_chown):
1274         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
1275         * src/remove.c (fd_to_subdirp): Open with O_DIRECTORY | O_NOCTTY
1276         | O_NOFOLLOW too, for consistency with other dir-openers.
1277         Use POSIX-preferred O_NONBLOCK rather than O_NDELAY.
1278         (is_empty_dir): Likewise.
1279         * src/shred.c (wipename): Likewise.  Don't bother trying to open
1280         dir for writing, since POSIX prohibits it.
1281
1282 2005-12-22  Jim Meyering  <jim@meyering.net>
1283
1284         * tests/help-version: Redirect stderr to /dev/full, to suppress
1285         write error diagnostic.
1286
1287 2005-12-19  Jim Meyering  <jim@meyering.net>
1288
1289         * src/mkdir.c, src/mknod.c, src/mkfifo.c (main)
1290         Avoid a minor race condition when `-m MODE' is specified, by using
1291         open, fchown, and close rather than just chown.  To do that reliably --
1292         even with an overly restrictive umask -- ensure that each mkdir,
1293         mknod and mkfifo call uses a mode including at least owner-read access.
1294         * src/mknod.c (main): When `-m MODE' is specified, exit nonzero if
1295         the subsequent chown (or equivalent open,fchown,close) fails.
1296         * tests/misc/mknod: New tests.
1297         * tests/misc/Makefile.am (TESTS): Add mknod.
1298
1299 2005-12-17  Jim Meyering  <jim@meyering.net>
1300
1301         * src/remove.c (is_empty_dir): Open with O_NDELAY, so we don't hang,
1302         e.g., on a named pipe.
1303         (OPEN_NO_FOLLOW_SYMLINK): Remove definition.  Use O_NOFOLLOW in
1304         place of all uses, since it is guaranteed (system.h) to be defined.
1305
1306 2005-12-05  Andreas Gruenbacher  <agruen@suse.de>
1307
1308         Add POSIX ACL support
1309         * src/ls.c: Switch back from HAVE_ACL to USE_ACL: The acl() syscall
1310         is no requirement for ACL support; particularly, it does not exist
1311         on systems that have POSIX ACLs.
1312         * src/copy.h (cp_option_init) [umask_kill]: Remove member.
1313         * src/cp.c (umask_kill): With default acls, the umask is not to be
1314         applied.  Remove umask_kill, don't change the process umask, and let
1315         the kernel apply the umask where appropriate.
1316         * src/cp.c (make_dir_parents_private): Fix logic for POSIX ACLs.
1317         * src/copy.c (get_dest_mode): Remove; it is obsolete after removing
1318         umask_kill.
1319         (copy_reg, copy_internal): Use copy_acl and set_acl
1320         instead of fchown/chown. Fix the logic for POSIX ACLs.
1321         (chown_succeded): Remove; we now always copy acls and
1322         preserve S_ISUID, S_ISGID, and S_ISVTX when needed, no matter if we
1323         did a chown before or not.
1324         * src/mv.c, src/install.c (cp_option_init): Don't set umask_kill member.
1325         * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD, cp_LDADD,
1326         mv_LDADD, ginstall_LDADD): On systems with an ACL library, arrange
1327         to link with it via $(LIB_ACL), for the utilities that need it.
1328
1329 2005-12-16  Paul Eggert  <eggert@cs.ucla.edu>
1330
1331         * src/remove.c (OPENAT_CWD_RESTORE__REQUIRE): Remove.
1332         (OPENAT_CWD_RESTORE__ALLOW_FAILURE): Likewise.
1333         (fd_to_subdirp): Remove openat_cwd_restore_allow_failure arg; its
1334         value is now signified by whether cwd_errno is null.
1335         (fd_to_subdirp, remove_dir, rm_1); Change cwd failure indicator from
1336         pointer-to-bool to pointer-to-errno-value.  All callers changed.
1337         (rm_1): Don't bother setting a local cwd failure flag and then
1338         ORing it into the caller's.  Just set the caller's.
1339         (rm): Use cwd failure errno value to print a slightly-better
1340         diagnostic.
1341
1342 2005-12-15  Jim Meyering  <jim@meyering.net>
1343
1344         * src/stat.c (print_it): Properly handle a backslash at the
1345         end of a --printf format string.  Reported by Paul Eggert.
1346         * tests/misc/stat-printf (end-bs): Add a test for the above.
1347
1348 2005-12-15  Paul Eggert  <eggert@cs.ucla.edu>
1349
1350         * tests/acl: Port to pre-POSIX shells like Solaris 8 /bin/sh.
1351         Don't assume /etc/passwd contains user names; use 'id' instead.
1352
1353 2005-12-15  Jim Meyering  <jim@meyering.net>
1354
1355         stat: revert behavior of --format=FMT (-c)
1356         stat: add new option: --printf=FMT
1357         * NEWS: Mention this.
1358         * src/stat.c (isodigit, octtobin, hextobin): Define.
1359         (PRINTF_OPTION): Define.
1360         (interpret_backslash_escapes, trailing_delim): New globals.
1361         (usage): Document them.  Alphabetize on long option names.
1362         (print_esc_char): New function.
1363         (print_it): Rewrite, in order to handle backslash escapes.
1364         (main): Handle new option.  Set globals for --format, too.
1365
1366         * tests/misc/stat-printf: Test --printf and --format.
1367         * tests/misc/Makefile.am (TESTS): Add stat-printf.
1368
1369 2005-12-14  Paul Eggert  <eggert@cs.ucla.edu>
1370
1371         * NEWS: sort now reports incompatible options.
1372         * src/sort.c (incompatible_options, check_ordering_compatibility):
1373         New functions.
1374         (main): Use them.  Don't bother with a usage message for
1375         "sort -c a b", for consistency with other error diagnostics.
1376         * tests/sort/Test.pm (incompat1, incompat2, incompat3, incompat4):
1377         New tests.
1378
1379         * src/cat.c (main): Undo previous change.  close_stdout already
1380         does the check, so the previous change wasn't necessary.
1381
1382 2005-12-13  Paul Eggert  <eggert@cs.ucla.edu>
1383
1384         * src/cat.c (main): Check for close (STDOUT_FILENO) failure.
1385
1386 2005-12-12  Paul Eggert  <eggert@cs.ucla.edu>
1387
1388         Install a more-conservative approach for sort -R.  It's the
1389         same basic idea as the existing code, except it uses the full ISAAC
1390         approach (called the "more kosher" approach in the existing comments).
1391         This makes "sort -R" quite a bit slower (about a factor of 2 on my
1392         little tests involving 10000 lines on a 2.4 GHz P4), but I think it's
1393         better to be conservative here at first, and review any performance
1394         improvements carefully.
1395         * .x-sc_require_config_h: Add src/rand-isaac.c.
1396         * src/rand-isaac.h: Remove.  All uses now simply include rand-isaac.c.
1397         * src/Makefile.am (noinst_HEADERS): Remove rand-isaac.h.
1398         (shred_SOURCES, sort_SOURCES): Remove.
1399         (EXTRA_DIST): Add rand-isaac.c.
1400         * src/rand-isaac.c: Revert to what used to be in shred.c, without
1401         changing it to allow for varying numbers of words in the state.
1402         Alter so that we include rand-isaac.c directly rather than
1403         compiling it and linking to it.  Don't include config.h or
1404         system.h; that's the includer's responsibility.
1405         Omit functions that are specific to shred.
1406         (ISAAC_LOG, ISAAC_WORDS, ISAAC_BYTES, struct isaac_state, ind):
1407         (isaac_step, struct irand_state):
1408         Resurrect these, with the same defns that used to be in shred.c.
1409         (ISAAC_SIZE, isaac_new, isaac_copy): Remove.
1410         (isaac_refill, isaac_seed_start, isaac_seed_data, irand_init, irand32):
1411         static again.
1412         (struct isaac_state, isaac_refill, isaac_mix, isaac_init):
1413         (isaac_seed_start, isaac_seed_data, isaac_seed_finish, isaac_seed):
1414         (irand_init, irand32, irand_mod):
1415         Number of words is constant again.
1416         (struct irand_state, irand_init, irand32, irand_mod): Move to shred.c.
1417         * src/shred.c: Include rand-isaac.c rather than rand-isaac.h.
1418         * src/sort.c: Likewise.
1419         * src/shred.c (fillrand, dopass, main): Undo previous change.
1420         (struct irand_state, irand_init, irand32, irand_mod): Moved back here,
1421         from rand-isaac.c.
1422         * src/sort.c: Don't include md5.h; it wasn't needed.
1423         (struct keyfield): Rename random_hash to random, for consistency
1424         with the other member names.  All uses changed.
1425         (usage): Tweak wording to mention STRING for --seed option.
1426         (short_options): Rorder for consistency with other programs.
1427         (rand_state): Now a struct, not a pointer to one.  All uses changed.
1428         (HASH_WORDS, HASH_SIZE): Remove.
1429         (get_hash): Remove comments around resbuf size, since we can assume C89.
1430         Use a "more-kosher" (but slower) approach of invoking isaac_refill.
1431         (keycompare): Adjust to the new get_hash.
1432         Add a FIXME.
1433         (badfieldspec): Omit recently-introduced comment; it isn't needed.
1434         (main): Don't set need_random simply because gkey has it set; that
1435         doesn't necessarily mean we'll need random numbers.
1436         Redo seeding to match new get_hash approach.
1437
1438 2005-12-10  Jim Meyering  <jim@meyering.net>
1439
1440         * src/Makefile.am (noinst_HEADERS): Add rand-isaac.h.
1441
1442         Avoid shred segfault on 64-bit systems.
1443         * src/rand-isaac.c (isaac_refill): Don't try to negate a
1444         local of type uint32_t.  Make the local an `int' instead.
1445
1446         * NEWS: Mention sort's new options.
1447
1448         * src/rand-isaac.c (isaac_mix): Declare to be static.
1449         Mark all other functions as `extern' so the tight-scope
1450         part of `make distcheck' passes once again.
1451         * src/rand-isaac.h (isaac_mix): Remove declaration.
1452
1453         * src/sort.c (get_hash): Change position of `*' in parameter
1454         type to conform with convention.
1455         (main): Split a long line so it fits in 80 columns.
1456         (keycompare): Remove stray SPACE before TAB that was
1457         causing `make distcheck' to fail.
1458
1459         * src/shred.c: Don't include gethrxtime.h.  No longer needed.
1460
1461         * tests/misc/sort-rand: New file: basic tests for the new options.
1462         * tests/misc/Makefile.am (TESTS): Add sort-rand.
1463
1464 2005-12-10  Frederik Eaton  <frederik@ofb.net>
1465
1466         * src/Makefile.am (sort_LDADD): Add $(LIB_GETHRXTIME).
1467         (shred_SOURCES, sort_SOURCES): New macros, so we compile rand-isaac.c.
1468         * src/rand-isaac.c: New file, containing ISAAC code that was in shred.c.
1469         Make state size runtime-configurable.
1470         (isaac_new, isaac_copy): New functions.
1471         * src/rand-isaac.h: New file.
1472         * src/shred.c: Include rand-isaac.h.  Move ISAAC code to rand-isaac.c.
1473         (fillrand, main): Adjust to the fact that the state size is now
1474         runtime-configurable.
1475         * src/sort.c (short_options, long_options, WORDS, keycompare, main):
1476         (usage): Add options --random-sort and --seed to implement a random
1477         shuffle.
1478         Include md5.h and rand-isaac.h.
1479         (get_hash): New function.
1480         (rand_state): New var.
1481         (HASH_WORDS, HASH_SIZE): New macros.
1482
1483 2005-12-09  Paul Eggert  <eggert@cs.ucla.edu>
1484
1485         * tests/dd/misc: Add test for dd iflags=noatime.
1486
1487 2005-12-09  Jim Meyering  <jim@meyering.net>
1488
1489         * src/sort.c (usage): Mention white space vs -b and -t options.
1490         From The Wanderer.
1491
1492 2005-12-09  Eric Blake  <ebb9@byu.net>
1493
1494         * src/test.c (main): Fix misleading comment.
1495
1496 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
1497
1498         * NEWS: Mention dd's new noatime flag.
1499         * src/system.h (O_NOATIME): Define to 0 if not already defined.
1500         * src/dd.c (flags, usage): Add support for noatime flag.
1501
1502 2005-12-07  Jim Meyering  <jim@meyering.net>
1503
1504         Distribute the cvsu script, used only by `make syntax-check'.
1505         * Makefile.am (EXTRA_DIST): Add build-aux/cvsu.
1506         * Makefile.maint (CVS_LIST): Use build-aux/cvsu, now that we
1507         distribute a copy of this script.
1508         * .x-sc_unmarked_diagnostics: Add build-aux/cvsu.
1509
1510         * tests/mv/acl: exit-77 before the trap, not after, if we fail
1511         to create a temporary directory on another partition.
1512         From Andreas Gruenbacher.
1513
1514 2005-12-06  Tomas Pospisek  <tpo@sourcepole.ch>  (tiny change)
1515
1516         * man/basename.x: Cross-reference to dirname and readlink.
1517         * man/dirname.x: Cross-reference to basename and readlink.
1518
1519 2005-12-05  Andreas Gruenbacher
1520
1521         * src/copy.c [!HAVE_FCHOWN]: Define fchown(...) to -1.
1522         (set_owner, preserve_author): New functions, factored out of copy_reg.
1523         (copy_reg): Use them.
1524         (copy_internal): Use them here, too.
1525
1526 2005-12-04  Jim Meyering  <jim@meyering.net>
1527
1528         * src/sleep.c (usage): Say what happens with two or more arguments.
1529         Suggested by Justin Pryzby.
1530
1531         * src/uptime.c (print_uptime): Move decl of `upsecs' into scope
1532         where it's used.
1533
1534 2005-12-03  Jim Meyering  <jim@meyering.net>
1535
1536         * src/rm.c (long_opts): Change the name of each undocumented, for-
1537         testing-only option to start with `-', so that it cannot render
1538         ambiguous any prefix it happens to share with some other option name.
1539         Problem reported by Eric Blake.
1540         * src/head.c (long_options): Likewise.
1541         * src/tail.c (long_options): Likewise.
1542
1543         * tests/misc/head-elide-tail: Update uses of undocumented, for-
1544         testing-only --presume* options to start with `---'.
1545         * tests/rm/dangling-symlink: Likewise.
1546         * tests/rm/dir-no-w: Likewise.
1547         * tests/rm/isatty: Likewise.
1548
1549 2005-11-30  Jim Meyering  <jim@meyering.net>
1550
1551         * Makefile.maint: Add a comment about cvsu.
1552
1553 2005-11-25  Paul Eggert  <eggert@cs.ucla.edu>
1554
1555         * NEWS: df updates for "none", "proc", inaccessible file systems.
1556         * src/df.c (show_point): Ignore inaccessible file systems.
1557         (usage): -a includes dummy file systems, not size-0 file systems.
1558
1559         * src/od.c (unsigned_long_long_int): Renamed from ulonglong_t,
1560         to avoid collision with POSIX name space.  All uses changed.
1561
1562 2005-11-24  Jim Meyering  <jim@meyering.net>
1563
1564         * tests/Makefile.am (EXTRA_DIST): Add acl to the list.
1565         * tests/acl: Add `$0: ' prefix to diagnostics.
1566
1567         * .x-sc_require_config_h: Add lib/buffer-lcm.c to the list.
1568
1569 2005-11-23  Paul Eggert  <eggert@cs.ucla.edu>
1570
1571         * src/copy.c: Improve performance a bit by optimizing away
1572         unnecessary system calls and going to a block size of at least
1573         8192 (on normal hosts, anyway).  This improved performance 5% on my
1574         Debian stable host (2.4.27 kernel, x86, copying from root
1575         ext3 file system to itself).
1576         Include "buffer-lcm.h".
1577         (copy_reg): Omit last argument.  All callers changed.
1578         Use xmalloc to allocate rather than trusting alloca
1579         (which is unwise with large block sizes).
1580         Declare locals more locally, if possible.
1581         Use uintptr_t words instead of int words, for a bit more speed
1582         when looking for null blocks on 64-bit hosts.
1583         Optimize away reads of zero bytes on regular files.
1584         In the typical case, insist on 8 KiB buffers, at least.
1585         Avoid unnecessary extra call to fstat when checking for sparse files.
1586         Avoid now-unnecessary cast to off_t, and "0L".
1587         Avoid unnecessary test of *new_dst when checking for same owner
1588         and group.
1589
1590 2005-11-22  Paul Eggert  <eggert@cs.ucla.edu>
1591
1592         * src/remove.c (rm): Don't assume C99 for-loop syntax.
1593
1594 2005-11-22  Jim Meyering  <jim@meyering.net>
1595
1596         * src/remove.c (AD_push): Remove debugging cruft.
1597
1598         * tests/rm/unread2 (rm): Change expected diagnostic,
1599         `cannot open directory' to `cannot remove', to align with
1600         new version of rm.
1601         * tests/rm/rm2: Ensure that rm now continues removing entries
1602         even after certain types of failure.
1603
1604         * src/remove.c: Rewrite.  Now, this module is reentrant on systems
1605         that provide openat (Solaris), and on systems like Linux+procfs
1606         where our openat emulation code is reentrant.  This also fixes a
1607         few low-probability leaks and eliminates some code that could,
1608         in very unusual circumstances, cause rm() (via a callee) to exit.
1609         * NEWS: Mention this.
1610
1611         * configure.ac: Put copyright dates all on one line so the
1612         emacs function that updates them works properly.
1613
1614 2005-11-18  Paul Eggert  <eggert@cs.ucla.edu>
1615
1616         * configure.ac (AM_PROG_CC_C_O): Add.  Needed for CVS Automake.
1617         Problem reported by Eric Blake.
1618         (AC_PROG_CC_STDC): Use this instead of AC_PROG_CC, so that
1619         we get a standard-conforming compiler.  This relies on the new
1620         m4/c.m4 file.  Note that it's a bit tricky, since c.m4 doesn't
1621         define AC_PROG_CC_STDC; we are relying on Autoconf 2.59 internals.
1622         m4/c.m4 can go away with Autoconf 2.60 comes out.
1623
1624 2005-11-17  Jim Meyering  <jim@meyering.net>
1625
1626         * src/remove.c (AD_mark_helper): Make a `char *' parameter `const'.
1627         (AD_mark_current_as_unremovable): Likewise, but for a local.
1628         (rm_1): Likewise.
1629
1630         * tests/mv/acl: Let traps handle removing temporary directories.
1631
1632         Expect acl-related tests to fail, until the corresponding
1633         patches are committed.
1634         * tests/mv/Makefile.am (XFAIL_TESTS): Add acl.
1635         * tests/cp/Makefile.am (XFAIL_TESTS): Likewise.
1636
1637         ACL tests, from Andreas Gruenbacher.
1638         * tests/acl, tests/mv/acl, tests/cp/acl: New files.
1639         * tests/mv/Makefile.am (TESTS): Add acl.
1640         * tests/cp/Makefile.am (TESTS): Add acl.
1641
1642         * src/ls.c (basename_is_dot_or_dotdot): Correct wording in comment.
1643
1644 2005-11-16  Paul Eggert  <eggert@cs.ucla.edu>
1645
1646         * NEWS: Improve quality of ln's diagnostics.
1647         * src/ln.c (do_link, usage): Likewise.
1648         (do_link): Don't use alloca on a buffer of unbounded size.
1649
1650 2005-11-16  Jim Meyering  <jim@meyering.net>
1651
1652         * tests/cp/fail-perm: Accommodate HPUX.  It appears to fail
1653         with EACCES rather than EPERM.  Reported by Peter O'Gorman here:
1654         http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/5766
1655         This also affects AIX 4.3.3, according to Ralf Wildenhues, in
1656         http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html
1657
1658 2005-11-14  Jim Meyering  <jim@meyering.net>
1659
1660         * NEWS (sort): Mention consequences of today's mkstemp-safer.c fix.
1661
1662 2005-11-13  Jim Meyering  <jim@meyering.net>
1663
1664         * announce-gen: Accept new option, --gpg-key-id=ID and
1665         emit a blurb telling how to use the .sig files.
1666         * Makefile.cfg (gpg_key_ID): Define.
1667         * Makefile.maint (announcement): Use new option and key.
1668
1669         Require that most .c files include <config.h>.
1670         * Makefile.maint (sc_require_config_h): New rule.
1671         (syntax-check-rules): Add it.
1672         * .x-sc_require_config_h: New file listing exceptions to the
1673         above rule.  Some are legit, others are simply grandfathered in.
1674         * Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h here, too.
1675
1676 2005-11-12  Jim Meyering  <jim@meyering.net>
1677
1678         * src/checksum.h, src/md5.c, src/sha1sum.c: Remove now-unused files.
1679
1680 2005-11-11  Jim Meyering  <jim@meyering.net>
1681
1682         * NEWS: Mention `readlink -f' bug fix in 5.3.0 news.
1683         Mention new readlink options in 5.3.0's `New features' section.
1684         Spotted by Thomas Hood.
1685
1686 2005-11-08  Jim Meyering  <jim@meyering.net>
1687
1688         * NEWS: Merge in changes from b5_9x branch.
1689
1690 2005-11-08  Paul Eggert  <eggert@cs.ucla.edu>
1691
1692         * NEWS: ls now defaults to --time-style='locale', which in turn acts
1693         like --time-style='posix-long-iso' if the locale settings are messed up.
1694         * src/ls.c (decode_switches): Implement this.
1695
1696 2005-11-08  Jim Meyering  <jim@meyering.net>
1697
1698         * tests/du/2g: s/expensive/very expensive/ in a comment.
1699         From Paul Townsend.
1700
1701 2005-10-17  Eric Blake  <ebb9@byu.net>
1702
1703         * src/ls.c (usage): Fix descriptions of --sort, --time.
1704         Reported by Vitaly A. Ostanin.
1705
1706 2005-11-04  Paul Eggert  <eggert@cs.ucla.edu>
1707
1708         * src/ln.c: Include filenamecat.c.
1709         (FILE_BASENAME_CONCAT): Remove.
1710         (do_link): Remove last arg DEST_IS_DIR.  All callers changed.
1711         (main): Use file_name_concat, base_name, and strip_trailing_slashes
1712         instead of FILE_BASENAME_CONCAT.  This simplifies the code, and avoids
1713         the use of alloca.
1714
1715 2005-11-04  Jim Meyering  <jim@meyering.net>
1716
1717         * src/du.c (process_file): Don't overflow for files of size >= 2^31
1718         on systems with stat.st_blocks of a signed 32-bit type.
1719         This bug causes trouble on some AIX 5.1 systems.
1720         Report and trivial patch from Paul Townsend:
1721         <http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00033.html>
1722         * NEWS: Mention this.
1723
1724         * tests/du/2g: New (very-expensive) test for the above-fixed bug.
1725         * tests/du/Makefile.am (TESTS): Add it here.
1726         * tests/very-expensive: New file.
1727         * tests/Makefile.am (EXTRA_DIST): Add it here.
1728         * tests/cp/perm: Mark this test as `very-expensive', too.
1729
1730 2005-11-02  Paul Eggert  <eggert@cs.ucla.edu>
1731
1732         * NEWS: Mention that rm -d and maybe ln -d are scheduled for
1733         removal in 2006.
1734         * src/remove.h (struct rm_options): Remove unlink_dirs.  All uses
1735         removed.
1736         * src/rm.c (usage): Don't mention rm -d.
1737
1738 2005-11-02  Jim Meyering  <jim@meyering.net>
1739
1740         * tests/dd/skip-seek: Fix typo in comment: s/fileutils/coreutils.
1741         From Andreas Schwab.
1742
1743         * tests/dd/unblock-sync: Redirect stderr to /dev/null so the
1744         `M+N records in/out' lines don't pollute `make check' output.
1745
1746         * tests/dd/skip-seek (sk-seek4): New test, to exercise the bug
1747         fixed on 2005-10-31.  This test uses the new, IN_PIPE specifier.
1748         * tests/Coreutils.pm: Accept a new type of input specifier: IN_PIPE,
1749         to indicate that the input file should be piped into the command
1750         under test (via `cat FILE | $prog ...').
1751
1752         * src/remove.c (remove_entry): Emit a better diagnostic when rm
1753         (without -r) fails to remove a directory on a non-Linux system.
1754         This change affects only newer Solaris systems (with priv_*
1755         functions like priv_allocset).  Reported by Keith Thompson.
1756
1757         * tests/rm/dir-nonrecur: New file/test for the above fix.
1758         * tests/rm/Makefile.am (TESTS): Add dir-nonrecur.
1759
1760 2005-11-01  Paul Eggert  <eggert@cs.ucla.edu>
1761
1762         * NEWS: "tail -c 2 FILE" and "touch 0101000000" now operate as
1763         POSIX 1002.1-2001 requires.
1764         * src/tail.c (parse_obsolete_option): Implement this.
1765         Problem reported by Vincent Lefevre.
1766         * src/touch.c (main): Pass PDS_PRE_2000 to posixtime.
1767         * tests/tail/Test.pm (c-2, c-2-minus, c2, c2-minus): New tests.
1768         (test_vector): Add special cases for _POSIX2_VERSION, and
1769         regularize the old ones a bit.
1770         * tests/touch/obsolescent: Add y2000 test.
1771
1772 2005-10-31  Paul Eggert  <eggert@cs.ucla.edu>
1773
1774         * src/dd.c (skip): Fix off-by-one error reported by
1775         Theodoros V. Kalamatianos.
1776
1777 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
1778
1779         * tests/mkdir/p-3: Require that the test be run as non-root.
1780         Problem and trivial fix reported by Theodoros V. Kalamatianos.
1781
1782 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
1783
1784         * src/ln.c (FILE_BASENAME_CONCAT): Omit unnecessary slashes in the
1785         boundary between DEST and SOURCE in the result.
1786
1787 2005-10-26  Dmitry V. Levin  <ldv@altlinux.org>
1788
1789         * src/md5sum.c (main) [!O_BINARY]: Changed default read mode
1790         back to text, to sync with documentation and for backwards
1791         compatibility.
1792
1793 2005-10-25  Jim Meyering  <jim@meyering.net>
1794
1795         * tests/dircolors/simple (other-wr): Add an explicit test for
1796         the dircolors bug (NULL-dereference) fixed yesterday.
1797
1798 2005-10-24  Jim Meyering  <jim@meyering.net>
1799
1800         * src/tac.c (tac_file): When determining whether a file is seekable,
1801         also test whether it is a tty.  Using only the lseek-based test would
1802         give a false positive on Solaris.  Reported by Peter Fales.
1803
1804 2005-10-24  Dmitry V. Levin  <ldv@altlinux.org>
1805
1806         * tests/install/d-slashdot: New test, for "install -d" failure.
1807         * tests/install/Makefile.am (TESTS): Add d-slashdot.
1808         * tests/mkdir/p-slashdot: New test, for "mkdir -p" failure.
1809         * tests/mkdir/Makefile.am (TESTS): Add p-slashdot.
1810
1811 2005-10-24  Jim Meyering  <jim@meyering.net>
1812
1813         * src/dircolors.c (ls_codes): Add missing comma.
1814         Anonymous report and patch from
1815         http://savannah.gnu.org/bugs/?func=detailitem&item_id=14849
1816
1817         * src/dircolors.c: Add compile-time assertion that the slack_codes
1818         and ls_codes arrays have the same number of elements.  This would
1819         have prevented the above-fixed bug.
1820
1821         * src/expand.c (parse_tab_stops): Add a comment to make this function
1822         identical to the one in unexpand.c.
1823         * src/unexpand.c (parse_tab_stops): Adjust syntax to make this function
1824         identical to the one in expand.c.
1825
1826         * src/expand.c (next_file): Don't assume fopen cannot return stdin.
1827
1828 2005-10-23  Jim Meyering  <jim@meyering.net>
1829
1830         * src/md5sum.c (digest_check, main): Use ptr_align rather than
1831         a dangerous pointer-value-to-`unsigned' cast.
1832         * NEWS: mention the new sha* programs.
1833         * AUTHORS: Add new sha* programs.
1834
1835 2005-08-28  David Madore  <david.madore@ens.fr>
1836
1837         Add new programs: sha224sum, sha256sum, sha384sum, sha512sum.
1838         * README: Add their names to the list.
1839         * src/md5sum.c: Provide framework for computing sha-2 hashes.
1840         * src/Makefile.am (sha224sum, sha256sum, sha384sum, sha512sum):
1841         Rules for compiling sha-2 utilities
1842         (noinst_HEADERS): Remove checksum.h.
1843         * man/sha512sum.x, man/sha384sum.x, man/sha256sum.x, man/sha224sum.x:
1844         New files.
1845         * man/Makefile.am (dist_man_MANS): Add the corresponding .1 names.
1846         (sha224sum.1, sha256sum.1, sha384sum.1, sha512sum.1): New dependencies.
1847         * tests/misc/sha224sum, tests/misc/sha256sum: New files.
1848         * tests/misc/sha384sum, tests/misc/sha512sum: New files.
1849         * tests/misc/Makefile.am (TESTS): Add new sha224sum, sha256sum,
1850         sha384sum, sha512sum test scripts here rather that each in its
1851         own directory.
1852
1853 2005-08-28  David Madore  <david.madore@ens.fr>
1854
1855         * tests/sha1sum/basic-1 (million-a): Add the "million a's" test (one
1856         of the FIPS test vectors).
1857
1858 2005-10-23  Jim Meyering  <jim@meyering.net>
1859
1860         * configure.ac: Use 6.0-cvs as the version string.
1861         * NEWS: Adjust accordingly.