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