Run the coreutils-specific code only if tests/Makefile.am.in exists.
[platform/upstream/coreutils.git] / ChangeLog
1 2007-07-08  Jim Meyering  <jim@meyering.net>
2
3         Run the coreutils-specific code only if tests/Makefile.am.in exists.
4         * bootstrap (mam_template): Move definition out of loop.
5
6         Create symlinks for gl/{lib,m4}/*, just as for gnulib/{lib,m4}/*.
7         * bootstrap (symlink_to_dir): Rename function from symlink_to_gnulib.
8         Add a directory parameter.  Update all callers.
9         (cp_mark_as_generated): Also check for -- and link to -- files in gl/.
10
11         * THANKS: Add Pádraig Brady.
12
13 2007-07-08  Jim Meyering  <jim@meyering.net>
14
15         Adapt to deeper hierarchy in gnulib.
16         * bootstrap (gnulib_tool): If the destination directory doesn't exist,
17         create it. This is required at least for "lib/uniwidth/cjk.h".
18
19         Use <wchar.h>, not "wcwidth.h".
20         * src/wc.c: Now that gnulib provides the POSIX-specified <wchar.h>,
21         include it and <wctype.h>, rather than "wcwidth.h".
22         * src/ls.c: Include <wchar.h>, rather than "wcwidth.h".
23
24 2007-07-05  Jim Meyering  <jim@meyering.net>
25
26         setuidgid: set all groups, not just the primary one.
27         I wanted to use the xgetgroups function from id.c, so factored
28         it out and made it into a non-exiting function (hence the "m"
29         prefix rather than "x").
30         * src/setuidgid.c (main): Use mgetgroups.
31         Include "mgetgroups.h".
32
33         * src/id.c (xgetgroups): Remove function.
34         Include "mgetgroups.h".
35         (print_group_list): Use mgetgroups, not xgetgroups.
36
37         * gl/modules/mgetgroups: New module.
38         * gl/lib/mgetgroups.c: New file.  mgetgroups is derived from
39         id.c's xgetgroups function.
40         * bootstrap.conf (gnulib_modules): Add mgetgroups.
41         * gl/m4/mgetgroups.m4: New file.
42         * gl/lib/mgetgroups.h: New file.
43
44         * bootstrap: Merge in changes from gnulib.
45
46         * src/id.c: Include "getugroups.h" rather than declaring manually.
47
48 2007-07-04  Paul Eggert  <eggert@cs.ucla.edu>
49
50         * NEWS: pr -F no longer suppresses the footer or the first two blank
51         lines in the header.
52         * doc/coreutils.texi (pr invocation): Likewise.  Also, a too-short
53         page length implies -t, not -T.
54         * src/pr.c (lines_per_header, lines_per_footer): Now constants.
55         (init_parameters): Don't try to change them.
56         (print_header): Use the same header and footer format regardless of
57         wither form feeds are being used.
58         (usage): Adjust to above change when describing too-short page length.
59         Too-short page length impliesy -t, not -T.
60         * tests/pr/2-S_f-t_notab: Adjust to the fact that -F now affects
61         only formfeed handling; it does not change the header.
62         * tests/pr/2-Sf-t_notab: Likewise.
63         * tests/pr/2f-t_notab: Likewise.
64         * tests/pr/2s_f-t_notab: Likewise.
65         * tests/pr/2s_w60f-t_nota: Likewise.
66         * tests/pr/2sf-t_notab: Likewise.
67         * tests/pr/2sw60f-t_notab: Likewise.
68         * tests/pr/2w60f-t_notab: Likewise.
69         * tests/pr/3a3f-0F: Likewise.
70         * tests/pr/3b3f-0F: Likewise.
71         * tests/pr/3b3f-0FF: Likewise.
72         * tests/pr/3b3f-FF: Likewise.
73         * tests/pr/3f-0F: Likewise.
74         * tests/pr/3f-FF: Likewise.
75         * tests/pr/Test.pm: Likewise.
76         * tests/pr/a3f-0F: Likewise.
77         * tests/pr/a3f-0FF: Likewise.
78         * tests/pr/a3f-FF: Likewise.
79         * tests/pr/b3f-0F: Likewise.
80         * tests/pr/b3f-0FF: Likewise.
81         * tests/pr/b3f-FF: Likewise.
82         * tests/pr/3-5l17f-t: Remove, since it's been renamed to another
83         file whose name has a line count 7 larger,
84         reflecting the new line count needed for this behavior.
85         * tests/pr/3a3l8f-t: Likewise.
86         * tests/pr/3b3l8f-t: Likewise.
87         * tests/pr/3l17f-t: Likewise.
88         * tests/pr/3ml17f-t: Likewise.
89         * tests/pr/Ja3l17f-lm: Likewise.
90         * tests/pr/Jb3l17f-lm: Likewise.
91         * tests/pr/Jml17f-lm-lo: Likewise.
92         * tests/pr/W-72l17f-ll: Likewise.
93         * tests/pr/W20l17f-ll: Likewise.
94         * tests/pr/W26l17f-ll: Likewise.
95         * tests/pr/W27l17f-ll: Likewise.
96         * tests/pr/W28l17f-ll: Likewise.
97         * tests/pr/W35Ja3l17f-lm: Likewise.
98         * tests/pr/W35Jb3l17f-lm: Likewise.
99         * tests/pr/W35Jml17f-lmlo: Likewise.
100         * tests/pr/W35a3l17f-lm: Likewise.
101         * tests/pr/W35b3l17f-lm: Likewise.
102         * tests/pr/W35ml17f-lm-lo: Likewise.
103         * tests/pr/W72Jl17f-ll: Likewise.
104         * tests/pr/a3l17f-lm: Likewise.
105         * tests/pr/a3l8f-t: Likewise.
106         * tests/pr/b3l17f-lm: Likewise.
107         * tests/pr/b3l8f-t: Likewise.
108         * tests/pr/l17f-t: Likewise.
109         * tests/pr/ml17f-0F: Likewise.
110         * tests/pr/ml17f-lm-lo: Likewise.
111         * tests/pr/ml17f-t: Likewise.
112         * tests/pr/ml17f-t-0F: Likewise.
113         * tests/pr/n+2-5l17f-0FF: Likewise.
114         * tests/pr/n+2l17f-0FF: Likewise.
115         * tests/pr/n+2l17f-bl: Likewise.
116         * tests/pr/n+3l17f-0FF: Likewise.
117         * tests/pr/n+3l17f-bl: Likewise.
118         * tests/pr/n+3ml13f-bl-FF: Likewise.
119         * tests/pr/n+3ml17f-bl-tn: Likewise.
120         * tests/pr/n+3ml17f-tn-bl: Likewise.
121         * tests/pr/n+4b2l10f-0FF: Likewise.
122         * tests/pr/n+5-8b3l10f-FF: Likewise.
123         * tests/pr/n+5a3l6f-0FF: Likewise.
124         * tests/pr/n+6b3l6f-FF: Likewise.
125         * tests/pr/nJml17f-lmlmlo: Likewise.
126         * tests/pr/nJml17f-lmlolm: Likewise.
127         * tests/pr/nN1+3l17f-bl: Likewise.
128         * tests/pr/nN15l17f-bl: Likewise.
129         * tests/pr/nSml13-bl-FF: Likewise.
130         * tests/pr/nSml13-t-t-FF: Likewise.
131         * tests/pr/nSml13-t-tFFFF: Likewise.
132         * tests/pr/nSml17-bl-FF: Likewise.
133         * tests/pr/nSml17-t-t-FF: Likewise.
134         * tests/pr/nSml17-t-tFFFF: Likewise.
135         * tests/pr/nl17f-bl: Likewise.
136         * tests/pr/o3Jml17f-lm-lo: Likewise.
137         * tests/pr/o3a3Sl17f-tn: Likewise.
138         * tests/pr/o3a3Snl17f-tn: Likewise.
139         * tests/pr/o3a3l17f-tn: Likewise.
140         * tests/pr/o3b3Sl17f-tn: Likewise.
141         * tests/pr/o3b3Snl17f-tn: Likewise.
142         * tests/pr/o3b3l17f-tn: Likewise.
143         * tests/pr/o3mSl17f-bl-tn: Likewise.
144         * tests/pr/o3mSnl17fbltn: Likewise.
145         * tests/pr/o3ml17f-bl-tn: Likewise.
146         * tests/pr/w72l17f-ll: Likewise.
147         * tests/pr/3-5l24f-t: New file, containing the contents of the
148         file with the same name but with the line count smaller by 7,
149         reflecting the new behavior with -F.
150         * tests/pr/3a3l15f-t: Likewise.
151         * tests/pr/3b3l15f-t: Likewise.
152         * tests/pr/3l24f-t: Likewise.
153         * tests/pr/3ml24f-t: Likewise.
154         * tests/pr/Ja3l24f-lm: Likewise.
155         * tests/pr/Jb3l24f-lm: Likewise.
156         * tests/pr/Jml24f-lm-lo: Likewise.
157         * tests/pr/W-72l24f-ll: Likewise.
158         * tests/pr/W20l24f-ll: Likewise.
159         * tests/pr/W26l24f-ll: Likewise.
160         * tests/pr/W27l24f-ll: Likewise.
161         * tests/pr/W28l24f-ll: Likewise.
162         * tests/pr/W35Ja3l24f-lm: Likewise.
163         * tests/pr/W35Jb3l24f-lm: Likewise.
164         * tests/pr/W35Jml24f-lmlo: Likewise.
165         * tests/pr/W35a3l24f-lm: Likewise.
166         * tests/pr/W35b3l24f-lm: Likewise.
167         * tests/pr/W35ml24f-lm-lo: Likewise.
168         * tests/pr/W72Jl24f-ll: Likewise.
169         * tests/pr/a3l15f-t: Likewise.
170         * tests/pr/a3l24f-lm: Likewise.
171         * tests/pr/b3l15f-t: Likewise.
172         * tests/pr/b3l24f-lm: Likewise.
173         * tests/pr/l24f-t: Likewise.
174         * tests/pr/ml24f-0F: Likewise.
175         * tests/pr/ml24f-lm-lo: Likewise.
176         * tests/pr/ml24f-t: Likewise.
177         * tests/pr/ml24f-t-0F: Likewise.
178         * tests/pr/n+2-5l24f-0FF: Likewise.
179         * tests/pr/n+2l24f-0FF: Likewise.
180         * tests/pr/n+2l24f-bl: Likewise.
181         * tests/pr/n+3l24f-0FF: Likewise.
182         * tests/pr/n+3l24f-bl: Likewise.
183         * tests/pr/n+3ml20f-bl-FF: Likewise.
184         * tests/pr/n+3ml24f-bl-tn: Likewise.
185         * tests/pr/n+3ml24f-tn-bl: Likewise.
186         * tests/pr/n+4b2l17f-0FF: Likewise.
187         * tests/pr/n+5-8b3l17f-FF: Likewise.
188         * tests/pr/n+5a3l13f-0FF: Likewise.
189         * tests/pr/n+6b3l13f-FF: Likewise.
190         * tests/pr/nJml24f-lmlmlo: Likewise.
191         * tests/pr/nJml24f-lmlolm: Likewise.
192         * tests/pr/nN1+3l24f-bl: Likewise.
193         * tests/pr/nN15l24f-bl: Likewise.
194         * tests/pr/nSml20-bl-FF: Likewise.
195         * tests/pr/nSml20-t-t-FF: Likewise.
196         * tests/pr/nSml20-t-tFFFF: Likewise.
197         * tests/pr/nSml24-bl-FF: Likewise.
198         * tests/pr/nSml24-t-t-FF: Likewise.
199         * tests/pr/nSml24-t-tFFFF: Likewise.
200         * tests/pr/nl24f-bl: Likewise.
201         * tests/pr/o3Jml24f-lm-lo: Likewise.
202         * tests/pr/o3a3Sl24f-tn: Likewise.
203         * tests/pr/o3a3Snl24f-tn: Likewise.
204         * tests/pr/o3a3l24f-tn: Likewise.
205         * tests/pr/o3b3Sl24f-tn: Likewise.
206         * tests/pr/o3b3Snl24f-tn: Likewise.
207         * tests/pr/o3b3l24f-tn: Likewise.
208         * tests/pr/o3mSl24f-bl-tn: Likewise.
209         * tests/pr/o3mSnl24fbltn: Likewise.
210         * tests/pr/o3ml24f-bl-tn: Likewise.
211         * tests/pr/w72l24f-ll: Likewise.
212
213 2007-06-23  Jim Meyering  <jim@meyering.net>
214
215         Prefer "STREQ (a, b)" over "strcmp (a, b) == 0"; similar for != 0.
216         * src/base64.c (main): Likewise.
217         * src/install.c (setdefaultfilecon): Likewise.
218         * src/sort.c (main): Likewise.
219         * Makefile.maint (sc_prohibit_strcmp): New rule.
220         * .x-sc_prohibit_strcmp: New file, to list the few exceptions.
221         * Makefile.am (EXTRA_DIST): Add .x-sc_prohibit_strcmp.
222
223 2007-06-22  Paul Eggert  <eggert@cs.ucla.edu>
224
225         * NEWS: seq no longer mishandles obvious cases like
226         "seq 0 0.000001 0.000003" by omitting the last output number.
227         * doc/coreutils.texi (seq invocation): Remove advice about workaround
228         for seq off-by-one problem, since the bug is fixed now.  Replace
229         it with more-generic advice about rounding errors.
230         * src/seq.c (long_double_format, print_numbers):
231         New arg NUMERIC_FORMAT.  All uses changed.
232
233 2007-06-22  Pádraig Brady  <P@draigBrady.com>  (trivial change)
234
235         * tests/seq/basic: Add test cases for seq off-by-one problem.
236
237 2007-06-22  Jim Meyering  <jim@meyering.net>
238
239         * src/stat.c (long_options): Add a FIXME comment to help ensure
240         that the deprecated and undocumented "--filesystem" option is
241         removed someday.
242
243 2007-06-18  Paul Eggert  <eggert@cs.ucla.edu>
244
245         A few more symlink-related fixes.  Fix a bug triggered by cp
246         --parents and symlinks.  Close some race conditions possible when
247         the destination replaces a newly-created file with a symlink.
248         * NEWS: Document that 'cp --parents' no longer mishandles
249         symlinks in file name components of source.
250         * src/copy.c (HAVE_LCHOWN): Default to false.
251         (lchown) [!defined HAVE_LCHOWN]: Define to chown, for convenience.
252         * src/cp.c (lchown) [!HAVE_LCHOWN]: Likewise.
253         * src/install.c (lchown [!HAVE_LCHOWN]: Likewise.
254         * src/copy.c (set_owner): Use lchown instead of chown, for safety
255         in case the file got replaced by a symlink in the meantime.
256         * src/cp.c (re_protect): Likewise.
257         * src/install.c (change_attributes): Likewise.
258         * src/copy.c (copy_internal): Use ordinary C rather than an #if.
259         * src/cp.c (lchown) [!HAVE_LCHOWN]: Define to chown, for convenience.
260         (struct dir_attr): Cache the entire struct stat of the directory,
261         rather than just its mode, so that we needn't stat the directory
262         twice (which can lead to races).
263         (re_protect): Don't use XSTAT as that's not appropriate in
264         this context (symlinks should be followed here).  Instead, use
265         the cached stat value.
266         (make_dir_parents_private): Save dir's entire struct stat, not
267         just its mode.
268         * tests/cp/cp-parents: Add test to check against bug with
269         cp --parents and symlinks.
270
271 2007-06-18  Jim Meyering  <jim@meyering.net>
272
273         Use mreadlink_with_size (doesn't exit), not xreadlink_with_size.
274         * bootstrap.conf (gnulib_modules): Add readlink-with-size.
275         Remove xreadlink and xreadlink-with-size.
276         * src/copy.c (copy_internal): Use mreadlink_with_size,
277         not xreadlink_with_size.
278         * src/ls.c (get_link_name): Likewise.
279         * src/readlink.c (main): Likewise.
280         * src/stat.c (print_stat): Likewise.
281
282         * README-hacking: Don't mention Gzip 1.2.4, now that 1.3.12 is out.
283
284 2007-06-16  Jim Meyering  <jim@meyering.net>
285
286         Make chgrp and chown diagnostics consistent.
287         * src/chown.c (main): Emit the diagnostic before the file name,
288         not after it, to be consistent with chgrp's diagnostic.
289         * src/chgrp.c (parse_group): Emit a ":" between the diagnostic
290         and the file name.
291         Reported by Egmont Koblinger.
292         * THANKS: Add Egmont Koblinger.
293
294 2007-06-15  Paul Eggert  <eggert@cs.ucla.edu>
295
296         Correct cp's handling of destination symlinks in some cases.
297         * NEWS: "cp" no longer considers a destination symlink to be the
298         same as the referenced file when copying links or making backups.
299         * src/copy.c (copy_reg): When following a symlink, use the
300         followed name in later chown etc. requests, so that the created
301         file is affected, rather than the symlink.  Use O_NOFOLLOW on
302         source when not dereferencing symlinks; this avoids a race.
303         Preserve errno correctly when doing multiple open attempts on the
304         destination.
305         (copy_internal): Follow destination symlinks only when copying a
306         regular file and only when we don't intend to remove or rename the
307         destination first, regardless of whether following source
308         symlinks; this is because since POSIX and tradition (e.g.,
309         FreeBSD) say we should ordinarily follow destination symlinks if
310         the system calls would ordinarily do so.
311         * src/copy.h (struct cp_options): Add comment that 'dereference'
312         is only for source files.
313         * src/cp.c (usage): Note that --derereference etc. are only for
314         source files.
315         (make_dir_parents_private): Follow symlinks, regardless of whether
316         --dereference is specified, because these are destination symlinks.
317         * tests/cp/same-file: Adjust tests to match revised behavior.
318         Filter out perror output since it might vary from host to host.
319         Use sed alone instead of also using echo.
320
321         * doc/coreutils.texi (cp invocation): Document the behavior better when
322         the destination is a symlink.  Clarify source versus destination
323         symlinks.  Describe the new behavior for destination symlinks.
324
325 2007-06-15  Jim Meyering  <jim@meyering.net>
326
327         * src/copy.c: Include "canonicalize.h".
328         (copy_reg): Use canonicalize_filename_mode to follow the symlink,
329         so that we can always open with O_EXCL and avoid a race.
330
331 2007-06-15  Jim Meyering  <jim@meyering.net>
332
333         Don't include "quote.h" when it is not used.
334         * src/md5sum.c: Remove unnecessary inclusion of "quote.h".
335         * src/expr.c: Likewise.
336         * src/shred.c: Likewise.
337         * Makefile.maint (sc_prohibit_quote_without_use): New rule.
338         * src/c99-to-c89.diff: Adjust offsets.
339
340 2007-06-14  Paul Eggert  <eggert@cs.ucla.edu>
341
342         Clarify what "cat" documentation means by "blank" lines.
343         * doc/coreutils.texi (cat invocation): "Blank" lines actually mean
344         empty lines.
345         * src/cat.c (usage): Say that "nonblank" means nonempty.  Clarify
346         --squeeze-blank.
347
348 2007-06-13  Jim Meyering  <jim@meyering.net>
349
350         rmdir: give better diagnostics
351         * src/rmdir.c (remove_parents): Give a more descriptive/consistent
352         diagnostic upon failure.
353         (main): Likewise.
354         Suggestion from Joey Hess.
355         * THANKS: Add Joey Hess.
356
357         Don't include "quotearg.h" when it is not used.
358         * Makefile.maint (sc_prohibit_quotearg_without_use): New rule.
359         * src/cp.c: Don't include "quotearg.h".  It wasn't used.
360
361         * README-hacking: List Gperf as a build-requirement, too.
362         Reported by Steve Ward.
363
364 2007-06-11  Jim Meyering  <jim@meyering.net>
365
366         * README: Mention README-hacking, for whose who start from
367         cloned/checked-out sources rather than from a distribution tarball.
368         Reported by Steve Ward.
369         * THANKS: Add Steve Ward.
370
371 2007-06-10  Jim Meyering  <jim@meyering.net>
372
373         bug-fix: cp would fail to write through a dangling symlink
374         * NEWS: Mention the bug fix.
375         * src/copy.c (copy_reg): When open fails with EEXIST, the destination
376         is lstat'able, and a symlink, call open again, but now without O_EXCL.
377         * tests/cp/thru-dangling: New file, to test for the above fix.
378         * tests/cp/Makefile.am (TESTS): Add thru-dangling.
379         * THANKS: Add Michael McLagan.
380         Bug report from Michael McLagan in <http://bugzilla.redhat.com/243588>.
381
382 2007-06-04  Paul Eggert  <eggert@cs.ucla.edu>
383
384         * doc/coreutils.texi (Common options): Mention that -h and
385         --human-readable are equivalent to --block-size=human-readable.
386         Documentation problem reported by Steve Ward in
387         <http://lists.gnu.org/archive/html/bug-coreutils/2007-06/msg00007.html>.
388         (du invocation): Use optSi rather than duplicating the macro's
389         contents (incorrectly, since we claimed a "B" was output).
390
391 2007-05-31  Jim Meyering  <jim@meyering.net>
392
393         Pull printf-related code from gnulib, rather than using forked copy.
394         * bootstrap.conf (gnulib_modules): Don't avoid size_max and xsize
395         modules.  While I dislike xsize-style overflow avoidance, maintaining
396         a forked version of e.g., vasnprintf.c was too much work.
397
398 2007-05-29  Jim Meyering  <jim@meyering.net>
399
400         * src/dircolors.hin: Add screen-256color.
401         Suggested by sdl.web@gmail.com in <http://bugzilla.redhat.com/239266>.
402
403 2007-05-26  Jim Meyering  <jim@meyering.net>
404
405         * TODO: Add an entry for comm --output-delimiter=STR
406
407 2007-05-25  James Youngman  <jay@gnu.org>
408
409         wc: ignore multibyte-character decoding errors
410         * src/wc.c (wc): Don't issue an error message when mbrtowc
411         indicates that we have seen an invalid byte sequence.  This
412         makes "wc /bin/sh" bearable (though the word and line counts
413         are likely not to be useful).
414         * NEWS: Mention the change.
415
416 2007-05-22  Jim Meyering  <jim@meyering.net>
417
418         Check for an up-to-date copyright year in coreutils.texi.
419         * Makefile.maint (copyright-check): Also check for an up-to-date
420         copyright year in doc/$().texi, if that file exists.
421         * doc/coreutils.texi: Add 2007 to list of Copyright years.
422         Reported by Karl Berry.
423
424         cut: diagnose a range starting with 0 (-f 0-2) as invalid, and
425         give a better diagnostic for a field-number/offset of 0.
426         * NEWS: Mention the fix.
427         * src/cut.c (ADD_RANGE_PAIR): Add an explicit check.
428         Based on a patch from James Youngman.
429         * tests/misc/cut: Add tests for the above.
430
431         "cut -f 2-0" now fails; before, it was equivalent to "cut -f 2-"
432         Also, diagnose the '-' in "cut -f -" as an invalid range, rather
433         than interpreting it as the unlimited range, "1-".
434         * NEWS: Mention these changes.
435         * src/cut.c (set_fields): Don't interpret an accumulator "value"
436         of 0 as an unspecified range endpoint.
437         Give better diagnostics.
438         Adjust a comment so that it is true also for 64-bit size_t.
439
440         * tests/cut/Test.pm: Add tests for the above.
441
442         stty: fix a harmless syntax nit
443         * src/stty.c (visible): Use ";" as the statement terminator
444         between two assignments, not ",".
445         (integer_arg): Join an unnecessarily wrapped line.
446
447 2007-05-20  Jim Meyering  <jim@meyering.net>
448
449         stty: diagnose an invalid hex value in 35-colon commmand-line argument
450         * NEWS: Mention this.
451         * src/stty.c (strtoul_tcflag_t, strtoul_cc_t): New functions.
452         (recover_mode): Use those functions (not sscanf), to parse the
453         string robustly.
454         * tests/stty/invalid: New file.  Test for the above.
455         * tests/stty/Makefile.am (TESTS): Add invalid.
456         * .x-sc_prohibit_atoi_atof: Don't exempt stty.c from this check.
457         Add tests/stty/invalid so we don't have to obfuscate the comment
458         about sscanf therein.
459         * Makefile.maint (sc_prohibit_atoi_atof): Mention sscanf in the
460         diagnostic, too.
461
462         * TODO: Remove some now-completed or no longer relevant items.
463
464 2007-05-19  Jim Meyering  <jim@meyering.net>
465
466         Rename uses of futimens -> gl_futimens; glibc now declares the former.
467         * src/copy.c (copy_reg): Reflect renaming: futimens -> gl_futimens.
468         * src/touch.c (touch): Likewise.
469
470 2007-05-18  Jim Meyering  <jim@meyering.net>
471
472         * Makefile.maint (my-distcheck): Remove -pedantic from $(CFLAGS)
473         for now, to avoid c89-check failure due to use of #include_next.
474
475 2007-05-15  Jim Meyering  <jim@meyering.net>
476
477         Generate a dozen test-related Makefile.am files at bootstrap-time.
478         * README-hacking: Build-from-checkout now require Perl, too.
479         * bootstrap: Now that these generated Makefile.am files are no longer
480         under version control, they must be created at bootstrap time.
481
482 2007-05-14  Paul Eggert  <eggert@cs.ucla.edu>
483
484         * man/chmod.x: Document chmod's behavior with setuid and setgid bits.
485         Remove misleading implication about leading zero.  Problem
486         reported by Jan Engelhardt in
487         <http://lists.gnu.org/archive/html/bug-coreutils/2007-05/msg00134.html>.
488
489 2007-05-13  Jim Meyering  <jim@meyering.net>
490
491         Remove the generated tests/*/Makefile.am files from version control.
492         * tests/cut/Makefile.am: git-remove this generated file.
493         * tests/head/Makefile.am: Likewise.
494         * tests/join/Makefile.am: Likewise.
495         * tests/pr/Makefile.am: Likewise.
496         * tests/sort/Makefile.am: Likewise.
497         * tests/tac/Makefile.am: Likewise.
498         * tests/tail/Makefile.am: Likewise.
499         * tests/test/Makefile.am: Likewise.
500         * tests/tr/Makefile.am: Likewise.
501         * tests/uniq/Makefile.am: Likewise.
502         * tests/wc/Makefile.am: Likewise.
503         * .cvsignore, .gitignore: Ignore these generated files.
504
505         * src/.cvsignore, src/.gitignore: Add chcon here, ...
506         * .cvsignore, .gitignore: ... not here.
507
508         Test uniq's new --zero-terminated (-z) option.
509         * tests/uniq/Test.pm: When possible, create a "-z"-testing variant
510         of each existing test.
511         (2z, 3z, 4z, 5z, 20z, 122, 123): New tests from James Youngman.
512
513 2007-05-12  James Youngman  <jay@gnu.org>
514
515         Add -z option to uniq.  Originally proposed by Egmont Koblinger.
516         * NEWS: Mention uniq's new option: --zero-terminated (-z).
517         * src/uniq.c: Add new option, --zero-terminated (-z), to make
518         uniq use the NUL byte as separator/delimiter rather than newline.
519         (check_file): Add a parameter: delimiter.  Update caller.
520         Use readlinebuffer_delim in place of readlinebuffer everywhere.
521         (main): Handle the new option.
522         (usage): Describe new option the same way sort does.
523         * doc/coreutils.texi (uniq invocation): Describe the new option.
524
525 2007-05-07  Jim Meyering  <jim@meyering.net>
526
527         * NEWS: Mention that last week's tr bug dates back to 1992.
528
529 2007-05-04  Jim Meyering  <jim@meyering.net>
530
531         Avoid test failure when run with an unusual umask.
532         * tests/ls/color-dtype-dir: Set umask to 022.
533         Suggestion from AIDA Shinra.
534
535         Avoid failure of root-only test when run with a restrictive umask.
536         * tests/rm/no-give-up: Ensure that non-root can access "d/" through
537         root-owned ".".  Reported by AIDA Shinra.
538
539         tr -c: don't abort when translating with S2 larger than complement of S1
540         * src/tr.c (main): Remove invalid assertion triggered by e.g.,
541         tr -c a '[b*256]'.  There's nothing wrong with having Set2 larger
542         than Set1.  Reported by Guntram Blohm.
543         * tests/tr/Test.pm (no-abort-1): Test for the above.
544         * NEWS: Mention this bug fix.
545         * THANKS: Add Guntram Blohm.
546
547 2007-05-03  Jim Meyering  <jim@meyering.net>
548
549         Avoid test failure when run with a permissive umask.
550         * tests/rm/no-give-up: Set permissions of test directory properly,
551         i.e., not depending on umask prohibiting go=w.
552         Reported by AIDA Shinra.
553
554 2007-05-02  Paul Eggert  <eggert@cs.ucla.edu>
555
556         The following commands and options now support the standard size
557         suffixes kB, M, MB, G, GB, and so on for T, P, Y, Z, and Y:
558         head -c, head -n, od -j, od -N, od -S, split -b, split -C,
559         tail -c, tail -n.
560         * doc/coreutils.texi (od invocation, head invocation, tail invocation):
561         Document support for new size suffixes.
562         (head invocation, tail invocation):
563         Document that -n uses the same suffixes as -c.
564         (tail invocation): More-clearly document what leading "+" does.
565         * src/head.c (usage, string_to_integer): Support new suffixes.
566         * src/od.c (usage, main): Likewise.
567         * src/split.c (usage, main): Likewise.
568         * src/tail.c (usage, parse_options): Likewise.
569         Prompted by a patch from Evan Hunt.
570
571 2007-05-02  Jim Meyering  <jim@meyering.net>
572
573         * src/du.c (usage): Tweak description of --dereference-args (-D) again.
574         Prompted by another request for clarification from Justin Pryzby.
575
576         Invoke rm via 'setuidgid ... env PATH="$PATH" ...', as in fail-eperm.
577         * tests/rm/fail-2eperm: Patch from AIDA Shinra.
578         Reported by Peter Dyballa.
579         * THANKS: Add AIDA Shinra and Peter Dyballa.
580
581 2007-04-28  Paul Eggert  <eggert@cs.ucla.edu>
582
583         * src/nohup.c (usage): Describe how standard input and output
584         are redirected.
585
586 2007-04-25  Jim Meyering  <jim@meyering.net>
587
588         * src/du.c (usage): Clarify description of --dereference-args (-D).
589         Prompted by a report from Justin Pryzby.
590
591         * bootstrap.conf (gnulib_modules): Add fseeko and ftello.
592         (gnulib_modules): Add autobuild.
593
594 2007-04-24  Jim Meyering  <jim@meyering.net>
595
596         * THANKS: Add Andreas Frische.
597         * NEWS: Mention today's ls --color fix.
598         * tests/ls-2/tests (sl-dangle): Add a test for today's fix.
599
600 2007-04-24  Eric Blake  <ebb9@byu.net>
601
602         ls --color once again colors dangling symlinks correctly
603         * src/ls.c (gobble_file): Much like the 2007-04-07 fix,
604         add a term to the expression that decides whether we need
605         stat and/or lstat calls.  Reported by Andreas Frische.
606
607 2007-04-16  Jim Meyering  <jim@meyering.net>
608
609         * src/cut.c (usage): Adjust synopsis to show that an OPTION is required.
610         Reported by Rudolf Kastl.
611         * THANKS: Add Rudolf Kastl.
612
613 2007-04-11  Paul Eggert  <eggert@cs.ucla.edu>
614
615         split --line-bytes=N (-C N): don't create an empty file.
616         * src/split.c (line_bytes_split): Don't create an empty line
617         afterwards if the last buffer happens to be exactly full.
618         * tests/misc/split-fail: Add a test case for this.
619         * NEWS: mention this.
620
621 2007-04-10  Jim Meyering  <jim@meyering.net>
622
623         ls: don't form or compute the length of strings that won't be used.
624         * src/ls.c (gobble_file): Form and compute length of strings for
625         block size, owner, group, author, major+minor numbers and file size
626         only if they'll actually be used.  I.e., don't form most of them
627         when not producing long format output.
628
629 2007-04-07  Jim Meyering  <jim@meyering.net>
630
631         Add a test for, and document, today's fix.
632         * NEWS: Mention today's ls --color fix.
633         * tests/ls-2/tests (sl-target): Add a test for today's fix.
634         * THANKS: Add Kirk Kelsey.
635
636 2007-04-07  Eric Blake  <ebb9@byu.net>
637
638         Fix a bug in how the LS_COLORS ln=target attribute is handled.
639         * src/ls.c (gobble_file): Use "stat" (not lstat) also when the
640         ln=target attribute applies.  Reported by Kirk Kelsey.
641
642 2007-04-02  Jim Meyering  <jim@meyering.net>
643
644         * src/copy.c (copy_reg): Initialize local "con", before calling
645         getfscreatecon, in case that function (or its inline stub) does
646         not set it.
647
648 2007-04-01  Paul Eggert  <eggert@cs.ucla.edu>
649
650         * src/ls.c (print_horizontal): Fix bug reported by Mike Frysinger:
651         ls -x DIR would sometimes output the wrong string in place of the
652         first entry.
653         * NEWS: Mention the bug fix.
654         * tests/ls/x-option: New file.
655         * tests/ls/Makefile.am (TESTS): Add x-option.
656
657         gnulib moved md5 and sha1 modules into a new crypt/ directory; adapt
658         * bootstrap.conf (gnulib_modules): Adjust to gnulib's renaming of
659         md5 to crypt/md5 and sha1 to crypt/sha1.
660
661 2007-03-30  Jim Meyering  <jim@meyering.net>
662
663         * NEWS: Mention these SELinux changes.
664
665         * ChangeLog-selinux: Remove file.
666         Move its contents into this file, removing old dates.
667
668         * src/runcon.c (main): Don't reorder arguments.  Reported by
669         Ulrich Drepper in <http://bugzilla.redhat.com/232652>.
670         * tests/misc/runcon-no-reorder: New file.  Test for the above.
671         * tests/misc/Makefile.am (TESTS): Add runcon-no-reorder.
672
673         * src/runcon.c (main): Remove "." at end of a diagnostic.
674
675         * src/runcon.c: New program.
676         * src/Makefile.am (bin_PROGRAMS): Add runcon.
677         (runcon_LDADD): Define.
678         * README: Add runcon to the list of programs.
679         * AUTHORS: Add this: runcon: Russell Coker
680         * tests/help-version: Add runcon as an exception.
681         * man/Makefile.am (dist_man_MANS): Add runcon.1.
682         (runcon.1): New dependency.
683
684         mkfifo, mknod: Accept new "-Z, --context=C" option.
685         * src/mkfifo.c, src/mknod.c: Include <selinux/selinux.h>.
686         (main): Honor it.
687         * src/Makefile.am (mkfifo_LDADD, mknod_LDADD): Use $(LIB_SELINUX).
688
689         mkdir: Accept new "-Z, --context=C" option.
690         * src/mkdir.c: Include <selinux/selinux.h>.
691         (main): Honor it.
692         * src/Makefile.am (mkdir_LDADD): Use $(LIB_SELINUX).
693
694         * tests/cp/cp-a-selinux: New file.  Test for the bug reported in
695         <http://bugzilla.redhat.com/219900>.
696         * tests/cp/Makefile.am (TESTS): Add cp-a-selinux.
697
698         * tests/selinux: New file.
699         * tests/Makefile.am (EXTRA_DIST): Add selinux.
700         * tests/misc/selinux: Source the new script, rather than open coding it.
701
702         Change how "cp -a" and "cp --preserve=context" work with SELinux.
703         Now, cp -a attempts to preserve context, but failure to do so does
704         not change cp's exit status.  However "cp --preserve=context" is
705         similar, but failure *does* cause cp to exit with nonzero status.
706         * src/copy.h (struct cp_options) [require_preserve_context]: New member.
707         * src/copy.c (copy_reg, copy_internal): Implement the above.
708         * src/mv.c (cp_option_init): Initialize the new member.
709         * src/install.c (cp_option_init): Likewise.
710         * src/cp.c (cp_option_init): Likewise.
711         (decode_preserve_arg): Set it or reset it.
712
713         cp, mv, install: add SELinux support, but unlike with the Red Hat
714         patch, mv and cp do not provide the "-Z context" option.
715         * src/copy.c: Include <selinux/selinux.h>.
716         (restore_default_fscreatecon): New function.
717         (copy_reg): Make cp --preserve=context work for existing destination.
718         (copy_internal): Likewise for new destinations.
719         * src/copy.h (cp_options) [preserve_security_context]: New member.
720         * src/cp.c: Include <selinux/selinux.h>.
721         (selinux_enabled): New global.
722         (usage): Mention new --preserve=context option.
723         (PRESERVE_CONTEXT): Define/use.
724         (decode_preserve_arg): Handle PRESERVE_CONTEXT.
725         (main): Remove an obsolete comment.
726         If --preserve=context is specified on a system without SELinux
727         enabled, give a diagnostic and fail.
728         * src/mv.c: Include <selinux/selinux.h>.
729         Set x->preserve_security_context if SELinux is enabled.
730         * src/install.c: Accept new "-Z, --context=C" option.
731         Accept --preserve-context option (but not -P option).
732         Accept alternate spelling: --preserve_context, for now.
733         Include <selinux/selinux.h> and "quotearg.h".
734         (selinux_enabled, use_default_selinux_context): New globals.
735         (PRESERVE_CONTEXT_OPTION): Define.
736         (cp_option_init): Default: do not preserve security context.
737         (setdefaultfilecon): New function.
738         (main): Honor new options.
739         * src/Makefile.am (mv_LDADD, cp_LDADD, ginstall_LDADD):
740         Add $(LIB_SELINUX).
741         * src/system.h (GETOPT_SELINUX_CONTEXT_OPTION_DECL): Define.
742
743         * tests/misc/selinux [VERBOSE]: Print version info for each
744         of the tested tools, not just ls.
745
746         * src/c99-to-c89.diff: Remove the ls.c patch, now that I've
747         temporarily removed the offending c99'ism.
748
749         * src/chcon.c (usage): Split a string literal that was longer than 509.
750
751         * src/ls.c (gobble_file): Don't call getfilecon unless print_scontext.
752         Upon failed getfilecon, accept not just ENOTSUP, but also ENODATA.
753
754         * src/c99-to-c89.diff: Adjust offsets.
755
756         * AUTHORS: Add chcon.
757
758         * src/c99-to-c89.diff: Remove trailing blanks.
759
760         * src/chcon.c: Don't include "dirname.h".  system.h already includes it.
761
762         * gl/lib/selinux-at.c: Remove a use of HAVE_CONFIG_H.
763
764         * src/c99-to-c89.diff: Handle a new c99'ism in ls.c.
765
766         * src/id.c (main): Tweak id -Z diagnostic.
767
768         id: Add SELinux support: -Z option.
769         * src/id.c (main): Apply patches from Fedora, with these changes:
770         Remove #ifdef WITH_SELINUX.
771         Use error (EXIT_FAILURE, not fprintf+exit(1).
772         * src/Makefile.am (id_LDADD): Define, so as to add $(LIB_SELINUX).
773
774         stat: Add support for SELinux in the form of a %C format directive.
775         * src/stat.c (follow_links): Make this variable file-global.
776         (out_file_context): New function.
777         (print_statfs): Honor %C.
778         (print_stat): Honor %C.
779         (do_stat): Remove follow_links parameter.
780         (usage): Document the two %C directives.
781         (main): Accept -Z (though it's a no-op).
782         * src/Makefile.am (stat_LDADD): Define.
783
784         ls: Add support for SELinux and a slightly modified -Z option.
785         I started with the patches from Red Hat.
786         The entries below tell how the code evolved.
787
788         * src/ls.c (print_long_format, print_file_name_and_frills): When
789         there is no security context (due to getfilecon/lgetfilecon failing
790         with e.g. ENOTSUP), print it as "?", not "".
791         * src/ls.c (print_file_name_and_frills): Make -Z work without -l.
792         (length_of_file_name_and_frills): Likewise.
793
794         * src/ls.c: Remove the --lcontext and --scontext options.
795         Change the way -Z, --context work so that it no longer implies -l.
796         Thus, -Z -l will work like -lcontext and -Z without -l will work
797         like --scontext.
798
799         Adjust tests to reflect new 'ls -l' syntax -- affects only
800         systems with SELinux when operating on a file with no ACL.
801         These tests assumed that everything before the first space on
802         each line is the 10-byte mode string.  But there may also be a "+"
803         in the 11th column, just before the space.  However, note that this
804         is not new.  The same thing would have happened even without the
805         change below, when listing a file with an ACL.
806         * tests/chmod/equals, tests/cp/cp-parents, tests/cp/fail-perm:
807         * tests/cp/link-preserve, tests/install/basic-1, tests/misc/mknod:
808         * tests/mkdir/parents, tests/mkdir/special-1, tests/mv/partition-perm:
809
810         Don't make compilation depend on USE_ACL.  An SELinux security
811         context counts as an "alternate access control method", so ls
812         must output a "+" for each file with a security context.
813         * src/ls.c [struct fileinfo] (have_acl): Declare unconditionally.
814         (FILE_HAS_ACL): Remove macro definition.  Use f->have_acl directly.
815         (gobble_file): Record whether a file has a security context, and
816         update the condition used to determine whether to print the "+".
817         (gobble_file): Call getfilecon/lgetfilecon also when
818         format == long_format, so that we get the "+".
819
820         * src/ls.c (gobble_file): Add a comment explaining why (with a
821         security context option) ls doesn't exit nonzero due to e.g.,
822         getfilecon failing with errno == ENOTSUP.
823
824         * src/ls.c (gobble_file): Ignore failure of getfilecon if it's due
825         to ENOTSUP.
826
827         * src/ls.c (gobble_file): Factor out three small blocks using
828         getfilecon and lgetfilecon.
829         Don't ignore return value from getfilecon and lgetfilecon.
830
831         * src/ls.c (print_long_format): Don't use ?: (empty 2nd arg with C
832         ternary operator).
833         (print_scontext_format): Likewise.
834         (print_scontext): Declare to be "bool", not int.  Adjust uses.
835
836         * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD): Add $(LIB_SELINUX).
837
838         * tests/misc/chcon: New file.
839         * tests/misc/chcon-fail: New file.
840         * tests/Makefile.am (check-root): Run new, root-only misc/chcon test.
841         * tests/misc/Makefile.am (TESTS): Add chcon and chcon-fail.
842
843         * tests/misc/Makefile.am (TESTS): Add selinux.
844         * tests/misc/selinux: New file.
845         * tests/help-version: Skip chcon.
846         * man/chcon.x: New file.
847         * man/Makefile.am: Build chcon.1.
848
849         New program: chcon
850         * gl/modules/selinux-at: New module.  Check for libselinux and set
851         LIB_SELINUX here, unconditionally, rather than depending on
852         the configure-time --enable-selinux option.
853         * gl/modules/selinux-h: New module.
854         * bootstrap.conf (gnulib_modules): Add selinux-at.
855         * gl/lib/selinux-at.c, gl/lib/selinux-at.h: New files.
856         * gl/lib/se-selinux_.h: New file.
857         * gl/lib/se-context_.h: New file.
858         * gl/m4/selinux-selinux-h.m4: New file.
859         * gl/m4/selinux-context-h.m4: New file.
860         * src/Makefile.am (bin_PROGRAMS): Add chcon.
861         (chcon_LDADD): Define.
862         * README: Add chcon to the list of programs.
863         * src/chcon.c: Rewrite the original (Red Hat) chcon to use fts.
864
865 2007-03-29  Jim Meyering  <jim@meyering.net>
866
867         * .vg-suppressions: Add libc-getpwuid-leak.
868
869 2007-03-28  Jim Meyering  <jim@meyering.net>
870
871         Help translators include translation team's web or email address.
872         * src/system.h (emit_bug_reporting_address): New function.
873         * src/base64.c: Use it rather than a literal printf.
874         * src/basename.c, src/cat.c, src/chgrp.c, src/chmod.c:
875         * src/chown.c, src/chroot.c, src/cksum.c, src/comm.c, src/cp.c:
876         * src/csplit.c, src/cut.c, src/date.c, src/dd.c, src/df.c:
877         * src/dircolors.c, src/dirname.c, src/du.c, src/echo.c, src/env.c:
878         * src/expand.c, src/expr.c, src/factor.c, src/fmt.c, src/fold.c:
879         * src/head.c, src/hostid.c, src/hostname.c, src/id.c, src/install.c:
880         * src/join.c, src/kill.c, src/link.c, src/ln.c, src/logname.c:
881         * src/ls.c, src/md5sum.c, src/mkdir.c, src/mkfifo.c, src/mknod.c:
882         * src/mv.c, src/nice.c, src/nl.c, src/nohup.c, src/od.c:
883         * src/paste.c, src/pathchk.c, src/pinky.c, src/pr.c, src/printenv.c:
884         * src/printf.c, src/ptx.c, src/pwd.c, src/readlink.c, src/rm.c:
885         * src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c, src/shuf.c:
886         * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c:
887         * src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac.c:
888         * src/tail.c, src/tee.c, src/test.c, src/touch.c, src/tr.c:
889         * src/true.c, src/tsort.c, src/tty.c, src/uname.c, src/unexpand.c:
890         * src/uniq.c, src/unlink.c, src/uptime.c, src/users.c, src/wc.c:
891         * src/who.c, src/whoami.c, src/yes.c: Likewise.
892
893         * src/stty.c: Don't include "vasprintf.h", now that its
894         declarations are guaranteed to be in gnulib's stdio.h.
895         * src/who.c: Likewise.
896
897 2007-03-27  Jim Meyering  <jim@meyering.net>
898
899         * README: Use "install", not "ginstall" in the list of program names.
900         * src/Makefile.am (check-README): Substitute s/ginstall/install/.
901
902 2007-03-25  Jim Meyering  <jim@meyering.net>
903
904         * src/c99-to-c89.diff: Regenerate.
905
906 2007-03-25  Paul Eggert  <eggert@cs.ucla.edu>
907
908         Avoid the need for euidaccess and/or lstat on every directory entry
909         with 'rm -r dir' (without -f), if we are root, or if we are removing
910         a directory tree that is full of symbolic links.
911         * bootstrap.conf (gnulib_modules): Add write-any-file.
912         * src/copy.c: Include write-any-file.h.
913         (UNWRITABLE): Remove macro, replacing with....
914         (writable_destination): New function, which uses can_write_any_file
915         to avoid the need for euidaccess when we are privileged.
916         (overwrite_prompt, abandon_move): Use it.
917         * src/remove.c: Include write-any-file.h.
918         (D_TYPE): New macro.
919         (DT_UNKNOWN, DT_DIR, DT_LNK) [!HAVE_STRUCT_DIRENT_D_TYPE]: New macros.
920         (write_protected_non_symlink): Don't bother to stat if we can write
921         any file.
922         (prompt): New arg PDIRENT_TYPE.  All callers changed.
923         Use readdir dirent type to avoid the need for 'lstat' on each directory
924         entry in cases like 'rm -r dir', if we are root, or if the tree is
925         full of symbolic links.
926         (DT_IS_KNOWN, DT_MUST_BE): Remove.
927         (remove_entry): New arg DIRENT_TYPE_ARG.  All callers changed.
928
929 2007-03-24  Jim Meyering  <jim@meyering.net>
930
931         If strace malfunctions, skip the test rather than failing it.
932         * tests/mv/atomic: Required on a mips-unknown-linux-gnu system
933         running the aging linux-2.4.27-mipscvs-20040814.
934
935 2007-03-23  Paul Eggert  <eggert@cs.ucla.edu>
936
937         * src/pathchk.c: Don't include euidaccess.h, as we don't call
938         euidaccess.
939
940 2007-03-23  Jim Meyering  <jim@meyering.net>
941
942         * README-package-renamed-to-coreutils: Add a URL for the FAQ,
943         and a couple more archive links.
944
945 2007-03-22  Jim Meyering  <jim@meyering.net>
946
947         Post-release version change.
948         * NEWS: Add a line for 6.9+.
949         * configure.ac (AC_INIT): Set new version string.
950
951         Version 6.9.
952         * NEWS: Record release date and new version number.
953         * configure.ac (AC_INIT): New version number.
954
955         * tests/mv/hard-3: Correct the preceding change: $3 -> $2.
956
957 2007-03-22  Paul Eggert  <eggert@cs.ucla.edu>
958
959         Improve a test script.
960         * tests/mv/hard-3: Check for 'ls' failure, too.
961         Generate more-useful debugging output when 'ls' fails.
962
963 2007-03-21  Jim Meyering  <jim@meyering.net>
964
965         Fix a test script not to claim an ext2 file system is of type xfs.
966         * tests/du/slink: When using df --local and df --type=TYPE,
967         test only the exit code.  Don't bother with stdout.
968         Prompted by a report by Thomas Schwinge of an inaccurate diagnostic.
969
970         * gl/lib/savewd.c: Remove this file, since the savewd_save change
971         is now in gnulib.  The other wasn't useful.
972
973 2007-03-20  Jim Meyering  <jim@meyering.net>
974
975         * gl/lib/acl.c: Remove this file, now that gnulib's version subsumes it.
976
977         Skip part of this test when "." is not a local file system.
978         * tests/install/basic-1: Otherwise, it would fail on some NFS
979         file systems.
980         * tests/mkdir/p-3: Likewise.
981
982 2007-03-19  Paul Eggert  <eggert@cs.ucla.edu>
983
984         * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD):
985         Add $(LIB_ACL_TRIVIAL).
986
987 2007-03-18  Jim Meyering  <jim@meyering.net>
988
989         Fix a generic NFS-related test failure.
990         * tests/mkdir/p-3: When setting up an unreadable "." in an
991         inaccessible parent, make the parent inaccessible *after* making "."
992         unreadable.  Otherwise, running "chmod a-r ." in an already-
993         inaccessible parent would fail on NFS with "Stale NFS file handle".
994
995         Fix a bug in how pr -m -s works.
996         * NEWS: Describe how the fix affects pr.
997         * src/pr.c (init_parameters): The --merge (-m) option does
998         not imply --expand-tabs (-e), so don't set "untabify_input".
999         Reported by Wis Macomson.
1000         * tests/misc/pr: New file.  Test for the above fix.
1001         * tests/misc/Makefile.am (TESTS): Add pr.
1002         * THANKS: Update.
1003
1004 2007-03-17  Jim Meyering  <jim@meyering.net>
1005
1006         Detect use of AC_CONFIG_AUX_DIR also when its argument is quoted.
1007         * bootstrap: Put ""s around use of $build_aux, in case
1008         someone uses a name containing shell meta-characters.
1009         Reported by Alfred M. Szmidt.
1010         * tests/misc/tty-eof: Add shuf to the list of tested commands.
1011
1012         Avoid test failure on NFS-mounted Solaris ZFS file system.
1013         * tests/du/basic: Skip a test if "." is on a non-local file system.
1014
1015         Avoid an obscure build failure, prefer waitpid over wait.
1016         * src/install.c (strip): Use waitpid, not wait.  It's equivalent,
1017         but feels less obsolescent.
1018
1019         * bootstrap: Don't use \> in grep regexp.  For HP-UX.
1020
1021 2007-03-16  Jim Meyering  <jim@meyering.net>
1022
1023         Begin adding support for Solaris ZFS (4 entries per trivial ACL)
1024         * gl/lib/acl.c (ACL_NOT_WELL_SUPPORTED): New macro.
1025         (file_has_acl, copy_acl): Use it, rather than enumerating errno values.
1026         (is_trivial_acl): New function.  Incomplete, for now.
1027         (file_has_acl, copy_acl): Use the new function, rather than
1028         counting the number of entries in an ACL.
1029
1030         * bootstrap: Update from gnulib.
1031
1032         * .x-sc_prohibit_atoi_atof: Add TODO here, too.
1033
1034 2007-03-16  Paul Eggert  <eggert@cs.ucla.edu>
1035
1036         * src/copy.c: Include filemode.h.
1037         (overwrite_prompt): Say "try to overwrite", not "overwrite", to
1038         make it clearer that the attempt may fail.  Problem reported by
1039         Dan Jacobson in:
1040         http://lists.gnu.org/archive/html/bug-coreutils/2007-03/msg00130.html
1041         Output symbolic mode as well as numeric.
1042         * tests/mv/i-2 (fail): Adjust to new prompt format.
1043
1044 2007-03-15  Jim Meyering  <jim@meyering.net>
1045
1046         Enforce policy: don't use *scanf functions.
1047         * Makefile.maint (sc_prohibit_atoi_atof): Add to regexp and diagnostic.
1048         * .x-sc_prohibit_atoi_atof: Give stty a temporary pass.
1049         * TODO: note that stty.c needs this small clean-up.
1050
1051 2007-03-13  Jim Meyering  <jim@meyering.net>
1052
1053         Prepare to work on ACL-related failure when using Solaris ZFS.
1054         * gl/lib/acl.c: New file, copied from gnulib.
1055
1056         Work around a failing test due to an NFS-based race condition.
1057         * tests/cp/sparse: Accept a report that the copy is *smaller*.
1058
1059 2007-03-12  Jim Meyering  <jim@meyering.net>
1060
1061         Make bootstrap.conf a tiny bit more generic.
1062         * bootstrap.conf (XGETTEXT_OPTIONS): Exclude gettext-related .m4
1063         files when e.g., AM_GNU_GETTEXT([external] appears in configure.ac.
1064
1065 2007-03-10  Jim Meyering  <jim@meyering.net>
1066
1067         Try to fix today's NFS-related failure: Treat ESTALE like EACCES.
1068         * gl/lib/savewd.c: Copy this file from gnulib, then change
1069         "errno != EACCES" to (errno != EACCES && errno != ESTALE).
1070         The symptom was this failure in tests/install/basic-1:
1071         ginstall: cannot create directory `rel/a': Stale NFS file handle
1072
1073         The preceding change solved part of the problem.  Now ginstall fails.
1074         * tests/install/basic-1: Temporarily, don't redirect ginstall's
1075         stderr to /dev/null, so I can see why the NFS autobuilder's NFS test
1076         is failing.
1077
1078         * tests/install/basic-1: When setting up an unreadable "." in an
1079         inaccessible parent, make the parent inaccessible *after* making "."
1080         unreadable.  Otherwise, running "chmod a-r ." in an already-
1081         inaccessible parent would fail on NFS with "Stale NFS file handle".
1082         Reported by Bob Proulx.
1083
1084         * Makefile.maint (po-check): Exclude c99-to-c89.diff.
1085
1086 2007-03-09  Jim Meyering  <jim@meyering.net>
1087
1088         Avoid test failures on Darwin 7.9.0 (MacOS X 10.3.9)
1089         * tests/chgrp/basic: Don't let failure by chgrp to set the
1090         group of a symlink make this test fail.  Do give a diagnostic.
1091         In the chgrp-no-change-ctime test, add darwin7.9.0 as another
1092         known-failing system.
1093         When failing on some other system, print $host_triplet, too.
1094         Also avoid test failures on Darwin 8.8.x (MacOS X 10.4).
1095         Reported by Peter Fales.
1096
1097 2007-03-08  Jim Meyering  <jim@meyering.net>
1098
1099         * src/c99-to-c89.diff: Reflect the new c99'ism, update offsets.
1100
1101 2007-03-08  Paul Eggert  <eggert@cs.ucla.edu>
1102
1103         rm without -f: give a better diagnostic when euidaccess fails.
1104         * src/remove.c (write_protected_non_symlink): Return int, not bool,
1105         so that we can indicate failure too (as a postive error number).
1106         (prompt): If write_protected_non_symlink fails, report that error
1107         number and fail rather than charging ahead and removing the dubious
1108         entry.  Redo the logic of printing a diagnostic so that we need to
1109         invoke quote (full_filename (...)) only once.  More details at:
1110         <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9952/focus=9996>
1111
1112 2007-03-08  Jim Meyering  <jim@meyering.net>
1113
1114         Generalize a few more cvs-isms.
1115         * bootstrap (checkout_only_file): Rename from CVS_only_file.
1116         Change comments and diagnostics not to say "CVS".
1117
1118         * bootstrap: Run libtool, if necessary.
1119
1120         Make bootstrap a little more general.
1121         * bootstrap (build_aux): Factor out/use this definition.
1122         Formally require a "AC_CONFIG_AUX_DIR($build_aux)" line in configure.ac.
1123         (insert_sorted_if_absent): Move function definition "up", to
1124         precede new first use.
1125         If $build_aux/ doesn't exist initially, create it, and
1126         mark it as ignored.
1127
1128 2007-03-03  Andrew Church  <achurch@achurch.org>  (tiny change)
1129             Paul Eggert  <eggert@cs.ucla.edu>
1130
1131         Fix a bug: cp -x would fail to set mount point permissions.
1132         * NEWS: mention cp -x bug fix
1133         * src/copy.c (copy_internal): Don't return immediately after
1134         copying a mount point that we do not intend to recurse under.
1135         Based on a patch by Andrew Church.
1136
1137 2007-03-03  Jim Meyering  <jim@meyering.net>
1138
1139         pwd-unreadable-parent: Skip test on ia64/Linux, too.
1140         * tests/misc/pwd-unreadable-parent: Also skip when $REPLACE_GETCWD.
1141         Reported by Bob Proulx.
1142
1143 2007-03-02  Jim Meyering  <jim@meyering.net>
1144
1145         pwd-unreadable-parent: Skip test on non-Linux/GNU systems.
1146         * tests/misc/pwd-unreadable-parent: Rather than trying to decide
1147         whether this test has a chance of succeeding, run it only when
1148         $(host_os) is linux-gnu.  It was failing on powerpc-apple-darwin8.8.0
1149         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Add host_os=$(host_os).
1150
1151         * tests/misc/pwd-long: Also allow "+" in $PWD.
1152
1153         Remove another coreutils-ism.  Formatting cleanup.
1154         * Makefile.maint (my-distcheck): Update an outdated comment.
1155         (emit_upload_commands): Use $(PACKAGE) rather than "coreutils".
1156         (my-distcheck): Skip the c99/c89 check if there's no such .diff file.
1157
1158 2007-03-01  Jim Meyering  <jim@meyering.net>
1159
1160         * Makefile.maint (warn_cflags): Hoist, adding "-Dlint -O".
1161         (my-distcheck): Use the new variable, instead of too-long literal.
1162
1163         Make "make syntax-check" rules less coreutils-specific.
1164         * Makefile.maint (sc_cast_of_x_alloc_return_value): Use CVS_LIST_EXCEPT.
1165         (sc_cast_of_alloca_return_value): Likewise.
1166         (sc_root_tests): Do nothing if there is no check-root target
1167         in tests/Makefile.am.
1168
1169         Run the writable-files check only for release-building targets.
1170         * Makefile.maint (local-checks-available): Remove writable-files.
1171         (alpha beta major): Put it here, instead.
1172
1173         "make syntax-check" now runs only Makefile.cfg-selected tests
1174         * Makefile.maint (syntax-check-rules): Hoist this definition so that
1175         it precedes the indirect use in the definition of $(local-check).
1176         (local-check): Use :=, not just "=".
1177         (syntax-check): Depend on $(local-check), not $(syntax-check-rules).
1178
1179 2007-02-28  Bruno Haible  <bruno@clisp.org>
1180
1181         * bootstrap.conf (gnulib_modules): Replace xreadlink with
1182         xreadlink-with-size. Add xreadlink.
1183         * src/copy.c (copy_internal): Update.
1184         * src/ls.c (is_directory): Update.
1185         * src/stat.c (print_stat): Update.
1186         * src/readlink.c (main): Use the one-argument xreadlink function.
1187
1188 2007-02-28  Paul Eggert  <eggert@cs.ucla.edu>
1189
1190         * doc/coreutils.texi (Common options): --si outputs "M", not "MB".
1191         Problem reported by Philip Rowlands in
1192         <http://lists.gnu.org/archive/html/bug-coreutils/2007-02/msg00283.html>.
1193
1194 2007-02-28  Jim Meyering  <jim@meyering.net>
1195
1196         * .x-sc_file_system: Add the new test, tests/misc/df-P, to this
1197         list of exceptions, for the "make distcheck" sc_file_system rule.
1198
1199         * Makefile.maint (gnulib_snapshot_date): Remove now-unused definition.
1200
1201 2007-02-27  Paul Eggert  <eggert@cs.ucla.edu>
1202
1203         Make df -P immune to effects of e.g., the BLOCK_SIZE envvar.
1204         * NEWS: With -P, the default block size and output format is not
1205         affected by DF_BLOCK_SIZE, BLOCK_SIZE, or BLOCKSIZE.
1206         * src/df.c (main): Implement this.
1207
1208 2007-02-27  Jim Meyering  <jim@meyering.net>
1209
1210         Add a test for the above.
1211         * tests/misc/df-P: New file.
1212         * tests/misc/Makefile.am (TESTS): Add df-P.
1213
1214 2007-02-25  Jim Meyering  <jim@meyering.net>
1215
1216         * Makefile.maint (announcement): Adjust so that it works with
1217         announce-gen's --gnulib-snapshot-time-stamp option.
1218         Indent one of the command lines using TAB, not 8 spaces.
1219
1220         Post-release version change.
1221         * NEWS: Add a line for 6.8+.
1222         * configure.ac (AC_INIT): Set new version string.
1223
1224 2007-02-24  Jim Meyering  <jim@meyering.net>
1225
1226         Version 6.8.
1227         * NEWS: Record release date and new version number.
1228         * configure.ac (AC_INIT): New version number.
1229
1230         Don't skip this test on new-enough Linux/GNU systems.
1231         * tests/misc/pwd-unreadable-parent: Test $REPLACE_GETCWD = 0,
1232         rather than for __GETCWD_PREFIX in config.h (the latter is no
1233         longer defined, ever, due to gnulib changes).
1234         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define REPLACE_GETCWD.
1235
1236         Remove the "gnits" option; it prohibits my using "+" as a version
1237         string suffix, and all it does (beyond the default "gnu" option)
1238         is to _require_ the THANKS file.
1239         * configure.ac (AM_INIT_AUTOMAKE): Remove it.
1240
1241         Remove all AUTOMAKE_OPTIONS settings in Makefile.am files.
1242         * tests/chgrp/Makefile.am, tests/chmod/Makefile.am:
1243         * tests/chown/Makefile.am, tests/cp/Makefile.am:
1244         * tests/du/Makefile.am, tests/expr/Makefile.am:
1245         * tests/factor/Makefile.am, tests/general/Makefile.am:
1246         * tests/install/Makefile.am, tests/ln/Makefile.am:
1247         * tests/ls/Makefile.am, tests/mkdir/Makefile.am:
1248         * tests/mv/Makefile.am, tests/readlink/Makefile.am:
1249         * tests/rm/Makefile.am, tests/rmdir/Makefile.am:
1250         * tests/seq/Makefile.am, tests/stty/Makefile.am:
1251         * tests/tee/Makefile.am, tests/touch/Makefile.am:
1252
1253         * README: Document the OSF/1 4.0d build failure and work-around.
1254         Reported by Bruno Haible.
1255
1256         * NEWS: Use a simple "+" suffix to denote pre-release, not "-dirty".
1257         Nicer connotations.
1258         * configure.ac: Use 6.7+, not 6.7-dirty.
1259
1260 2007-02-24  Paul Eggert  <eggert@cs.ucla.edu>
1261
1262         * NEWS: sort no longer compresses temporaries by default.
1263         * bootstrap.conf: Remove findprog.
1264         * doc/coreutils.texi (sort invocation): The default is to not
1265         compress.  Don't treat "" specially.
1266         * src/sort.c: Don't include findprog.h.
1267         (create_temp): Compress only if the user specified --compress-program.
1268         * tests/misc/sort-compress: Adjusts tests to match new behavior.
1269
1270 2007-02-24  Jim Meyering  <jim@meyering.net>
1271
1272         Avoid a shell syntax error, when building with an inadequate Perl.
1273         * man/Makefile.am (.x.1): Add quotes around $(PERL) in case, since
1274         it can expand to "/.../missing perl".
1275
1276         * man/Makefile.am (.x.1): Warn when unable to update a man page.
1277         Suggestion from Bruno Haible.
1278
1279 2007-02-23  Bruno Haible  <bruno@clisp.org>
1280
1281         Handle better the combination of old Perl and a pre-c99 compiler.
1282         * man/Makefile.am (.x.1): If the autoconf test has determined that
1283         perl is missing or not a sufficient version, do nothing.
1284
1285         * tests/readlink/can-e: Put the closing double-quote at the end of a
1286         backquoted word, not in the middle. Works around a bug in sh on
1287         OSF/1 4.0d.
1288         * tests/readlink/can-f: Likewise.
1289         * tests/readlink/can-m: Likewise.
1290
1291         * tests/du/slink: Skip the test if executing on an nfsv3 file system.
1292         This avoids a test failure at least on OSF/1 4.0d.
1293
1294 2007-02-23  Jim Meyering  <jim@meyering.net>
1295
1296         * src/date.c (usage): Split a diagnostic that had grown to be
1297         longer than the C89 maximum of 509 bytes.
1298
1299 2007-02-23  Ed Santiago <ed@edsantiago.com>
1300
1301         * src/date.c (usage): Mention that --rfc-3339 uses space, not 'T',
1302         for a separator.  Include sample RFC 2822 and 3339 output.
1303
1304 2007-02-23  Jim Meyering  <jim@meyering.net>
1305
1306         With -Dlint, make shuf free all heap-allocated storage.
1307         * src/shuf.c (main): Move declaration of input_lines to
1308         function scope, and initialize to NULL, so we can free it.
1309         [lint]: Free all malloc'd memory.
1310         * tests/misc/shuf: Also test shuf's -e and -i options.
1311
1312 2007-02-22  Jim Meyering  <jim@meyering.net>
1313
1314         Merge in a change from some other incarnation of this file (gzip?)
1315         * bootstrap (gnulib_tool): Skip get_translations if there is no po/ dir.
1316
1317         Adjust preceding change not to perform an unaligned access.
1318         * src/copy.c (copy_reg): Undo previous change.  Instead, make
1319         it clearer that we're using a single-byte sentinel, and
1320         [lint]: Initialize sizeof (uintptr_t) - 1 bytes after the sentinel.
1321         Reported by Andreas Schwab.
1322
1323         Placate valgrind, wrt ./cp --sparse=always
1324         * src/copy.c (copy_reg): Place the sentinel by setting a
1325         full word's worth of bits, not just a single byte's worth.
1326         This avoids a harmless (but distracting) case of memory being
1327         used-uninitialized.
1328
1329 2007-02-21  Paul Eggert  <eggert@cs.ucla.edu>
1330
1331         Honor dd's noatime flag if possible, even if not supported on build fs
1332         * doc/coreutils.texi (dd invocation): Warn that noatime might not be
1333         reliable.
1334         * src/dd.c (flags, usage): Look at O_NOATIME, not
1335         HAVE_WORKING_O_NOATIME, to decide whether to support the noatime
1336         flag, so that dd attempts O_NOATIME even if the build file system
1337         does not support it.  Problem reported by Jim Meyering today in
1338         bug-coreutils.
1339         * tests/dd/misc: Generate a warning, not a failure, if noatime
1340         exists but fails.
1341
1342 2007-02-21  Jim Meyering  <jim@meyering.net>
1343
1344         * tests/misc/date: Remove vestigial use of Data::Dumper.
1345
1346 2007-02-20  Paul Eggert  <eggert@cs.ucla.edu>
1347
1348         * src/copy.c (cached_umask): Cast -1 to mode_t to avoid a warning
1349         about out-of-range initializer with Sun C 5.8.
1350
1351 2007-02-20  Jim Meyering  <jim@meyering.net>
1352
1353         * bootstrap (CVS_only_file): Use README-hacking.
1354
1355         Now that we use GIT, not cvs, rename README-cvs.
1356         * README-hacking: Renamed from...
1357         Update to reflect that we now use git.
1358
1359         * README-cvs: ...this.
1360
1361         * src/env.c (main): When invoked with no arguments (i.e. when printing
1362         the environment), use a local variable to iterate through the global
1363         "environ" array, rather than "environ" itself.  This is solely to
1364         avoid changing the environment for an LD_PRELOAD-substituted "puts"
1365         or "exit" function.  Tiny patch by Harvey Eneman.  See
1366         <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9735>.
1367         * THANKS: Update.
1368
1369         * bootstrap: Move definitions of temporary directory names and the
1370         new bt_regex "up" to precede all uses, so it's clearer what their
1371         scope is.  Also, use [.], rather than \\., since the former works
1372         even if eval'd.
1373
1374         * bootstrap: Remove occurrences of $bt (._bootmp) from lib/Makefile.
1375         Based on the bison 2007-02-19 change by Joel E. Denny.
1376
1377 2007-02-19  Paul Eggert  <eggert@cs.ucla.edu>
1378
1379         * NEWS: sort now uses a --compress-program option rather than
1380         an environment variable.
1381         * doc/coreutils.texi (sort invocation): Document this.
1382         * src/sort.c (usage): Likewise.
1383         (COMPRESS_PROGRAM_OPTION): New const.
1384         (long_options, create_temp, main): Support new option.
1385         * tests/misc/sort-compress: Test it.
1386
1387 2007-02-19  Jim Meyering  <jim@meyering.net>
1388
1389         * bootstrap: Fix typo s/dowloading/downloading/ in --help output.
1390
1391 2007-02-18  Jim Meyering  <jim@meyering.net>
1392
1393         * src/system.h: Don't include exit.h, now that it's subsumed
1394         by the gnulib-generated stdlib.h.
1395
1396         * tests/rm/fail-eacces: Skip this test when running as root.
1397         Reported by Matthew Woehlke.
1398
1399         * bootstrap: Use "._bootmp" as the temporary directory name,
1400         not ".#bootmp".  The latter's "#" caused trouble with the new,
1401         gnulib-added "LINK_WARNING_H = $(top_srcdir)/.#bootmp/..." line.
1402
1403 2007-02-14  Paul Eggert  <eggert@cs.ucla.edu>
1404
1405         * bootstrap.conf (gnulib_modules): Add c-strcase.  Remove strcase.
1406         * src/dircolors.c: Include c-strcase.h.
1407         (dc_parse_stream): Use c_strcasecmp rather than
1408         strcasecmp to avoid unreliable results in locales like Turkish
1409         where strcasecmp is incompatible with the C locale.
1410
1411 2007-02-13  Jim Meyering  <jim@meyering.net>
1412
1413         Also check for and print stderr output, in case a program fails.
1414         * tests/misc/tty-eof: Occasionally (not reproducible), this
1415         test would fail, with one or more programs exiting nonzero, e.g.,
1416         tty-eof: sha224sum exited with status 1 (expected 0)
1417         Now, maybe we'll get a clue, the next time that happens.
1418
1419 2007-02-12  Jim Meyering  <jim@meyering.net>
1420
1421         * .x-sc_useless_cpp_parens: Ignore a false-positive in a shell script.
1422
1423         * tests/misc/pwd-unreadable-parent: Skip the test if we're
1424         definitely using the replacement.
1425         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define CONFIG_HEADER.
1426
1427 2007-02-10  Jim Meyering  <jim@meyering.net>
1428
1429         Remove excess leading spaces that would make help2man misbehave.
1430         * src/printf.c (usage): Remove excess spaces on 2nd line of %b desc.
1431         * src/nl.c (usage): Remove excess spaces on 2nd line of pBRE desc.
1432         * src/dd.c (usage): Remove excess spaces on 2nd line of sync desc.
1433         * src/date.c (usage): Use two spaces after each optional flag, not one.
1434         Reported by Thomas Huriaux in <http://bugs.debian.org/410407>.
1435
1436         * Makefile.maint (longopt_re): Relax the regexp, making square
1437         brackets optional, so it matches the newly reported violations, too.
1438
1439         * src/csplit.c (usage): Use two spaces (not one) to separate
1440         each option string from its description, so help2man formats
1441         the derived man page properly.  Reported by Thomas Huriaux in
1442         <http://bugs.debian.org/410407>.
1443         * src/df.c (usage): Likewise.
1444         * src/du.c (usage): Likewise.
1445         * src/install.c (usage): Likewise.
1446         * src/ls.c (usage): Likewise.
1447
1448 2007-02-03  Jim Meyering  <jim@meyering.net>
1449
1450         Test for today's gnulib/lib/getcwd.c fix affecting pwd and readlink
1451         * NEWS: Mention the bug fix.
1452         * tests/misc/pwd-unreadable-parent: New file.
1453         * tests/misc/Makefile.am (TESTS): Ad pwd-unreadable-parent.
1454
1455 2007-02-02  Paul Eggert  <eggert@cs.ucla.edu>
1456
1457         * NEWS: Document fix for cp --preserve=mode.
1458         * src/copy.c (copy_internal): Omit the group- or other-writeable
1459         permissions when creating a directory, to avoid a race condition
1460         if the special mode bits aren't right just after the directory is
1461         created.
1462         * src/cp.c (make_dir_parents_private): Likewise.
1463         * tests/cp/parent-perm-race: Test for the "cp --preserve=mode"
1464         race fix in copy.c.
1465
1466         * NEWS: Document fix for cp --parents.
1467         * src/cp.c (make_dir_parents_private): Report the error sooner with
1468         "cp --parents DIR/FILE DEST" when DIR is a non-directory, thus not
1469         creating the directory, DEST/DIR.
1470         * tests/cp/cp-parents: Test for the non-race-condition bug fixed
1471         by the above change.
1472
1473 2007-02-02  Jim Meyering  <jim@meyering.net>
1474
1475         * src/nl.c (proc_text): Use "NULL", not "(struct re_registers *) 0".
1476
1477         * src/c99-to-c89.diff: Make shred.c Index: and a/b prefixes
1478         consistent, so this can be applied with patch -p0.
1479         Reported by Matthew Woehlke.
1480
1481         Arrange for "make check-root" to run the new root-only test.
1482         * tests/Makefile.am (t9): New target, to run tests/cp/cp-a-selinux.
1483         (all_t): Add t9.
1484
1485         * Makefile.maint (patch-check): Use patch with its -p2 option,
1486         since that makes this check slightly more strict.
1487
1488         Use a directory on a loopback device mounted with -o context=...
1489         * tests/cp/cp-a-selinux: Since this test now runs mount and umount,
1490         it is a root-only one.
1491
1492 2007-01-29  Jim Meyering  <jim@meyering.net>
1493
1494         Plug a leak in ls.
1495         * src/ls.c (print_dir): Don't leak a "DIR"+fd upon failure to
1496         determine dev/inode or upon detecting a symlink loop.
1497
1498         * src/ls.c: Rename three global variables.
1499         (cwd_file): Rename from 'files'.
1500         (cwd_n_alloc): Rename from 'nfiles'.
1501         (cwd_n_used): Rename from 'files_index'.
1502
1503         Shave 8 bytes off the size of "struct fileinfo".
1504         * src/ls.c (fileinfo): Put all members of type "bool" together.
1505
1506 2007-01-28  Paul Eggert  <eggert@cs.ucla.edu>
1507
1508         Modify "ls" to sort its data faster, using the new gnulib mpsort
1509         module rather than qsort.  This is particularly a win in
1510         environments where strcoll is slow, since mpsort typically calls
1511         strcoll less often than qsort does.
1512         * bootstrap.conf (gnulib_modules): Add mpsort.
1513         * src/ls.c: Include mpsort.h.
1514         (sorted_file, sorted_file_alloc): New vars, for a new vector of
1515         pointers to the file info, for speed.
1516         (clear_files, extract_dirs_from_files, sort_files, print_current_files):
1517         (print_many_per_line, print_horizontal, print_with_commas):
1518         (calculate_columns): Set and use new vector.
1519         (initialize_ordering_vector): New function.
1520
1521 2007-01-26  Paul Eggert  <eggert@cs.ucla.edu>
1522
1523         Adjust to today's change to gnulib, which added a module for
1524         string.h to replace the little include files like strcase.h.
1525         * src/dircolors.c: Don't include strcase.h.
1526         * src/system.h: Don't include mempcpy.h, memrchr.h, stpcpy.h, strpbrk.h.
1527
1528 2007-01-26  Jim Meyering  <jim@meyering.net>
1529
1530         * src/dd.c (advance_input_after_read_error): Change diagnostic to
1531         say "invalid file offset" rather than "screwy file offset".
1532
1533         * .x-sc_cast_of_argument_to_free: Remove this file.
1534         * Makefile.am (EXTRA_DIST): Likewise.
1535
1536 2007-01-25  Dan Hipschman  <dsh@linux.ucla.edu>
1537
1538         * src/sort.c (create_temp): Remove superfluous access-X_OK
1539         check.  find_in_path does this for us.
1540
1541 2007-01-24  Jim Meyering  <jim@meyering.net>
1542
1543         Remove usually-skipped test.
1544         * tests/cp/open-perm-race: Remove this file.  It is subsumed
1545         by parent-perm-race.
1546         * tests/cp/Makefile.am (TESTS): Remove open-perm-race.
1547         * tests/sort/Makefile.am: Regenerate.
1548
1549         Pass "make distcheck" again.
1550         * src/sort.c (usage): Split a diagnostic that had grown to be
1551         longer than the C89 maximum of 509 bytes.
1552         * .x-sc_cast_of_argument_to_free: New file.  Allow a cast in sort.c.
1553         FIXME: this is just temporary, while we wait to remove the offending
1554         access-calling code.
1555         * Makefile.am (EXTRA_DIST): Add .x-sc_cast_of_argument_to_free.
1556         * Makefile.maint (sc_cast_of_argument_to_free): Use the
1557         canonical, $$($(CVS_LIST_EXCEPT)).
1558         * m4/.gitignore, m4/.cvsignore, lib/.gitignore, lib/.cvsignore: Update.
1559
1560 2007-01-24  Paul Eggert  <eggert@cs.ucla.edu>
1561
1562         * NEWS: New option sort -C, proposed by XCU ERN 127, which looks
1563         like it will be approved.  Also add --check=quiet, --check=silent
1564         as long aliases, and --check=diagnose-first as an alias for -c.
1565         * doc/coreutils.texi (sort invocation): Document this.
1566         Also, mention that sort -c can take at most one file.
1567         * src/sort.c: Implement this.
1568         Include argmatch.h.
1569         (usage): Document the change.
1570         (CHECK_OPTION): New constant.
1571         (long_options): --check now takes an optional argument, and is now
1572         treated differently from 'c'.
1573         (check_args, check_types): New constant arrays.
1574         (check): New arg CHECKONLY, which suppresses diagnostic if -C.
1575         (main): Parse the new options.
1576         * tests/sort/Test.pm (02d, 02d, incompat5, incompat6):
1577         New tests for -C.
1578
1579 2007-01-24  Jim Meyering  <jim@meyering.net>
1580
1581         Fix a typo.
1582         * tests/misc/sort-compress: Use $abs_top_builddir, not $top_builddir.
1583         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Likewise.
1584
1585         Don't depend on "which".
1586         * tests/misc/sort-compress (SORT): Use $abs_builddir, now which.
1587         * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Export top_builddir.
1588
1589 2007-01-24  Dan Hipschman  <dsh@linux.ucla.edu>
1590
1591         Test sort compression.
1592         * tests/misc/Makefile.am: Add the test.
1593         * tests/misc/sort-compress: New file containing the tests.
1594
1595 2007-01-24  Jim Meyering  <jim@meyering.net>
1596
1597         * NEWS: sort temp file compression: tweak wording.
1598         * src/sort.c (struct sortfile) [name]: Declare member to be const.
1599
1600 2007-01-21  Jim Meyering  <jim@meyering.net>
1601
1602         * src/sort.c (MAX_FORK_RETRIES_COMPRESS, MAX_FORK_RETRIES_DECOMPRESS):
1603         In pipe_fork callers, use these named constants, not "2" and "8".
1604         (proctab, nprocs): Declare to be "static".
1605         (pipe_fork) [lint]: Initialize local, pid,
1606         to avoid unwarranted may-be-used-uninitialized warning.
1607         (create_temp): Use the active voice.  Describe parameters, too.
1608
1609 2007-01-21  James Youngman  <jay@gnu.org>
1610
1611         Centralize all the uses of sigprocmask().  Don't restore an invalid
1612         saved mask.
1613         * src/sort.c (enter_cs, leave_cs): New functions for protecting
1614         code sequences against signal delivery.
1615         * (exit_cleanup): Use enter_cs and leave_cs instead of
1616         calling sigprocmask directly.
1617         (create_temp_file, pipe_fork, zaptemp): Likewise
1618
1619 2007-01-21  Dan Hipschman  <dsh@linux.ucla.edu>
1620
1621         Add compression of temp files to sort.
1622         * NEWS: Mention this.
1623         * bootstrap.conf: Import findprog.
1624         * configure.ac: Add AC_FUNC_FORK.
1625         * doc/coreutils.texi: Document GNUSORT_COMPRESSOR environment
1626         variable.
1627         * src/sort.c (compress_program): New global, holds the name of the
1628         external compression program.
1629         (struct sortfile): New type used by mergepfs and friends instead
1630         of filenames to hold PIDs of compressor processes.
1631         (proctab): New global, holds compressor PIDs on which to wait.
1632         (enum procstate, struct procnode): New types used by proctab.
1633         (proctab_hasher, proctab_comparator): New functions for proctab.
1634         (nprocs): New global, number of forked but unreaped children.
1635         (reap, reap_some): New function, wait for/cleanup forked processes.
1636         (register_proc, update_proc, wait_proc): New functions for adding,
1637         modifying and removing proctab entries.
1638         (create_temp_file): Change parameter type to pointer to file
1639         descriptor, and return type to pointer to struct tempnode.
1640         (dup2_or_die): New function used in create_temp and open_temp.
1641         (pipe_fork): New function, creates a pipe and child process.
1642         (create_temp): Creates a temp file and possibly a compression
1643         program to which we filter output.
1644         (open_temp): Opens a compressed temp file and creates a
1645         decompression process through which to filter the input.
1646         (mergefps): Change FILES parameter type to struct sortfile array
1647         and update access accordingly.  Use open_temp and reap_some.
1648         (avoid_trashing_input, merge): Change FILES parameter like
1649         mergefps and call create_temp instead of create_temp_file.
1650         (sort): Call create_temp instead of create_temp_file.
1651         Use reap_some.
1652         (avoid_trashing_input, merge, sort, main): Adapt to mergefps.
1653
1654         The idea of compressing sorts temporary files was first
1655         suggested/implemented by Jay Soffian in 1998, and again
1656         by Charles Randall in 2001.
1657
1658 2007-01-20  Jim Meyering  <jim@meyering.net>
1659
1660         * tests/misc/pwd-long: Work properly even when run from the
1661         wrong one of two or more bind-mounted sibling directories.
1662         Suggestion from Mike Stone in <http://bugs.debian.org/380552>.
1663
1664 2007-01-20  Paul Eggert  <eggert@cs.ucla.edu>
1665
1666         Standardize on list of signals when an app catches signals.
1667         * src/csplit.c (main): Also catch SIGALRM, SIGPIPE, SIGPOLL,
1668         SIGPROF, SIGVTALRM, SIGXCPU, SIGXFSZ.
1669         * src/ls.c (main): Likewise (except SIGPIPE was already caught).
1670         Note that ls.c is special, as it also catches SIGTSTP.
1671         * src/sort.c (main): Likewise.  Also catch SIGQUIT.  More details in
1672         <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9510>.
1673
1674 2007-01-19  Dan Hipschman  <dsh@linux.ucla.edu>
1675         and Paul Eggert  <eggert@cs.ucla.edu>
1676
1677         * src/sort.c (cleanup): Clear temphead at the end.
1678         (exit_cleanup): New function.
1679         (main): Don't invoke atexit until we're ready.
1680         Invoke it with exit_cleanup, not with cleanup and close_stdout,
1681         to avoid a race condition with cleanup and signal handling.  More
1682         details: http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9508
1683
1684 2007-01-18  Jim Meyering  <jim@meyering.net>
1685
1686         * src/c99-to-c89.diff: Adjust remove.c offsets.
1687
1688 2007-01-17  Jim Meyering  <jim@meyering.net>
1689
1690         Make "rm --interactive=never ..." never prompt.
1691         * NEWS: Mention this.
1692         * src/remove.h (enum rm_interactive): New ternary type.
1693         (struct rm_options) [interactive]: Use it, here -- rather than bool.
1694         * src/remove.c (prompt): Reflect type change.
1695         * src/mv.c (rm_option_init): Initialize to RMI_NEVER now.
1696         * src/rm.c (main): Add a FIXME comment for '-d' option.
1697         Adapt to type change of rm_options.interactive.
1698
1699         * tests/rm/i-never: New file.  Test for the above fix.
1700         * tests/rm/Makefile.am (TESTS): Add i-never.
1701
1702 2007-01-15  Jim Meyering  <jim@meyering.net>
1703
1704         * bootstrap (gnulib_tool): When adding to .cvsignore and .gitignore,
1705         emit foo.h, for each foo_.h.  This yields one false-positive, fts.h,
1706         but that's ok, since fts_.h will eventually be renamed.
1707
1708         * src/remove.c (remove_dir): Don't use errno in diagnostic.
1709         Root-only test failure reported by Alex van Hout and Jon Grosshart in
1710         <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/9415/focus=9415>.
1711
1712         * bootstrap.conf (avoided_gnulib_modules): Fix my typo:
1713         s/--avoid=canonicalize-lgpl/--avoid=canonicalize-gpl/
1714
1715 2007-01-14  Bruno Haible  <bruno@clisp.org>
1716
1717         Enable use of gnulib's new fchdir module.
1718         * bootstrap.conf (avoided_gnulib_modules): Avoid canonicalize-lgpl,
1719         since we use canonicalize.
1720         (gnulib_modules): Add fchdir.
1721         * m4/jm-macros.m4 (coreutils_MACROS): Remove fchdir-stub.
1722
1723 2007-01-13  Jim Meyering  <jim@meyering.net>
1724
1725         * tests/cp/open-perm-race: Remove gdb-based test.
1726         It would run only when compiled with -g, and besides is now
1727         subsumed by file-perm-race.
1728         * tests/cp/Makefile.am (TESTS): Remove open-perm-race.
1729
1730         * Transform all Makefile.am files so that when running "make check",
1731         CU_TEST_NAME is set to the name of the test.  This is so that when I
1732         run valgrind-enabled (--log-file-qualifier=CU_TEST_NAME) "make check"
1733         on the entire package it is more convenient to map a leak or error
1734         found in a valgrind log file back to the offending test.
1735         Use this command:
1736         (echo tests/Makefile.am.in; find tests -name Makefile.am) \
1737          |xargs perl -pi -e '/^(\s*)PATH=...VG_PATH_PREFIX/ and ' \
1738            -e 'print $1,q|CU_TEST_NAME=`basename $(abs_srcdir)`,$$tst |,"\\\n"'
1739
1740 2007-01-11  Jim Meyering  <jim@meyering.net>
1741
1742         Avoid a leak in expr's implementation of the ":" (match) operator.
1743         * src/expr.c (docolon): Free the regexp buffer using regfree, rather
1744         than doing it manually, being careful to set fastmap to NULL first.
1745         Free any re_regs.start and .end members, if necessary.
1746
1747         * tests/misc/test-diag: Work also when libc's error function
1748         reports the entire program name ("../../src/test"), rather than
1749         just the final component.
1750
1751 2007-01-10  Jim Meyering  <jim@meyering.net>
1752
1753         Don't use fts_statp uninitialized for "chown -RLh --preserve-root ...".
1754         * src/chown-core.c (FTSENT_IS_DIRECTORY): New macro.
1755         (change_file_owner): Perform the ROOT_DEV_INO_CHECK only for a
1756         directory.  Non-directory entries lack fts_statp data when using
1757         the FTS_NOSTAT option.
1758
1759 2007-01-07  Jim Meyering  <jim@meyering.net>
1760
1761         * tests/sample-test: Update copyright date to 2007.
1762         * Makefile.maint (copyright-check): Also check the copyright date
1763         in tests/sample-test.
1764
1765 2007-01-06  Jim Meyering  <jim@meyering.net>
1766
1767         * tests/fmt/basic (pfx-only, pfx-of-pfx): New tests,
1768         based on examples from G.P. Halkes in
1769         <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/9388>.
1770
1771 2007-01-06  G.P. Halkes  <buscom@ghalkes.nl>
1772
1773         * src/fmt.c (copy_rest): Correct prefix handling.
1774         Don't elide a line with the prefix followed by only white space.
1775         (get_line): Move EOF-check to loop-termination condition.
1776         * tests/fmt/basic (pfx-1): Adjust test to expect desired result.
1777         (pfx-2): Remove test; its premise was contrary to the documentation.
1778
1779 2007-01-05  Jim Meyering  <jim@meyering.net>
1780
1781         Avoid a used-uninitialized bug for invalid input, i.e., when the size
1782         of the input, not counting newlines, is 1 % 4.
1783         * gl/lib/base64.c (base64_decode): Don't hard-code inlen==4.
1784         It may be smaller when flushing.
1785
1786 2007-01-05  Mike Frysinger  <vapier@gentoo.org>
1787
1788         * src/dircolors.hin: Add a TERM directive for cons25.
1789
1790 2007-01-04  Jim Meyering  <jim@meyering.net>
1791
1792         * Makefile.cfg (local-checks-to-skip): Skip strftime-check, in
1793         case you don't have convenient access to glibc info documentation.
1794
1795         Use the release year, not the current year.
1796         * src/groups.sh (version): Use a better name: @RELEASE_YEAR@.
1797         * src/Makefile.am (RELEASE_YEAR): Define it.
1798         (.sh): Use it.
1799         Thanks to a prod from Eric Blake.
1800
1801         Ensure that "group --version" always prints the current year.
1802         * src/groups.sh (version): Use @CURRENT_YEAR@, rather than 2006.
1803         * src/Makefile.am (.sh): Also substitute for @CURRENT_YEAR@.
1804         Suggestion from Eric Blake.
1805
1806         When decoding, always allow newlines in input, with almost no
1807         performance impact.
1808         * src/base64.c (do_decode): Initialize decode context.
1809         Call base64_decode one more time, after all input is processed.
1810         (usage): When decoding, newlines are always accepted.
1811
1812         * tests/misc/base64: Add a bunch of tests, for the above.
1813         * gl/lib/base64.c: Include <string.h>.
1814         (base64_decode_ctx_init, get_4, decode_4): New functions.
1815         (base64_decode): Efficiently handle interspersed newlines.
1816         (base64_decode_alloc): Update signature.
1817         * gl/lib/base64.h (struct base64_decode_context): Define.
1818         (base64_decode_ctx_init): Add prototype.
1819         (base64_decode, base64_decode_alloc): Update prototypes.
1820
1821         * gl/lib/base64.c: Copied from gnulib.
1822         * gl/lib/base64.h: Likewise.
1823
1824 2007-01-03  Jim Meyering  <jim@meyering.net>
1825
1826         * THANKS: Add Evan Hunt.
1827
1828 2007-01-03  Bruno Haible  <bruno@clisp.org>
1829
1830         Avoid spurious test failures on MacOS X 10.3.9, in a German locale.
1831         * tests/chown/deref: Apply lang-default.
1832         * tests/misc/split-a: Likewise.
1833         * tests/mv/reply-no: Likewise.
1834
1835         * src/copy.c (copy_internal): Use mkfifo as a fallback if mknod fails.
1836         Needed on MacOS X.
1837
1838 2007-01-02  Paul Eggert  <eggert@cs.ucla.edu>
1839
1840         Now, "ls -FRL" always follows symbolic links on Linux.
1841         * NEWS: Mention this bug fix.
1842         * src/ls.c (gobble_file): Fix bug reported by
1843         Nobuyuki Tsuchimura in
1844         http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00152.html
1845         where "ls -FRL" didn't follow a symbolic link in some cases on Linux.
1846         * tests/ls/follow-slink: Add a test for this case.
1847
1848 2007-01-01  Jim Meyering  <jim@meyering.net>
1849
1850         * tests/rm/fail-eperm: Revert last change.  The PATH=... setting
1851         is not honored at least on HP-UX 11.23 systems.
1852         Instead, simply transform the actual output diagnostic.
1853         Test failure reported by Bob Proulx.
1854
1855 2006-12-30  Jim Meyering  <jim@meyering.net>
1856
1857         * bootstrap (gnulib_extra_files): Remove announce-gen.
1858         * bootstrap.conf (gnulib_modules): Add it here instead, now that
1859         it's a module.
1860
1861         * tests/misc/base64: Factor a long, repetitive string.
1862
1863         * src/c99-to-c89.diff: Adjust remove.c offsets.
1864
1865         Clean up after the change of 2006-12-28.
1866         * src/remove.c (AD_pop_and_chdir): Change **DIRP parameter to *DIRP,
1867         now that this function never modifies the pointer.  Adjust comments
1868         and code accordingly.
1869         (remove_dir): Set "dirp" to NULL right after AD_pop_and_chdir call,
1870         now that AD_pop_and_chdir no longer does that.
1871
1872         * tests/rm/fail-eperm: Avoid spurious differences (the error function
1873         from latest glibc no longer prints the full program_name): so don't
1874         invoke rm via ../../src/rm.  Instead, invoke it via "PATH=../../src rm".
1875
1876         * tests/mv/acl (skip): Skip this test also if the destination
1877         directory, which is on a different file system, lacks ACL support.
1878
1879         * src/copy.c (copy_reg): Rewrite a comment that was rendered
1880         inaccurate by the 2006-10-18 change.
1881
1882 2006-12-28  Jim Meyering  <jim@meyering.net>
1883
1884         When moving "up" the hierarchy, be careful to remove a just-emptied
1885         directory before opening ".", to avoid trouble with file system
1886         implementations that cache readdir results at opendir-time.
1887         * src/remove.c (AD_pop_and_chdir): Add a file descriptor parameter.
1888         Don't update **DIRP.  Don't call fdopendir here.
1889         (remove_dir): Call fdopendir here instead.
1890         Report and patch from Mikulas Patocka:
1891         <http://lists.gnu.org/archive/html/bug-coreutils/2006-12/msg00170.html>
1892
1893 2006-12-27  Jim Meyering  <jim@meyering.net>
1894
1895         * src/tail.c (usage): Mention +N for --bytes and --lines.
1896         Suggestion from Evan Hunt.
1897
1898 2006-12-26  Jim Meyering  <jim@meyering.net>
1899
1900         * configure.ac: Require autoconf-2.61 and automake-1.10.
1901         Without the former (even with autoconf-2.60), "make distcheck"
1902         would fail (without the 2006-09-26 autoconf AC_CHECK_DECL fix),
1903         due to an inttypes.h generated with CFLAGS including -pedantic.
1904         With the old decl check, @HAVE_DECL_STRTOUMAX@ would be 0.
1905
1906         * Makefile.maint (VC-tag): Define, so as to gpg-sign each release
1907         tag, using the release version number as the message.
1908         (vc-dist): Use $(VC-tag), rather than "$(VC) tag".
1909
1910 2006-12-21  Paul Eggert  <eggert@cs.ucla.edu>
1911
1912         * NEWS: dd bs= operands now silently override later ibs= and obs=,
1913         as POSIX requires.
1914         * src/dd.c (scanargs): Implement it.
1915         * tests/dd/misc (outbytes): Test it.
1916         * doc/coreutils.texi (dd invocation): Specify that bs=N
1917         overrides later ibs and obs, undoing part of the
1918         previous change.  (The behavior was wrong.)
1919
1920 2006-12-20  Jim Meyering  <jim@meyering.net>
1921
1922         "rm -rf /etc/motd" (run by non-root) now prints a diagnostic.
1923         * src/remove.c (remove_entry): Handle EACCES for a non-directory, too.
1924         Don't let a non-directory get by with errno == EPERM, either.
1925         Check the file type directly (using cached stat value), rather
1926         than trying to guess it from errno values.
1927         Karl Berry reported that a cross-partition "mv /etc/issue ~"
1928         failed with the um,... suboptimal diagnostic,
1929         "mv: cannot remove `/etc/issue': Not a directory".
1930         * tests/rm/Makefile.am (TESTS): Add fail-eacces.
1931         * tests/rm/fail-eacces: New file.
1932         * NEWS: Mention that both mv and rm are affected.
1933
1934         "cut -f 2- A B" no longer triggers a double-free bug
1935         * src/cut.c (cut_fields): Set file-scoped global to NULL after
1936         freeing it.  This avoids a double-free (and core dump on some systems)
1937         for this usage: "echo 1>a; echo 2>b; cut -f2- a b".  Reported by
1938         James Hunt in <http://bugzilla.redhat.com/220312>.
1939         * NEWS: List this bug fix.
1940         * THANKS: Mention him.
1941         * tests/misc/cut: New file.
1942         * tests/misc/Makefile.am (TESTS): Add cut.
1943
1944 2006-12-15  Jim Meyering  <jim@meyering.net>
1945
1946         * tests/cp/open-perm-race: Correct the gdb-existence check.
1947         Don't run either subsequent gdb command in a sub-shell.
1948         Reported by Thomas Schwinge.
1949         * THANKS: bring up to date.
1950
1951 2006-12-14  Paul Eggert  <eggert@cs.ucla.edu>
1952
1953         Make sure cp -p isn't too generous with file permissions.
1954         * tests/cp/Makefile.am (TESTS): Add file-perm-race.
1955         * tests/cp/file-perm-race: New file.
1956
1957         Ensure cp -pR --parents isn't too generous with parent permissions.
1958         * tests/cp/Makefile.am (TESTS): Add parent-perm-race.
1959         * tests/cp/parent-perm-race: New file.
1960
1961 2006-12-14  Jim Meyering  <jim@meyering.net>
1962
1963         * tests/chgrp/default-no-deref: Don't assume that files are created
1964         with the primary group by default.  That's not true in a directory
1965         with the set-GID bit set.
1966
1967         Don't hang when there's no input tty.
1968         * tests/cp/open-perm-race: Skip this test if there is no
1969         controlling input `terminal'.
1970
1971         Test for a hard-to-detect race fix, using gdb.
1972         * tests/cp/open-perm-race: New file, to test for the
1973         cp --preserve=ownership fix of 2006-12-06.
1974
1975         * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Define abs_top_builddir.
1976         (TESTS): Add open-perm-race.
1977
1978         * src/chgrp.c (main): Don't prohibit -RLh, aka -RL with --no-dereference.
1979         * src/chown.c (main): Likewise.
1980         * src/chown-core.c (change_file_owner): Add to a comment.
1981         * tests/chown/preserve-root: Add tests.
1982
1983         * NEWS: --preserve-root now works with chgrp, chmod, and chown.
1984         * src/chmod.c (process_file): Do honor the --preserve-root option.
1985         * src/chown-core.c (change_file_owner): Likewise, but here, also
1986         handle the case in which a traversal would go "through" a symlink
1987         to root.  Reported by Matthew M. Boedicker
1988         * tests/chown/preserve-root: Test for the above.
1989         * tests/chown/Makefile.am (TESTS): Add preserve-root.
1990
1991         * NEWS: Mention the chmod fix induced by the 2006-12-11 change
1992         to gnulib's m4/openat.m4.
1993
1994 2006-12-13  Andreas Schwab  <schwab@suse.de>
1995
1996         Don't fail if mv/acl test succeeds.
1997         * tests/mv/acl (skip): Check for acl support in the file system.
1998         * tests/mv/Makefile.am (XFAIL_TESTS): Remove.
1999         (TESTS_ENVIRONMENT): Pass CONFIG_HEADER.
2000
2001 2006-12-13  Paul Eggert  <eggert@cs.ucla.edu>
2002
2003         Remove some arbitrary restrictions on size fields, so that
2004         commands like "sort -k 18446744073709551616" no longer fail merely
2005         because 18446744073709551616 doesn't fit in uintmax_t.  The trick
2006         is that these fields can all be treated as effectively infinity;
2007         their exact values don't matter, since no internal buffer can be
2008         that long.
2009         * src/join.c (string_to_join_field): Verify that SIZE_MAX <=
2010         ULONG_MAX if the code assumes this.  Silently truncate too-large
2011         values to SIZE_MAX, as the remaining code will do the right thing
2012         in this case.
2013         * src/sort.c (parse_field_count): Likewise.
2014         * src/uniq.c (size_opt, main): Likewise.
2015         * tests/join/Test.pm (bigfield): New test.
2016         * tests/sort/Test.pm (bigfield): New test.
2017         * tests/uniq/Test.pm (121): New test.
2018
2019 2006-12-13  Jim Meyering  <jim@meyering.net>
2020
2021         * tests/chgrp/default-no-deref: New test.
2022         * tests/chgrp/Makefile.am (TESTS): Add default-no-deref.
2023
2024 2006-12-12  Jim Meyering  <jim@meyering.net>
2025
2026         * src/system.h (SETVBUF): Remove definition, now that the
2027         autoconf macro, AC_FUNC_SETVBUF_REVERSED, does nothing.
2028         * src/tee.c (tee_files): s/SETVBUF/setvbuf/.
2029         * src/od.c (open_next_file): Likewise.
2030
2031 2006-12-09  Jim Meyering  <jim@meyering.net>
2032
2033         * man/Makefile.am (.x.1): Make help2man use $(PACKAGE_STRING) as the
2034         "source".  I.e. "GNU coreutils 6.7".
2035
2036         * NEWS: With the change from "-pre" to "-dirty" suffix, also change
2037         from NEXT_VER-pre to CUR_VER-dirty.  So, this is 6.7-dirty.
2038         * configure.ac (AC_INIT): s/6.8-dirty/6.7-dirty/.
2039
2040         * tests/uniq/Test.pm (test_vector): Skip the pipe-reading test
2041         whenever uniq is expected to fail.  This should catch the other case
2042         [test #112] in which uniq emits "cat: write error: Broken pipe" on
2043         some systems.
2044
2045 2006-12-08  Jim Meyering  <jim@meyering.net>
2046
2047         Include bootstrap tool version info in the announcement form.
2048         * Makefile.maint (gnulib_snapshot_date): Define.
2049         (announcement): Use two new announce-gen options,
2050         --bootstrap-tools and --gnulib-snapshot-date.
2051         * Makefile.cfg (gnulib_dir): Set.
2052
2053         Post-release version change.
2054         * NEWS: Add a line for 6.8-dirty.
2055         * configure.ac (AC_INIT): Set new version string.
2056
2057 2006-12-07  Jim Meyering  jim@meyering.net
2058
2059         Version 6.7.
2060         * NEWS: Record release date.  Remove '-pre' suffix.
2061         * configure.ac (AC_INIT): Remove version string suffix.
2062
2063 2006-12-07  Jim Meyering  <jim@meyering.net>
2064
2065         Make the output of "make check" more reproducible.
2066         * tests/touch/empty-file: Use envvar-check, so "make check" doesn't
2067         evoke diagnostics like this when COLUMNS=0 in the environment:
2068         ls: ignoring invalid width in environment variable COLUMNS: 0
2069         * tests/touch/no-rights: Likewise.
2070         * tests/help-version: Likewise.
2071         * tests/uniq/Test.pm: Don't perform the pipe-reading version of test
2072         118, since it emits "cat: write error: Broken pipe" on some systems.
2073
2074 2006-12-06  Paul Eggert  <eggert@cs.ucla.edu>
2075
2076         * NEWS: Document the cp -p fix for special bits.
2077         * src/copy.c (set_owner): Now returns a three-way result, so
2078         that the caller can clear the special bits.  All callers changed.
2079         (copy_reg): Don't set the special bits if chown failed.
2080         (copy_internal): Likewise.
2081         * tests/cp/special-bits: Test this fix.
2082
2083 2006-12-06  Paul Eggert  <eggert@cs.ucla.edu>
2084
2085         * NEWS: Document the cp --preserve=ownership fix.
2086         * m4/jm-macros.m4 (coreutils_MACROS): Check for fchmod.
2087         * src/copy.c (fchmod_or_lchmod): New function.
2088         (copy_reg): New arg OMITTED_PERMISSIONS.  All uses changed.
2089         Omit confusing and unused ", dst_mode" arg to 'open' without O_CREAT.
2090         When creating a file, use O_EXCL, so we're more likely to detect
2091         funny business by other processes.  At the end, if permissions
2092         were omitted, chmod them back in.
2093         (copy_internal): If the ownership might change, omit some permissions
2094         at first, then restore them after chowning the file.
2095         * src/cp.c (make_dir_parents_private): Likewise.
2096         * src/copy.c (cached_umask): New function.
2097         * src/copy.h (cached_umask): New decl.
2098
2099 2006-12-06  Jim Meyering  <jim@meyering.net>
2100
2101         Make the output of "make check" more reproducible.
2102         * tests/misc/date-sec: Don't emit any diagnostic about sleeping.
2103
2104 2006-12-03  Paul Eggert  <eggert@cs.ucla.edu>
2105
2106         * src/install.c (install_file_in_file): Preserve time stamps
2107         before changing owner or file mode bits, for consistency with
2108         other coreutils programs.
2109
2110 2006-12-03  Jim Meyering  <jim@meyering.net>
2111
2112         * tests/misc/date-sec: Output a fixed string.
2113
2114         * NEWS: du --one-file-system (-x) would skip subdirectories of any
2115         directory listed as second or subsequent command line argument.
2116         * tests/du/one-file-system: New file.  Test for today's fts.c fix.
2117         * tests/du/Makefile.am (TESTS): Add one-file-system.
2118         Reported by Mike Frysinger.
2119
2120 2006-12-02  Jim Meyering  <jim@meyering.net>
2121
2122         * tests/du/basic: Generate 4KB file simply using printf, rather than
2123         seq+head.  This avoids a spurious "Broken pipe" diagnostic from seq.
2124
2125 2006-11-28  Jim Meyering  <jim@meyering.net>
2126
2127         * tests/mv/no-target-dir: Detect a buggy rename syscall.  If found,
2128         skip this test.  This happens at least on ia64 linux-2.4.19 w/ext3.
2129         Reported by Matthew Woehlke.
2130
2131         * tests/mv/dir2dir: Also accept EBUSY.
2132         Reported by Matthew Woehlke.
2133
2134 2006-11-27  Jim Meyering  <jim@meyering.net>
2135
2136         * Makefile.maint (patch-check): Rewrite to diagnose failure.
2137         * src/c99-to-c89.diff: Adjust shred.c offsets.
2138
2139 2006-11-26  Paul Eggert  <eggert@cs.ucla.edu>
2140
2141         Improve the check for departures from C89, and fix the departures
2142         I found.
2143         * Makefile.maint (my-distcheck): Also check for C89 compatibility
2144         as best we can with GCC.
2145         * src/stat.c (PRINTF_OPTION): Omit comma before } in enum
2146         declaration; C89 doesn't allow this.
2147         * src/dcgen: Don't generate string literals longer than
2148         what C89 requires support for.
2149         * src/cut.c (usage): Don't use string literals longer than
2150         what C89 requires support for.
2151         * src/date.c (usage): Likewise.
2152         * src/dd.c (usage): Likewise.
2153         * src/du.c (usage): Likewise.
2154         * src/ls.c (usage): Likewise.
2155         * src/od.c (usage): Likewise.
2156         * src/readlink.c (usage): Likewise.
2157         * src/seq.c (usage): Likewise.
2158         * src/shred.c (usage): Likewise.
2159
2160 2006-11-26  Mike Frysinger  <vapier@gentoo.org>
2161
2162         Recognize new archive, audio and image formats.
2163         Give audio files a separate color.
2164         * src/dircolors.hin: Add comments for common .sh and .csh scripts.
2165         Add .bz2, .tbz2, .tz, .rar, .ace, .zoo, .cpio, .7z, .rz as archive
2166         suffixes.  Add .mng, .pcx, .m2v, .mkv, .ogm, .mp4, .m4v, .mp4v, .vob,
2167         .qt, .nuv, .wmv, .asf, .rm, .rmvb, .flc, .yuv as image formats.
2168         Add .aac, .au, .mid, .midi, .mka, .ra as audio suffixes.  Change
2169         audio color to 00;36 to differentiate from image/video color.
2170
2171 2006-11-26  Jim Meyering  <jim@meyering.net>
2172
2173         * Makefile.maint (patch-check): Compile patched sources with
2174         CFLAGS='-Wdeclaration-after-statement -Werror', to ensure that
2175         no violations remain.
2176
2177         * src/c99-to-c89.diff: Remove 3 bogus hunks.
2178
2179         * src/remove.c (fd_to_subdirp): Remove unused parameter, ds.
2180         Update callers.
2181
2182         * src/c99-to-c89.diff: Adjust for changes in rm.c and in remove.c.
2183
2184         * src/rm.c (main): Remove unnecessary (assuming C99) braces.
2185
2186 2006-11-26  Paul Eggert  <eggert@cs.ucla.edu>
2187
2188         Port parts of the code to C89 to minimize the need for c99-to-c89.diff,
2189         while trying to retain the readability of C99 as much as possible.
2190         * src/remove.c (rm_1): Remove decl of local, fd_cwd.
2191         Replace each of two uses with literal AT_FDCWD.
2192         (cache_stat_init): Return its argument, for convenience.
2193         Update the caller in remove_dir.
2194         (AD_pop_and_chdir): Return prev_dir rather than storing through
2195         a pointer argument.  All uses changed.
2196         (AD_ensure_initialized): New function.
2197         (AD_mark_helper): Use it, to avoid the need for declaration
2198         after statement.
2199         (rm): Move cycle_check_init call into callee...
2200         (rm_1): ...here.
2201         Use an else clause in place of a "continue" statement.
2202         (close_preserve_errno): Remove.
2203         (fd_to_subdirp): Rewrite to avoid the need for decl after statement.
2204
2205 2006-11-25  Jim Meyering  <jim@meyering.net>
2206
2207         * Makefile.am (EXTRA_DIST): Remove announce-gen from here, too.
2208
2209 2006-11-24  Theodoros V. Kalamatianos  <thkala@softlab.ece.ntua.gr> (tiny change)
2210
2211         * tests/du/inacc-dest: Skip this test when running as root.
2212
2213 2006-11-23  Jim Meyering  <jim@meyering.net>
2214
2215         * announce-gen: Remove file.  It's moving to gnulib.
2216         * bootstrap: Pull it from gnulib/build-aux instead.
2217         * Makefile.maint (announcement): Reflect move to ./build-aux.
2218
2219         * tests/du/deref-args: Use "printf %65536s x" to create a 64KB file,
2220         rather than a pipeline that would sometimes evoke a diagnostic
2221         like "seq: write error: Broken pipe".
2222
2223         * tests/help-version: Suppress dd transfer rate output.
2224
2225         * configure.ac (AC_INIT): Bump to 6.7-pre, not 6.6-pre.
2226
2227 2006-11-22  Jim Meyering  <jim@meyering.net>
2228
2229         * announce-gen (print_news_deltas): Fix silly, but harmless typo:
2230         change "(:?..." to "(?:..." in regexps.
2231
2232         Post-release version change.
2233         * NEWS: Add a line for 6.7-pre.
2234         * configure.ac (AC_INIT): Bump to 6.7 and add "-pre" suffix.
2235
2236         Version 6.6.
2237         * NEWS: Record release date.  Remove "-pre" suffix.
2238         * configure.ac (AC_INIT): Remove "-pre" suffix from version string.
2239
2240         * announce-gen: Remove unused --release-archive-directory option.
2241         (print_news_deltas): Accept new adjective, "Noteworthy", in addition
2242         to the old "Major".
2243         Match version numbers in NEWS using tighter regular expressions.
2244         (main): Require the --gpg-key-id=ID option.
2245         * Makefile.maint (announcement): Don't use now-removed
2246         --release-archive-directory=... option.
2247
2248         * NEWS: Mention the three noteworthy changes, all fixed via gnulib.
2249
2250 2006-11-21  Jim Meyering  <jim@meyering.net>
2251
2252         * tests/rm/one-file-system: Upon setup failure (e.g., mount failure),
2253         skip the test rather than failing.  Reported by Michael Deutschmann.
2254
2255         * tests/rm/fail-eperm: Use the "(exit N); exit N" idiom,
2256         rather than just "exit N".
2257
2258         Arrange for "make check-root" to run the new root-only test.
2259         * tests/Makefile.am (t7): New target, to run tests/ls/nameless-uid.
2260         (all_t): Add t7.
2261
2262 2006-11-20  Jim Meyering  <jim@meyering.net>
2263
2264         Add a root-only test for today's lib/idcache.c fix.
2265         * tests/ls/nameless-uid: New file.
2266         * tests/ls/Makefile.am (TESTS): Add nameless-uid.
2267         (TESTS_ENVIRONMENT): Add PERL to the list.
2268
2269 2006-11-19  Jim Meyering  <jim@meyering.net>
2270
2271         * tests/tail-2/assert-2: Mark as a very-expensive test, because I
2272         find the 7-second sleep annoyingly long.  Besides, this test is
2273         probably far too specific and timing sensitive ever to trigger again.
2274         * tests/tail-2/assert: Likewise.
2275
2276         Post-release version change.
2277         * NEWS: Add a line for 6.6-pre.
2278         * configure.ac (AC_INIT): Bump to 6.6 and add "-pre" suffix.
2279
2280         Version 6.5.
2281         * NEWS: Record release date.  Remove "-cvs" suffix.
2282         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
2283
2284 2006-11-18  Jim Meyering  <jim@meyering.net>
2285
2286         "ln --backup f f" produces a misleading diagnostic:
2287         ln: creating hard link `f' => `f': No such file or directory
2288         * src/ln.c (do_link): Give a better diagnostic in this unusual case.
2289         (do_link): Rename local: s/lstat_ok/dest_lstat_ok/.
2290         * tests/ln/Makefile.am (TESTS): Add hard-backup.
2291         * tests/ln/hard-backup: New test for the above.
2292         * NEWS: Mention this fix.
2293
2294 2006-11-16  Paul Eggert  <eggert@cs.ucla.edu>
2295
2296         * bootstrap.conf (gnulib_modules): Add sys_stat, since we use it
2297         directly too.
2298         * lib/.cvsignore, lib/.gitignore: Add root-dev-ino.c, root-dev-ino.h.
2299         * m4/.cvsignore, m4/.gitignore: Add root-dev-ino.m4.
2300         * src/ls.c (DIRED_FPUTS_LITERAL, PUSH_CURRENT_DIRED_POS):
2301         Omit unnecessary parenthesization of args.
2302         * src/od.c (EQUAL_BLOCKS): Likewise.
2303         * src/system.h (STREQ, ASSIGN_STRDUPA): Likewise.
2304
2305 2006-11-16  Jim Meyering  <jim@meyering.net>
2306
2307         * tests/tail-2/append-only: If chattr +a fails, exit 77 (to tell
2308         automake we're skipping this test), and give a diagnostic to tell
2309         the user the same thing.  Reported by Mike Grayson.
2310
2311 2006-11-16  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2312
2313         * man/Makefile.am (dist_man_MANS): Replace all optional manpages
2314         with `$(MAN)', computed at configure time; also, list them ...
2315         (optional_mans): ... in this new variable.
2316         (max_aux, EXTRA_DIST): Ensure that we distribute all manpages.
2317
2318 2006-11-16  Jim Meyering  <jim@meyering.net>
2319
2320         Help valgrind see that there is no leak in dd.c.
2321         * src/dd.c (dd_copy): Declare real_buf and real_obuf to be static,
2322         so we need not free them at all.  This is easier than freeing
2323         both buffers at each of the early "return"s.
2324
2325         * src/csplit.c (load_buffer): Plug an inconsequential leak.
2326
2327 2006-11-15  Jim Meyering  <jim@meyering.net>
2328
2329         * .x-po-check: Exclude gl/ files.  Otherwise, po-check would
2330         complain that some of gl/lib/*.[ch] are not listed in POTFILES.in.
2331
2332 2006-11-14  Jim Meyering  <jim@meyering.net>
2333
2334         * gl/m4/root-dev-ino.m4: Now that this is part of a real "module",
2335         remove the now-unnecessary use of AC_LIBSOURCES.
2336
2337         Adapt to new version of gnulib-tool.
2338         * gl/modules/root-dev-ino: New file.
2339         * lib/root-dev-ino.c, lib/root-dev-ino.h: Move these files ...
2340         * gl/lib/root-dev-ino.c, gl/lib/root-dev-ino.h: ... to here.
2341         * m4/root-dev-ino.m4: Move this file ...
2342         * gl/m4/root-dev-ino.m4: ... to here.
2343
2344         * bootstrap.conf (gnulib_modules): Add root-dev-ino.
2345
2346 2006-11-13  Jim Meyering  <jim@meyering.net>
2347
2348         * src/sort.c (insertkey): Use xmemdup, rather than xmalloc+assignment.
2349         From Paul Eggert.
2350
2351         Plug another technically-unimportant leak in sort.
2352         * src/sort.c (main): Don't allocate memory for each new key here.
2353         (insertkey): Allocate memory for each key here, instead.
2354         (key_init): Rename from new_key.  Don't allocate.
2355
2356         * src/sort.c (main): Plug a tiny memory leak.
2357         Move declaration of local "minus" down to be nearer point of use.
2358
2359 2006-11-12  Jim Meyering  <jim@meyering.net>
2360
2361         du would exit early, when encountering an inaccessible directory
2362         Reported by Mike Frysinger, in
2363         http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8831
2364         * tests/du/inacc-dest: New test, based on an example from Mike Frysinger.
2365         * tests/chgrp/no-x: Remove the "fts_read failed: ..."
2366         diagnostic from the expected output when using native fdopendir.
2367         * tests/chmod/no-x: Likewise.
2368         * tests/du/no-x: Likewise.
2369         * NEWS: Mention this bug fix.
2370         * tests/du/Makefile.am (TESTS): Add inacc-dest.
2371
2372         * Makefile.maint (sc_cast_of_x_alloc_return_value): Add an exclusion
2373         for xalloc.h itself.
2374
2375         Avoid false-positive when testing via valgrind.
2376         * tests/mv/atomic: Grep strace output for a more specific pattern
2377         than just "unlink", since that got a false positive when testing
2378         under valgrind: unlink("/tmp/valgrind_proc_9657_cmdline_A51E9991") = 0
2379         * tests/mv/Makefile.am (TESTS_ENVIRONMENT): Define EGREP.
2380
2381 2006-10-28  Jim Meyering  <jim@meyering.net>
2382
2383         * Makefile.maint (patch-check): Make it easier to regenerate
2384         the src/c99-to-c89.diff file.  E.g., I do this:
2385         make patch-check REGEN_PATCH=1; ediff src/c99-to-c89.diff new-diff
2386
2387         * src/c99-to-c89.diff: Update to reflect new offsets in rm.c.
2388
2389 2006-10-26  Jim Meyering  <jim@meyering.net>
2390
2391         * src/system.h (ftello): Add a compile-time check for the highly
2392         unlikely condition of off_t narrower than long int, rather than
2393         handling it at run time.  Based on a patch from Paul Eggert.
2394
2395 2006-10-25  Paul Eggert  <eggert@cs.ucla.edu>
2396
2397         * tests/chmod/c-option: When double-quoting part of a word, prefer
2398         to double-quote the whole word.  This is a bit easier to read (at
2399         least for me), and in some cases it avoids a shell bug with Tru64
2400         4.0 sh reported by Nelson H. F. Beebe.  For example, instead of
2401         "$abs_srcdir"/../setgid-check we now write
2402         "$abs_srcdir/../setgid-check".
2403         * tests/cp/cp-parents: Likewise.
2404         * tests/du/inaccessible-cwd: Likewise.
2405         * tests/du/long-from-unreadable: Likewise.
2406         * tests/install/basic-1: Likewise.
2407         * tests/install/trap: Likewise.
2408         * tests/misc/close-stdout: Likewise.
2409         * tests/mkdir/concurrent-1: Likewise.
2410         * tests/mkdir/p-1: Likewise.
2411         * tests/mkdir/p-3: Likewise.
2412         * tests/mkdir/parents: Likewise.
2413         * tests/mkdir/perm: Likewise.
2414         * tests/readlink/can-e: Likewise.
2415         * tests/readlink/can-f: Likewise.
2416         * tests/readlink/can-m: Likewise.
2417         * tests/rm/inaccessible: Likewise.
2418         * tests/rm/unread3: Likewise.
2419         * tests/touch/no-create-missing: Likewise.
2420
2421         * lib/.cvsignore: Add uinttostr.c.
2422
2423 2006-10-25  Jim Meyering  <jim@meyering.net>
2424
2425         Portability to Tru64 V4.0.
2426         * src/system.h (ftello) [!HAVE_FSEEKO && !defined ftello]:
2427         Define inline replacement function.
2428         This (along with a yesterday's fix for autoconf's
2429         _AC_SYS_LARGEFILE_MACRO_VALUE macro) makes it so coreutils
2430         now builds once more on Tru64 V4.0.  Reported by Nelson Beebe.
2431
2432 2006-10-25  Bruno Haible  <bruno@clisp.org>
2433
2434         * src/cat.c (infile): Add "const" to declaration.
2435         * src/csplit.c (prefix): Likewise.
2436         * src/printf.c (cfcc_msg): Likewise.
2437         * src/tail.c (valid_file_spec): Likewise.
2438         * src/cut.c (cut_file): Likewise, for a parameter.
2439         * src/expr.c (str_value): Likewise.
2440         * src/fold.c (fold_file): Likewise.
2441         * src/pr.c (init_header): Likewise.
2442         * src/dircolors.c (dc_parse_stream): Likewise, for a local.
2443         * src/tr.c (make_printable_str): Likewise.
2444         * src/nl.c (body_type, header_type, footer_type, current_type):
2445         (separator_str, build_type_arg, nl_file): Likewise, for many.
2446         * src/paste.c (main): Don't assign a read-only string to 'optarg'.
2447         * src/tac.c (separator, tac_seekable, copy_to_temp): Likewise.
2448
2449 2006-10-25  Jim Meyering  <jim@meyering.net>
2450
2451         * tests/sample-test: Update copyright year list to include only
2452         the current year, since this is what I'll want in any new test.
2453
2454 2006-10-24  Jim Meyering  <jim@meyering.net>
2455
2456         * src/c99-to-c89.diff: Update to reflect new offsets.
2457
2458         * NEWS: new feature: rm accepts new option: --one-file-system
2459         Suggested by Steve McIntyre in <http://bugs.debian.org/392925>.
2460         * src/remove.h (struct rm_options) [one_file_system]: New member.
2461         * src/rm.c (rm_option_init): Initialize it.
2462         (usage): Document the option.
2463         * src/mv.c (rm_option_init): Likewise.
2464         * src/remove.c (remove_dir): With --one-file-system and --recursive,
2465         for each directory command line argument, do not affect a file system
2466         different from that of the starting directory.  And give a diagnostic.
2467         * src/rm.c (ONE_FILE_SYSTEM): New enum.
2468         (main): Handle new option.
2469         * tests/rm/one-file-system: Test the above.
2470         * tests/rm/Makefile.am (TESTS): Add one-file-system.
2471         * tests/Makefile.am (check-root): Add the rm/one-file-system
2472         test to the list.
2473         (EXTRA_DIST): Add other-fs-tmpdir.
2474
2475         * tests/mv/setup: Removed.  Renamed to...
2476         * tests/other-fs-tmpdir: ...this new file.
2477         * tests/mv/Makefile.am (EXTRA_DIST): Remove setup.
2478         * tests/mv/acl: Reflect renaming: use ../other-fs-tmpdir.
2479         * tests/mv/backup-is-src: Likewise.
2480         * tests/mv/hard-link-1: Likewise.
2481         * tests/mv/leak-fd: Likewise.
2482         * tests/mv/mv-special-1: Likewise.
2483         * tests/mv/part-fail: Likewise.
2484         * tests/mv/part-hardlink: Likewise.
2485         * tests/mv/part-rename: Likewise.
2486         * tests/mv/part-symlink: Likewise.
2487         * tests/mv/partition-perm: Likewise.
2488         * tests/mv/to-symlink: Likewise.
2489         * tests/mv/into-self-2: Likewise.
2490
2491         Don't let a failure in one test stop "make -k" from running the others.
2492         * tests/Makefile.am (t1 t2 t3 t4 t5): New targets.
2493         (check-root): Depend on them, rather than executing the five
2494         commands in a single rule.  Reported by Greg Schafer.
2495
2496 2006-10-23  Bob Proulx  <bob@proulx.com>  (tiny change)
2497
2498         * Makefile.maint (alpha beta major): Use a better log message for
2499         the automatic commit of .prev-version.
2500
2501 2006-10-23  Jim Meyering  <jim@meyering.net>
2502
2503         * tests/misc/pwd-long: Undo last change, since it made Perl invoke
2504         pwd via a shell.  Instead, ensure that the absolute name of the
2505         pwd binary consists solely of reasonable characters.
2506         Whoops.  Don't exec the perl script.  Otherwise, the sh-trap-based
2507         clean-up code isn't run.
2508
2509         * NEWS: Add a line for 6.5-cvs.
2510         * configure.ac (AC_INIT): Bump to 6.5 and add "-cvs" suffix.
2511
2512 2006-10-22  Jim Meyering  <jim@meyering.net>
2513
2514         Version 6.4.
2515
2516         * NEWS: Record the 6.4 release date.
2517         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
2518
2519         * Makefile.maint: Complete the adaptation to function with a working
2520         directory that is using git (rather than cvs) for version control.
2521
2522 2006-10-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2523
2524         * tests/chmod/c-option: Double-quote instances of `$abs_srcdir'.
2525         * tests/cp/cp-parents: Likewise.
2526         * tests/mkdir/parents: Likewise.
2527         * tests/mkdir/perm: Likewise.
2528
2529         * tests/sample-test: Quote variables containing absolute build
2530         tree paths.  In the cleanup trap, make sure `cd' succeeds before
2531         `chmod'ing and `rm'ing the temporary files.
2532         * tests/chgrp/basic: Likewise.
2533         * tests/chgrp/deref: Likewise.
2534         * tests/chgrp/no-x: Likewise.
2535         * tests/chgrp/posix-H: Likewise.
2536         * tests/chgrp/recurse: Likewise.
2537         * tests/chmod/c-option: Likewise.
2538         * tests/chmod/equal-x: Likewise.
2539         * tests/chmod/equals: Likewise.
2540         * tests/chmod/inaccessible: Likewise.
2541         * tests/chmod/no-x: Likewise.
2542         * tests/chmod/octal: Likewise.
2543         * tests/chmod/setgid: Likewise.
2544         * tests/chmod/umask-x: Likewise.
2545         * tests/chmod/usage: Likewise.
2546         * tests/chown/basic: Likewise.
2547         * tests/chown/deref: Likewise.
2548         * tests/chown/separator: Likewise.
2549         * tests/cp/acl: Likewise.
2550         * tests/cp/backup-1: Likewise.
2551         * tests/cp/backup-dir: Likewise.
2552         * tests/cp/backup-is-src: Likewise.
2553         * tests/cp/cp-HL: Likewise.
2554         * tests/cp/cp-deref: Likewise.
2555         * tests/cp/cp-i: Likewise.
2556         * tests/cp/cp-mv-backup: Likewise.
2557         * tests/cp/cp-parents: Likewise.
2558         * tests/cp/deref-slink: Likewise.
2559         * tests/cp/dir-rm-dest: Likewise.
2560         * tests/cp/dir-slash: Likewise.
2561         * tests/cp/dir-vs-file: Likewise.
2562         * tests/cp/fail-perm: Likewise.
2563         * tests/cp/into-self: Likewise.
2564         * tests/cp/link: Likewise.
2565         * tests/cp/link-no-deref: Likewise.
2566         * tests/cp/link-preserve: Likewise.
2567         * tests/cp/no-deref-link1: Likewise.
2568         * tests/cp/no-deref-link2: Likewise.
2569         * tests/cp/no-deref-link3: Likewise.
2570         * tests/cp/perm: Likewise.
2571         * tests/cp/preserve-2: Likewise.
2572         * tests/cp/r-vs-symlink: Likewise.
2573         * tests/cp/same-file: Likewise.
2574         * tests/cp/slink-2-slink: Likewise.
2575         * tests/cp/sparse: Likewise.
2576         * tests/cp/special-bits: Likewise.
2577         * tests/cp/src-base-dot: Likewise.
2578         * tests/cp/symlink-slash: Likewise.
2579         * tests/dd/not-rewound: Likewise.
2580         * tests/dd/skip-seek2: Likewise.
2581         * tests/dd/unblock-sync: Likewise.
2582         * tests/du/2g: Likewise.
2583         * tests/du/8gb: Likewise.
2584         * tests/du/basic: Likewise.
2585         * tests/du/deref: Likewise.
2586         * tests/du/deref-args: Likewise.
2587         * tests/du/exclude: Likewise.
2588         * tests/du/fd-leak: Likewise.
2589         * tests/du/hard-link: Likewise.
2590         * tests/du/inaccessible-cwd: Likewise.
2591         * tests/du/long-from-unreadable: Likewise.
2592         * tests/du/long-sloop: Likewise.
2593         * tests/du/no-deref: Likewise.
2594         * tests/du/no-x: Likewise.
2595         * tests/du/restore-wd: Likewise.
2596         * tests/du/slash: Likewise.
2597         * tests/du/slink: Likewise.
2598         * tests/du/trailing-slash: Likewise.
2599         * tests/du/two-args: Likewise.
2600         * tests/fmt/long-line: Likewise.
2601         * tests/install/basic-1: Likewise.
2602         * tests/install/create-leading: Likewise.
2603         * tests/install/d-slashdot: Likewise.
2604         * tests/install/trap: Likewise.
2605         * tests/ln/misc: Likewise.
2606         * tests/ln/target-1: Likewise.
2607         * tests/ls/color-dtype-dir: Likewise.
2608         * tests/ls/dangle: Likewise.
2609         * tests/ls/dired: Likewise.
2610         * tests/ls/file-type: Likewise.
2611         * tests/ls/follow-slink: Likewise.
2612         * tests/ls/infloop: Likewise.
2613         * tests/ls/inode: Likewise.
2614         * tests/ls/m-option: Likewise.
2615         * tests/ls/no-arg: Likewise.
2616         * tests/ls/recursive: Likewise.
2617         * tests/ls/rt-1: Likewise.
2618         * tests/ls/stat-dtype: Likewise.
2619         * tests/ls/stat-failed: Likewise.
2620         * tests/ls/stat-vs-dirent: Likewise.
2621         * tests/misc/cat-proc: Likewise.
2622         * tests/misc/close-stdout: Likewise.
2623         * tests/misc/csplit: Likewise.
2624         * tests/misc/date-sec: Likewise.
2625         * tests/misc/false-status: Likewise.
2626         * tests/misc/head-c: Likewise.
2627         * tests/misc/head-pos: Likewise.
2628         * tests/misc/mknod: Likewise.
2629         * tests/misc/nl: Likewise.
2630         * tests/misc/nohup: Likewise.
2631         * tests/misc/pathchk1: Likewise.
2632         * tests/misc/printf: Likewise.
2633         * tests/misc/printf-hex: Likewise.
2634         * tests/misc/pwd-long: Likewise.
2635         * tests/misc/shuf: Likewise.
2636         * tests/misc/sort-rand: Likewise.
2637         * tests/misc/split-a: Likewise.
2638         * tests/misc/split-fail: Likewise.
2639         * tests/misc/split-l: Likewise.
2640         * tests/misc/stat-fmt: Likewise.
2641         * tests/misc/tac-continue: Likewise.
2642         * tests/misc/wc-files0: Likewise.
2643         * tests/mkdir/concurrent-1: Likewise.
2644         * tests/mkdir/p-1: Likewise.
2645         * tests/mkdir/p-2: Likewise.
2646         * tests/mkdir/p-3: Likewise.
2647         * tests/mkdir/p-slashdot: Likewise.
2648         * tests/mkdir/p-thru-slink: Likewise.
2649         * tests/mkdir/p-v: Likewise.
2650         * tests/mkdir/parents: Likewise.
2651         * tests/mkdir/perm: Likewise.
2652         * tests/mkdir/t-slash: Likewise.
2653         * tests/mv/acl: Likewise.
2654         * tests/mv/atomic: Likewise.
2655         * tests/mv/backup-dir: Likewise.
2656         * tests/mv/childproof: Likewise.
2657         * tests/mv/diag: Likewise.
2658         * tests/mv/dir-file: Likewise.
2659         * tests/mv/dir2dir: Likewise.
2660         * tests/mv/dup-source: Likewise.
2661         * tests/mv/hard-2: Likewise.
2662         * tests/mv/hard-3: Likewise.
2663         * tests/mv/hard-4: Likewise.
2664         * tests/mv/hard-link-1: Likewise.
2665         * tests/mv/hard-verbose: Likewise.
2666         * tests/mv/i-2: Likewise.
2667         * tests/mv/i-3: Likewise.
2668         * tests/mv/i-4: Likewise.
2669         * tests/mv/i-5: Likewise.
2670         * tests/mv/i-link-no: Likewise.
2671         * tests/mv/into-self-4: Likewise.
2672         * tests/mv/leak-fd: Likewise.
2673         * tests/mv/mv-special-1: Likewise.
2674         * tests/mv/no-target-dir: Likewise.
2675         * tests/mv/part-fail: Likewise.
2676         * tests/mv/part-hardlink: Likewise.
2677         * tests/mv/part-rename: Likewise.
2678         * tests/mv/part-symlink: Likewise.
2679         * tests/mv/partition-perm: Likewise.
2680         * tests/mv/perm-1: Likewise.
2681         * tests/mv/reply-no: Likewise.
2682         * tests/mv/trailing-slash: Likewise.
2683         * tests/mv/update: Likewise.
2684         * tests/od/od-N: Likewise.
2685         * tests/od/x8: Likewise.
2686         * tests/readlink/can-e: Likewise.
2687         * tests/readlink/can-f: Likewise.
2688         * tests/readlink/can-m: Likewise.
2689         * tests/readlink/rl-1: Likewise.
2690         * tests/rm/cycle: Likewise.
2691         * tests/rm/dangling-symlink: Likewise.
2692         * tests/rm/deep-1: Likewise.
2693         * tests/rm/dir-no-w: Likewise.
2694         * tests/rm/dir-nonrecur: Likewise.
2695         * tests/rm/dot-rel: Likewise.
2696         * tests/rm/empty-inacc: Likewise.
2697         * tests/rm/f-1: Likewise.
2698         * tests/rm/fail-2eperm: Likewise.
2699         * tests/rm/hash: Likewise.
2700         * tests/rm/i-1: Likewise.
2701         * tests/rm/i-no-r: Likewise.
2702         * tests/rm/ignorable: Likewise.
2703         * tests/rm/inaccessible: Likewise.
2704         * tests/rm/interactive-always: Likewise.
2705         * tests/rm/interactive-once: Likewise.
2706         * tests/rm/ir-1: Likewise.
2707         * tests/rm/isatty: Likewise.
2708         * tests/rm/no-give-up: Likewise.
2709         * tests/rm/r-1: Likewise.
2710         * tests/rm/r-2: Likewise.
2711         * tests/rm/r-3: Likewise.
2712         * tests/rm/r-4: Likewise.
2713         * tests/rm/readdir-bug: Likewise.
2714         * tests/rm/rm1: Likewise.
2715         * tests/rm/rm2: Likewise.
2716         * tests/rm/rm3: Likewise.
2717         * tests/rm/rm4: Likewise.
2718         * tests/rm/rm5: Likewise.
2719         * tests/rm/sunos-1: Likewise.
2720         * tests/rm/unread2: Likewise.
2721         * tests/rm/unread3: Likewise.
2722         * tests/rmdir/fail-perm: Likewise.
2723         * tests/rmdir/t-slash: Likewise.
2724         * tests/shred/exact: Likewise.
2725         * tests/shred/remove: Likewise.
2726         * tests/sum/sysv: Likewise.
2727         * tests/tail-2/append-only: Likewise.
2728         * tests/tail-2/assert: Likewise.
2729         * tests/tail-2/assert-2: Likewise.
2730         * tests/tail-2/big-4gb: Likewise.
2731         * tests/tail-2/fflush: Likewise.
2732         * tests/tail-2/infloop-1: Likewise.
2733         * tests/tail-2/proc-ksyms: Likewise.
2734         * tests/tail-2/start-middle: Likewise.
2735         * tests/tail-2/tail-n0f: Likewise.
2736         * tests/tee/basic: Likewise.
2737         * tests/tee/dash: Likewise.
2738         * tests/touch/fail-diag: Likewise.
2739         * tests/touch/no-create-missing: Likewise.
2740         * tests/touch/not-owner: Likewise.
2741         * tests/touch/obsolescent: Likewise.
2742         * tests/touch/read-only: Likewise.
2743         * tests/touch/relative: Likewise.
2744
2745 2006-10-21  Jim Meyering  <jim@meyering.net>
2746
2747         * NEWS: (cp --backup fix): Fix a typo.
2748
2749         * .gitignore: Remove some references to files in subdirectories.
2750         * build-aux/.gitignore, doc/.gitignore, lib/.gitignore: New files.
2751         * m4/.gitignore, po/.gitignore, src/.gitignore: Likewise.
2752
2753         * src/copy.c (copy_internal): Add a comment saying why we prefer
2754         mknod over mkfifo.
2755
2756         Enable an fts optimization (call lstat only for directories,
2757         on some file system types) also with the --preserve-root option
2758         of chown or chgrp.
2759         * src/chown-core.c (change_file_owner): Compare fts_statp-based
2760         dev/ino against root dev/ino only for directories.
2761         (chown_files): Don't let the root_dev_ino setting influence whether
2762         we use FTS_NOSTAT: fts always sets *fts_statp for a directory.
2763
2764 2006-10-20  Jim Meyering  <jim@meyering.net>
2765
2766         * src/od.c (usage): Change description of default to use "-w16",
2767         not the now-invalid "-w 16" syntax.  From Dan Jacobson.
2768
2769 2006-10-19  Jim Meyering  <jim@meyering.net>
2770
2771         * bootstrap: Add names to each .gitignore file (if it exists)
2772         as well as to .cvsignore.
2773
2774         * Makefile.maint (po-check): This rule didn't detect the new use
2775         of "gettext" (as opposed to the use of "_" everywhere else) in
2776         lib/xstrtol.h.  Adjust the grep regexp so that now it does.
2777
2778 2006-10-18  Paul Eggert  <eggert@cs.ucla.edu>
2779
2780         * src/copy.c (copy_reg): Rewrite slightly to avoid duplicate code
2781         when opening dst_name.
2782         (copy_reg, copy_internal): Use (SYSCALL != 0) rather than plain
2783         (SYSCALL) to test for failure in a system call.
2784
2785         * src/copy.c (copy_internal): Use mknod rather than mkfifo to copy
2786         a fifo.  This preserves the special mode bits on Solaris 10, which
2787         is compatible with what Solaris 10 cp -R does.
2788
2789         * src/copy.c (copy_internal): Remove redundant and confusing local
2790         variable src_type.
2791
2792         * src/copy.c (copy_internal): Don't pass mkdir a mode greater than
2793         7777.  This matches historical 'cp' behavior and avoids some
2794         (though not all) implementation-defined behavior of mkdir.
2795         * src/cp.c (make_dir_parents_private): Likewise.
2796         * src/copy.c (copy_internal): Don't pass 'open' a mode greater
2797         than 777.  This is required by POSIX.  It doesn't make any difference
2798         in actual behavior on any host that I know of.
2799
2800 2006-10-17  Jim Meyering  <jim@meyering.net>
2801
2802         * src/dd.c (usage): Use two spaces (not one) to separate the
2803         "fdatasync" option string from its description, so help2man formats
2804         the derived man page properly.  Reported by Samuel Thibault
2805         in <http://bugs.debian.org/393649>.
2806
2807 2006-10-16  Jim Meyering  <jim@meyering.net>
2808
2809         * .x-sc_trailing_blank: Remove names of files that are no longer
2810         version-controlled.
2811
2812 2006-10-16  Paul Eggert  <eggert@cs.ucla.edu>
2813
2814         * src/groups.sh (version): Reword message to match the other programs.
2815         Problem reported by Eric Blake.
2816
2817 2006-10-14  Jim Meyering  <jim@meyering.net>
2818
2819         * Makefile.maint (headers_with_interesting_macro_defs): Define.
2820         (.re-defmac, sc_always_defined_macros): New rules.
2821
2822         * src/system.h (EXIT_FAILURE, EXIT_SUCCESS): Remove definitions.
2823         Instead, include "exit.h".  This hereby retires the work-around for
2824         "Sony NEWS-OS Release 4.0C"'s bug due to "#define EXIT_FAILURE 0".
2825
2826         * src/cksum.c (uint_fast32_t): Don't define.
2827         Instead, include <stdint.h>.
2828
2829         * src/pinky.c (S_IWGRP): Don't define.
2830         It's already defined by "stat-macros.h" (included via system.h).
2831
2832         * Makefile.cfg: Remove cruft that's now handled via bootstrap.
2833         * Makefile.maint: Likewise, remove these targets/rules/variables:
2834         (local_updates, update, cvs-update, wget_files, get-targets): Remove.
2835         (cvs_files, wget-update, automake_repo): Likewise.
2836         Move the comment about cvsu to build-aux/vc-list-files,
2837         where cvsu is actually used.
2838
2839         * Makefile.maint (cvs-update): Use $(CVS), not "cvs".
2840
2841         Work also when the working directory (with e.g. coreutils sources)
2842         is version controlled with git, rather than CVS.
2843         * bootstrap (CVS_only_file): Test for the existence of README-cvs,
2844         rather than CVS.
2845         In messages and comments, say e.g., "checked-out sources",
2846         rather than "CVS sources".
2847         (version_controlled_file): New function.  Work for git as well as
2848         for CVS.  Don't use grep's -q option.
2849         (slurp): Call it here, in place of CVS-specific code.
2850
2851         * NEWS: cp -r --backup dir1 dir2, would rename an existing dir1/dir2
2852         to dir1/dir2~.
2853         * src/copy.c (copy_internal): Although we do create a backup of each
2854         destination directory when in move mode, don't do that when copying.
2855         Reported by Peter Breitenlohner, in
2856         <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8616>.
2857         * tests/cp/backup-dir: New file.  Test for the above.
2858         * tests/cp/Makefile.am (TESTS): Add backup-dir.
2859
2860 2006-10-13  Jim Meyering  <jim@meyering.net>
2861
2862         More chown/chgrp dereferencing-related fixes.
2863         * src/chown-core.c (change_file_owner): Don't use fts_statp if
2864         we're dereferencing symlinks.
2865         Reverse conjuncts, so that we use dereference file_stats
2866         (aka ent->fts_statp) only *after* we've confirmed that
2867         chopt->affect_symlink_referent is true.  Otherwise, we might
2868         use ent->fts_statp uninitialized.
2869         Don't turn on FTS_NOSTAT when dereferencing symlinks.
2870         * tests/chown/deref: Update the expected diagnostic, now that
2871         this test case (trying to use "chown --dereference ..." on a
2872         dangling symlink) takes a different code path.
2873
2874 2006-10-13  Paul Eggert  <eggert@cs.ucla.edu>
2875
2876         Sync from Bison, as follows:
2877
2878         2006-10-01  Paul Eggert  <eggert@cs.ucla.edu>
2879
2880         Fix problems with translating English-language diagnostics.
2881         * bootstrap: Fix bug introduced in recent bootstrap changes, with
2882         respect to bison-runtime pot generation.  The YY_ stuff
2883         wasn't being captured.
2884
2885 2006-10-13  Jim Meyering  <jim@meyering.net>
2886
2887         * src/chown-core.c (change_file_owner): Use fstatat, not stat,
2888         now that we're using fts_open with FTS_CWDFD.
2889         * tests/chgrp/posix-H: Add --preserve-root to an invocation of
2890         chgrp, to exercise the above fix.
2891         * NEWS: Mention the above.
2892
2893         * src/du-tests: Clean up a little, though it's still not portable.
2894
2895         * .vg-suppressions: Add 3 more for debian unstable.
2896
2897         * tests/ls/Test.pm: Remove long-unused file.
2898         * Makefile.am (EXTRA_DIST): Add bootstrap.conf.
2899         Suggestions from Bruno Haible.
2900
2901 2006-10-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2902
2903         * Makefile.am (THANKS-to-translators): Add missing $(srcdir).
2904         (MAINTAINERCLEANFILES): Add .kludge-stamp.
2905         * man/Makefile.am (MAINTAINERCLEANFILES): Typo $(dist_man_MANS)
2906         instead of $(man_MANS).
2907
2908 2006-10-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
2909
2910         * configure.ac: Avoid compiler warnings about default return
2911         type in function definitions and unused variables in tests.
2912         * src/who.c (print_user) [HAVE_UT_HOST]: hostlen is only needed
2913         if this is #defined.
2914
2915 2006-10-12  Jim Meyering  <jim@meyering.net>
2916
2917         * configure.ac: Reflect s/gl_MACROS/coreutils_MACROS/ renaming.
2918         Call gl_INIT directly, rather than through the above.
2919
2920 2006-10-11  Paul Eggert  <eggert@cs.ucla.edu>
2921
2922         * bootstrap (symlink_to_gnulib): Fix bug: the dot_dots shell
2923         variable was sometimes used without being initialized.  This
2924         messed up the installation of the INSTALL file in some cases.
2925
2926 2006-10-11  Jim Meyering  <jim@meyering.net>
2927
2928         * src/ls.c (usage): Correct description of -s, --size.
2929         It works even without -l.  Suggestion from Karl Berry.
2930
2931 2006-10-10  Paul Eggert  <eggert@cs.ucla.edu>
2932
2933         * src/ls.c (quote_name): Use initializer rather than memset to
2934         initialize an object to zero.  This is easier to read and is less
2935         likely to introduce a runtime error due to a mixup.  It causes
2936         gcc -W to issue a warning, but you can work around this by
2937         appending -Wno-missing-field-initializers.
2938         * src/pathchk.c (portable_chars_only): Likewise.
2939         * src/shred.c (main): Likewise.
2940         * src/stty.c (main): Likewise.
2941         * src/tr.c (card_of_complement): Likewise.
2942         * src/wc.c (wc): Likewise.
2943
2944 2006-10-09  Paul Eggert  <eggert@cs.ucla.edu>
2945
2946         * src/sort.c (usage): Mention again that sort fields are origin 1.
2947
2948         * NEWS: Fix typo: iso-8602 -> iso-8601.  Problem reported by
2949         Bob Proulx.
2950
2951         * bootstrap (usage, main program, symlink_to_gnulib): Add option
2952         --copy.  Inspired by a suggestion from Bruno Haible.
2953
2954 2006-10-09  Jim Meyering  <jim@meyering.net>
2955
2956         Avoid a compiler warning.
2957         * src/pathchk.c (portable_chars_only): Initialize variable of type
2958         mbstate_t via memset, rather than via '{0}'.  Patch from Bruno Haible.
2959
2960 2006-10-06  Paul Eggert  <eggert@cs.ucla.edu>
2961
2962         Fix bug reported today by Mike Frysinger: mkdir -pv is logging the
2963         wrong file name in some cases.  Lars Wendler reported a bug in
2964         my original fix.
2965         * src/install.c (make_ancestor): New arg COMPONENT.
2966         * src/mkdir.c (make_ancestor): Likewise.
2967         * tests/install/basic-1: Check for install -Dv bug.
2968         * tests/mkdir/Makefile.am (TESTS): Add p-v.
2969         * tests/mkdir/p-v: New file, to test this bug.
2970
2971 2006-10-05  Paul Eggert  <eggert@cs.ucla.edu>
2972
2973         * src/chgrp.c: Don't include lchown.h; no longer needed.
2974         * src/chown.c: Likewise.
2975
2976         * tests/ls/stat-dtype: Use a dynamic test to decide whether the
2977         current file system has useful d_type info.
2978
2979         * src/dd.c (flags): noatime and nofollow now depend on
2980         HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW, too.
2981         (usage): Output info about noatime and nofollow only if
2982         they are known to work.
2983         * src/remove.c (AD_push): Inspect HAVE_WORKING_O_NOFOLLOW rather
2984         than O_NOFOLLOW, when testing whether it's possible to avoid a
2985         race condition reliably.
2986
2987 2006-10-05  Jim Meyering  <jim@meyering.net>
2988
2989         * src/c99-to-c89.diff: Update to reflect new offsets.
2990
2991         * tests/install/basic-1: Skip the latter part of this test if the
2992         just-built dd binary is not readable.  Otherwise, this test would fail
2993         when binaries were created as root.  Reported by Bauke Jan Douma in
2994         <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/8433>.
2995
2996 2006-10-03  Paul Eggert  <eggert@cs.ucla.edu>
2997
2998         * src/system.h (ST_BLKSIZE): Ceiling at SIZE_MAX / 8 + 1, not at 4
2999         MiB, since XFS hosts can legitimately have large values of
3000         st_blksize.  Problem reported by Tony Ernst in
3001         <http://savannah.gnu.org/bugs/?17903>.
3002
3003 2006-10-04  Jim Meyering  <jim@meyering.net>
3004
3005         * src/remove.c (nonexistent_file_errno): Remove ENAMETOOLONG.
3006         Paul Eggert pointed out that the specified file may exist,
3007         in spite of such an errno value.
3008         * tests/rm/Makefile.am (TESTS): Remove ignore-name-too-long.
3009         * tests/rm/ignore-name-too-long: Remove file.
3010         * NEWS: Update here, too.
3011
3012 2006-10-03  Jim Meyering  <jim@meyering.net>
3013
3014         * tests/rm/fail-eperm: Report failure also if rm is terminated by
3015         a signal.
3016
3017         * src/c99-to-c89.diff: Convert two c99'isms -- one in remove.c
3018         and one in shred.c -- that were added before coreutils-6.3.
3019         Reported by Michael Deutschmann.
3020
3021         * src/c99-to-c89.diff: Update to reflect new offsets.
3022
3023         * src/remove.c (remove_entry): With -f, exit successfully in spite
3024         of a missing file under some very unusual conditions (with errno
3025         being any of ENOENT, ENOTDIR, ENAMETOOLONG).
3026
3027         With --force (-f), rm no longer fails for ENOTDIR.
3028         * src/remove.c (ignorable_missing): New function.
3029         Use it everywhere, rather than open-coding the test.
3030         Andreas Schwab reported the ENOTDIR problem.
3031         (ignorable_missing): Similarly, don't fail for ENAMETOOLONG.
3032
3033         * NEWS: Mention the bug fix.
3034         * tests/rm/ignorable: New file.  Test for the ENOTDIR case.
3035         * tests/rm/ignore-name-too-long: New file. Test for ENAMETOOLONG.
3036         * tests/rm/Makefile.am (TESTS): Add the new file names.
3037
3038         * bootstrap: Undo last change to this file, since now gnulib-tool
3039         sticks with the automake default in generating dependencies.
3040
3041         * NEWS: Add a line for 6.4-cvs.
3042         * configure.ac (AC_INIT): Bump to 6.4 and add "-cvs" suffix.
3043
3044 2006-09-30  Jim Meyering  <jim@meyering.net>
3045
3046         Version 6.3.
3047         * NEWS: Record the 6.3 release date.
3048         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
3049
3050         * NEWS: Mention Paul's Solaris 8 vs. 10 work-around.
3051
3052         * src/c99-to-c89.diff: Update offsets.
3053
3054 2006-09-29  Paul Eggert  <eggert@cs.ucla.edu>
3055
3056         * tests/rm/readdir-bug: Don't use $(...) in a shell script,
3057         as it doesn't work with Solaris /bin/sh.
3058
3059 2006-09-29  Jim Meyering  <jim@meyering.net>
3060
3061         * NEWS: Mention Paul's fix (to gnulib's canon-host.c) for
3062         the pinky segfault.
3063
3064         * tests/seq/basic [neg-2, eq-wid-2]: Comment out tests that
3065         use .1 as the increment.  Actual output varies too much.
3066         [eq-wid-3]: New, commented out test.
3067
3068         * src/shuf.c (read_input): Fix an off-by-one error that
3069         would cause an infloop for piped input of 8KB or more.
3070         * NEWS: Mention the fix.
3071         * tests/misc/shuf: Test for the above fix.
3072
3073         Since any system may be affected by the Darwin readdir bug,
3074         perform the extra rewinddir unconditionally.  The performance
3075         impact of rewinding a directory is negligible.
3076         * src/remove.c (NEED_REWIND): Define to use
3077         CONSECUTIVE_READDIR_UNLINK_THRESHOLD unconditionally.
3078
3079         * tests/seq/basic: Use .11 as the upper bound, in case the ".1"
3080         increment translates to a slightly larger value.
3081         This corrects a test failure on FreeBSD 6.1 reported by Nelson Beebe.
3082         The final expected value wasn't being printed.
3083
3084         Work around a readdir bug in Darwin 7.9.0 (MacOS X 10.3.9) on HFS+
3085         and NFS, whereby rm would not remove all files in a directory.
3086         * src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Reduce to 10.
3087         (NEED_REWIND): New macro, so that we incur the cost of the work-around
3088         rewinddir only on afflicted systems.
3089         * NEWS: Clarify and correct.
3090         * tests/rm/readdir-bug: New file.  Test for the above fix.
3091         * tests/rm/Makefile.am (TESTS): Add it.
3092         Prompted by testing and analysis from Bruno Haible:
3093         http://lists.gnu.org/archive/html/bug-coreutils/2006-09/msg00326.html
3094
3095 2006-09-28  Paul Eggert  <eggert@cs.ucla.edu>
3096
3097         * tests/rm/fail-eperm: Unset BASH_ENV, CDPATH, and ENV, too;
3098         suggested for Debian stable, which uses Perl 5.8.4.
3099
3100 2006-09-28  Jim Meyering  <jim@meyering.net>
3101
3102         Automatically generated dependencies are important even
3103         when all of the sources in a directory come from gnulib.
3104         * bootstrap (gnulib_tool): Remove the "no-dependencies" automake
3105         option that gnulib-tool adds to what becomes our lib/gnulib.mk.
3106
3107         * tests/rm/fail-eperm: Enable Perl's (-T) taint checking.
3108         Ensure that IFS is set properly and unset PATH.
3109         Sanitize inputs.
3110         Work properly even when the name of the selected file starts with "-".
3111         Invoke rm via "../../src/rm", and adjust expected output.
3112         Prompted by a patch from Tim Waugh.
3113
3114         * README-cvs: Add Bison to the list of required packages.
3115
3116 2006-09-26  Jim Meyering  <jim@meyering.net>
3117
3118         * src/c99-to-c89.diff: Update offsets.
3119
3120         * NEWS: rm works around a bug in Darwin 8.6.1 w/NFS that kept
3121         it from removing a directory containing 188 or more entries.
3122         * src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Decrease by
3123         20, go work around the buggy readdir on Darwin 8.6.1 with NFS.
3124         Reported by Matthew Woehlke.
3125
3126 2006-09-26  Paul Eggert  <eggert@cs.ucla.edu>
3127
3128         * NEWS: "groups user" no longer outputs "user :"; you need at least
3129         two users.  "groups" now processes options like --help more compatibly.
3130         * src/groups.sh: Implement the option-processing change.
3131         Handle user and group names with special characters more robustly.
3132         Report write errors instead of exiting silently with status 1.
3133
3134 2006-09-26  Jim Meyering  <jim@meyering.net>
3135
3136         * README: Warn not to run autoreconf manually.  Use bootstrap instead.
3137
3138         * src/groups.sh: When invoked with 0 or 1 argument, just exec "id".
3139         Rewrite to avoid using temporary, $status.
3140
3141         * NEWS: Mention the bug fix.
3142         * src/groups.sh: Don't hide a write failure.
3143         Reported by Iain Calder <ic56@rogers.com>.
3144
3145 2006-09-25  Jim Meyering  <jim@meyering.net>
3146
3147         * src/chown.c (usage): Clarify --dereference description.
3148         * src/chgrp.c (usage): Likewise.  Suggestion from Jamie McClelland.
3149
3150 2006-09-24  Jim Meyering  <jim@meyering.net>
3151
3152         * NEWS: Mention these fixes.
3153         * src/copy.c (copy_reg): With --verbose (-v), print
3154         "removed `file_name'" just after unlinking a file.
3155         (copy_internal): Likewise, in three more places.
3156         Marc Lehman reported that "touch x; ln x y; mv -v x y" was silent.
3157         * tests/mv/hard-verbose: New file.  Test for the above fix.
3158         * tests/mv/Makefile.am (TESTS): Add hard-verbose.
3159
3160         * tests/help-version (sync_args): Don't call sync, since it spins up
3161         disks that I've deliberately caused to spin down (but not unmounted).
3162
3163         * NEWS: Mention the improvement to sort.
3164
3165         * tests/tail-2/proc-ksyms: Require that /proc/ksyms be readable
3166         as well as existing.
3167
3168         * tests/ls/stat-dtype: Don't use tmpfs on linux-2.4 or older,
3169         since that predated addition of d_type support.
3170
3171 2006-09-23  Jim Meyering  <jim@meyering.net>
3172
3173         * gl/modules/getloadavg.diff: New file.  Work around the way the latest
3174         version of the getloadavg module interacts with our bootstrap script.
3175         * bootstrap (gnulib_tool_options): Add "--local-dir gl".
3176         * Makefile.am (EXTRA_DIST): Sort file names.
3177         Add bootstrap and gl/modules/getloadavg.diff
3178
3179 2006-09-20  Paul Eggert  <eggert@cs.ucla.edu>
3180
3181         * bootstrap: Add support for --force.
3182         (usage): New function.  Describe usage less tersely.
3183         (CVS_only_file): New var.
3184
3185         * NEWS: Document fix for cp -i and mv -i.
3186         * src/copy.c (copy_internal): With -i, prompt even if the source
3187         is a directory and the destination is not.  This is required by
3188         POSIX and gives the user a chance to bail out before failing.
3189         * tests/cp/Makefile.am (TESTS): Add cp-i.
3190         * tests/cp/cp-i: New file.
3191         * tests/mv/Makefile.am (TESTS): Add i-5.
3192         * tests/mv/i-5: New file.
3193
3194 2006-09-20  Jim Meyering  <jim@meyering.net>
3195
3196         * NEWS: Mention the chmod bug fix.
3197
3198         * tests/chmod/inaccessible: New test, specifically for this bug.
3199         Based on a test case from Paul Eggert.
3200         * tests/chmod/Makefile.am (TESTS): Add inaccessible.
3201
3202         Fix the 2006-09-18 bug differently.
3203         * src/chmod.c: (process_file): Upon FTS_NS for a top-level file,
3204         tell fts_read to stat the file again, in case it has become
3205         accessible since the initial fts_open call.
3206         * src/chown-core.c (change_file_owner): Likewise.
3207
3208         * src/chmod.c: Revert last change.  There is a better way.
3209         * src/chown-core.c: Likewise.
3210
3211 2006-09-19  Paul Eggert  <eggert@cs.ucla.edu>
3212
3213         * src/ln.c (target_directory_operand): Rewrite to avoid porting
3214         problem on Tandem reported by Matthew Woehlke in
3215         <https://savannah.gnu.org/bugs/?17172>.
3216
3217 2006-09-18  Paul Eggert  <eggert@cs.ucla.edu>
3218
3219         Fix bug where chmod, chown, and chgrp did not process operands
3220         left-to-right in some cases.
3221         * src/chmod.c (wd_errno): New var.
3222         (chmod_file): New function, with most of the contents of the
3223         old prcess_file function.
3224         (process_files): Use it.  This gives file names to fts one
3225         at a time, so that they are processed left-to-right as POSIX
3226         requires.
3227         * src/chown-core.c (wd_errno, chown_files): Likewise.
3228         (chown_file): New function.
3229         * tests/install/basic-1: Redo test so as to not workaround
3230         the chmod bug, thereby testing for it.
3231
3232         * src/shuf.c (main): Quote the entire range when reporting an
3233         invalid one, rather than just the part that contained the error.
3234
3235         * tests/stty/row-col-1: Rewrite to avoid temporary file that is
3236         sometimes left behind if the test is skipped or interrupted.
3237
3238         * bootstrap (symlink_to_gnulib): New function.
3239         (cp_mark_as_generated): Use it, to prefer symlinks-to-gnulib
3240         to copies-of-gnulib.
3241         (cp_mark_as_generated, slurp, gnulib_files):
3242         Avoid making a copy if it's the same as the old version.
3243         (gnulib_files): Add support for this variable (used by Bison).
3244
3245         * tests/ls/stat-vs-dirent: Fix quoting problem in diagnostic
3246         indicating flaw in kernel.  Reword to say that the flaw isn't
3247         serious for coreutils, since the flaw does affect ls -i.
3248
3249         * tests/chgrp/basic: Fix bug in test case exposed by building on
3250         Solaris 8 in a setgid directory.  The test case incorrectly
3251         assumed that 'symlink' would be in group $g1.
3252
3253 2006-09-18  Jim Meyering  <jim@meyering.net>
3254
3255         * NEWS: Add a line for 6.3-cvs.
3256         * configure.ac (AC_INIT): Bump to 6.3 and add "-cvs" suffix.
3257
3258         Version 6.2.
3259         * NEWS: Record the 6.2 release date.
3260         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
3261
3262 2006-09-17  Jim Meyering  <jim@meyering.net>
3263
3264         * tests/chgrp/basic: On an OpenBSD system, rather than failing
3265         due to a known problem, merely warn about it.
3266         Rewrite to avoid testing output of chgrp --verbose and chgrp -c.
3267         Instead, use stat to test file system for desired results, directly.
3268         * tests/chgrp/Makefile.am (TESTS_ENVIRONMENT): Set host_triplet.
3269
3270         * tests/envvar-check: Add more variable names to the list of those
3271         that can affect these programs and tests: _POSIX2_VERSION, COLUMNS,
3272         QUOTING_STYLE, TABSIZE, TERM, TMPDIR.
3273
3274 2006-09-16  Paul Eggert  <eggert@cs.ucla.edu>
3275
3276         * NEWS: Document that mkdir -p and install -d now fork on occasion.
3277         * bootstrap.conf (gnulib_modules): Add savewd.
3278         * src/install.c: Include savewd.h.
3279         (process_dir): New function.
3280         (main, install_file_in_file_parents): Use it, along with the new
3281         savewd module, to avoid some race conditions.
3282         * src/mkdir.c: Include savewd.h.
3283         (struct mkdir_options): New members make_ancestor_function, mode,
3284         mode_bits.
3285         (make_ancestor): Return 1 if the resulting directory is not readable.
3286         (process_dir): New function.
3287         (main): Use it, along with new savewd module, to avoid some
3288         race conditions.  Fill in new slots of struct mkdir_options, so
3289         that callees get the values.
3290         * tests/install/basic-1: Test for coreutils 5.97 bug that was
3291         fixed in coreutils 6.0, and which should still be fixed with
3292         this change.
3293         * tests/mkdir/p-3: Likewise.
3294
3295 2006-09-15  Jim Meyering  <jim@meyering.net>
3296
3297         * bootstrap.conf (gnulib_modules): Add rename-dest-slash.
3298         The 2006-09-08 changes made it so "mv dir new-name/" would
3299         fail on NetBSD 1.6.  This makes it work once again.
3300
3301 2006-09-14  Jim Meyering  <jim@meyering.net>
3302
3303         * src/mv.c (main): Remove unnecessary (always-true) test for 2 <= n.
3304         Instead, since it's a little fragile, assert the condition.
3305         (target_directory_operand): Update comment to reflect latest change.
3306
3307 2006-09-12  Paul Eggert  <eggert@cs.ucla.edu>
3308
3309         * src/who.c (print_user): Rewrite to avoid warning from
3310         GCC 4.1.1 with -Wall.
3311
3312 2006-09-12  Jim Meyering  <jim@meyering.net>
3313
3314         * tests/mv/atomic: Check for specific strace output, rather than
3315         simply nonempty.  RHEL AS 4 would fail this test due to strace
3316         generating "[ Process PID=14434 runs in 32 bit mode. ]".
3317         Reported by Nelson Beebe.
3318
3319 2006-09-11  Jim Meyering  <jim@meyering.net>
3320
3321         * src/remove.c (remove_dir): Move new cache_stat_init call onto
3322         it's own line.
3323         (rm_1): Move declaration of "st" and new cache_stat_init call
3324         "down" to nearer where they're used.
3325         * src/c99-to-c89.diff: Add another set of curly braces.
3326
3327 2006-09-10  Paul Eggert  <eggert@cs.ucla.edu>
3328
3329         * src/expr.c (eval6): Fix buffer overrun, or bad performance, if
3330         substr's last operand is very large.  Performance problem reported
3331         by Sebastian Kreft.
3332
3333 2006-09-09  Jim Meyering  <jim@meyering.net>
3334
3335         * Makefile.maint (sc_prohibit_jm_in_m4): Don't hang when there
3336         are no .m4 files.
3337         (sc_require_config_h): Skip this test if there are no version-
3338         controlled .c files.
3339         (sc_prohibit_assert_without_use): Likewise.
3340
3341 2006-09-08  Jim Meyering  <jim@meyering.net>
3342
3343         * bootstrap: Export CVS_RSH separate from its assignment, to work
3344         even with Solaris 10's /bin/sh.  Suggestion from Mark D. Baushke.
3345
3346 2006-09-08  Paul Eggert  <eggert@cs.ucla.edu>
3347
3348         * NEWS: tail now ignores the -f option if POSIXLY_CORRECT is set,
3349         no file operand is given, and standard input is any FIFO.
3350         This is in response to Open Group XCU ERN 114.
3351         * src/tail.c (main): Likewise.
3352
3353 2006-09-08  Jim Meyering  <jim@meyering.net>
3354
3355         mv and "cp -r" no longer fail when invoked with two arguments
3356         where the first one names a directory and the second name ends in
3357         a slash and doesn't exist.  E.g., "mv dir B/", for nonexistent B,
3358         now succeeds, once more. This reverts part of the 2004-06-27
3359         change for 5.3.0.
3360         * NEWS: Say the above.
3361         * src/mv.c (target_directory_operand): Don't require (here)
3362         that the target operand "look like" a directory.  This change
3363         pushes the test down to the rename syscall level, where a
3364         "mv dir existing-non-dir/" will mistakenly succeed on older systems
3365         that ignore trailing slashes in the rename destination argument.
3366         * src/cp.c (target_directory_operand): Likewise, but for cp.
3367         * tests/mv/trailing-slash: Exercise the above fixes.
3368         * tests/cp/trailing-slash: New file.
3369         * tests/cp/Makefile.am (EXTRA_DIST): Add trailing-slash.
3370
3371         * bootstrap: Use the previously unused variable, $src,
3372         to avoid repeating "$GNULIB_SRCDIR/$file".
3373
3374         * bootstrap (cp_mark_as_generated): Don't use "local", to
3375         accommodate ancient "/bin/sh".  Suggested by Ralf Wildenhues.
3376         Rename now-global "$src" and "$dst" to have cp_ prefix.
3377         Safer, and avoids confusion.
3378
3379         * bootstrap (cp_mark_as_generated): New function.
3380         (slurp): Use it to prepend editor hints and a warning that
3381         the file we're copying is generated.
3382         Suggestion from Bruce Korb.
3383         (cp_mark_as_generated): Don't add C-style comments for .l or .y files.
3384         Fix last-minute typo.
3385
3386 2006-09-07  Jim Meyering  <jim@meyering.net>
3387
3388         * bootstrap: Revert last change.  There are less disruptive ways
3389         to mark these generated files as read-only.
3390
3391         * src/c99-to-c89.diff: Update to have proper offsets.
3392
3393 2006-09-06  Jim Meyering  <jim@meyering.net>
3394
3395         Ensure that some gnulib-tool-generated files are read-only.
3396         * bootstrap (slurp): Put the body of this function in a sub-shell,
3397         with "umask a-w" so that all new files are read-only.  Remove each
3398         file before we write to it, in case it's read-only.
3399         Make po/Makevars and runtime-po/Makevars read-only, too.
3400
3401 2006-09-05  Jim Meyering  <jim@meyering.net>
3402
3403         * tests/cp/acl: Skip this test when cp lacks ACL support.
3404         * tests/cp/Makefile.am (TESTS_ENVIRONMENT): Set $(CONFIG_HEADER).
3405
3406         * src/c99-to-c89.diff (remove.c): Adapt one hunk to match the new
3407         context from change of 2006-09-02.
3408
3409 2006-09-04  Jim Meyering  <jim@meyering.net>
3410
3411         * README-cvs: Fix typo in update command.
3412
3413 2006-09-03  Jim Meyering  <jim@meyering.net>
3414
3415         * NEWS: Tweak the wording in the new change description so that
3416         no one can think this change causes e.g., `rm -fr foo../' to fail.
3417
3418         * tests/rm/inaccessible: Adjust for movement of config.h to lib/.
3419         Use $CONFIG_HEADER, rather than hard-coding it.
3420         * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Set $CONFIG_HEADER.
3421
3422 2006-09-02  Paul Eggert  <eggert@cs.ucla.edu>
3423
3424         * NEWS: rm now rejects attempts to remove /, ./, and ../.
3425         * src/basename.c: Don't include dirname.h, since system.h does it now.
3426         * src/chmod.c: Likewise.
3427         * src/copy.c: Likewise.
3428         * src/cp.c: Likewise.
3429         * src/df.c: Likewise.
3430         * src/dircolors.c: Likewise.
3431         * src/dirname.c: Likewise.
3432         * src/du.c: Likewise.
3433         * src/install.c: Likewise.
3434         * src/ln.c: Likewise.
3435         * src/ls.c: Likewise.
3436         * src/mkdir.c: Likewise.
3437         * src/mv.c: Likewise.
3438         * src/remove.c: Likewise.
3439         * src/rm.c: Likewise.
3440         * src/rmdir.c: Likewise.
3441         * src/shred.c: Likewise.
3442         * src/split.c: Likewise.
3443         * src/su.c: Likewise.
3444         * src/system.h: Include "dirname.h", since dot_or_dotdot needs it
3445         now.
3446         (dot_or_dotdot): Succeed even if "." or ".." is followed by a
3447         slash.
3448         * src/rm.c (usage, main): --preserve-root is now the default.
3449         * src/remove.h: Fix comment.
3450         * src/remove.c (cache_fstatat, cache_stat_init): New functions.
3451         (cache_statted, cache_stat_ok): New functions.
3452         (write_protected_non_symlink): Remove struct stat ** buf_p arg,
3453         which is no longer needed with the new functions.  All callers
3454         changed.
3455         (prompt, is_dir_lstat, remove_entry, remove_dir):
3456         New struct stat * arg.  All callers changed.
3457         (write_protected_non_symlink, prompt, is_dir_lstat, remove_entry):
3458         (remove_cwd_entries, remove_dir, rm_1):
3459         Use and maintain the file status cache.
3460         (prompt, remove_entry): Omit the first "directory" in the diagnostic
3461         "Cannot remove directory `foo': is a directory".  This causes "rm"
3462         to pass a test case that it would otherwise fail now that it
3463         "knows" more about its argument.  I think the diagnostic is better
3464         without the first "directory" anyway.
3465         (prompt): Remove the no-longer-needed IS_DIR arg; all callers changed.
3466         (rm_1): Reject attempts to remove /, ./, or ../.
3467         * tests/rm/Makefile.am (TESTS): Add r-4.
3468         * tests/rm/r-4: New file.
3469
3470 2006-09-01  Paul Eggert  <eggert@cs.ucla.edu>
3471
3472         * src/stat.c: Include <stddef.h>
3473         (alignof): New macro.
3474         (HAVE_STRUCT_STATXFS_F_FSID___VAL, HAVE_STRUCT_STATXFS_F_FSID_VAL):
3475         Remove.
3476         (STRUCT_STATXFS_F_FSID_IS_INTEGER): New macro.
3477         (FSID_VAL): Remove.
3478         (print_statfs): If f_fsid isn't an integer, grab its words one
3479         at a time in little-endian order.  This is a bit easier to configure
3480         and should avoid a compilation failure on MacOS reported by Bruno
3481         Haible.
3482
3483 2006-08-29  Paul Eggert  <eggert@cs.ucla.edu>
3484
3485         * src/stat.c (HAVE_STRUCT_STATXFS_F_FSID_VAL, FSID_VAL): New macros, to
3486         work around a Mac OS X porting problem reported by Bruno Haible in
3487         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00308.html>.
3488         (print_statfs): Use them.
3489
3490         * bootstrap.conf (gnulib_modules): Add isapipe.
3491         * src/tail.c: Include isapipe.h.
3492         (IS_PIPE_LIKE_FILE_TYPE): Remove.
3493         (IS_TAILABLE_FILE_TYPE): Just list both FIFOs and sockets as
3494         tailable, since this seems to be portable.
3495         (main): Use isapipe, to fix a bug on MacOS X reported by Bruno Haible in
3496         <http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00304.html>.
3497
3498         * src/system.h (LOCALEDIR): Remove, since configmake.h now defines
3499         it for us.
3500
3501 2006-08-28  Paul Eggert  <eggert@cs.ucla.edu>
3502
3503         * src/copy.c (copy_internal): Don't test whether macros like
3504         S_ISLNK are defined, since they're always defined now.
3505         * src/cp.c (main): Likewise.
3506         * src/ln.c (main): Likewise.
3507         * src/ls.c (get_link_name, make_link_name): Likewise.
3508         * src/mknod.c (main): Likewise.
3509         * src/mkfifo.c (usage): Likewise.
3510         * src/who.c (S_IWGRP): Likewise.
3511
3512         Adjust to recent gnulib changes for the gnulib module.
3513         * bootstrap.conf (gnulib_modules): Add fcntl.
3514         * src/system.h (SEEK_SET, SEEK_CUR, SEEK_END): Remove.  Other code
3515         is already assuming these macros are defined.
3516         (O_DIRECT, O_DIRECTORY, O_DSYNC, O_NDELAY, O_NOATIME, O_NONBLOCK):
3517         (O_NOCTTY, O_NOFOLLOW, O_NOLINKS, O_RSYNC, O_SYNC, O_BINARY, O_TEXT):
3518         Remove; the fcntl module now handles these.
3519
3520         Adjust to recent gnulib changes for the inttypes module.
3521         * bootstrap.conf (gnulib_modules): Remove stdint; add inttypes.
3522         (excluded_files): Don't exclude m4/inttypes-h.m4 or m4/inttypes-pri.m4.
3523
3524         * src/system.h: Don't bother to include <stdint.h>, since we can
3525         now assume inttypes.h does the equivalent of including stdint.h.
3526
3527 2006-08-27  Jim Meyering  <jim@meyering.net>
3528
3529         * src/copy.c (copy_internal): Don't make a backup if the last
3530         component of the source name is "." or "..".
3531         Reported by Andreas Schwab in http://savannah.gnu.org/bugs/?17540.
3532         * NEWS: Mention this.
3533         * tests/cp/src-base-dot: New file.  Test for the above fix.
3534         * tests/cp/Makefile.am (TESTS): Add src-base-dot.
3535
3536         * src/system.h (DOT_OR_DOTDOT): Remove macro.  Rewrite as a...
3537         (dot_or_dotdot): ...new static inline function.
3538         * src/remove.c (rm_1): Reflect this renaming.
3539         * src/ls.c (basename_is_dot_or_dotdot): Likewise.
3540
3541         * src/copy.c (copy_internal): Add comments.
3542
3543 2006-08-26  Paul Eggert  <eggert@cs.ucla.edu>
3544
3545         * src/Makefile.am (AM_CPPFLAGS): Remove -I$(srcdir) and -I../lib,
3546         since Automake supplies them for us.  It always did -I$(srcdir),
3547         and with the recent change to AC_CONFIG_HEADERS in configure.ac it
3548         is now also doing -I../lib.
3549
3550         * bootstrap (get_translations): Skip this if WGET_COMMAND is empty.
3551         Fail if the first "echo" fails.  Suppress diagnostics from "ls po/*.po"
3552         since there might not be any .po files.
3553         (WGET_COMMAND): Set to empty if wget doesn't
3554         seem to be available.
3555
3556 2006-08-26  Jim Meyering  <jim@meyering.net>
3557
3558         This test was failing in some environments.
3559         * tests/ls/color-dtype-dir: Don't rely on eval "`dircolors -b`"
3560         to set LS_COLORS in the environment.
3561         * tests/envvar-check: Instead, ensure that LS_COLORS is not set.
3562         Reported by Bob Proulx.
3563
3564         * src/c99-to-c89.diff: Remove hunk for copy.c; no longer needed.
3565
3566         * Makefile.am (EXTRA_DIST): Remove these files here, too:
3567         .x-sc_no_if_have_config_h, .x-sc_prohibit_assert_without_use,
3568         .x-sc_two_space_separator_in_usage.
3569
3570         Fix "mv --verbose --backup" so its output includes the
3571         " (backup: foo.~1~)" suffix also when backing up a directory.
3572         * NEWS: Report this bug fix.
3573         * src/copy.c (emit_verbose): New function, factored out of...
3574         (copy_internal): ...here.  Use the new function.
3575         * tests/mv/backup-dir: Test for the above fix.
3576         * tests/mv/Makefile.am (TESTS): Add backup-dir.
3577
3578 2006-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3579
3580         * .x-sc_no_if_have_config_h: Remove; no longer needed.
3581         * .x-sc_prohibit_assert_without_use: Remove; it was empty.
3582         * .x-sc_two_space_separator_in_usage: Likewise.
3583         * Makefile.maint (sc_no_have_config_h): Renamed from
3584         sc_no_if_have_config_h, since it now checks that HAVE_CONFIG_H
3585         is absent everywhere.
3586         * bootstrap.conf (gnulib_modules): Add config-h.
3587         * src/shred.c: Include <config.h> unconditionally, since
3588         we now assume config.h exists.
3589         * src/dircolors.c: Likewise.
3590
3591 2006-08-26  Jim Meyering  <jim@meyering.net>
3592
3593         "ls --color" would highlight other-writable and sticky directories
3594         no differently than regular directories on a file system with
3595         dirent.d_type support.
3596         * NEWS: Say the above.
3597         * src/ls.c (gobble_file): With --color, also stat the file when
3598         we know it is a directory.
3599         Derived from an anonymous one-line fix and bug report:
3600         <http://savannah.gnu.org/bugs/?15043>.
3601         * tests/ls/color-dtype-dir: New file.  Test for the above fix.
3602         * tests/ls/Makefile.am (TESTS): Add color-dtype-dir.
3603
3604 2006-08-25  Paul Eggert  <eggert@cs.ucla.edu>
3605
3606         * .cvsignore: Remove stamp-h1.  Add coreutils-*, to ignore
3607         tarballs.
3608         * bootstrap.conf: Add configmake, verify.
3609         * src/.cvsignore: Remove localedir.h.
3610         * src/Makefile.am (localedir, DISTCLEANFILES, localedir.h): Remove;
3611         subsumed by configmake.
3612         * src/system.h: Include configmake.h rather than localedir.h
3613         (LOCALEDIR): New macro.
3614
3615         Rewrite to avoid some unnecessary casts, macros, literals.
3616         * src/shred.c (DEFAULT_PASSES, VERBOSE_UPDATE): Now constants,
3617         not macros.
3618         (SECTOR_SIZE, SECTOR_MASK): New constants.
3619         (fillpattern, dopass, do_wipefd, main): Remove unnecessary casts,
3620         and use the SECTOR_* constants when applicable.  Check for size <
3621         0 rather than size == -1, since negative-size files are a sign of
3622         trouble anyway.
3623
3624 2006-08-25  Bruno Haible  <bruno@clisp.org>
3625
3626         * src/shred.c (dopass): Assume a continuable error if EIO even
3627         if the current position is not a multiple of 512.
3628
3629 2006-08-24  Jim Meyering  <jim@meyering.net>
3630
3631         * src/stat.c (print_statfs): Fix typo: remove extra "sizeof".
3632
3633 2006-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3634
3635         * src/stat.c (HAVE_STRUCT_STATXFS_F_FSID___VAL): Define.  This
3636         macro was being used without being defined.
3637         (SB_F_NAMEMAX): Remove cast.
3638         (f_fsid) [BeOS]: Likewise.
3639         (OUT_NAMEMAX): Renamed from NAMEMAX_FORMAT, with a new meaning.
3640         All uses changed.
3641         (out_string, out_int, out_uint, out_uint_o, out_uint_x): New
3642         functions.
3643         (xstrcat): Remove.  All uses changed to use the above functions.
3644         (print_statfs, print_stat): 2nd arg is now the prefix len, not the
3645         buffer len.  All uses changed.  Output '?', not '*', for unknown
3646         data or errors.  Do not assume signed values can be interchanged
3647         with unsigned when printing.
3648         (print_statfs): For %i, print the fsid as a single int, not as a
3649         pair.
3650         (print_it): Quote invalid format better.
3651
3652         * NEWS: printf supports the I flag.
3653         * src/printf.c (print_formatted) [glibc 2.2 or later]: Likewise.
3654
3655 2006-08-23  Bruno Haible  <bruno@clisp.org>
3656
3657         * src/stat.c (STRUCT_STATVFS, statfs, f_fsid, f_blocks, f_bfree) [BeOS]:
3658         (f_bavail, f_bsize, STATFS_FRSIZE, f_files, f_ffree) [BeOS]:
3659         (STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME) [BeOS]: Define.
3660
3661         * src/ls.c (SA_RESTART): Fallback define.
3662
3663 2006-08-23  Paul Eggert  <eggert@cs.ucla.edu>
3664
3665         * src/system.h (EDQUOT): Define if not already defined.
3666         Problem reported by Bruno Haible for BeOS.
3667
3668         * .cvsignore: Remove config.h, config.hin, as they are now
3669         in lib.
3670         * configure.ac (AC_CONFIG_HEADERS): Move config.h and config.hin
3671         to lib.
3672         * src/Makefile.am (AM_CPPFLAGS): Remove '-I..'; no longer needed.
3673
3674         * bootstrap (slurp): Define gl_LOCK_EARLY instead of gl_LOCK,
3675         to accommodate today's gnulib change.
3676
3677 2006-08-23  Jim Meyering  <jim@meyering.net>
3678
3679         * NEWS: Mention the sweeping infrastructure changes.
3680
3681 2006-08-22  Paul Eggert  <eggert@cs.ucla.edu>
3682
3683         * bootstrap.conf (gnulib_modules): Add gnupload.
3684         * Makefile.maint (emit_upload_commands): gnupload is now
3685         in build-aux.
3686         * gnupload: Remove from CVS, since it's now a gnulib module.
3687
3688         * bootstrap (bootstrap_conf_cleanup): Remove.
3689         (excluded_files): New var.
3690         * bootstrap.conf: Likewise.
3691         * bootstrap (slurp): Exclude files early if they're in the
3692         excluded_files list.  That way, their names don't get put into
3693         .cvsignore.
3694
3695         * aclocal.m4, config.hin, configure:
3696         Remove from CVS, since ./bootstrap generates them automatically.
3697         * .cvsignore: Add INSTALL, Makefile.in, aclocal.m4, config.hin,
3698         configure, *.cache, *.lineno, *.log.
3699         Remove more-specific entries.  This catches files like configure.lineno.
3700         * man/.cvsignore: Add Makefile.in.
3701         * src/.cvsignore: Add Makefile.in.
3702         Remove .version, dir.c, install, mvdir, stamp-v, vdir.c, version.c.
3703
3704         * tests/.cvsignore:
3705         * tests/chgrp/.cvsignore:
3706         * tests/chmod/.cvsignore:
3707         * tests/chown/.cvsignore:
3708         * tests/cp/.cvsignore:
3709         * tests/cut/.cvsignore:
3710         * tests/dd/.cvsignore:
3711         * tests/dircolors/.cvsignore:
3712         * tests/du/.cvsignore:
3713         * tests/expr/.cvsignore:
3714         * tests/factor/.cvsignore:
3715         * tests/fmt/.cvsignore:
3716         * tests/head/.cvsignore:
3717         * tests/install/.cvsignore:
3718         * tests/join/.cvsignore:
3719         * tests/ln/.cvsignore:
3720         * tests/ls/.cvsignore:
3721         * tests/ls-2/.cvsignore:
3722         * tests/md5sum/.cvsignore:
3723         * tests/misc/.cvsignore:
3724         * tests/mkdir/.cvsignore:
3725         * tests/mv/.cvsignore:
3726         * tests/od/.cvsignore:
3727         * tests/pr/.cvsignore:
3728         * tests/readlink/.cvsignore:
3729         * tests/rm/.cvsignore:
3730         * tests/rmdir/.cvsignore:
3731         * tests/seq/.cvsignore:
3732         * tests/sha1sum/.cvsignore:
3733         * tests/shred/.cvsignore:
3734         * tests/sort/.cvsignore:
3735         * tests/stty/.cvsignore:
3736         * tests/sum/.cvsignore:
3737         * tests/tac/.cvsignore:
3738         * tests/tail/.cvsignore:
3739         * tests/tail-2/.cvsignore:
3740         * tests/tee/.cvsignore:
3741         * tests/test/.cvsignore:
3742         * tests/touch/.cvsignore:
3743         * tests/tr/.cvsignore:
3744         * tests/tsort/.cvsignore:
3745         * tests/unexpand/.cvsignore:
3746         * tests/uniq/.cvsignore:
3747         * tests/wc/.cvsignore:
3748         Add Makefile.in.  Sort entries if necessary.  Remove *.I, *.E,
3749         *.X, *.O, *-tests, build-script, mk-script if they're never
3750         created in this directory.
3751
3752 2006-08-22  Bruno Haible  <bruno@clisp.org>
3753
3754         BeOS portability.
3755         * src/uptime.c: Include OS.h if it exists.
3756         (print_uptime): On BeOS, use the get_system_info function (actually a
3757         macro). Loop through utmp entries only if utmp.h or utmpx.h exists.
3758         (uptime): Call read_utmp only if utmp.h or utmpx.h exists.
3759
3760 2006-08-22  Jim Meyering  <jim@meyering.net>
3761
3762         * .cvsignore: Add ABOUT-NLS.
3763
3764         Move the check-AUTHORS rule to be run as part of "make distcheck",
3765         rather than "make check".
3766         * src/Makefile.am (check): Don't depend on check-AUTHORS; it would
3767         cause "make check" to fail on systems unable to build all binaries.
3768         * Makefile.maint (check-AUTHORS): New rule.
3769         (local-checks-available): Add it here.
3770         Reported by Bruno Haible.  Needed for BeOS.
3771
3772 2006-08-21  Paul Eggert  <eggert@cs.ucla.edu>
3773
3774         * src/df.c (print_header, show_dev): Use a column width that
3775         depends on the block size of -P is specified and not autoscaling.
3776         Problem reported by Gustavo G. Rondina in:
3777         http://lists.gnu.org/archive/html/bug-coreutils/2006-08/msg00164.html
3778
3779 2006-08-21  Jim Meyering  <jim@meyering.net>
3780
3781         * tests/dircolors/simple (a): Don't fail with an unexpected diagnostic
3782         when the shell variable, SHELL, is not set.
3783         Trigger the failure with "(unset SHELL; make check TESTS=simple)".
3784         Reported by Sven Joachim in <http://bugs.debian.org/355368>.
3785
3786         * src/od.c: Now that HAVE_UNSIGNED_LONG_LONG is no longer defined
3787         in config.h, change the uses to HAVE_UNSIGNED_LONG_LONG_INT.
3788         Otherwise, on a system with 4-byte longs, "od -t u8" fails with this:
3789         od: invalid type string `u8';
3790         this system doesn't provide a 8-byte integral type
3791         FIXME: add a test for this, but skip it when sizeof uintmax < 8.
3792
3793 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
3794
3795         Add a bootstrap procedure, so that the CVS version contains fewer
3796         files and we bootstrap the rest from gnulib, gettext, etc.
3797         * README-cvs: New file.
3798         * bootstrap: New file.
3799         * bootstrap.conf: New file.
3800         * .x-sc_trailing_blank: Remove config-log, .gdb-history.  Add .po.
3801         * configure.ac (AC_PREREQ): Move here from m4/*.m4, for benefit
3802         of gnulib-tool.
3803         (gl_DEFAULT_POSIX2_VERSION, gl_USE_SYSTEM_EXTENSIONS, gl_PERL):
3804         (gl_IGNORE_UNUSED_LIBRARIES): Remove; now done by gnulib.
3805         (gl_EARLY): Add.
3806         (gl_MACROS): Call just after gl_EARLY, just for clarity.
3807         * src/c99-to-c89.diff: Remove patch to ls.c; no longer needed.
3808         * src/kill.c (strtoimax): Remove decl.
3809         * src/ls.c: Include "wcwidth.h" instead of rolling it ourselves.
3810         * src/wc.c: Likewise.
3811         * src/ls.c (sort_files): Rewrite to avoid need for C99-style
3812         declaration, so that we don't need to patch this file.
3813         * src/printf.c (strtoimax, strtoumax): Remove decls.
3814         * src/su.c: Include getpass.h.
3815         (getpass): remove.
3816         * src/system.h: Include mempcpy.h, stpcpy.h, strpbrk.h.
3817         Include inttypes.h unconditionally.
3818         (LONGEST_MODIFIER, PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Remove.
3819         (stpcpy, strndup, strstr, strtoul, mempcpy, CHAR_MIN, CHAR_MAX):
3820         (SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, SHRT_MIN, SHRT_MAX, INT_MAX):
3821         (INT_MIN, INTMAX_MAX, INTMAX_MIN, UINT_MAX, LONG_MAX, ULONG_MAX):
3822         (SIZE_MAX, SSIZE_MAX, UINTMAX_MAX): Remove.
3823
3824         * ABOUT-NLS, INSTALL, Makefile.in, man/Makefile.in:
3825         * src/Makefile.in, tests/Makefile.in, tests/chgrp/Makefile.in:
3826         * tests/chmod/Makefile.in, tests/chown/Makefile.in:
3827         * tests/cp/Makefile.in, tests/cut/Makefile.in:
3828         * tests/dd/Makefile.in, tests/dircolors/Makefile.in:
3829         * tests/du/Makefile.in, tests/expr/Makefile.in:
3830         * tests/factor/Makefile.in, tests/fmt/Makefile.in:
3831         * tests/general/Makefile.in, tests/head/Makefile.in:
3832         * tests/install/Makefile.in, tests/join/Makefile.in:
3833         * tests/ln/Makefile.in, tests/ls/Makefile.in:
3834         * tests/ls-2/Makefile.in, tests/md5sum/Makefile.in:
3835         * tests/misc/Makefile.in, tests/mkdir/Makefile.in:
3836         * tests/mv/Makefile.in, tests/od/Makefile.in:
3837         * tests/pr/Makefile.in, tests/readlink/Makefile.in:
3838         * tests/rm/Makefile.in, tests/rmdir/Makefile.in:
3839         * tests/seq/Makefile.in, tests/sha1sum/Makefile.in:
3840         * tests/shred/Makefile.in, tests/sort/Makefile.in:
3841         * tests/stty/Makefile.in, tests/sum/Makefile.in:
3842         * tests/tac/Makefile.in, tests/tail/Makefile.in:
3843         * tests/tail-2/Makefile.in, tests/tee/Makefile.in:
3844         * tests/test/Makefile.in, tests/touch/Makefile.in:
3845         * tests/tr/Makefile.in, tests/tsort/Makefile.in:
3846         * tests/unexpand/Makefile.in, tests/uniq/Makefile.in:
3847         * tests/wc/Makefile.in:
3848         Remove from CVS, since ./bootstrap generates them automatically.
3849
3850 2006-08-20  Eric Blake  <ebb9@byu.net>
3851
3852         * src/stat.c (USE_STATVFS): Reinstate the patch from 2006-08-15;
3853         the patch from 2006-08-18 broke on cygwin.
3854
3855 2006-08-20  Jim Meyering  <jim@meyering.net>
3856
3857         * NEWS: Add a line for 6.2-cvs.
3858         * configure.ac (AC_INIT): Bump to 6.2 and add "-cvs" suffix.
3859
3860 2006-08-19  Jim Meyering  <jim@meyering.net>
3861
3862         * Version 6.1.
3863         * NEWS: Record the 6.1 release date.
3864         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
3865
3866         * tests/Makefile.am (EXTRA_DIST): Add sparse-file.
3867
3868         Avoid test failure when `make check' is run through debuild.
3869         * tests/help-version: Ensure that $SHELL is set to some value
3870         and exported.  Patch from Sven Joachim.  For details, see
3871         <http://bugs.debian.org/355368>.
3872
3873         * tests/ls/stat-dtype: Test for the 2006-08-17 `ls -CF' fix.
3874
3875         * README: Describe potential "pre-C99 build failure", and work-around.
3876
3877         Some of my 2006-07-03 changes to tests/*/Makefile.am were being
3878         backed out due to updates provoked by the copyright changes.
3879         * tests/Makefile.am.in (PATH): Prepend $(VG_PATH_PREFIX), so that
3880         it propagates to the derived Makefile.am files.
3881         ($(srcdir)/Makefile.am): Mark generated .am files as read-only,
3882         so we don't mistakenly edit them again.
3883         * tests/cut/Makefile.am: Regenerate.
3884         * tests/head/Makefile.am: Likewise.
3885         * tests/join/Makefile.am: Likewise.
3886         * tests/pr/Makefile.am: Likewise.
3887         * tests/sort/Makefile.am: Likewise.
3888         * tests/tac/Makefile.am: Likewise.
3889         * tests/tail/Makefile.am: Likewise.
3890         * tests/test/Makefile.am: Likewise.
3891         * tests/tr/Makefile.am: Likewise.
3892         * tests/uniq/Makefile.am: Likewise.
3893         * tests/wc/Makefile.am: Likewise.
3894
3895         * NEWS: Fix cp --sparse so that it preserves tail-end sparseness, even
3896         when the file's apparent size is not a multiple of its block size.
3897         * src/copy.c (copy_reg): Don't write a NUL before calling ftruncate.
3898         For some file sizes, writing that single byte would unnecessarily
3899         waste a few file blocks.  That write may have been necessary in the
3900         early days of Linux, but now, removing it should be safe.
3901         Based on a patch by Alan Curry: <http://bugs.debian.org/370792>
3902         * tests/cp/sparse: New test for the above.
3903         * tests/cp/Makefile.am (TESTS): Add sparse.
3904
3905         * tests/sparse-file: New file, essence factored out of...
3906         * tests/du/8gb: ... here.  Use the new script.
3907
3908 2006-08-18  Paul Eggert  <eggert@cs.ucla.edu>
3909
3910         * src/system.h (select_plural): Reduce by 1000000, not 1000, since
3911         the CVS gettext manual now suggests 1000000.
3912
3913 2006-08-18  Bruno Haible  <bruno@clisp.org>
3914
3915         Add support for NetBSD 3.0.
3916         * src/stat.c (USE_STATVFS): Set to 1 if 'struct statvfs' has a field
3917         f_fstypename.
3918         (STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME): Define also if 'struct statvfs'
3919         has a field f_fstypename.
3920         This undoes the 2006-08-15 to src/stat.c.
3921
3922 2006-08-17  Paul Eggert  <eggert@cs.ucla.edu>
3923
3924         Copyright notice fixes.
3925
3926         * COPYING: Upgrade to latest version from FSF.
3927
3928         * src/uname.c: Use (C) in copyright notice.
3929
3930         * .vg-suppressions: Add copyright notice.
3931         * ChangeLog: Likewise.
3932         * ChangeLog-2005: Likewise.
3933         * Makefile.am: Likewise.
3934         * NEWS: Likewise.
3935         * README: Likewise.
3936         * README-valgrind: Likewise.
3937         * TODO: Likewise.
3938         * announce-gen: Likewise.
3939         * man/Makefile.am: Likewise.
3940         * man/chmod.x: Likewise.
3941         * man/chown.x: Likewise.
3942         * man/df.x: Likewise.
3943         * man/du.x: Likewise.
3944         * man/rm.x: Likewise.
3945         * src/dircolors.hin: Likewise.
3946         * src/du-tests: Likewise.
3947         * src/extract-magic: Likewise.
3948         * src/tac-pipe.c: Likewise.
3949         * src/wheel-gen.pl: Likewise.
3950         * tests/Coreutils.pm: Likewise.
3951         * tests/Makefile.am.in: Likewise.
3952         * tests/acl: Likewise.
3953         * tests/envvar-check: Likewise.
3954         * tests/expensive: Likewise.
3955         * tests/group-names: Likewise.
3956         * tests/help-version: Likewise.
3957         * tests/mk-script: Likewise.
3958         * tests/priv-check: Likewise.
3959         * tests/rwx-to-mode: Likewise.
3960         * tests/sample-test: Likewise.
3961         * tests/setgid-check: Likewise.
3962         * tests/chgrp/basic: Likewise.
3963         * tests/chgrp/deref: Likewise.
3964         * tests/chgrp/no-x: Likewise.
3965         * tests/chgrp/posix-H: Likewise.
3966         * tests/chgrp/recurse: Likewise.
3967         * tests/chmod/c-option: Likewise.
3968         * tests/chmod/equal-x: Likewise.
3969         * tests/chmod/equals: Likewise.
3970         * tests/chmod/no-x: Likewise.
3971         * tests/chmod/octal: Likewise.
3972         * tests/chmod/setgid: Likewise.
3973         * tests/chmod/umask-x: Likewise.
3974         * tests/chmod/usage: Likewise.
3975         * tests/chown/basic: Likewise.
3976         * tests/chown/deref: Likewise.
3977         * tests/chown/separator: Likewise.
3978         * tests/cp/Makefile.am: Likewise.
3979         * tests/cp/acl: Likewise.
3980         * tests/cp/backup-1: Likewise.
3981         * tests/cp/backup-is-src: Likewise.
3982         * tests/cp/cp-HL: Likewise.
3983         * tests/cp/cp-deref: Likewise.
3984         * tests/cp/cp-mv-backup: Likewise.
3985         * tests/cp/cp-parents: Likewise.
3986         * tests/cp/deref-slink: Likewise.
3987         * tests/cp/dir-rm-dest: Likewise.
3988         * tests/cp/dir-slash: Likewise.
3989         * tests/cp/dir-vs-file: Likewise.
3990         * tests/cp/fail-perm: Likewise.
3991         * tests/cp/into-self: Likewise.
3992         * tests/cp/link: Likewise.
3993         * tests/cp/link-no-deref: Likewise.
3994         * tests/cp/link-preserve: Likewise.
3995         * tests/cp/no-deref-link1: Likewise.
3996         * tests/cp/no-deref-link2: Likewise.
3997         * tests/cp/no-deref-link3: Likewise.
3998         * tests/cp/perm: Likewise.
3999         * tests/cp/preserve-2: Likewise.
4000         * tests/cp/r-vs-symlink: Likewise.
4001         * tests/cp/same-file: Likewise.
4002         * tests/cp/slink-2-slink: Likewise.
4003         * tests/cp/special-bits: Likewise.
4004         * tests/cp/symlink-slash: Likewise.
4005         * tests/cut/Makefile.am: Likewise.
4006         * tests/cut/Test.pm: Likewise.
4007         * tests/dd/misc: Likewise.
4008         * tests/dd/not-rewound: Likewise.
4009         * tests/dd/skip-seek: Likewise.
4010         * tests/dd/skip-seek2: Likewise.
4011         * tests/dd/unblock-sync: Likewise.
4012         * tests/dircolors/simple: Likewise.
4013         * tests/du/2g: Likewise.
4014         * tests/du/8gb: Likewise.
4015         * tests/du/Makefile.am: Likewise.
4016         * tests/du/basic: Likewise.
4017         * tests/du/deref: Likewise.
4018         * tests/du/deref-args: Likewise.
4019         * tests/du/exclude: Likewise.
4020         * tests/du/fd-leak: Likewise.
4021         * tests/du/files0-from: Likewise.
4022         * tests/du/hard-link: Likewise.
4023         * tests/du/inaccessible-cwd: Likewise.
4024         * tests/du/long-from-unreadable: Likewise.
4025         * tests/du/long-sloop: Likewise.
4026         * tests/du/no-deref: Likewise.
4027         * tests/du/no-x: Likewise.
4028         * tests/du/restore-wd: Likewise.
4029         * tests/du/slash: Likewise.
4030         * tests/du/slink: Likewise.
4031         * tests/du/trailing-slash: Likewise.
4032         * tests/du/two-args: Likewise.
4033         * tests/expr/basic: Likewise.
4034         * tests/factor/basic: Likewise.
4035         * tests/fmt/basic: Likewise.
4036         * tests/fmt/long-line: Likewise.
4037         * tests/general/Makefile.am: Likewise.
4038         * tests/general/atgeneral.m4: Likewise.
4039         * tests/general/dd.at: Likewise.
4040         * tests/head/Makefile.am: Likewise.
4041         * tests/head/Test.pm: Likewise.
4042         * tests/install/basic-1: Likewise.
4043         * tests/install/create-leading: Likewise.
4044         * tests/install/d-slashdot: Likewise.
4045         * tests/install/trap: Likewise.
4046         * tests/join/Makefile.am: Likewise.
4047         * tests/join/Test.pm: Likewise.
4048         * tests/ln/backup-1: Likewise.
4049         * tests/ln/misc: Likewise.
4050         * tests/ln/sf-1: Likewise.
4051         * tests/ln/target-1: Likewise.
4052         * tests/ls/Makefile.am: Likewise.
4053         * tests/ls/Test.pm: Likewise.
4054         * tests/ls/dangle: Likewise.
4055         * tests/ls/dired: Likewise.
4056         * tests/ls/file-type: Likewise.
4057         * tests/ls/follow-slink: Likewise.
4058         * tests/ls/infloop: Likewise.
4059         * tests/ls/inode: Likewise.
4060         * tests/ls/m-option: Likewise.
4061         * tests/ls/no-arg: Likewise.
4062         * tests/ls/recursive: Likewise.
4063         * tests/ls/rt-1: Likewise.
4064         * tests/ls/stat-dtype: Likewise.
4065         * tests/ls/stat-failed: Likewise.
4066         * tests/ls/stat-vs-dirent: Likewise.
4067         * tests/ls/symlink-slash: Likewise.
4068         * tests/ls/time-1: Likewise.
4069         * tests/ls-2/tests: Likewise.
4070         * tests/md5sum/basic-1: Likewise.
4071         * tests/md5sum/newline-1: Likewise.
4072         * tests/misc/Makefile.am: Likewise.
4073         * tests/misc/base64: Likewise.
4074         * tests/misc/basename: Likewise.
4075         * tests/misc/cat-proc: Likewise.
4076         * tests/misc/close-stdout: Likewise.
4077         * tests/misc/csplit: Likewise.
4078         * tests/misc/date: Likewise.
4079         * tests/misc/date-sec: Likewise.
4080         * tests/misc/df: Likewise.
4081         * tests/misc/dirname: Likewise.
4082         * tests/misc/expand: Likewise.
4083         * tests/misc/false-status: Likewise.
4084         * tests/misc/fold: Likewise.
4085         * tests/misc/head-c: Likewise.
4086         * tests/misc/head-elide-tail: Likewise.
4087         * tests/misc/head-pos: Likewise.
4088         * tests/misc/mknod: Likewise.
4089         * tests/misc/nice: Likewise.
4090         * tests/misc/nl: Likewise.
4091         * tests/misc/nohup: Likewise.
4092         * tests/misc/paste-no-nl: Likewise.
4093         * tests/misc/pathchk1: Likewise.
4094         * tests/misc/printf: Likewise.
4095         * tests/misc/printf-hex: Likewise.
4096         * tests/misc/pwd-long: Likewise.
4097         * tests/misc/sha224sum: Likewise.
4098         * tests/misc/sha256sum: Likewise.
4099         * tests/misc/sha384sum: Likewise.
4100         * tests/misc/sha512sum: Likewise.
4101         * tests/misc/shuf: Likewise.
4102         * tests/misc/sort-merge: Likewise.
4103         * tests/misc/sort-rand: Likewise.
4104         * tests/misc/split-a: Likewise.
4105         * tests/misc/split-fail: Likewise.
4106         * tests/misc/split-l: Likewise.
4107         * tests/misc/stat-fmt: Likewise.
4108         * tests/misc/stat-printf: Likewise.
4109         * tests/misc/tac-continue: Likewise.
4110         * tests/misc/test-diag: Likewise.
4111         * tests/misc/tty-eof: Likewise.
4112         * tests/misc/wc-files0: Likewise.
4113         * tests/misc/wc-files0-from: Likewise.
4114         * tests/mkdir/concurrent-1: Likewise.
4115         * tests/mkdir/p-1: Likewise.
4116         * tests/mkdir/p-2: Likewise.
4117         * tests/mkdir/p-3: Likewise.
4118         * tests/mkdir/p-slashdot: Likewise.
4119         * tests/mkdir/p-thru-slink: Likewise.
4120         * tests/mkdir/parents: Likewise.
4121         * tests/mkdir/perm: Likewise.
4122         * tests/mkdir/special-1: Likewise.
4123         * tests/mkdir/t-slash: Likewise.
4124         * tests/mkdir/writable-under-readonly: Likewise.
4125         * tests/mv/Makefile.am: Likewise.
4126         * tests/mv/acl: Likewise.
4127         * tests/mv/atomic: Likewise.
4128         * tests/mv/backup-is-src: Likewise.
4129         * tests/mv/childproof: Likewise.
4130         * tests/mv/diag: Likewise.
4131         * tests/mv/dir-file: Likewise.
4132         * tests/mv/dir2dir: Likewise.
4133         * tests/mv/dup-source: Likewise.
4134         * tests/mv/force: Likewise.
4135         * tests/mv/hard-2: Likewise.
4136         * tests/mv/hard-3: Likewise.
4137         * tests/mv/hard-4: Likewise.
4138         * tests/mv/hard-link-1: Likewise.
4139         * tests/mv/i-1: Likewise.
4140         * tests/mv/i-2: Likewise.
4141         * tests/mv/i-3: Likewise.
4142         * tests/mv/i-4: Likewise.
4143         * tests/mv/i-link-no: Likewise.
4144         * tests/mv/into-self: Likewise.
4145         * tests/mv/into-self-2: Likewise.
4146         * tests/mv/into-self-3: Likewise.
4147         * tests/mv/into-self-4: Likewise.
4148         * tests/mv/leak-fd: Likewise.
4149         * tests/mv/mv-special-1: Likewise.
4150         * tests/mv/no-target-dir: Likewise.
4151         * tests/mv/part-fail: Likewise.
4152         * tests/mv/part-hardlink: Likewise.
4153         * tests/mv/part-rename: Likewise.
4154         * tests/mv/part-symlink: Likewise.
4155         * tests/mv/partition-perm: Likewise.
4156         * tests/mv/perm-1: Likewise.
4157         * tests/mv/reply-no: Likewise.
4158         * tests/mv/setup: Likewise.
4159         * tests/mv/to-symlink: Likewise.
4160         * tests/mv/trailing-slash: Likewise.
4161         * tests/mv/update: Likewise.
4162         * tests/mv/vfat: Likewise.
4163         * tests/od/od-N: Likewise.
4164         * tests/od/x8: Likewise.
4165         * tests/pr/Makefile.am: Likewise.
4166         * tests/pr/Test.pm: Likewise.
4167         * tests/readlink/can-e: Likewise.
4168         * tests/readlink/can-f: Likewise.
4169         * tests/readlink/can-m: Likewise.
4170         * tests/readlink/rl-1: Likewise.
4171         * tests/rm/Makefile.am: Likewise.
4172         * tests/rm/cycle: Likewise.
4173         * tests/rm/dangling-symlink: Likewise.
4174         * tests/rm/deep-1: Likewise.
4175         * tests/rm/dir-no-w: Likewise.
4176         * tests/rm/dir-nonrecur: Likewise.
4177         * tests/rm/dot-rel: Likewise.
4178         * tests/rm/empty-inacc: Likewise.
4179         * tests/rm/empty-name: Likewise.
4180         * tests/rm/f-1: Likewise.
4181         * tests/rm/fail-2eperm: Likewise.
4182         * tests/rm/fail-eperm: Likewise.
4183         * tests/rm/hash: Likewise.
4184         * tests/rm/i-1: Likewise.
4185         * tests/rm/i-no-r: Likewise.
4186         * tests/rm/inaccessible: Likewise.
4187         * tests/rm/interactive-always: Likewise.
4188         * tests/rm/interactive-once: Likewise.
4189         * tests/rm/ir-1: Likewise.
4190         * tests/rm/isatty: Likewise.
4191         * tests/rm/no-give-up: Likewise.
4192         * tests/rm/r-1: Likewise.
4193         * tests/rm/r-2: Likewise.
4194         * tests/rm/r-3: Likewise.
4195         * tests/rm/rm1: Likewise.
4196         * tests/rm/rm2: Likewise.
4197         * tests/rm/rm3: Likewise.
4198         * tests/rm/rm4: Likewise.
4199         * tests/rm/rm5: Likewise.
4200         * tests/rm/sunos-1: Likewise.
4201         * tests/rm/unread2: Likewise.
4202         * tests/rm/unread3: Likewise.
4203         * tests/rm/unreadable: Likewise.
4204         * tests/rmdir/fail-perm: Likewise.
4205         * tests/rmdir/ignore: Likewise.
4206         * tests/rmdir/t-slash: Likewise.
4207         * tests/seq/basic: Likewise.
4208         * tests/sha1sum/basic-1: Likewise.
4209         * tests/sha1sum/sample-vec: Likewise.
4210         * tests/shred/exact: Likewise.
4211         * tests/shred/remove: Likewise.
4212         * tests/sort/Makefile.am: Likewise.
4213         * tests/sort/Test.pm: Likewise.
4214         * tests/sort-time/Makefile: Likewise.
4215         * tests/sort-time/README: Likewise.
4216         * tests/sort-time/rand-gen: Likewise.
4217         * tests/stty/basic-1: Likewise.
4218         * tests/stty/row-col-1: Likewise.
4219         * tests/sum/basic-1: Likewise.
4220         * tests/sum/sysv: Likewise.
4221         * tests/tac/Makefile.am: Likewise.
4222         * tests/tac/Test.pm: Likewise.
4223         * tests/tail/Makefile.am: Likewise.
4224         * tests/tail/Test.pm: Likewise.
4225         * tests/tail-2/Makefile.am: Likewise.
4226         * tests/tail-2/append-only: Likewise.
4227         * tests/tail-2/assert: Likewise.
4228         * tests/tail-2/assert-2: Likewise.
4229         * tests/tail-2/big-4gb: Likewise.
4230         * tests/tail-2/fflush: Likewise.
4231         * tests/tail-2/infloop-1: Likewise.
4232         * tests/tail-2/proc-ksyms: Likewise.
4233         * tests/tail-2/start-middle: Likewise.
4234         * tests/tail-2/tail-n0f: Likewise.
4235         * tests/tee/basic: Likewise.
4236         * tests/tee/dash: Likewise.
4237         * tests/test/Makefile.am: Likewise.
4238         * tests/test/Test.pm: Likewise.
4239         * tests/touch/Makefile.am: Likewise.
4240         * tests/touch/dangling-symlink: Likewise.
4241         * tests/touch/empty-file: Likewise.
4242         * tests/touch/fail-diag: Likewise.
4243         * tests/touch/fifo: Likewise.
4244         * tests/touch/no-create-missing: Likewise.
4245         * tests/touch/no-rights: Likewise.
4246         * tests/touch/not-owner: Likewise.
4247         * tests/touch/obsolescent: Likewise.
4248         * tests/touch/read-only: Likewise.
4249         * tests/touch/relative: Likewise.
4250         * tests/tr/Makefile.am: Likewise.
4251         * tests/tr/Test.pm: Likewise.
4252         * tests/tr/failures: Likewise.
4253         * tests/tsort/basic-1: Likewise.
4254         * tests/unexpand/basic-1: Likewise.
4255         * tests/uniq/Makefile.am: Likewise.
4256         * tests/uniq/Test.pm: Likewise.
4257         * tests/wc/Makefile.am: Likewise.
4258         * tests/wc/Test.pm: Likewise.
4259
4260 2006-08-17  Jim Meyering  <jim@meyering.net>
4261
4262         ls -CF would misalign columns in some cases.
4263         * src/ls.c (get_type_indicator): New function.  extracted from...
4264         (print_type_indicator): ...here.  Use it.
4265         (length_of_file_name_and_frills): Use it here, too, rather than
4266         assuming stat.st_mode is valid.
4267         Reported by Andreas Schwab, here:
4268         <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7774>
4269         See the test for this above. FYI, I did ls -CF /proc and visually
4270         inspected the result.
4271
4272         * src/copy.c (copy_internal, same_file_ok): Adjust comments not
4273         to mention the now-removed cp_options.xstat member.
4274
4275         * Makefile.maint (patch-check): Adapt to work now that the patch
4276         modifies more than one file in src/.
4277
4278         With this patch, permit building with Solaris cc on Solaris 7.
4279         * src/c99-to-c89.diff: Add diffs to convert more c99-isms.
4280         This integrates patches from Bruno Haible.
4281
4282 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
4283
4284         Fix some problems reported by Bruno Haible.
4285         * tests/chmod/setgid (abs_srcdir): Remove; not used or needed.
4286         Skip this test if "chmod g+s d" silently does nothing.
4287         * tests/ls-2/tests: Skip this test suite if we can't set up files
4288         properly for the setuid-etc test.  This simplifies some of the
4289         hacks we were using to work around porting problems.
4290
4291 2006-08-16  Jim Meyering  <jim@meyering.net>
4292
4293         * tests/cp/Makefile.am: Don't mark "acl" as XFAIL.
4294         * tests/cp/acl: Instead, skip the test if either setfacl
4295         or getfacl fails.
4296         Reported by Michael Stone.
4297
4298 2006-08-16  Paul Eggert  <eggert@cs.ucla.edu>
4299
4300         * tests/lang-default (LC_ALL): Set to "C", so we get
4301         English-language diagnostics.  Unset the other variables; it
4302         should be portable to use 'unset' for this stuff nowadays.
4303         Problem reported by Bruno Haible.  Using "C" reverses the
4304         2000-10-22 change to fileutils in this area.
4305
4306         Fix bugs when printing plurals of numbers that are not
4307         unsigned long int values.
4308         * src/system.h (select_plural): New function.
4309         * src/md5sum.c (digest_check): Use select_plural to avoid bug.
4310         * src/uptime.c (print_uptime): Likewise.
4311         * src/dd.c (print_stats): Likewise.  Also, don't use ngettext to
4312         print a floating point number, as reducing to 0 or 1 doesn't work
4313         for some languages.  Instead, just use "s" for seconds since it
4314         doesn't need a plural form.
4315
4316 2006-08-16  Bruno Haible  <bruno@clisp.org>
4317
4318         Old versions of gzip would write --help output to stderr, and it
4319         would be annoying to see that in the output of every "make" command.
4320         * Makefile.maint (gzip_rsyncable): Throw away stderr output of
4321         "gzip --help".
4322
4323 2006-08-16  Andreas Schwab  <schwab@suse.de>
4324
4325         * tests/cp/acl: Don't use non-portable == operator for test.
4326
4327 2006-08-16  Jim Meyering  <jim@meyering.net>
4328
4329         * tests/ls/stat-dtype: Use stat to test file system type, rather
4330         than df -T, in case /etc/mtab lies.  Reported by Michael Stone.
4331
4332 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
4333
4334         * NEWS: Mention that df exits with nonzero status if it generates
4335         no output.  This change was in 6.0 but inadvertently unmentioned.
4336         * src/df.c (file_systems_processed): Renamed from n_valid_args, and now
4337         a boolean.
4338         (show_dev): Don't set it until we actually output something.
4339         Print the header if this is the first output.
4340         (main): Don't print a header, as that is now show_dev's job.
4341         * tests/misc/Makefile.am (TESTS): Add df.
4342         * tests/misc/df: New file.
4343
4344 2006-08-15  Eric Blake  <ebb9@byu.net>
4345
4346         * src/stat.c (USE_STATVFS): Define to 0 if f_type is needed, but
4347         statvfs.f_type not present.  See
4348         <http://savannah.gnu.org/bugs/?func=detailitem&item_id=16325>.
4349
4350 2006-08-15  Paul Eggert  <eggert@cs.ucla.edu>
4351
4352         * src/dd.c (print_stats): Don't substitute "1" for number, as this
4353         causes confusion for the Hungarian translators.  Problem reported
4354         by Egmont Koblinger here:
4355         http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7726
4356
4357 2006-08-15  Jim Meyering  <jim@meyering.net>
4358
4359         * .x-sc_require_config_h: Add lib/at-func.c.
4360
4361         * NEWS: Add a line for 6.1-cvs.
4362         * configure.ac (AC_INIT): Bump to 6.1 and add "-cvs" suffix.
4363
4364 2006-08-15  Jim Meyering  <jim@meyering.net>
4365
4366         * Version 6.0.
4367         * NEWS: Record the 6.0 release date.
4368         * configure.ac (AC_INIT): Remove "-cvs" suffix from version string.
4369
4370         * TODO: Add an item (convert to use gnulib-tool), add to the plan
4371         for id-vs-getgrouplist, and remove a few completed items.
4372
4373         * Makefile.maint (alpha beta major): Fix syntax error.
4374
4375 2006-08-13  Jim Meyering  <jim@meyering.net>
4376
4377         * src/shred.c (usage): Don't indent the second line of an item.
4378         Otherwise, help2man would misformat the output.
4379         Reported by Adam Buchbinder in <https://launchpad.net/bugs/48917>.
4380
4381 2006-08-11  Paul Eggert  <eggert@cs.ucla.edu>
4382
4383         * configure.ac (AM_GNU_GETTEXT): Upgrade to need-formatstring-macros.
4384         Suggested by Eric Blake to avoid problems like
4385         <http://lists.gnu.org/archive/html/bug-coreutils/2006-07/msg00087.html>.
4386
4387 2006-08-11  Jim Meyering  <jim@meyering.net>
4388
4389         * tests/ls/stat-vs-dirent: Too many (losing) systems trigger the
4390         failure that this test checks for (stat/dirent inode mismatch at
4391         a mount point), so continue to give a diagnostic about the failure,
4392         but don't actually count it as a failure.
4393
4394 2006-08-10  Paul Eggert  <eggert@cs.ucla.edu>
4395
4396         * ABOUT-NLS: Update from gettext 0.15.
4397         * configure.ac (AM_GNU_GETTEXT_VERSION): Update from 0.13.1 to 0.15.
4398
4399         * src/csplit.c (struct control): Remove fastmap member.
4400         (extract_regexp): Allocate fastmap separately, since otherwise
4401         it might move due to a realloc.  This fixes a bug that led
4402         to a core dump on 64-bit sparc Solaris 10 (Sun Studio 10).
4403
4404 2006-08-10  Jim Meyering  <jim@meyering.net>
4405
4406         * tests/ls/stat-dtype: If "." is tmpfs, skip this test unless uname -s
4407         reports "Linux".  This avoids a failure on Solaris 10's tmpfs.
4408         Redirect both stdout and stderr of df invocations.
4409
4410         * src/dircolors.hin: Add a TERM directive for each of the following:
4411         ansi, color-xterm, gnome, konsole, kterm, rxvt-cygwin,
4412         rxvt-cygwin-native, screen.linux, xterm-256color.
4413         Sort the TERM directives.
4414         From Mike Frysinger.
4415
4416 2006-08-09  Paul Eggert  <eggert@cs.ucla.edu>
4417
4418         * src/dd.c (usage): Warn about oflag=append without conv=notrunc.
4419         See Debian bug 373736.
4420
4421         * src/dircolors.hin: Add mlterm, rxvt-unicode; this fixes Debian
4422         bug 317503.
4423
4424         * src/.cvsignore: Add shuf.
4425
4426         * Makefile.maint: Remove the po-update procedure; it doesn't
4427         work with the new repository on http://www.iro.umontreal.ca/.
4428         For now I guess we'll have to fix things by hand.
4429         (do-po-update, po-update): Remove.  All references removed.
4430
4431         * src/shuf.c (next_line): New function.
4432         (read_input): Use it, to avoid relying on GCC-specific behavior
4433         with void * arithmetic.  Problem reported by Bob Proulx.
4434         * Makefile.maint (my-distcheck): Compile with -Wpointer-arith
4435         to detect this sort of problem automatically in the future.
4436
4437 2006-08-09  Jim Meyering  <jim@meyering.net>
4438
4439         * src/ls.c: Add a compile-time check to ensure that filetype
4440         and filetype_letter have the same number of elements.
4441
4442         * tests/misc/sort-rand: Remove use of --seed=S.
4443
4444 2006-08-08  Paul Eggert  <eggert@cs.ucla.edu>
4445
4446         Add a command 'shuf', and modify shred and sort to use the new
4447         random number generator library of 'shuf'.
4448
4449         * AUTHORS: Add shuf.
4450         * README: Likewise.
4451         * NEWS: Likewise.  Mention new --random-source option for shred
4452         and sort.  Move "sort +1 -2" notice to the appropriate section,
4453         and clarify its role with respect to POSIXLY_CORRECT.
4454         * man/.cvsignore: Add shuf.1.
4455         * man/Makefile.am (dist_man_MANS): Add shuf.1.
4456         (shuf.1): New dependency.
4457         * man/shuf.x: New file.
4458         * src/Makefile.am (bin_PROGRAMS): Add shuf.
4459         (EXTRA_DIST): Remove rand-isaac.c.
4460         (shuf_LDADD): New macro.
4461         * src/rand-isaac.c: Remove, moving most of its contents to
4462         lib/rand-isaac.c.
4463         * src/shuf.c: New file.
4464         * src/shred.c: Use new random-number interface rather than rand-isaac.c.
4465         Don't include rand-isaac.c; include randint.h and randread.h instead.
4466         (RANDOM_SOURCE_OPTION): New enum.
4467         (long_opts, usage, main): New option --random-source.
4468         * src/sort.c: Likewise.
4469         * src/shred.c (struct irand_state, irand_init, irand32, irand_mod): Remove.
4470         All callers changed to use randint interface.
4471         (fillrand): Remove.  All callers changed to use randread interface.
4472         (dopass): Remove dependency on ISAAC buffer size.
4473         (genpattern): Don't wipe the random state here.
4474         (randint_source): New static var.
4475         (clear_random_data): New function.
4476         (main): Allocate random source, and arrange to wipe it on exit.
4477         * src/sort.c: Include md5.h, randread.h, xmemxfrm.h.
4478         (longopts, usage, main): Remove undocumented --seed option;
4479         it's now replaced by --random-source.
4480         (rand_state, get_hash): Remove.
4481         (randread_source): New static var.
4482         (random_state, cmp_hashes, compare_random): New functions; they guarantee
4483         no collisions in the random hash function.
4484         (keycompare): Use compare_random for -R; don't fall back on comparing
4485         via memcoll, since compare_random does the right thing.
4486         * tests/misc/Makefile.am (TESTS): Add shuf.
4487         * tests/misc/shuf: New file.
4488
4489 2006-07-29  Paul Eggert  <eggert@cs.ucla.edu>
4490
4491         * src/copy.c (set_author): Preserve the st_author field via the
4492         file descriptor dest_desc.
4493
4494 2006-07-28  Paul Eggert  <eggert@cs.ucla.edu>
4495
4496         * NEWS: chmod now preserves setuid and setgid bits on directories
4497         if you use a numeric mode with them clear, e.g., "chmod 755 DIR".
4498
4499         Fix test case problems if working directory is setgid,
4500         reported by Bob Proulx.
4501         * tests/cp/fail-perm: Use symbolic mode so that we clear
4502         setgid bit more reliably on directories.
4503         * tests/mkdir/special-1 (set_mode_string): Likewise.
4504
4505 2006-07-27  Jim Meyering  <jim@meyering.net>
4506
4507         * src/chgrp.c (usage): Use correct grammar in description of the
4508         --reference option
4509         * src/chown.c (usage): Likewise.
4510
4511 2006-07-26  Thomas Schwinge  <tschwinge@gnu.org>  (tiny change)
4512
4513         * src/copy.c (set_author) [HAVE_STRUCT_STAT_ST_AUTHOR]:
4514         Correctly access SRC_SB's element ST_AUTHOR.
4515
4516 2006-07-26  Jim Meyering  <jim@meyering.net>
4517
4518         * tests/ls/stat-failed: Adapt to match new expected output.
4519         From Paul Eggert.
4520
4521         * src/ls.c (print_color_indicator): Test for S_IFREG first, rather
4522         than having the code test for all of the other types first.
4523         Hoist the set-uid/gid-testing code "up" into this new block.
4524         Classify any other type of file (e.g., S_TYPEISSHM, etc.) as
4525         C_ORPHAN, not as C_FILE.
4526
4527 2006-07-26  Jim Meyering  <jim@meyering.net>
4528
4529         Checking in a change from Paul.
4530
4531         2006-07-25  Paul Eggert  <eggert@cs.ucla.edu>
4532
4533         * src/ls.c (DT_INIT): Remove.  All uses removed.
4534         (enum filetype): Use an ordinary enum rather than trying to keep
4535         the values in sync with DT_FIFO etc.  That way, we don't have
4536         to make special assumptions about them.  All uses changed.
4537         (whiteout): New constant member of enum filetype.
4538         (filetype_letter): New constant, for use with enum filetype.
4539         (FILETYPE_INDICATORS): New initializer list.
4540         (print_dir): Add case for DT_WHT.
4541         (gobble_file): If stat fails, don't discard information from
4542         readdir; instead, preserve it so it can be printed.
4543         (print_long_format): Fall back on readdir result if stat info
4544         is not available.  Use "?" to denote each unknown mode char,
4545         instead of an overall "?", since we now know some of the mode
4546         typically.
4547         (print_type_indicator): Now that MODE isn't necessarily
4548         useful, guard all uses.
4549         Now that two blocks in the type-checking tree can set "type = C_FILE",
4550         move the suffix-handling code out and down.
4551
4552 2006-07-26  Jim Meyering  <jim@meyering.net>
4553
4554         Prepare for the above change.
4555         * src/ls.c [struct fileinfo] (stat_ok): Rename from stat_failed,
4556         and adjust uses.  From a patch by Paul Eggert.
4557
4558 2006-07-26  Jim Meyering  <jim@meyering.net>
4559
4560         * src/ls.c: Correct indentation/formatting in a few places.
4561
4562 2006-07-25  Paul Eggert  <eggert@cs.ucla.edu>
4563
4564         * tests/cp/fail-perm: Use "chmod 0500" rather than "chmod 500".
4565         Problem report and fix from Bob Proulx.
4566         * NEWS: Clarify the "chmod 0500" news, and correct the vague
4567         statements about compatibility with BSD.
4568
4569 2006-07-25  Jim Meyering  <jim@meyering.net>
4570
4571         * src/ls.c (gobble_file): When handling a stat-failed entry,
4572         print the entry name not the absolute_name -- to be consistent
4573         with the usual case.
4574         * tests/ls/stat-failed: Update accordingly.
4575
4576         * src/ls.c: Add parens around the new uses of ?: ternary operator.
4577
4578         * src/dircolors.hin: Mention that ORPHAN refers not just to dangling
4579         symlinks.
4580
4581         Get --dired offsets right when handling stat-failed entries.
4582         * src/ls.c (print_long_format): Be careful to increment P by the
4583         appropriate amount, even when inode_number_width and nlink_width
4584         are zero.
4585         * tests/ls/stat-failed: Test for the above.
4586
4587         * src/ls.c (gobble_file) [USE_ACL]: Don't use-uninitialized the
4588         have_acl member.  That would happen for a directory with both a
4589         non-stat'able entry and one with an ACL.
4590
4591         * src/ls.c (gobble_file): Make it so failure to stat a
4592         non-command-line file provokes an exit status of 1, not 0.
4593         Say "cannot access" rather than "cannot stat".
4594         * tests/ls/stat-failed: New file/test, for the above.
4595         * tests/ls/Makefile.am (TESTS): Add stat-failed.
4596         * tests/ls-2/tests (no-a-isdir-b): Update to reflect addition
4597         of "cannot access " to diagnostic.
4598
4599         * src/ls.c: Declare stat_failed to be "bool", not "int" everywhere.
4600
4601         * src/ls.c [enum filetype] (command_line): Remove member.  Not needed.
4602         Replace all occurrences of "type == command_line" with the
4603         equivalent, "command_line_arg".
4604
4605         * src/ls.c: Apply the stat-failed parts of Red Hat's
4606         coreutils-selinux.patch.  From Ulrich Drepper.
4607         This makes it so files not mentioned on the command line (e.g.,
4608         names read from a directory that *is* mentioned on the command
4609         line) for which stat fails are still listed.  With --color,
4610         such files are colored just like ORPHANs (aka dangling symlinks).
4611
4612         * src/df.c (n_valid_args): Declare global to be static.
4613
4614 2006-07-24  Jim Meyering  <jim@meyering.net>
4615
4616         * tests/ls/stat-dtype: Skip this test on reiserfs, since that file
4617         system lacks d_type support.
4618
4619 2006-07-22  Paul Eggert  <eggert@cs.ucla.edu>
4620
4621         * man/chmod.x: Update to reflect recent changes to coreutils.texi.
4622
4623 2006-07-21  Jim Meyering  <jim@meyering.net>
4624
4625         * src/su.c (usage): Correct typo in --help output: s/commmand/command/
4626         Reported by Tim Waugh.
4627         Also remove the comment duplicating much of --help output.
4628
4629         * src/ls.c (FILE_TYPE_INDICATOR_OPTION): Reposition this new
4630         name so the list remains alphabetized.
4631
4632         Fix another bug: ls --indicator-style=file-type would call
4633         stat for a symlink, even though it wasn't always needed.
4634         In some cases, that unnecessary stat would cause ls to fail.
4635         * src/ls.c (gobble_file): Don't treat symlinks specially (in
4636         requiring a stat syscall).  Remove the offending exclusion.
4637
4638         * NEWS: Mention the fix.
4639
4640         * tests/ls/stat-dtype: New file/test, for the above fix.
4641         Also exercises the new df feature, below.
4642
4643         * src/df.c (main): Fail and don't print the headers if no
4644         file system is processed.  This makes it easy to test whether
4645         a specified directory is on a file system of a given type or types.
4646         Otherwise, applications would have had to parse df's output.
4647         E.g., is "." either ext3 or reiserfs: df -t ext3 -t reiserfs .
4648
4649         Fix a bug: ls --file-type worked like --indicator-style=slash,
4650         rather than like --indicator-style=file-type.
4651         * src/ls.c (FILE_TYPE_INDICATOR_OPTION): New enum member.
4652         (long_options): Map "file-type" to FILE_TYPE_INDICATOR_OPTION,
4653         not to 'p'.
4654         (decode_switches): Handle new case: FILE_TYPE_INDICATOR_OPTION.
4655         * NEWS: Mention the fix.
4656         * tests/ls-2/tests (file-type): New test, for the above fix.
4657
4658 2006-07-19  Jim Meyering  <jim@meyering.net>
4659
4660         * src/ls.c (print_dir): Give a better diagnostic for failed opendir.
4661
4662         * Makefile.am (EXTRA_DIST): Add build-aux/vc-list-files.
4663
4664 2006-07-16  Paul Eggert  <eggert@cs.ucla.edu>
4665
4666         * NEWS: chmod, install, and mkdir now leave setgid and setuid bits
4667         of directories alone unless you specify them explicitly.
4668         install and mkdir now implement X correctly.
4669         install now creates parent directories with mode 755, without
4670         changing their owner or group.
4671         * src/chmod.c (process_file): Adjust to mode_adjust API change.
4672         * src/install.c: Include mkancesdirs.h.
4673         (announce_mkdir, make_ancestor): New functions.
4674         (DEFAULT_MODE): New macro, specifying initial value of 'mode'.
4675         (mode): Use it.
4676         (dir_mode, dir_mode_bits): New vars.
4677         (main): Set dir modes separately from nondir, so that the X
4678         op of -m works correctly.
4679         (main): Remove cwd_errno cruft, since make_dir_parents no longer
4680         affects cwd.  Adjust to new make_dir_parents API.
4681         (install_file_in_file_parents): 2nd arg is now char *, not char
4682         const *.  Use mkancesdirs instead of rolling our own code.
4683         (change_attributes): Don't worry about AFS, since that kludge
4684         should not be needed any more.
4685         * src/mkdir.c (struct mkdir_options): New struct.
4686         (announce_mkdir, make_ancestor): New functions.
4687         (main): Use them.  Adjust to mode_adjust API change.  Stick with
4688         umask 0.  Use make_dir_parents for all the work.
4689         * src/mkfifo.c (main): Adjust to new mode_adjust API.
4690         * src/mknod.c (main): Likewise.
4691         * tests/chmod/setgid: Do the setgid test instead of bailing.
4692         * tests/mkdir/p-3: Remove re_protect case that no longer applies.
4693         GNU chmod now behaves like other versions of chmod.
4694         * tests/mkdir/perm: Add a test for the X bug.
4695
4696 2006-07-14  Paul Eggert  <eggert@cs.ucla.edu>
4697
4698         * src/base64.c (do_decode): Output to parameter OUT, not to stdout.
4699         This doesn't fix any bugs, since OUT always equals stdout, but it
4700         makes the code easier to understand.
4701
4702 2006-07-14  Jim Meyering  <jim@meyering.net>
4703
4704         * Makefile.maint (CVS_LIST): Use new file, build-aux/vc-list-files,
4705         rather than open-coding it.  Now supports mercurial, too.
4706         * .hgignore: New file.
4707         * Makefile.am (EXTRA_DIST): Add .hgignore, which ignores nearly
4708         all generated files, including ones like configure and po/*.po
4709         that are currently version-controlled in cvs.
4710
4711         * Makefile.am (EXTRA_DIST): Add a few more .??* files.
4712         They've been in CVS, just haven't been distributed before this.
4713         Distribute ChangeLog-2005, too.
4714         (MAINTAINERCLEANFILES): Add THANKS-to-translators.
4715
4716 2006-07-11  Paul Eggert  <eggert@cs.ucla.edu>
4717
4718         * src/system.h: Assume <dirent.h> exists, since gnulib assumes
4719         this now as well.
4720
4721 2006-07-09  Jim Meyering  <jim@meyering.net>
4722
4723         * tests/mv/dir2dir: Adjust so failing with ENOTEMPTY is ok, too.
4724         That happens with Linux/tmpfs.
4725         * tests/mv/Makefile.am (TESTS): Add dir2dir.
4726
4727 2006-07-09  Paul Eggert  <eggert@cs.ucla.edu>
4728
4729         Adjust to recent updates from gnulib.
4730         * src/dd.c (apply_translations): Use toupper rather than
4731         islower followed by toupper; it's simpler and typically
4732         faster now that we assume at least C89 semantics.  Similarly
4733         for tolower.
4734         * src/sort.c (inittables): Likewise.
4735         * src/expand.c (expand): Don't assume that isprint etc. return
4736         booleans (needed for pre-C99 hosts).
4737         * src/fmt.c (check_punctuation): Likewise.
4738         * src/ptx.c (initialize_regex, fix_output_parameters): Likewise.
4739         * src/tr.c (is_char_class_member): Likewise.
4740         * src/unexpand.c (unexpand): Likewise.
4741         * src/join.c (is_blank): Remove; no longer needed.  All uses
4742         replaced by isblank (to_uchar (...)).
4743         * src/pinky.c (create_fullname): Don't assume char is unsigned.
4744         * src/printf.c (print_esc): Likewise.
4745         * src/ptx.c (SKIP_NON_WHITE, SKIP_WHITE, SKIP_WHITE_BACKWARDS):
4746         (copy_unescaped_string): Likewise.
4747         * src/stat.c (print_it): Likewise.
4748         * src/system.h (_D_EXACT_NAMELEN): Renamed from NLENGTH, for
4749         convenience on GNU systems.  All uses changed.  Don't bother
4750         looking for any dirent.h substitute other than ndir.h.
4751         (D_INO): Remove unnecessary parentheses.
4752         (IN_CTYPE_DOMAIN, ISGRAPH, ISPRINT, ISALNUM, ISALPHA):
4753         (ISCNTRL, ISLOWER, ISPUNCT, ISSPACE, ISUPPER, ISXDIGIT):
4754         (ISDIGIT_LOCALE, TOLOWER, TOUPPER): Remove.  All uses changed
4755         to ctype.h equivalents.
4756         (isblank): Renamed from ISBLANK.  Check for HAVE_DECL_ISBLANK too.
4757         All uses changed.
4758
4759 2006-07-08  Jim Meyering  <jim@meyering.net>
4760
4761         * tests/mv/dir2dir: New file, test for 2006-07-05 fix in copy.c.
4762
4763         * Makefile.maint (sc_the_the): New rule.
4764
4765         * src/dd.c (skip): Remove one of two adjacent "the"s in a comment.
4766         * tests/Coreutils.pm (run_tests): Remove one of two adjacent "then"s
4767         in a comment.
4768
4769 2006-07-07  Jim Meyering  <jim@meyering.net>
4770
4771         * NEWS: Mention that mv can now remove an empty destination directory,
4772         and give an example.  Prompted by a report from Florent Bayle.
4773
4774 2006-07-05  Jim Meyering  <jim@meyering.net>
4775
4776         * src/ls.c (usage): Correct the description of -G: it is useful
4777         only in a long listing.  Reported by Martin Pool in
4778         <https://launchpad.net/distros/ubuntu/+source/coreutils/+bug/51653>.
4779
4780         * man/chmod.x: Correct the description of the sticky bit.  Reported
4781         by Chris Moore via Ian Jackson in <http://bugs.debian.org/376745>.
4782
4783         * src/copy.c (copy_internal): Don't work around old NFS clients like
4784         SunOS-4.1.4 and Irix 5.3 that set errno to values like EIO and
4785         ENOTEMPTY upon failed rename.  Otherwise, we risk misinterpreting
4786         a banal failure as a recursive move-into-self failure.
4787         Reported by Florent Bayle in <http://bugs.debian.org/376749>.
4788
4789         * src/c99-to-c89.diff: Regenerate, to remove fuzz.
4790
4791 2006-07-03  Jim Meyering  <jim@meyering.net>
4792
4793         Plug another unusual leak.
4794         (AD_mark_helper): Free malloc'd filename if hash_insert says
4795         that string is already in the hash table.
4796
4797         The dev/inode of the topmost directory in each hierarchy were not
4798         being recorded.
4799         * src/remove.c (remove_cwd_entries): Don't call cycle_check here.
4800         (AD_push): Call it from here instead.
4801
4802         Fix two small leaks.
4803         * src/remove.c (AD_stack_clear): New function.
4804         (rm_1): Use it.
4805         (AD_pop_and_chdir): Free *prev_dir just before longjmp.
4806
4807         * tests/Makefile.am, tests/*/Makefile.am: (TESTS_ENVIRONMENT):
4808         Add $VG_PATH_PREFIX as a prefix to $PATH
4809
4810         * tests/envvar-check (vars): Add CDPATH and POSIXLY_CORRECT.
4811         * tests/Makefile.am (evar-check): Remove rule.
4812         (EXTRA_DIST): Remove .env-warn.
4813         * tests/.env-warn: Remove file.  No longer used.
4814         Suggestion from Eric Blake.
4815
4816 2006-07-02  Paul Eggert  <eggert@cs.ucla.edu>
4817
4818         * src/system.h: Include <stdint.h> unconditionally, since we
4819         now assume the stdint module.
4820
4821 2006-07-01  Paul Eggert  <eggert@cs.ucla.edu>
4822
4823         * NEWS: With no operand, 'tail -f' now silently ignores the '-f'
4824         only if standard input is a FIFO or pipe and POSIXLY_CORRECT is set.
4825         * src/tail.c (main): Implement this.
4826         * tests/tail/Test.pm (f-pipe-1): Renamed from f-1.
4827         (test_vector): Set POSIXLY_CORRECT for the f-pipe-* tests.
4828
4829 2006-07-01  Jim Meyering  <jim@meyering.net>
4830
4831         * src/ln.c (do_link): Use new, shorter URL, for ag-review link.
4832
4833         * .x-sc_require_config_h: Add ^lib/xstrtold\.c$, so make distcheck
4834         passes once again.
4835
4836 2006-06-30  Paul Eggert  <eggert@cs.ucla.edu>
4837
4838         * NEWS: seq now uses long double internally rather than double.
4839         It now defaults to a minimal fixed point format if possible.
4840         It lets you use %a, %A, %E, %F, %G.
4841         * src/Makefile.am (seq_LDADD): Remove $(SEQ_LIBM); add $(POW_LIB).
4842         * src/seq.c: Don't include <math.h> or <xstrtol.h>; no longer needed.
4843         (isfinite) [!defined isfinite]: New macro.
4844         (separator, terminator): Now points to const.
4845         (first, step, last): Remove.
4846         (usage): Update to match new behavior.
4847         (struct operand, operand): New type.
4848         (scan_arg): Renamed from scan_double_arg, since we no longer use double.
4849         All uses changed.
4850         Compute and return a value of type operand, not double.
4851         (long_double_format): Renamed from valid_format, and now returns a
4852         new format with an "L" added if needed, if the original format was
4853         valid.  Allow %a, %A, %E, %F, and %G formats.
4854         (print_numbers): Take numeric values as args rather than from globals.
4855         Print long double, not double.
4856         (get_width_format): Remove.
4857         (get_default_format): New function.
4858         (main): Implement new way of calculating default format.
4859         Don't worry about locale's representation of the decimal point, since
4860         the arguments are always processed in the C locale.
4861         * tests/seq/basic (neg-2): Adjust to new default format.
4862         (eq-wid-1, eq-wid-2): Resurrect these tests, since the new
4863         implementation should do the right thing.
4864
4865 2006-06-30  Jim Meyering  <jim@meyering.net>
4866
4867         * tests/stty/basic-1: Work around an intermittent test failure
4868         on HP-UX 11.11.  Report and analysis from Bob Proulx.
4869         http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7475
4870
4871 2006-06-28  Paul Eggert  <eggert@cs.ucla.edu>
4872
4873         * NEWS: Support obsolete usages like "sort +1 -2" even when
4874         conforming to POSIX 1003.1-2001, since this is a pure extension to
4875         POSIX.  Problem reported by Christian in:
4876         http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00220.html
4877         * src/sort.c (main): Implement this.
4878
4879         * src/system.h (CLOSEDIR): Remove.  All uses changed to closedir.
4880         Autoconf 2.60 says this stuff was obsolete.
4881
4882 2006-06-28  Jim Meyering  <jim@meyering.net>
4883
4884         * src/c99-to-c89.diff: Regenerate, to remove fuzz.
4885
4886 2006-06-28  Bob Proulx  <bob@proulx.com>  (tiny change)
4887
4888         * tests/mv/i-link-no: Work around HP-UX /bin/sh tracing problem
4889         (set -x when VERBOSE=yes) when stderr is redirected before stdout
4890         causing shell tracing of the stdout redirection to be written to
4891         the stderr file.  Avoid problem and test failure on HP-UX by
4892         redirecting stderr last.
4893         * tests/dd/unblock-sync: Order shell file redirections for
4894         stderr and stdout in the common style.
4895         tests/acl: Likewise.
4896
4897 2006-06-27  Jim Meyering  <jim@meyering.net>
4898
4899         * tests/misc/cat-proc: Try to avoid any spurious numeric
4900         differences in frequently-changing /proc/cpuinfo.
4901         Reported by Nelson Beebe.
4902
4903 2006-06-26  Jim Meyering  <jim@meyering.net>
4904
4905         Attempt rmdir (actually, unlinkat-with-AT_REMOVEDIR) upon any
4906         fd_to_subdirp failure, not just when errno == EACCES.
4907         * src/remove.c (remove_dir): Use unlinkat-with-AT_REMOVEDIR, not
4908         rmdir, here, even though rmdir may happen to be adequate.
4909
4910         * NEWS: rm no longer fails to remove an empty, unreadable directory
4911         * src/remove.c (remove_cwd_entries): If we can't open a directory,
4912         and the failure is not being ignored, try to remove the directory
4913         with rmdir (aka unlinkat-with-AT_REMOVEDIR), in case it's empty.
4914         Problem report and test case from Paul Eggert in
4915         <http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/7425>.
4916
4917         * tests/rm/empty-inacc: New test, for the above.
4918
4919         Avoid a segfault for wc --files0=- < /dev/null.
4920         * src/wc.c (compute_number_width): Return right away if nfiles == 0.
4921
4922 2006-06-25  Jim Meyering  <jim@meyering.net>
4923
4924         * NEWS: wc accepts a new option --files0-from=FILE, where FILE
4925         contains a list of NUL-separated file names.
4926
4927         * src/wc.c: Include "readtokens.h".
4928         (usage): Describe the new option, and adjust the `Usage':
4929         with this option, no FILE may be specified on the command line.
4930         (main): Handle the new option.
4931         * tests/misc/wc-files0: New tests, for the above.
4932         * tests/misc/wc-files0-from: Likewise.
4933         * tests/misc/Makefile.am (TESTS): Add wc-files0.
4934
4935 2006-06-24  Jim Meyering  <jim@meyering.net>
4936
4937         * src/md5sum.c (DIGEST_BUFFER): Remove now-unused definitions.
4938
4939 2006-06-22  Jim Meyering  <jim@meyering.net>
4940
4941         * src/tee.c (tee_files): Rename from tee, to avoid conflict with
4942         the function in glibc's <fcntl.h>.  Reported by Andreas Schwab.
4943
4944 2006-06-19  Jim Meyering  <jim@meyering.net>
4945
4946         * Makefile.cfg (local-checks-to-skip): Add changelog-check,
4947         so this check is not run as part of "make distcheck".
4948
4949 2006-06-18  Bob Proulx  <bob@proulx.com>  (tiny change)
4950
4951         * tests/misc/pwd-long: Fix typo (s/neq/ne/) in previous change.
4952
4953 2006-06-18  Jim Meyering  <jim@meyering.net>
4954
4955         * tests/misc/pwd-long: Make error output a little clearer.
4956
4957 2006-06-17  Jim Meyering  <jim@meyering.net>
4958
4959         * tests/rm/inaccessible: Skip this test on systems without openat
4960         support.  Reported by Bob Proulx.
4961
4962 2006-06-15  Bob Proulx  <bob@proulx.com>  (tiny change)
4963
4964         * tests/misc/mknod: Improve permission checks to handle
4965         running mkdir test in set-gid directories.
4966
4967 2006-06-14  Jim Meyering  <jim@meyering.net>
4968
4969         * tests/du/basic: Revamp not to hard-code file system block sizes.
4970
4971 2006-06-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
4972
4973         * tests/du/Makefile.am (TESTS_ENVIRONMENT): Pass $(PERL), for
4974         files0-from test.
4975
4976 2006-06-11  Jim Meyering  <jim@meyering.net>
4977
4978         * .gitignore: New file.
4979         * Makefile.am (EXTRA_DIST): Add .gitignore.
4980
4981         Setting TIME_STYLE=long-iso in the environment would make the
4982         cp/same-file test fail.
4983         * tests/envvar-check (vars): Add TIME_STYLE to the list.
4984         * tests/cp/same-file: Revert last change.
4985         Source the envvar-check script, to ensure that TIME_STYLE
4986         settings don't affect these tests.
4987
4988 2006-06-11  Paul Eggert  <eggert@cs.ucla.edu>
4989
4990         * tests/cp/same-file: Execute 'ls' in the C locale, so that it
4991         uses POSIX time stamp formats.  Problem reported by John Nixon in
4992         <http://lists.gnu.org/archive/html/bug-coreutils/2006-06/msg00062.html>.
4993
4994 2006-06-10  Jim Meyering  <jim@meyering.net>
4995
4996         * NEWS: Mention the AIX-strndup-bug vs. dircolors workaround.
4997
4998         Require a "Version N.M" line at the top of the ChangeLog
4999         file only when making the actual release, not when running
5000         "make distcheck".
5001         * Makefile.maint (maintainer-distcheck): Don't depend on
5002         changelog-check.
5003         (alpha beta major): Depend on it here, instead.
5004
5005 2006-06-08  Jim Meyering  <jim@meyering.net>
5006
5007         Ensure that cat works with any of the options, -A -v -e -E -T,
5008         when applied to files in /proc and /sys, even when the FIONREAD
5009         ioctl produces nonsensical results.  Before this change, cat would
5010         produce no output (or truncated output), for some linux kernels.
5011
5012         * src/cat.c (write_pending): New function, factored out of cat.
5013         (cat): Also interpret a negative ioctl/FIONREAD count as indicating
5014         that there are bytes to read.  Some versions of linux-2.6.16 do that.
5015         Write any pending output before returning.
5016         Reported by Dan Jacobson in <http://bugs.debian.org/370583>.
5017         * NEWS: Mention this bug fix.
5018         * tests/misc/cat-proc: New file.  Test for the above.
5019         * tests/misc/Makefile.am (TESTS): Add cat-proc.
5020
5021 2006-06-07  Paul Eggert  <eggert@cs.ucla.edu>
5022
5023         * src/expr.c (eval4): Detect overflow properly when multiplying
5024         INTMAX_MIN * -1.
5025
5026 2006-06-06  Paul Eggert  <eggert@cs.ucla.edu>
5027
5028         * NEWS: The 'expr' command now detects and reports integer overflow.
5029         (It would be better to use extended precision instead, but that
5030         would be more work.)
5031         * src/expr.c (integer_overflow): New function.
5032         (eval4, eval3): Check for integer overflow.
5033
5034 2006-06-05  Paul Eggert  <eggert@cs.ucla.edu>
5035
5036         Fix problems when building with Solaris/SVR4/etc. make, which uses a
5037         different and somewhat bogus implementation of VPATH.  In the
5038         directory tests/misc, rename tests whose names might appear in the
5039         Automake-generated rules.  For example, we can't use a test named
5040         'test', since Automake generates a rule that contains the text
5041         "if test -f ./$$tst; ...", and this might expand to something like
5042         "if ../../../coreutils-6.0/tests/misc/test -f ./$$test; ...",
5043         which executes the 'test' script rather than the 'test' command.
5044         * tests/misc/false-status: Renamed from tests/misc/false.
5045         * tests/misc/pwd-long: Renamed from tests/misc/pwd.
5046         * tests/misc/sort-merge: Renamed from tests/misc/sort.
5047         ($prog): Set to 'sort' rather than to $PROG.
5048         * tests/misc/test-diag: Renamed from tests/misc/test.
5049         * tests/misc/Makefile.am (PROG): Take the basename of $$tst,
5050         in case Solaris make has prepended the directory.
5051         (TESTS): Adjust to above renamings.
5052         * tests/misc/expand: Don't assign to PROG; no longer needed
5053         now that Makefile.am sets PROG to the basename.
5054         * tests/misc/fold: Likewise.
5055
5056 2006-06-03  Jim Meyering  <jim@meyering.net>
5057
5058         Make `cp --link --no-dereference' work also on systems where the
5059         link system call cannot create a hard link to a symbolic link.
5060         * src/copy.c (copy_internal) [LINK_FOLLOWS_SYMLINKS]: Don't use
5061         the link syscall on a symlink when it would do the wrong thing.
5062         Based on the patch by Aurelien Jarno: <http://bugs.debian.org/329451>
5063         * tests/cp/link-no-deref: New file/test for the above.
5064         * tests/cp/Makefile.am (TESTS): Add link-no-deref.
5065         * NEWS: Mention the change (doesn't affect Linux).
5066
5067 2006-06-01  Paul Eggert  <eggert@cs.ucla.edu>
5068
5069         Fix some porting problems in the test cases reported by
5070         Ralf Wildenhues for HP-UX 11.23 in:
5071         http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00238.html
5072         * tests/help-version: Don't assume that \< \> works in sed.
5073         * tests/misc/close-stdout: Don't assume that >&- works.
5074         Add a /dev/full test.
5075         * tests/touch/no-create-missing: Don't assume that >&- works.
5076
5077 2006-05-30  Jim Meyering  <jim@meyering.net>
5078
5079         * src/ls.c (usage): Add `v' to the list of sorting-related options.
5080         From Justin Pryzby.
5081
5082 2006-05-28  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
5083
5084         * tests/cp/fail-perm: source lang-default.
5085         * tests/rm/inaccessible: Likewise.
5086
5087 2006-05-28  Jim Meyering  <jim@meyering.net>
5088
5089         * tests/rm/inaccessible: AIX 4.3.3 gives a different diagnostic.
5090         Recognize it, too.  Reported by Ralf Wildenhues, in
5091         http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html
5092
5093 2006-05-27  Jim Meyering  <jim@meyering.net>
5094
5095         * src/chgrp.c: Support new options: --preserve-root and
5096         --no-preserve-root.  Somehow this program was skipped when those
5097         options were added to chown, chmod, and rm.  Reported by
5098         vaqflabuopac@spammotel.com in <http://bugs.debian.org/365656>.
5099         * NEWS: Mention this.
5100
5101 2006-05-25  Paul Eggert  <eggert@cs.ucla.edu>
5102
5103         * NEWS: Remove mention of --seed.  We'll replace it with something
5104         better, and don't want to indicate that it is supported.
5105         * src/sort.c (usage): Likewise.
5106
5107 2006-05-20  Jim Meyering  <jim@meyering.net>
5108
5109         * src/chmod.c (main): Use FTS_PHYSICAL here, too.
5110
5111         * src/du.c (main): Rename local, s/symlink_deref_bit/symlink_deref_bits/
5112         and arrange for -D to set fts' FTS_PHYSICAL bit as well as
5113         FTS_COMFOLLOW.  Spotted by Justin Pryzby.
5114
5115         * gnupload: Merge changes from automake, retaining the ""--to...
5116         kludge to placate overzealous `make distcheck' check.
5117
5118 2006-05-19  Jim Meyering  <jim@meyering.net>
5119
5120         * src/du.c (main): Don't let -D, -L, or -P turn off the internal
5121         FTS_TIGHT_CYCLE_CHECK directory traversal option.
5122         Reported by Justin Pryzby in http://bugs.debian.org/367691
5123
5124 2006-05-15  Jim Meyering  <jim@meyering.net>
5125
5126         * src/cp.c (usage): Correct description of -a: s/-dpR/-dpPR/.
5127         From Tomas Pospisek.
5128
5129 2006-05-13  Jim Meyering  <jim@meyering.net>
5130
5131         * tests/mv/no-target-dir: Test two more cases.
5132
5133 2006-05-11  Jim Meyering  <jim@meyering.net>
5134
5135         mv -T DIR EMPTY_DIR no longer fails unconditionally
5136         * src/copy.c (copy_internal): Don't manually prohibit a move where
5137         the destination is an existing directory.  Sometimes doing that is
5138         valid.  Let the rename system call enforce the rules.  That is
5139         allowed only when the source is a directory and the destination
5140         directory (to be replaced) is empty.  Reported by Eric Blake.
5141         * tests/mv/no-target-dir: New file/test for this.
5142         * tests/mv/Makefile.am (TESTS): Add no-target-dir.
5143         * NEWS: Mention this.
5144
5145         * tests/mv/atomic: New file/test for yesterday's fix.
5146         * tests/mv/Makefile.am (TESTS): Add atomic.
5147
5148         * tests/du/long-sloop: Avoid harmless `ambiguous redirect' diagnostic.
5149
5150 2006-05-10  Jim Meyering  <jim@meyering.net>
5151
5152         * src/copy.c (copy_internal): Don't explicitly unlink the destination
5153         when moving a symlink into the place of an existing non-directory.
5154         Reported by Joshua Hudson.
5155         * NEWS: mention this.
5156
5157 2006-05-07  Jim Meyering  <jim@meyering.net>
5158
5159         * Makefile.maint (patch-check): Fail if patch generates any output,
5160         even merely for changed offsets.
5161
5162         * src/c99-to-c89.diff: Adjust to reflect new offsets.
5163
5164         * NEWS: Mention changes affecting df, pwd, shred.
5165
5166 2006-05-06  Jim Meyering  <jim@meyering.net>
5167
5168         * tests/ls/stat-vs-dirent: New test, to detect the bogus file
5169         system condition where dirent.d_ino != stat.st_ino.
5170         * tests/ls/Makefile.am (TESTS): Add stat-vs-dirent.
5171
5172 2006-05-06  Eric Blake  <ebb9@byu.net>
5173
5174         * tests/ls/inode: Expand to test inode from readdir case.
5175         * tests/ls/follow-slink: Expand to test broken links encountered
5176         implicitly, favoring Solaris 9 and OpenBSD 3.4 behavior.
5177
5178 2006-05-06  Eric Blake  <ebb9@byu.net>
5179
5180         * tests/mv/leak-fd: Work even on case-insensitive file system.
5181
5182 2006-05-04  Jim Meyering  <jim@meyering.net>
5183
5184         * NEWS: Mention the 2006-03-19 pwd-related change that makes
5185         lib/getcwd.c work around inconsistent file system dirent.d_ino data.
5186
5187 2006-05-03  Jim Meyering  <jim@meyering.net>
5188
5189         * src/ls.c (DEFINE_SORT_FUNCTIONS, LIST_SORTFUNCTION_VARIANTS):
5190         Use better macro parameter names: s/basename/key_name/,
5191         s/basefunc/key_cmp_func.  Fix typo in comment.
5192
5193 2006-04-29  Eric Blake  <ebb9@byu.net>
5194
5195         * src/ls.c (main): On systems with d_type, directories_first only
5196         implies format_needs_type, not format_needs_stat.
5197
5198 2006-05-03  Jim Meyering  <jim@meyering.net>
5199
5200         * src/ls.c (xstrcoll_df_version, rev_xstrcoll_df_version): Add space
5201         after comma in arg list, from Eric Blake.
5202
5203 2006-04-25  Paul Eggert  <eggert@cs.ucla.edu>
5204
5205         * tests/misc/date (relative-3): New test, derived from a bug
5206         report by John Thomas McDole.
5207
5208 2006-04-23  Francesco Montorsi  <fr_m@hotmail.com>
5209
5210         New option for ls: --group-directories-first.
5211         It makes ls list directories before files.
5212         * NEWS [New features]: Mention it.
5213         * src/ls.c (sort_type): Rearrange to use as an array index when
5214         choosing sort function; added new sort_numtypes member for
5215         compile-time check.
5216         (time_type): Add new time_numtypes member for compile-time check.
5217         (directories_first): New global variable.
5218         (GROUP_DIRECTORIES_FIRST_OPTION): New enum.
5219         (long_options): Add --directories-first.
5220         (main): Support new option.
5221         (is_directory): New function.
5222         (extract_dirs_from_files): Use it.
5223         (DIRFIRST_CHECK, DEFINE_SORT_FUNCTIONS)
5224         (LIST_SORTFUNCTION_VARIANTS): New macros.
5225         (sort_functions): New global variable.
5226         (sort_files): Use it.
5227         (usage): Document new option.
5228
5229 2006-04-18  Paul Eggert  <eggert@cs.ucla.edu>
5230
5231         * src/shred.c (fillrand): The assertion was way too weak, due to
5232         what must be a typo.  Strengthen it to its intended value.
5233         (dopass): Don't use alloca; it's not worth the aggravation here,
5234         since it's used only to get a page-aligned buffer, and page
5235         alignment doesn't buy us much here.  I'm suspicious that alloca
5236         causes problems on some hosts, due to a recent bug report by Adam
5237         Waltman: http://bugs.gentoo.org/130246.
5238
5239 2006-04-18  Jim Meyering  <jim@meyering.net>
5240
5241         * tests/misc/tty-eof: Add new programs, base64, sha224sum, sha256sum,
5242         sha384sum, sha512sum.
5243
5244 2006-04-17  Paul Eggert  <eggert@cs.ucla.edu>
5245
5246         * src/chmod.c (describe_change): Adjust to filemode changes.
5247         * src/ls.c (HAVE_ST_DM_MODE): Remove; moved to ../lib/filemode.c.
5248         (print_long_format): Use (new) filemodestring rather than
5249         (old) mode_string, so that we get more file types right, at least
5250         in theory.  Adjust to filemode changes.
5251         * src/stat.c (human_access): Likewise.
5252
5253 2006-04-18  Jim Meyering  <jim@meyering.net>
5254
5255         * src/ptx.c (main) [DEFAULT_IGNORE_FILE]: Remove code to use a default
5256         ignore file.  This has never been enabled.  Reported by Eric Blake.
5257
5258 2006-04-12  Paul Eggert  <eggert@cs.ucla.edu>
5259
5260         * src/ln.c (linkfunc): Remove.  This method ran into a compiler/linker
5261         bug in Interix.  Just call symlink or link directly.  All uses changed.
5262         * src/setuidgid.c (main) [! HAVE_SETGROUPS]: Don't call setgroups.
5263         * src/stat.c (USE_STATVFS): New macro.
5264         Include <sys/statvfs.h> and use statvfs only if USE_STATVFS.
5265         (NAMEMAX_FORMAT): define a bit more clearly, now that the
5266         statvfs-using code is a bit more regular.
5267         * src/system.h (sync) [!HAVE_SYNC]: New macro.
5268
5269 2006-04-11  Paul Eggert  <eggert@cs.ucla.edu>
5270
5271         * NEWS: csplit, nl, expr now conform to POSIX better, and are
5272         more-compatible with traditional Unix, with respect to regular
5273         expressions.
5274         * src/csplit.c (extract_regexp): Set re_syntax_options to a
5275         value that is compatible with what POSIX requires.
5276         * src/nl.c (build_type_arg): Likewise.
5277         * src/expr.c (docolon): Likewise.  Also, don't let anchors match
5278         newline; this fixes an incompatibility with tradition and with POSIX.
5279         Don't warn about leading ^.  POSIX says it is unspecified whether
5280         ^ is a special character, which means that implementations can
5281         either treat it as special or not, but either way a warning is not
5282         allowed (unless the regexp is otherwise invalid).  Instead, anchor
5283         the expression but treat ^ as an anchor; this is the traditional
5284         behavior (e.g., Solaris 10).
5285         (eval4, eval3, eval2): Treat non-numeric args, division by zero,
5286         and the like as invalid expressions (exit status 2), not as
5287         failure of 'expr' (exit status 3).  This is more consistent with
5288         how Solaris behaves.
5289         * tests/expr/basic (fail-a): Adjust exit status to match new expr
5290         behavior, for status 2 versus 3.
5291         (anchor): New test.
5292         (bre1, bre2, bre3, bre4, bre5, bre6, bre7, bre8, bre9, bre10):
5293         (bre11, bre12, bre13, bre14, bre15, bre16, bre17, bre18, bre19, bre20):
5294         (bre21, bre22, bre23, bre24, bre25, bre26, bre27, bre28, bre29, bre30):
5295         (bre31, bre32, bre33, bre34, bre35, bre36, bre37, bre38, bre39, bre40):
5296         (bre41, bre42, bre43, bre44, bre45, bre46, bre47, bre48, bre49, bre50):
5297         (bre51, bre52, bre53, bre54, bre55, bre56, bre57, bre58, bre59, bre60):
5298         (bre61, bre62): New tests.
5299         * tests/misc/csplit: Use \{...\} in test RE, to test that we're
5300         conforming to POSIX.
5301
5302         Port to Solaris 8.
5303         * tests/du/long-from-unreachable: Solaris 8 sh doesn't understand
5304         "if !".  Do not assume that 'sed' can handle long, newline-free input.
5305         * tests/du/long-sloop: Likewise.  Evaluate expr once, not $n times.
5306
5307 2006-04-10  Paul Eggert  <eggert@cs.ucla.edu>
5308
5309         Adjust to new regex.h API (with new fastmap type), and clean
5310         up the regex storage allocation a bit.
5311
5312         * src/csplit.c (struct control): Put re_compiled member at the
5313         end, since it's large.  Change regexpr member from char * to bool;
5314         all uses changed.  Add new member fastmap.
5315         (extract_regexp): regexp arg is now char const *, not char *.
5316         Don't bother duplicating the regular expression; it's not needed.
5317         Set fastmap from new fastmap member.  Don't bother allocating
5318         a buffer, as the regexp code does a better job than we do.
5319         * src/expr.c (docolon): Allocate and use a fastmap.
5320         Don't bother allocating a buffer.
5321         * src/nl.c (body_fastmap, header_fastmap, footer_fastmap):
5322         New vars.
5323         (build_type_arg): New fastmap arg.  All uses changed.
5324         Don't bother allocating a buffer, but set a fastmap.
5325         * src/ptx.c (context_regex_string, word_regex_string): Remove.
5326         (context_regex, word_regex): New vars, replacing the above.
5327         All uses changed.
5328         (struct regex_data): New type.
5329         (compile_regex): Renamed from alloc_and_compile_regex, since
5330         we no longer allocate storage.  Arg is now a struct regex_data *,
5331         not a const char *.  All uses changed.  Don't allocate the fastmap;
5332         instead, take it from the caller.  Don't convert size_t to int,
5333         to avoid arithmetic overflow problems.  Don't bother freeing
5334         storage afterwards; it's not worth the aggravation.
5335         * src/tac.c (compiled_separator_fastmap): New ver.
5336         (main): Use it.  Don't bother allocating a buffer.
5337
5338 2006-03-30  Jim Meyering  <jim@meyering.net>
5339
5340         * src/dd.c (iwrite): Remove assignment without effect.
5341         Reported by Felix Rauch Valenti.
5342
5343 2006-03-22  Eric Blake  <ebb9@byu.net>
5344
5345         * src/ptx.c (usage): Remove mention of --copyright/-C.
5346         (main): Alias --copyright to --version plus a deprecation warning.
5347         * NEWS: Mention this.
5348
5349 2006-03-27  Jim Meyering  <jim@meyering.net>
5350
5351         * src/Makefile.am (uptime_LDADD): Add $(POW_LIB), for uptime's
5352         use of strtod.  Tiny patch from Nickolai Zeldovich.
5353
5354 2006-03-11  Eric Blake  <ebb9@byu.net>
5355
5356         * tests/misc/dirname: New file.
5357         * tests/basename/Makefile.am: Delete.
5358         * tests/basename/basic: Move to...
5359         * tests/misc/basename: ... this new file.  Add some tests,
5360         including fixed behavior for //.
5361         * tests/misc/Makefile.am (TESTS): Sort.  Add basename, dirname.
5362         * tests/Makefile.am (SUBDIRS): Remove basename.
5363         * configure.ac (AC_CONFIG_FILES): Remove tests/basename.
5364
5365         Improvements to dirname/basename handling on platforms like
5366         cygwin with distinct // and with drive letters.
5367         * NEWS: Document new behavior.
5368         * src/basename.c (main): Don't strip suffix from file system
5369         roots.
5370         * src/cp.c (target_directory_operand): Use new last_component.
5371         (ASSIGN_BASENAME_STRDUPA): Likewise.  Reduce time spent
5372         traversing the string.
5373         * src/dircolors.c (guess_shell_syntax): Use new last_component.
5374         * src/install.c (target_directory_operand, install_file_in_dir):
5375         Likewise.
5376         * src/ln.c (target_directory_operand, main): Likewise.
5377         * src/ls.c (basename_is_dot_or_dotdot): Likewise.
5378         * src/mv.c (target_directory_operand, movefile): Likewise.
5379         * src/remove.c (rm_1): Likewise.
5380         * src/shred.c (wipename): Likewise.
5381         * src/split.c (next_file_name): Likewise.
5382         * src/su.c (log_su, run_shell): Likewise.
5383
5384 2006-03-23  Paul Eggert  <eggert@cs.ucla.edu>
5385
5386         * NEWS: nohup diagnostics are now more precise, and nohup now
5387         redirects stderr to nohup.out if stdout is closed and stderr is a tty.
5388         * src/nohup.c (main): Implement this.
5389         * tests/misc/nohup: Test the new behavior.
5390
5391 2006-03-12  Jim Meyering  <jim@meyering.net>
5392
5393         * src/copy.c (set_author): Rename function, from preserve_author.
5394
5395         * src/remove.c (AD_pop_and_chdir): Use new macro,
5396         CYCLE_CHECK_REFLECT_CHDIR_UP, rather than open-coding it.
5397
5398         * src/system.h (SAME_INODE): Remove definition.
5399         Include "same-inode.h", instead.
5400
5401 2006-03-11  Eric Blake  <ebb9@byu.net>
5402
5403         * src/pwd.c (robust_getcwd): Prepend only one slash, not two.
5404
5405 2006-03-10  Jim Meyering  <jim@meyering.net>
5406
5407         Fix a bug whereby a user with write access to a directory being removed
5408         could cause the removal of that directory to fail with an erroneous
5409         diagnostic about a directory cycle.  Reported by Vineet Chadha.
5410
5411         * NEWS: Mention this.
5412         * src/remove.c (AD_pop_and_chdir): If the directory we're about to
5413         leave (and try to rmdir) is the one whose dev_ino is being used to
5414         detect a cycle, reset cycle_check_state.dev_ino to that of the parent.
5415
5416 2006-03-08  Paul Eggert  <eggert@cs.ucla.edu>
5417
5418         * NEWS: Document dd's new 'directory' and 'nolinks' flags.
5419         * src/dd.c (set_fd_flags): Handle file-creation flags on file
5420         descriptors, rather than ignoring them.
5421         * tests/dd/misc: Add test cases for append, nofollow, directory,
5422         and nolinks flags.  Simplify redirection to /dev/null in some cases.
5423
5424         * tests/dd/misc: iflags->iflag.  This fixes a typo that meant the
5425         noatime test never tested anything.
5426
5427 2006-03-05  Paul Eggert  <eggert@cs.ucla.edu>
5428
5429         * src/dd.c (flags, usage): New flags directory, nolinks.
5430         * src/system.h (O_NOLINKS): Define to 0 if not already defined.
5431
5432         * src/ls.c (usage): Mention that -f disables --color.
5433         Problem reported by Niels Möller.
5434
5435 2006-03-03  Justin Pryzby  <pryzbyj@justinpryzby.com>
5436
5437         * man/*.x: Add references to syscalls from utilities of the same name.
5438
5439 2006-03-05  Jim Meyering  <jim@meyering.net>
5440
5441         * tests/help-version: Set SHELL, if not already set, in order to
5442         avoid failure when `make check' is run through debuild;  dircolors
5443         would fail due to lack of $SHELL.  Reported by Sven Joachim.
5444
5445         Make `base64 --wrap=N' work for N=0, and for N larger than SIZE_MAX.
5446         * src/base64.c (wrap_write, do_encode, main): Change type of
5447         parameters and locals, wrap_column, form size_t to uintmax_t.
5448         (main): Adjust to use xstrtoumax, accordingly.
5449
5450 2006-03-03  Jim Meyering  <jim@meyering.net>
5451
5452         Don't fail when run from an environment with SHELL not a Bourne
5453         shell, e.g. `env SHELL=/bin/csh make check' would fail this test.
5454         * tests/dircolors/simple: Invoke each non-failing test with -b.
5455         Reported by Michael Stone.
5456
5457 2006-02-27  Jim Meyering  <jim@meyering.net>
5458
5459         * tests/misc/base64: Derive --decode-using tests from the
5460         encode-based ones.
5461
5462         * tests/misc/base64: Factor out a long constant string.
5463         Split lines to stay within 80 columns.
5464
5465         * tests/misc/Makefile.am (TESTS): Add base64.
5466         * tests/misc/base64: Test base64.  From Simon Josefsson.
5467
5468         * src/base64.c (do_decode): Use correct type for parameter,
5469         ignore_garbage: s/size_t/bool/.
5470
5471         * src/base64.c: Don't include .h files already included by system.h:
5472         <string.h>, <stdlib.h>, <stdbool.h>, <limits.h>, <errno.h>.
5473         Include "system.h" before the other lib/*.h header files.
5474         Include <sys/types.h> before "system.h".
5475         (wrap_write): Remove declaration of unused local, initial_column.
5476         (wrap_write): Correct declaration syntax: s/size_t * V/size_t *V/.
5477
5478         * README: Add base64 to the list.
5479
5480 2006-02-17  Simon Josefsson  <jas@extundo.com>
5481
5482         New program: base64.
5483         * AUTHORS: Mention base64.
5484         * NEWS: Likewise.
5485         * man/Makefile.am: Build base64.1.
5486         * man/base64.x: New file.
5487         * src/Makefile.am (bin_PROGRAMS): Add base64.
5488         * src/base64.c: New file.
5489
5490 2006-02-25  Eric Blake  <ebb9@byu.net>
5491
5492         In ls, avoid calling stat for --inode (-i), when possible.
5493         * src/pwd.c (NOT_AN_INODE_NUMBER, D_INO): Move to ...
5494         * src/system.h: ... here, for use in ...
5495         * src/ls.c (main): ... here.  Prefer dirent.d_ino to stat when
5496         possible.
5497         (gobble_file): Add inode argument.
5498         (print_dir): Pass inode if available.
5499         (usage): Remove inaccuracy.
5500
5501 2006-02-23  Jim Meyering  <jim@meyering.net>
5502
5503         * TODO: Update/correct some obsolete entries.
5504
5505 2006-02-20  Paul Eggert  <eggert@cs.ucla.edu>
5506
5507         * doc/coreutils.texi (join invocation): Mention `sort -k 1b,1'.
5508         * src/join.c (usage): Likewise.
5509         Documentation problem reported by Philip Kensche.
5510
5511 2006-02-20  Eric Blake  <ebb9@byu.net>
5512
5513         * man/rm.x: Update documentation to match previous patch.
5514
5515 2006-02-18  Eric Blake  <ebb9@byu.net>
5516
5517         New option for rm: --interactive=once (-I).
5518         * NEWS: Document it, along with change to rm --interactive.
5519         * TODO: Remove entry for implementing rm -I
5520         * src/rm.c (INTERACTIVE_OPTION): New enum value.
5521         (interactive_type): New enum.
5522         (long_opts): Let interactive take an optional argument.
5523         (interactive_args, interactive_types): New option arguments.
5524         (usage): Document -I, --interactive=WHEN.  Use program_name
5525         instead of a basename.
5526         (main): New -I option, new behavior to --interactive.
5527         * tests/rm/interactive-once: New tests.
5528         * tests/rm/interactive-always: Ditto.
5529         * tests/rm/Makefile.am (TESTS): Run them.
5530
5531 2006-02-18  Jim Meyering  <jim@meyering.net>
5532
5533         * Makefile.maint (sc_two_space_separator_in_usage): Make the regular
5534         expression match more of the target lines, e.g., those that start with
5535         `-S,' (short option followed by a comma) or that include `=[...]'.
5536         Patch by Nicolas François.
5537         Fix the four offenders thus exposed:
5538         * src/join.c (usage): Use two spaces (not one) to separate the
5539         --first-only option string from its description, so help2man formats
5540         the derived man page properly.
5541         * src/pr.c (usage): Likewise.
5542         * src/uniq.c (usage): Likewise.
5543         * src/install.c (usage): Likewise.
5544
5545 2006-02-15  Jim Meyering  <jim@meyering.net>
5546
5547         * Makefile.maint (alpha beta major): For `make major', ensure that the
5548         version string is of the form N.N[.N]*, where N is one or more digits.
5549
5550 2006-02-14  Jim Meyering  <jim@meyering.net>
5551
5552         * INSTALL: Update from gnulib.
5553
5554 2006-02-13  Jim Meyering  <jim@meyering.net>
5555
5556         * GNUmakefile (all): Emit diagnostics to stderr, not stdout.
5557
5558 2006-02-12  Jim Meyering  <jim@meyering.net>
5559
5560         * Makefile.maint (patch-check): New target.
5561         (local-checks-available): Add to the list.
5562
5563 2006-02-11  Jim Meyering  <jim@meyering.net>
5564
5565         * src/c99-to-c89.diff: New file.
5566         * src/Makefile.am (EXTRA_DIST): Add c99-to-c89.diff.
5567
5568         * .x-po-check: New file, with exclusions so that `make distcheck'
5569         passes once again.
5570         * Makefile.am (EXTRA_DIST): Add .x-po-check.
5571
5572         rm -r must remove an empty directory, even if it is inaccessible.
5573         * src/remove.c (close_preserve_errno): New function.
5574         (fd_to_subdirp): Don't print a diagnostic in this function.
5575         Do it from the callers instead, unless rmdir succeeds.
5576         (remove_cwd_entries, remove_dir): Adjust callers.
5577         * tests/rm/empty-inacc: New test for the above.
5578         * tests/rm/Makefile.am (TESTS): Add empty-inacc.
5579         * NEWS: Mention this bug fix.
5580         * tests/rm/rm2: Adjust two expected diagnostics, now that they're
5581         a tiny bit less precise: cannot remove `a/1': ... instead of
5582         cannot open directory `a/1': ...
5583
5584         * Makefile.maint (syntax-check-rules): Automatically derive this
5585         list of sc_-prefixed rule names.
5586
5587 2006-02-10  Paul Eggert  <eggert@cs.ucla.edu>
5588
5589         * Makefile.maint (CVS_LIST): Don't assume cvsu is available.
5590         (CVS_LIST_EXCEPT): New macro, to simplify exception-processing.
5591         Most uses of CVS_LIST changed to use CVS_LIST_EXCEPT.
5592         (syntax-check-rules): Bring back sc_changelong.  (Hmm, why did it
5593         go away? was that an accident?)
5594         (sc_cast_of_argument_to_free, sc_cast_of_x_alloc_return_value):
5595         (sc_cast_of_alloca_return_value, sc_space_tab, sc_prohibit_atoi_atof):
5596         (sc_error_exit_success, sc_file_system, sc_no_if_have_config_h):
5597         (sc_system_h_headers, sc_sun_os_names, sc_trailing_blank):
5598         (sc_two_space_separator_in_usage, sc_unmarked_diagnostics):
5599         (sc_obsolete_symbols, sc_changelog, sc_prohibit_jm_in_m4):
5600         (sc_useless_cpp_parens, makefile-check, m4-check, po-check):
5601         (author_mark_check, makefile_path_separator_check):
5602         Output line numbers, to simplify navigation of Emacs *compilation*
5603         buffers.
5604         (sc_prohibit_atoi_atof, sc_file_system):
5605         Rework slightly so that Makefile.maint doesn't get reported as a
5606         violation of its own syntax rules.
5607         (sc_dd_max_sym_length): Use ifneq to do nothing, instead of doing
5608         it at run-time (which didn't work with Bison).  Fix a makefile typo,
5609         caught by Makefile.maint itself: spaces where a tab should be.
5610         (po-check): Check lib/*.[ch] even if not in CVS; used by Bison,
5611         which copies from ../gnulib/lib/*.[ch] to lib/*.[ch].
5612         Ignore djgpp and man subdirectories, to avoid false matches with
5613         Bison and coreutils, respectively.  Use sort -u to remove the
5614         resulting duplicates.
5615         * gnupload: Rework slightly to avoid bogus warning from
5616         sc_two_space_separator_in_usage.
5617
5618 2006-02-10  Jim Meyering  <jim@meyering.net>
5619
5620         Use gzip's --rsyncable option only if it's available.
5621         * Makefile.maint (gzip_rsyncable): New variable.
5622         (GZIP_ENV): Use it.
5623
5624 2006-02-08  Jim Meyering  <jim@meyering.net>
5625
5626         * Makefile.maint (local-checks-available): Define in terms of
5627         the expansion, $(syntax-check-rules), rather than the single,
5628         top-level target `syntax-check', so that it's easier to exclude
5629         individual rules (via $(local-checks-to-skip)).
5630         (tgz-md5, tgz-sha1, ...): Remove now-unused definitions.
5631
5632 2006-02-07  Jim Meyering  <jim@meyering.net>
5633
5634         * src/system.h (!defined O_DIRECT): If O_DIRECTIO is defined (as it
5635         is on Tru64), define O_DIRECT to that.  Patch From James Lemley.
5636
5637         * tests/help-version (expected_failure_status_vdir):
5638         Redirect an expected disk-full diagnostic to /dev/null.
5639
5640 2006-02-06  Jim Meyering  <jim@meyering.net>
5641
5642         * src/unexpand.c (usage): Use two spaces (not one) to separate the
5643         --first-only option string from its description, so help2man formats
5644         the derived man page properly.
5645         * src/rm.c (usage): Likewise for --no-preserve-root.
5646         * src/chown.c (usage): Likewise.
5647         * src/chgrp.c (usage): Likewise.
5648
5649         Add a rule to ensure that the above doesn't happen again.
5650         * Makefile.maint (sc_two_space_separator_in_usage): New rule.
5651         (syntax-check-rules): Add it.
5652         * .x-sc_two_space_separator_in_usage: New empty file.
5653         * Makefile.am (EXTRA_DIST): Add .x-sc_two_space_separator_in_usage.
5654
5655 2006-02-06  Jim Meyering  <jim@meyering.net>
5656
5657         * src/cp.c (usage): Use two spaces (not one) to separate each
5658         option string from its description, so help2man formats the
5659         derived man page properly.
5660         * src/mv.c (usage): Likewise.
5661         Patch from Nicolas François in http://bugs.debian.org/351601.
5662
5663 2006-02-04  Jim Meyering  <jim@meyering.net>
5664
5665         * src/copy.c (copy_internal): cp -RL would fail when encountering
5666         the same directory more than once in the hierarchy beneath a single
5667         command-line argument.  That is legitimate, e.g. when there are
5668         two or more symbolic links, each pointing to some directory that
5669         would not otherwise be copied.  Reported by Christophe LYON.
5670         * tests/cp/cp-deref: New file.  Test for today's fix.
5671         * tests/cp/Makefile.am (TESTS): Add cp-deref.
5672         * NEWS: Document this.
5673
5674 2006-02-03  Jim Meyering  <jim@meyering.net>
5675
5676         * configure.ac: Require automake-1.9.6, not 1.8.3.
5677
5678 2006-02-01  Paul Eggert  <eggert@cs.ucla.edu>
5679
5680         * src/od.c (usage): Mention that -t a ignores high order bit.
5681         Documentation problem reported by Ed Avis.
5682
5683 2006-02-01  Jim Meyering  <jim@meyering.net>
5684
5685         * src/pwd.c (find_dir_entry): Remove unused local, `ent_sb_valid'.
5686
5687 2006-01-30  Paul Eggert  <eggert@cs.ucla.edu>
5688
5689         * src/head.c (main): Use a better diagnostic when someone uses a
5690         trailing numeric option in an invalid way.  Problem reported by
5691         Karl Berry.
5692         * src/tail.c (parse_options): Likewise.
5693
5694 2006-01-30  Jim Meyering  <jim@meyering.net>
5695
5696         * man/wc.x: Include `count' keyword in man page synopsis,
5697         per suggestion from http://bugs.debian.org/181585.
5698
5699 2006-01-24  Paul Eggert  <eggert@cs.ucla.edu>
5700
5701         * src/df.c (show_dev): If the file system claims to have
5702         more available than total blocks, report the number of used
5703         blocks as being total - available (a negative number) rather
5704         than as garbage.  Problem reported by Toralf Foerster.
5705
5706 2006-01-24  Jim Meyering  <jim@meyering.net>
5707
5708         * src/tail.c (tail_forever): Don't exit-nonzero when an attempt
5709         to put a regular file in O_NONBLOCK mode fails with EPERM.
5710         That happens on Linux (up to 2.6.15) when using tail -f on a file with
5711         the append-only attribute.  Reported by Dean Gaudet.  For details,
5712         see http://savannah.gnu.org/bugs/?func=detailitem&item_id=15473.
5713         * NEWS: Mention this fix.
5714         * tests/tail-2/append-only: New file.  Test for the above.
5715         * tests/tail-2/Makefile.am (TESTS): Add append-only.
5716         * tests/Makefile.am (check-root): Add tail-2/append-only
5717
5718 2006-01-21  Jim Meyering  <jim@meyering.net>
5719
5720         * NEWS: Mention fts-related improvements and bug fixes.
5721
5722 2006-01-19  Jim Meyering  <jim@meyering.net>
5723
5724         * tests/fmt/basic (pfx-1, pfx-2): New tests, to demonstrate the bug
5725         reported as http://bugs.debian.org/147577.  Forwarded by Thomas Hood.
5726
5727 2006-01-18  Jim Meyering  <jim@meyering.net>
5728
5729         * tests/du/Makefile.am (TESTS): Add long-from-unreadable.
5730
5731 2006-01-17  Jim Meyering  <jim@meyering.net>
5732
5733         Now that fts no longer changes the current working directory, adjust
5734         its clients accordingly -- note that du.c uses fts but doesn't need
5735         any adjustment, since it doesn't operate on the actual files,
5736         but rather just uses the stat buffers provided by fts.
5737
5738         * src/chown-core.c: Include "openat.h".
5739         Don't include "lchown.h".
5740         (restricted_chown): Accept a new parameter, CWD_FD, and use it in
5741         calling openat, lchownat, chownat, rather than open, lchown, chown.
5742         Update caller.
5743         * src/chmod.c: Include "openat.h".
5744         (process_file): Use chmodat (fts->fts_cwd_fd,... in place of chmod (...
5745
5746         * tests/du/long-from-unreadable: New test, to exercise one small
5747         corner of fts.c.
5748
5749 2006-01-13  Jim Meyering  <jim@meyering.net>
5750
5751         * tests/Makefile.am (SUBDIRS): Add comments discouraging the
5752         addition of new directories under tests/.
5753
5754         * tests/acl: Redirect stdin to /dev/null.  Otherwise, FreeBSD 5.0's
5755         getfacl would hang.
5756
5757 2006-01-12  Jim Meyering  <jim@meyering.net>
5758
5759         * tests/du/long-sloop: Adjust not to hard-code the expected
5760         diagnostic corresponding to ELOOP.  Solaris' diagnostic differs
5761         from that of GNU libc.  Reported by Paul Eggert.
5762
5763         * tests/du/long-sloop: Create file at end of symlink chain.
5764
5765         * tests/misc/test: New file, with a test for one of the
5766         bugs fixed by yesterday's test.c changes.
5767         * tests/misc/Makefile.am (TESTS): Add test.
5768
5769 2006-01-11  Jim Meyering  <jim@meyering.net>
5770
5771         * tests/du/long-sloop: New file.  Test for today's fts.c bug fix.
5772         That bug could make du -L, chgrp -L, or chown -L fail to diagnose
5773         a very long sequence of symbolic links (not necessarily a loop).
5774         * tests/du/Makefile.am (TESTS): Add long-sloop.
5775
5776 2006-01-11  Paul Eggert  <eggert@cs.ucla.edu>
5777
5778         * src/test.c (test_syntax_error): Append a newline.  All callers
5779         changed, except for the ones that didn't already append a newline.
5780         Bug reported by Eric Blake.
5781
5782 2006-01-11  Jim Meyering  <jim@meyering.net>
5783
5784         * src/system.h (X2NREALLOC): Now that verify_true is no longer
5785         void, cast its result to void, to avoid gcc's warning that
5786         ``left-hand operand of comma expression has no effect''.
5787         (DECIMAL_DIGIT_ACCUMULATE, X2REALLOC): Likewise.
5788
5789 2006-01-10  Jim Meyering  <jim@meyering.net>
5790
5791         * tests/chmod/no-x: Add a test for today's fts.c fix.
5792
5793 2006-01-10  Jim Meyering  <jim@meyering.net>  (tiny change)
5794
5795         * src/ls.c (gobble_file): Use DTTOIF only if it's defined.
5796         This is necessary for Dragonfly.  Patch by Joerg Sonnenberger.
5797
5798 2006-01-10  Paul Eggert  <eggert@cs.ucla.edu>
5799
5800         * src/system.h (X2NREALLOC, X2REALLOC, DECIMAL_DIGIT_ACCUMULATE):
5801         Use verify_true instead of verify_expr, to sync with gnulib.
5802
5803 2006-01-08  Jim Meyering  <jim@meyering.net>
5804
5805         * src/date.c (usage): Adjust the formatting of the entries for
5806         %::z and %:::z (separate with two spaces, not one) so that help2man
5807         formats them properly.  Reported by Philip Rowlands.
5808
5809 2006-01-06  Paul Eggert  <eggert@cs.ucla.edu>
5810
5811         * configure.ac (gl_IGNORE_UNUSED_LIBRARIES): Add.
5812
5813 2006-01-06  Jim Meyering  <jim@meyering.net>
5814
5815         * Makefile.maint (copyright-check): Use date +%Y in place of
5816         hard-coded 2005.
5817
5818         * src/remove.c (rm_1): Remove `static' attribute on local `status'.
5819         First off, the attribute should have been `volatile' (not static)
5820         to avoid longjmp-related risk of clobber.  Secondly, now there is
5821         no longer any risk of a local variable being clobbered, so there's
5822         no need for any attribute at all.
5823
5824 2006-01-05  Jim Meyering  <jim@meyering.net>
5825
5826         * src/remove.c: Give a few functions the inline attribute.
5827         (AD_pop_and_chdir): Use gotos to avoid some duplication.
5828         (AD_push): Rewrite an assertion so that the entire computation
5829         goes away when assertions are turned off.
5830
5831         * src/tail.c (ENOSYS) [!defined ENOSYS]: Don't define here.
5832         It's already defined in "system.h".
5833         * Makefile.maint: Add a FIXME comment.
5834
5835 2006-01-04  Jim Meyering  <jim@meyering.net>
5836
5837         * ChangeLog: Remove entries from 2005-10-22 and earlier.
5838         * ChangeLog-2005: New file, for entries up to version 5.92.
5839
5840 2006-01-03  Jim Meyering  <jim@meyering.net>
5841
5842         * tests/du/no-x: Also allow a slightly different diagnostic -- the
5843         one you get when using openat-enabled fts.c and du (coming soon).
5844         * tests/chmod/no-x: Likewise.
5845         * tests/chgrp/no-x: Likewise.
5846
5847         * src/system.h (O_DIRECTORY) [!defined O_DIRECTORY]: Define.
5848
5849 2006-01-02  Paul Eggert  <eggert@cs.ucla.edu>
5850
5851         * src/chown-core.c (RC_do_ordinary_chown): New enum value.
5852         (restricted_chown): Return it, if the file cannot be accessed due
5853         to EPERM, or if no uid or gid are required, or if the file is
5854         neither a directory nor a regular file.  Rewrite to avoid gotos.
5855         (change_file_owner): Handle RC_do_ordinary_chown case.
5856         Rewrite to avoid gotos.
5857         * tests/chgrp/basic: Make sure we can change the group of
5858         inaccessible files.
5859
5860         * src/date.c (usage): Explain %g, %G, and %V a bit better.
5861
5862 2006-01-02  Jim Meyering  <jim@meyering.net>
5863
5864         * src/copy.c (set_owner): Correct a comment.
5865
5866         * src/tail.c (parse_options): Change warning to say that --retry
5867         is useful `mainly' (not `only') when following by name.
5868         Reported here: http://bugs.debian.org/273781
5869
5870 2006-01-01  Paul Eggert  <eggert@cs.ucla.edu>
5871
5872         * NEWS: Document that mkfifo and mknod -m no longer set special bits.
5873         * src/copy.c: Include lchmod.h.
5874         (copy_internal): Use lchmod rather than chmod.
5875         * src/cp.c: Include lchmod.h.
5876         (re_protect, make_dir_parents_private): Use lchmod rather than chmod.
5877         * src/mkdir.c: Include lchmod.h.
5878         (usage): Clarify -m's operation.
5879         (main): Use lchmod rather than chmod.  Don't use lchmod unless the
5880         new mode contains bits outside the 777 range.
5881         * src/mkfifo.c (usage): Clarify -m's operation.
5882         (main): If -m is given, don't invoke chmod; use umask 0 instead.
5883         Report an error if -m asks for bits outside the 777 range.
5884         * src/mknod.c (usage, main): Likewise.
5885
5886         * src/mkdir.c, src/mkfifo.c, src/mknod.c: Undo 2005-12-19 changes.
5887
5888 2005-12-27  Jim Meyering  <jim@meyering.net>
5889
5890         * Makefile.maint (sc_obsolete_symbols): Prohibit use of O_NDELAY.
5891         (sc_prohibit_assert_without_use): New rule.
5892         (syntax-check-rules): Add it to the list.
5893         * .x-sc_prohibit_assert_without_use: New empty file.
5894         * Makefile.am (EXTRA_DIST): Add it.
5895
5896         * Makefile.maint (CVS_LIST): Define in terms of $(srcdir).
5897
5898         * cp.c, df.c, link.c, mknod.c, nice.c, sleep.c, unlink.c:
5899         Don't include <assert.h>; it wasn't used.
5900
5901 2005-12-26  Paul Eggert  <eggert@cs.ucla.edu>
5902
5903         * src/chown-core.c (restricted_chown):
5904         Don't try O_WRONLY unless O_RDONLY failed wth EACCES.
5905         * src/remove.c (fd_to_subdirp): Open with O_DIRECTORY | O_NOCTTY
5906         | O_NOFOLLOW too, for consistency with other dir-openers.
5907         Use POSIX-preferred O_NONBLOCK rather than O_NDELAY.
5908         (is_empty_dir): Likewise.
5909         * src/shred.c (wipename): Likewise.  Don't bother trying to open
5910         dir for writing, since POSIX prohibits it.
5911
5912 2005-12-22  Jim Meyering  <jim@meyering.net>
5913
5914         * tests/help-version: Redirect stderr to /dev/full, to suppress
5915         write error diagnostic.
5916
5917 2005-12-19  Jim Meyering  <jim@meyering.net>
5918
5919         * src/mkdir.c, src/mknod.c, src/mkfifo.c (main)
5920         Avoid a minor race condition when `-m MODE' is specified, by using
5921         open, fchown, and close rather than just chown.  To do that reliably --
5922         even with an overly restrictive umask -- ensure that each mkdir,
5923         mknod and mkfifo call uses a mode including at least owner-read access.
5924         * src/mknod.c (main): When `-m MODE' is specified, exit nonzero if
5925         the subsequent chown (or equivalent open,fchown,close) fails.
5926         * tests/misc/mknod: New tests.
5927         * tests/misc/Makefile.am (TESTS): Add mknod.
5928
5929 2005-12-17  Jim Meyering  <jim@meyering.net>
5930
5931         * src/remove.c (is_empty_dir): Open with O_NDELAY, so we don't hang,
5932         e.g., on a named pipe.
5933         (OPEN_NO_FOLLOW_SYMLINK): Remove definition.  Use O_NOFOLLOW in
5934         place of all uses, since it is guaranteed (system.h) to be defined.
5935
5936 2005-12-05  Andreas Gruenbacher  <agruen@suse.de>
5937
5938         Add POSIX ACL support
5939         * src/ls.c: Switch back from HAVE_ACL to USE_ACL: The acl() syscall
5940         is no requirement for ACL support; particularly, it does not exist
5941         on systems that have POSIX ACLs.
5942         * src/copy.h (cp_option_init) [umask_kill]: Remove member.
5943         * src/cp.c (umask_kill): With default acls, the umask is not to be
5944         applied.  Remove umask_kill, don't change the process umask, and let
5945         the kernel apply the umask where appropriate.
5946         * src/cp.c (make_dir_parents_private): Fix logic for POSIX ACLs.
5947         * src/copy.c (get_dest_mode): Remove; it is obsolete after removing
5948         umask_kill.
5949         (copy_reg, copy_internal): Use copy_acl and set_acl
5950         instead of fchown/chown. Fix the logic for POSIX ACLs.
5951         (chown_succeded): Remove; we now always copy acls and
5952         preserve S_ISUID, S_ISGID, and S_ISVTX when needed, no matter if we
5953         did a chown before or not.
5954         * src/mv.c, src/install.c (cp_option_init): Don't set umask_kill member.
5955         * src/Makefile.am (dir_LDADD, ls_LDADD, vdir_LDADD, cp_LDADD,
5956         mv_LDADD, ginstall_LDADD): On systems with an ACL library, arrange
5957         to link with it via $(LIB_ACL), for the utilities that need it.
5958
5959 2005-12-16  Paul Eggert  <eggert@cs.ucla.edu>
5960
5961         * src/remove.c (OPENAT_CWD_RESTORE__REQUIRE): Remove.
5962         (OPENAT_CWD_RESTORE__ALLOW_FAILURE): Likewise.
5963         (fd_to_subdirp): Remove openat_cwd_restore_allow_failure arg; its
5964         value is now signified by whether cwd_errno is null.
5965         (fd_to_subdirp, remove_dir, rm_1); Change cwd failure indicator from
5966         pointer-to-bool to pointer-to-errno-value.  All callers changed.
5967         (rm_1): Don't bother setting a local cwd failure flag and then
5968         ORing it into the caller's.  Just set the caller's.
5969         (rm): Use cwd failure errno value to print a slightly-better
5970         diagnostic.
5971
5972 2005-12-15  Jim Meyering  <jim@meyering.net>
5973
5974         * src/stat.c (print_it): Properly handle a backslash at the
5975         end of a --printf format string.  Reported by Paul Eggert.
5976         * tests/misc/stat-printf (end-bs): Add a test for the above.
5977
5978 2005-12-15  Paul Eggert  <eggert@cs.ucla.edu>
5979
5980         * tests/acl: Port to pre-POSIX shells like Solaris 8 /bin/sh.
5981         Don't assume /etc/passwd contains user names; use 'id' instead.
5982
5983 2005-12-15  Jim Meyering  <jim@meyering.net>
5984
5985         stat: revert behavior of --format=FMT (-c)
5986         stat: add new option: --printf=FMT
5987         * NEWS: Mention this.
5988         * src/stat.c (isodigit, octtobin, hextobin): Define.
5989         (PRINTF_OPTION): Define.
5990         (interpret_backslash_escapes, trailing_delim): New globals.
5991         (usage): Document them.  Alphabetize on long option names.
5992         (print_esc_char): New function.
5993         (print_it): Rewrite, in order to handle backslash escapes.
5994         (main): Handle new option.  Set globals for --format, too.
5995
5996         * tests/misc/stat-printf: Test --printf and --format.
5997         * tests/misc/Makefile.am (TESTS): Add stat-printf.
5998
5999 2005-12-14  Paul Eggert  <eggert@cs.ucla.edu>
6000
6001         * NEWS: sort now reports incompatible options.
6002         * src/sort.c (incompatible_options, check_ordering_compatibility):
6003         New functions.
6004         (main): Use them.  Don't bother with a usage message for
6005         "sort -c a b", for consistency with other error diagnostics.
6006         * tests/sort/Test.pm (incompat1, incompat2, incompat3, incompat4):
6007         New tests.
6008
6009         * src/cat.c (main): Undo previous change.  close_stdout already
6010         does the check, so the previous change wasn't necessary.
6011
6012 2005-12-13  Paul Eggert  <eggert@cs.ucla.edu>
6013
6014         * src/cat.c (main): Check for close (STDOUT_FILENO) failure.
6015
6016 2005-12-12  Paul Eggert  <eggert@cs.ucla.edu>
6017
6018         Install a more-conservative approach for sort -R.  It's the
6019         same basic idea as the existing code, except it uses the full ISAAC
6020         approach (called the "more kosher" approach in the existing comments).
6021         This makes "sort -R" quite a bit slower (about a factor of 2 on my
6022         little tests involving 10000 lines on a 2.4 GHz P4), but I think it's
6023         better to be conservative here at first, and review any performance
6024         improvements carefully.
6025         * .x-sc_require_config_h: Add src/rand-isaac.c.
6026         * src/rand-isaac.h: Remove.  All uses now simply include rand-isaac.c.
6027         * src/Makefile.am (noinst_HEADERS): Remove rand-isaac.h.
6028         (shred_SOURCES, sort_SOURCES): Remove.
6029         (EXTRA_DIST): Add rand-isaac.c.
6030         * src/rand-isaac.c: Revert to what used to be in shred.c, without
6031         changing it to allow for varying numbers of words in the state.
6032         Alter so that we include rand-isaac.c directly rather than
6033         compiling it and linking to it.  Don't include config.h or
6034         system.h; that's the includer's responsibility.
6035         Omit functions that are specific to shred.
6036         (ISAAC_LOG, ISAAC_WORDS, ISAAC_BYTES, struct isaac_state, ind):
6037         (isaac_step, struct irand_state):
6038         Resurrect these, with the same defns that used to be in shred.c.
6039         (ISAAC_SIZE, isaac_new, isaac_copy): Remove.
6040         (isaac_refill, isaac_seed_start, isaac_seed_data, irand_init, irand32):
6041         static again.
6042         (struct isaac_state, isaac_refill, isaac_mix, isaac_init):
6043         (isaac_seed_start, isaac_seed_data, isaac_seed_finish, isaac_seed):
6044         (irand_init, irand32, irand_mod):
6045         Number of words is constant again.
6046         (struct irand_state, irand_init, irand32, irand_mod): Move to shred.c.
6047         * src/shred.c: Include rand-isaac.c rather than rand-isaac.h.
6048         * src/sort.c: Likewise.
6049         * src/shred.c (fillrand, dopass, main): Undo previous change.
6050         (struct irand_state, irand_init, irand32, irand_mod): Moved back here,
6051         from rand-isaac.c.
6052         * src/sort.c: Don't include md5.h; it wasn't needed.
6053         (struct keyfield): Rename random_hash to random, for consistency
6054         with the other member names.  All uses changed.
6055         (usage): Tweak wording to mention STRING for --seed option.
6056         (short_options): Rorder for consistency with other programs.
6057         (rand_state): Now a struct, not a pointer to one.  All uses changed.
6058         (HASH_WORDS, HASH_SIZE): Remove.
6059         (get_hash): Remove comments around resbuf size, since we can assume C89.
6060         Use a "more-kosher" (but slower) approach of invoking isaac_refill.
6061         (keycompare): Adjust to the new get_hash.
6062         Add a FIXME.
6063         (badfieldspec): Omit recently-introduced comment; it isn't needed.
6064         (main): Don't set need_random simply because gkey has it set; that
6065         doesn't necessarily mean we'll need random numbers.
6066         Redo seeding to match new get_hash approach.
6067
6068 2005-12-10  Jim Meyering  <jim@meyering.net>
6069
6070         * src/Makefile.am (noinst_HEADERS): Add rand-isaac.h.
6071
6072         Avoid shred segfault on 64-bit systems.
6073         * src/rand-isaac.c (isaac_refill): Don't try to negate a
6074         local of type uint32_t.  Make the local an `int' instead.
6075
6076         * NEWS: Mention sort's new options.
6077
6078         * src/rand-isaac.c (isaac_mix): Declare to be static.
6079         Mark all other functions as `extern' so the tight-scope
6080         part of `make distcheck' passes once again.
6081         * src/rand-isaac.h (isaac_mix): Remove declaration.
6082
6083         * src/sort.c (get_hash): Change position of `*' in parameter
6084         type to conform with convention.
6085         (main): Split a long line so it fits in 80 columns.
6086         (keycompare): Remove stray SPACE before TAB that was
6087         causing `make distcheck' to fail.
6088
6089         * src/shred.c: Don't include gethrxtime.h.  No longer needed.
6090
6091         * tests/misc/sort-rand: New file: basic tests for the new options.
6092         * tests/misc/Makefile.am (TESTS): Add sort-rand.
6093
6094 2005-12-10  Frederik Eaton  <frederik@ofb.net>
6095
6096         * src/Makefile.am (sort_LDADD): Add $(LIB_GETHRXTIME).
6097         (shred_SOURCES, sort_SOURCES): New macros, so we compile rand-isaac.c.
6098         * src/rand-isaac.c: New file, containing ISAAC code that was in shred.c.
6099         Make state size runtime-configurable.
6100         (isaac_new, isaac_copy): New functions.
6101         * src/rand-isaac.h: New file.
6102         * src/shred.c: Include rand-isaac.h.  Move ISAAC code to rand-isaac.c.
6103         (fillrand, main): Adjust to the fact that the state size is now
6104         runtime-configurable.
6105         * src/sort.c (short_options, long_options, WORDS, keycompare, main):
6106         (usage): Add options --random-sort and --seed to implement a random
6107         shuffle.
6108         Include md5.h and rand-isaac.h.
6109         (get_hash): New function.
6110         (rand_state): New var.
6111         (HASH_WORDS, HASH_SIZE): New macros.
6112
6113 2005-12-09  Paul Eggert  <eggert@cs.ucla.edu>
6114
6115         * tests/dd/misc: Add test for dd iflags=noatime.
6116
6117 2005-12-09  Jim Meyering  <jim@meyering.net>
6118
6119         * src/sort.c (usage): Mention white space vs -b and -t options.
6120         From The Wanderer.
6121
6122 2005-12-09  Eric Blake  <ebb9@byu.net>
6123
6124         * src/test.c (main): Fix misleading comment.
6125
6126 2005-12-07  Paul Eggert  <eggert@cs.ucla.edu>
6127
6128         * NEWS: Mention dd's new noatime flag.
6129         * src/system.h (O_NOATIME): Define to 0 if not already defined.
6130         * src/dd.c (flags, usage): Add support for noatime flag.
6131
6132 2005-12-07  Jim Meyering  <jim@meyering.net>
6133
6134         Distribute the cvsu script, used only by `make syntax-check'.
6135         * Makefile.am (EXTRA_DIST): Add build-aux/cvsu.
6136         * Makefile.maint (CVS_LIST): Use build-aux/cvsu, now that we
6137         distribute a copy of this script.
6138         * .x-sc_unmarked_diagnostics: Add build-aux/cvsu.
6139
6140         * tests/mv/acl: exit-77 before the trap, not after, if we fail
6141         to create a temporary directory on another partition.
6142         From Andreas Gruenbacher.
6143
6144 2005-12-06  Tomas Pospisek  <tpo@sourcepole.ch>  (tiny change)
6145
6146         * man/basename.x: Cross-reference to dirname and readlink.
6147         * man/dirname.x: Cross-reference to basename and readlink.
6148
6149 2005-12-05  Andreas Gruenbacher
6150
6151         * src/copy.c [!HAVE_FCHOWN]: Define fchown(...) to -1.
6152         (set_owner, preserve_author): New functions, factored out of copy_reg.
6153         (copy_reg): Use them.
6154         (copy_internal): Use them here, too.
6155
6156 2005-12-04  Jim Meyering  <jim@meyering.net>
6157
6158         * src/sleep.c (usage): Say what happens with two or more arguments.
6159         Suggested by Justin Pryzby.
6160
6161         * src/uptime.c (print_uptime): Move decl of `upsecs' into scope
6162         where it's used.
6163
6164 2005-12-03  Jim Meyering  <jim@meyering.net>
6165
6166         * src/rm.c (long_opts): Change the name of each undocumented, for-
6167         testing-only option to start with `-', so that it cannot render
6168         ambiguous any prefix it happens to share with some other option name.
6169         Problem reported by Eric Blake.
6170         * src/head.c (long_options): Likewise.
6171         * src/tail.c (long_options): Likewise.
6172
6173         * tests/misc/head-elide-tail: Update uses of undocumented, for-
6174         testing-only --presume* options to start with `---'.
6175         * tests/rm/dangling-symlink: Likewise.
6176         * tests/rm/dir-no-w: Likewise.
6177         * tests/rm/isatty: Likewise.
6178
6179 2005-11-30  Jim Meyering  <jim@meyering.net>
6180
6181         * Makefile.maint: Add a comment about cvsu.
6182
6183 2005-11-25  Paul Eggert  <eggert@cs.ucla.edu>
6184
6185         * NEWS: df updates for "none", "proc", inaccessible file systems.
6186         * src/df.c (show_point): Ignore inaccessible file systems.
6187         (usage): -a includes dummy file systems, not size-0 file systems.
6188
6189         * src/od.c (unsigned_long_long_int): Renamed from ulonglong_t,
6190         to avoid collision with POSIX name space.  All uses changed.
6191
6192 2005-11-24  Jim Meyering  <jim@meyering.net>
6193
6194         * tests/Makefile.am (EXTRA_DIST): Add acl to the list.
6195         * tests/acl: Add `$0: ' prefix to diagnostics.
6196
6197         * .x-sc_require_config_h: Add lib/buffer-lcm.c to the list.
6198
6199 2005-11-23  Paul Eggert  <eggert@cs.ucla.edu>
6200
6201         * src/copy.c: Improve performance a bit by optimizing away
6202         unnecessary system calls and going to a block size of at least
6203         8192 (on normal hosts, anyway).  This improved performance 5% on my
6204         Debian stable host (2.4.27 kernel, x86, copying from root
6205         ext3 file system to itself).
6206         Include "buffer-lcm.h".
6207         (copy_reg): Omit last argument.  All callers changed.
6208         Use xmalloc to allocate rather than trusting alloca
6209         (which is unwise with large block sizes).
6210         Declare locals more locally, if possible.
6211         Use uintptr_t words instead of int words, for a bit more speed
6212         when looking for null blocks on 64-bit hosts.
6213         Optimize away reads of zero bytes on regular files.
6214         In the typical case, insist on 8 KiB buffers, at least.
6215         Avoid unnecessary extra call to fstat when checking for sparse files.
6216         Avoid now-unnecessary cast to off_t, and "0L".
6217         Avoid unnecessary test of *new_dst when checking for same owner
6218         and group.
6219
6220 2005-11-22  Paul Eggert  <eggert@cs.ucla.edu>
6221
6222         * src/remove.c (rm): Don't assume C99 for-loop syntax.
6223
6224 2005-11-22  Jim Meyering  <jim@meyering.net>
6225
6226         * src/remove.c (AD_push): Remove debugging cruft.
6227
6228         * tests/rm/unread2 (rm): Change expected diagnostic,
6229         `cannot open directory' to `cannot remove', to align with
6230         new version of rm.
6231         * tests/rm/rm2: Ensure that rm now continues removing entries
6232         even after certain types of failure.
6233
6234         * src/remove.c: Rewrite.  Now, this module is reentrant on systems
6235         that provide openat (Solaris), and on systems like Linux+procfs
6236         where our openat emulation code is reentrant.  This also fixes a
6237         few low-probability leaks and eliminates some code that could,
6238         in very unusual circumstances, cause rm() (via a callee) to exit.
6239         * NEWS: Mention this.
6240
6241         * configure.ac: Put copyright dates all on one line so the
6242         emacs function that updates them works properly.
6243
6244 2005-11-18  Paul Eggert  <eggert@cs.ucla.edu>
6245
6246         * configure.ac (AM_PROG_CC_C_O): Add.  Needed for CVS Automake.
6247         Problem reported by Eric Blake.
6248         (AC_PROG_CC_STDC): Use this instead of AC_PROG_CC, so that
6249         we get a standard-conforming compiler.  This relies on the new
6250         m4/c.m4 file.  Note that it's a bit tricky, since c.m4 doesn't
6251         define AC_PROG_CC_STDC; we are relying on Autoconf 2.59 internals.
6252         m4/c.m4 can go away with Autoconf 2.60 comes out.
6253
6254 2005-11-17  Jim Meyering  <jim@meyering.net>
6255
6256         * src/remove.c (AD_mark_helper): Make a `char *' parameter `const'.
6257         (AD_mark_current_as_unremovable): Likewise, but for a local.
6258         (rm_1): Likewise.
6259
6260         * tests/mv/acl: Let traps handle removing temporary directories.
6261
6262         Expect acl-related tests to fail, until the corresponding
6263         patches are committed.
6264         * tests/mv/Makefile.am (XFAIL_TESTS): Add acl.
6265         * tests/cp/Makefile.am (XFAIL_TESTS): Likewise.
6266
6267         ACL tests, from Andreas Gruenbacher.
6268         * tests/acl, tests/mv/acl, tests/cp/acl: New files.
6269         * tests/mv/Makefile.am (TESTS): Add acl.
6270         * tests/cp/Makefile.am (TESTS): Add acl.
6271
6272         * src/ls.c (basename_is_dot_or_dotdot): Correct wording in comment.
6273
6274 2005-11-16  Paul Eggert  <eggert@cs.ucla.edu>
6275
6276         * NEWS: Improve quality of ln's diagnostics.
6277         * src/ln.c (do_link, usage): Likewise.
6278         (do_link): Don't use alloca on a buffer of unbounded size.
6279
6280 2005-11-16  Jim Meyering  <jim@meyering.net>
6281
6282         * tests/cp/fail-perm: Accommodate HPUX.  It appears to fail
6283         with EACCES rather than EPERM.  Reported by Peter O'Gorman here:
6284         http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/5766
6285         This also affects AIX 4.3.3, according to Ralf Wildenhues, in
6286         http://lists.gnu.org/archive/html/bug-coreutils/2006-05/msg00192.html
6287
6288 2005-11-14  Jim Meyering  <jim@meyering.net>
6289
6290         * NEWS (sort): Mention consequences of today's mkstemp-safer.c fix.
6291
6292 2005-11-13  Jim Meyering  <jim@meyering.net>
6293
6294         * announce-gen: Accept new option, --gpg-key-id=ID and
6295         emit a blurb telling how to use the .sig files.
6296         * Makefile.cfg (gpg_key_ID): Define.
6297         * Makefile.maint (announcement): Use new option and key.
6298
6299         Require that most .c files include <config.h>.
6300         * Makefile.maint (sc_require_config_h): New rule.
6301         (syntax-check-rules): Add it.
6302         * .x-sc_require_config_h: New file listing exceptions to the
6303         above rule.  Some are legit, others are simply grandfathered in.
6304         * Makefile.am (EXTRA_DIST): Add .x-sc_require_config_h here, too.
6305
6306 2005-11-12  Jim Meyering  <jim@meyering.net>
6307
6308         * src/checksum.h, src/md5.c, src/sha1sum.c: Remove now-unused files.
6309
6310 2005-11-11  Jim Meyering  <jim@meyering.net>
6311
6312         * NEWS: Mention `readlink -f' bug fix in 5.3.0 news.
6313         Mention new readlink options in 5.3.0's `New features' section.
6314         Spotted by Thomas Hood.
6315
6316 2005-11-08  Jim Meyering  <jim@meyering.net>
6317
6318         * NEWS: Merge in changes from b5_9x branch.
6319
6320 2005-11-08  Paul Eggert  <eggert@cs.ucla.edu>
6321
6322         * NEWS: ls now defaults to --time-style='locale', which in turn acts
6323         like --time-style='posix-long-iso' if the locale settings are messed up.
6324         * src/ls.c (decode_switches): Implement this.
6325
6326 2005-11-08  Jim Meyering  <jim@meyering.net>
6327
6328         * tests/du/2g: s/expensive/very expensive/ in a comment.
6329         From Paul Townsend.
6330
6331 2005-10-17  Eric Blake  <ebb9@byu.net>
6332
6333         * src/ls.c (usage): Fix descriptions of --sort, --time.
6334         Reported by Vitaly A. Ostanin.
6335
6336 2005-11-04  Paul Eggert  <eggert@cs.ucla.edu>
6337
6338         * src/ln.c: Include filenamecat.c.
6339         (FILE_BASENAME_CONCAT): Remove.
6340         (do_link): Remove last arg DEST_IS_DIR.  All callers changed.
6341         (main): Use file_name_concat, base_name, and strip_trailing_slashes
6342         instead of FILE_BASENAME_CONCAT.  This simplifies the code, and avoids
6343         the use of alloca.
6344
6345 2005-11-04  Jim Meyering  <jim@meyering.net>
6346
6347         * src/du.c (process_file): Don't overflow for files of size >= 2^31
6348         on systems with stat.st_blocks of a signed 32-bit type.
6349         This bug causes trouble on some AIX 5.1 systems.
6350         Report and trivial patch from Paul Townsend:
6351         <http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00033.html>
6352         * NEWS: Mention this.
6353
6354         * tests/du/2g: New (very-expensive) test for the above-fixed bug.
6355         * tests/du/Makefile.am (TESTS): Add it here.
6356         * tests/very-expensive: New file.
6357         * tests/Makefile.am (EXTRA_DIST): Add it here.
6358         * tests/cp/perm: Mark this test as `very-expensive', too.
6359
6360 2005-11-02  Paul Eggert  <eggert@cs.ucla.edu>
6361
6362         * NEWS: Mention that rm -d and maybe ln -d are scheduled for
6363         removal in 2006.
6364         * src/remove.h (struct rm_options): Remove unlink_dirs.  All uses
6365         removed.
6366         * src/rm.c (usage): Don't mention rm -d.
6367
6368 2005-11-02  Jim Meyering  <jim@meyering.net>
6369
6370         * tests/dd/skip-seek: Fix typo in comment: s/fileutils/coreutils.
6371         From Andreas Schwab.
6372
6373         * tests/dd/unblock-sync: Redirect stderr to /dev/null so the
6374         `M+N records in/out' lines don't pollute `make check' output.
6375
6376         * tests/dd/skip-seek (sk-seek4): New test, to exercise the bug
6377         fixed on 2005-10-31.  This test uses the new, IN_PIPE specifier.
6378         * tests/Coreutils.pm: Accept a new type of input specifier: IN_PIPE,
6379         to indicate that the input file should be piped into the command
6380         under test (via `cat FILE | $prog ...').
6381
6382         * src/remove.c (remove_entry): Emit a better diagnostic when rm
6383         (without -r) fails to remove a directory on a non-Linux system.
6384         This change affects only newer Solaris systems (with priv_*
6385         functions like priv_allocset).  Reported by Keith Thompson.
6386
6387         * tests/rm/dir-nonrecur: New file/test for the above fix.
6388         * tests/rm/Makefile.am (TESTS): Add dir-nonrecur.
6389
6390 2005-11-01  Paul Eggert  <eggert@cs.ucla.edu>
6391
6392         * NEWS: "tail -c 2 FILE" and "touch 0101000000" now operate as
6393         POSIX 1002.1-2001 requires.
6394         * src/tail.c (parse_obsolete_option): Implement this.
6395         Problem reported by Vincent Lefevre.
6396         * src/touch.c (main): Pass PDS_PRE_2000 to posixtime.
6397         * tests/tail/Test.pm (c-2, c-2-minus, c2, c2-minus): New tests.
6398         (test_vector): Add special cases for _POSIX2_VERSION, and
6399         regularize the old ones a bit.
6400         * tests/touch/obsolescent: Add y2000 test.
6401
6402 2005-10-31  Paul Eggert  <eggert@cs.ucla.edu>
6403
6404         * src/dd.c (skip): Fix off-by-one error reported by
6405         Theodoros V. Kalamatianos.
6406
6407 2005-10-30  Paul Eggert  <eggert@cs.ucla.edu>
6408
6409         * tests/mkdir/p-3: Require that the test be run as non-root.
6410         Problem and trivial fix reported by Theodoros V. Kalamatianos.
6411
6412 2005-10-28  Paul Eggert  <eggert@cs.ucla.edu>
6413
6414         * src/ln.c (FILE_BASENAME_CONCAT): Omit unnecessary slashes in the
6415         boundary between DEST and SOURCE in the result.
6416
6417 2005-10-26  Dmitry V. Levin  <ldv@altlinux.org>
6418
6419         * src/md5sum.c (main) [!O_BINARY]: Changed default read mode
6420         back to text, to sync with documentation and for backwards
6421         compatibility.
6422
6423 2005-10-25  Jim Meyering  <jim@meyering.net>
6424
6425         * tests/dircolors/simple (other-wr): Add an explicit test for
6426         the dircolors bug (NULL-dereference) fixed yesterday.
6427
6428 2005-10-24  Jim Meyering  <jim@meyering.net>
6429
6430         * src/tac.c (tac_file): When determining whether a file is seekable,
6431         also test whether it is a tty.  Using only the lseek-based test would
6432         give a false positive on Solaris.  Reported by Peter Fales.
6433
6434 2005-10-24  Dmitry V. Levin  <ldv@altlinux.org>
6435
6436         * tests/install/d-slashdot: New test, for "install -d" failure.
6437         * tests/install/Makefile.am (TESTS): Add d-slashdot.
6438         * tests/mkdir/p-slashdot: New test, for "mkdir -p" failure.
6439         * tests/mkdir/Makefile.am (TESTS): Add p-slashdot.
6440
6441 2005-10-24  Jim Meyering  <jim@meyering.net>
6442
6443         * src/dircolors.c (ls_codes): Add missing comma.
6444         Anonymous report and patch from
6445         http://savannah.gnu.org/bugs/?func=detailitem&item_id=14849
6446
6447         * src/dircolors.c: Add compile-time assertion that the slack_codes
6448         and ls_codes arrays have the same number of elements.  This would
6449         have prevented the above-fixed bug.
6450
6451         * src/expand.c (parse_tab_stops): Add a comment to make this function
6452         identical to the one in unexpand.c.
6453         * src/unexpand.c (parse_tab_stops): Adjust syntax to make this function
6454         identical to the one in expand.c.
6455
6456         * src/expand.c (next_file): Don't assume fopen cannot return stdin.
6457
6458 2005-10-23  Jim Meyering  <jim@meyering.net>
6459
6460         * src/md5sum.c (digest_check, main): Use ptr_align rather than
6461         a dangerous pointer-value-to-`unsigned' cast.
6462         * NEWS: mention the new sha* programs.
6463         * AUTHORS: Add new sha* programs.
6464
6465 2005-08-28  David Madore  <david.madore@ens.fr>
6466
6467         Add new programs: sha224sum, sha256sum, sha384sum, sha512sum.
6468         * README: Add their names to the list.
6469         * src/md5sum.c: Provide framework for computing sha-2 hashes.
6470         * src/Makefile.am (sha224sum, sha256sum, sha384sum, sha512sum):
6471         Rules for compiling sha-2 utilities
6472         (noinst_HEADERS): Remove checksum.h.
6473         * man/sha512sum.x, man/sha384sum.x, man/sha256sum.x, man/sha224sum.x:
6474         New files.
6475         * man/Makefile.am (dist_man_MANS): Add the corresponding .1 names.
6476         (sha224sum.1, sha256sum.1, sha384sum.1, sha512sum.1): New dependencies.
6477         * tests/misc/sha224sum, tests/misc/sha256sum: New files.
6478         * tests/misc/sha384sum, tests/misc/sha512sum: New files.
6479         * tests/misc/Makefile.am (TESTS): Add new sha224sum, sha256sum,
6480         sha384sum, sha512sum test scripts here rather that each in its
6481         own directory.
6482
6483 2005-08-28  David Madore  <david.madore@ens.fr>
6484
6485         * tests/sha1sum/basic-1 (million-a): Add the "million a's" test (one
6486         of the FIPS test vectors).
6487
6488 2005-10-23  Jim Meyering  <jim@meyering.net>
6489
6490         * configure.ac: Use 6.0-cvs as the version string.
6491         * NEWS: Adjust accordingly.
6492
6493
6494         -----
6495
6496         Copyright (C) 2005, 2006 Free Software Foundation, Inc.
6497
6498         Copying and distribution of this file, with or without
6499         modification, are permitted provided the copyright notice
6500         and this notice are preserved.