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