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