1 2004-01-15 Jim Meyering <jim@meyering.net>
5 2003-12-15 Paul Eggert <eggert@twinsun.com>
7 * NEWS, doc/coreutils.texi: touch -r and -d can now both be specified,
8 with -r specifying the origin for -d.
9 * src/touch.c (flexible_date): Remove static var.
10 (get_reldate): New function.
11 (main): Use it, to implement this new behavior.
13 2004-01-13 Jim Meyering <jim@meyering.net>
15 * src/system.h: Include contents of sys2.h.
16 * src/sys2.h: Remove file.
17 * src/Makefile.am (noinst_HEADERS): Remove sys2.h.
19 * Use automake-1.8.2. Regenerate dependent files.
21 * Update to gettext-0.13.1.
22 * configure.ac: Use gettext-0.13.1.
23 * .x-sc_space_tab: Add m4/po.m4 to the list of exceptions.
25 2004-01-12 Jim Meyering <jim@meyering.net>
27 * Makefile.maint (%.sig): Use .sig suffix rather than .asc.
29 * Makefile.maint (po-check): Ensure that cvsu works before using it.
30 Reported by Alexandre Duret-Lutz.
32 * src/tail.c (main): Warn about following stdin only when it's a tty.
34 * configure.ac: Use gl_DEFAULT_POSIX2_VERSION.
36 2004-01-10 Jim Meyering <jim@meyering.net>
38 * tests/misc/stat-fmt: Use backticks, not `$()' notation.
40 2004-01-09 Jim Meyering <jim@meyering.net>
42 * configure.ac: Quote underquoted `jm_DUMMY_1' to avoid new warning.
44 2004-01-08 Jim Meyering <jim@meyering.net>
46 * src/stat.c (human_fstype): Use %lx, not %x format for `unsigned long'.
49 * tests/Makefile.am (TESTS_ENVIRONMENT): Remove `/vg' (prerelease test
50 remnant) from PATH component. That would cause tests in this directory
51 not to run the just-built binaries, but rather whatever happened
52 to be in one's PATH. Reported by Christian Krackowizer.
54 2004-01-04 Jim Meyering <jim@meyering.net>
56 * src/csplit.c (new_control_record): Use x2nrealloc
59 * src/cp.c (re_protect): Use ASSIGN_STRDUPA rather than
61 (make_path_private): Likewise.
63 2004-01-03 Jim Meyering <jim@meyering.net>
65 * src/paste.c: Use `bool' (not int) as the type for a few
67 (collapse_escapes): Rewrite to set globals rather than modifying
69 Use size_t (not int) for all counters and related index variables.
70 (paste_parallel): Remove needless complexity of
71 using xrealloc in the loop; just allocate the buffers up front.
72 Free the two temporary buffers.
73 Move declarations of locals `down' into scope where used.
74 (paste_serial): Remove `register' attributes.
75 (main): Simplify delim-related code.
76 Free `delims', now that it's malloc'd.
78 2004-01-02 Jim Meyering <jim@meyering.net>
80 * src/chroot.c: Include "quote.h".
81 (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): Define.
82 (main): Exit with status of 127, not 1, for too-few-args,
83 chroot failure, or chdir failure.
84 Give a better diagnostic upon execvp failure.
86 * src/du.c (usage): Mention that, with its current meaning,
89 * src/tail.c (main): Warn about following stdin when it's a tty.
90 Fail when following by name but no names are specified.
92 2003-12-30 Jim Meyering <jim@meyering.net>
94 * src/fold.c (main): Use memcpy, not strcpy.
96 * src/copy.c (copy_internal): Use ASSIGN_STRDUPA rather than
99 2003-12-28 Jim Meyering <jim@meyering.net>
101 * src/unexpand.c (n_tabs_allocated): New global.
102 (add_tabstop): Use x2nrealloc rather than xrealloc.
103 * src/expand.c: Likewise.
105 * tests/misc/expand: New file.
106 * tests/misc/Makefile.am (TESTS): Add expand.
108 * src/sort.c (add_temp_dir): Use x2nrealloc rather than xrealloc.
109 (fillbuf): Use x2nrealloc rather than xrealloc.
110 (sort): Use xnmalloc rather than xmalloc.
113 2003-12-27 Jim Meyering <jim@meyering.net>
115 * src/tee.c (tee): Use xnmalloc rather than xmalloc.
117 2003-12-29 Paul Eggert <eggert@twinsun.com>
119 * NEWS: Remove support for join -j1 FIELD, -j2 FIELD, and -o LIST1
120 LIST2 in POSIX 1003.1-2001 hosts, as required by POSIX.
122 * doc/coreutils.texi (join invocation): Remove documentation
123 accordingly. Document that -t makes all separators significant.
125 * src/join.c: Include posixver.h.
126 (obsolete_usage): New var.
127 (longopts): Put obsolete options first.
128 (OBSOLETE_LONG_OPTIONS): New constant.
129 (get_option, add_file_name): New functions.
130 (main): Use them to support new behavior.
131 (usage): Remove documentation for -j1 FIELD and -j2 FIELD.
132 Do not mark -j FIELD as obsolescent; it is longstanding
133 UNIX tradition and is a valid extension to POSIX.
135 * tests/join/Test.pm (tv): Avoid obsolete -o usage.
137 2003-12-28 Paul Eggert <eggert@twinsun.com>
139 * src/join.c (add_field_list): Don't use alloca with unbounded
140 size; just modify the argument, which is no longer const *.
142 Various other minor cleanups, mostly to avoid the need for casts.
144 (extract_field): Renamed from ADD_FIELD, as it's now a function.
146 (struct field.beg): Now char *, not unsigned char const *. All
147 uses changed. It shouldn't be const since xmemcoll writes on its
149 (extract_field): Likewise, for 2nd arg.
150 (keycmp): Remove now-unnecessary cast of xmemcoll args.
152 (is_blank): New function, to avoid need to cast arg to unsigned char.
153 (extract_field): Use it.
155 (xfields): Rewrite pretty much from scratch.
157 (hard_LC_COLLATE): Now bool, not int.
158 (get_line, getseq, add_field_list): Now returns bool, not int.
159 (decode_field_spec, add_field_list): Return true on success (not
160 false), for consistency with the rest of the code. All uses changed.
162 (tab): Now char, not unsigned char. This wasn't 100% necessary
163 but is slightly cleaner.
164 (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler.
166 (empty_filler): Now const *.
168 (make_blank): Remove; wasn't needed. Remove all calls.
169 (main): Don't set uni_blank.nfields; zero is fine.
171 2003-12-27 Jim Meyering <jim@meyering.net>
173 * src/join.c: Include "quote.h".
174 (min, max): Remove definitions.
175 Make a few function parameters and corresponding
176 locals `const'. Use bool for boolean variables.
177 Use size_t (not int) for all counters and related index variables.
178 (prjoin): Remove now-useless assertion.
179 (string_to_join_field): New function.
180 (main): Accept join fields as large as SIZE_MAX.
181 (keycmp): Rename `min' to MIN and max to MAX.
183 2003-12-26 Jim Meyering <jim@meyering.net>
185 fold -s didn't work on e.g., alpha-based systems.
186 * src/fold.c (fold_file): Adjust types (int->size_t) so that using
187 x2nrealloc works properly on systems with differing sizes for int
188 and size_t. Reported by Nelson Beebe.
190 * src/fold.c: Use `bool' (not int) as the type for a few
193 2003-12-23 Paul Eggert <eggert@twinsun.com>
195 * src/ls.c (length_of_file_names_and_frills):
196 Remove forward decl; not needed.
197 (print_file_name_and_frills, length_of_file_name_and_frills):
198 With -m, don't output spaces before inum or size.
199 (print_with_commas): Don't output space just before newline.
201 2003-12-24 Jim Meyering <jim@meyering.net>
203 * tests/ls/Makefile.am (TESTS): Add m-option.
204 * tests/ls/m-option: New file. Test for above fixes.
206 2003-12-20 Jim Meyering <jim@meyering.net>
210 * src/pr.c: Change type of global, buff_allocated, to size_t.
212 * src/join.c [struct seq]: Change types of members count and alloc
213 from `int' to `size_t'.
215 * tests/Makefile.am (root-hint): Tweak wording.
217 * src/du.c: Accept new option (-0, --null) that makes it so each
218 output line is NUL-terminated rather than newline-terminated.
220 * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync.
221 Reported by Volker Paul.
222 * tests/dd/Makefile.am (TESTS): Add unblock-sync.
223 * tests/dd/unblock-sync: New test for the above.
225 2003-12-19 Jim Meyering <jim@meyering.net>
227 * tests/misc/nohup: Double quote back-ticked expression,
228 in case it ends up having an unexpected value.
230 * tests/ls/no-arg: Use ls's -1 option in both runs.
232 * src/du.c (fts_debug): New global.
233 (FTS_CROSS_CHECK, DEBUG_OPT): Define.
234 (main): Make fts use FTS_TIGHT_CYCLE_CHECK.
235 (main) [DU_DEBUG]: Accept -d option.
237 2003-12-18 Jim Meyering <jim@meyering.net>
239 * src/ls.c (format_user): Increment dired_pos via two statements,
240 `dired_pos += width; dired_pos++;' rather than one,
241 `dired_pos += width + 1;' since the latter could conceivably overflow.
242 (format_group): Likewise.
245 * configure.ac: Require automake-1.8.
247 2003-12-12 Jim Meyering <jim@meyering.net>
249 * Use automake-1.8. Regenerate dependent files.
251 2003-12-08 Jim Meyering <jim@meyering.net>
253 * Makefile.maint (news-date-check): New rule.
254 (alpha beta major): Depend on it.
256 2003-12-03 Paul Eggert <eggert@twinsun.com>
258 * NEWS: ls -l (and similar options) now adjust all columns to
259 fit the data. Generalized from a suggestion by Leah Q for file sizes.
260 * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
261 (format_user_width, format_group_width, unsigned_file_size,
262 format_group): New functions.
263 (block_size_width): Renamed from block_size_size.
264 (inode_number_width, nlink_width, owner_width, group_width,
265 author_width, major_device_number_width, minor_device_number_width,
266 file_size_width): New vars.
267 (clear_files): Initialize them.
268 (gobble_file): Set them. Don't ceiling block_size_width to 7.
269 (print_long_file): Use them.
270 (gobble_file): Use a new local variable 'f' to make the code
271 smaller and more consistent with other functions.
272 (format_user): Output to stdout, not to a buffer, so that we
273 don't have to worry about buffer overrun. Update dired_pos.
274 (print_long_file): Don't put owner, group, author into buffer;
275 just print them directly. Don't assume link counts and
276 major and minor numbers fit into unsigned long int.
277 * tests/cp/same-file, tests/mv/part-symlink: Don't assume that
278 'ls' output is fixed-width.
280 2003-12-02 Jim Meyering <jim@meyering.net>
282 * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h.
284 2003-11-27 Jim Meyering <jim@meyering.net>
286 * Use automake-1.7f. Regenerate dependent files.
288 2003-11-24 Paul Eggert <eggert@twinsun.com>
290 Parse floating-point operands and options in the C locale.
291 POSIX requires this for printf, and we might as well be
292 consistent elsewhere (tail, sleep, seq).
294 * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer
295 needed now that we assume C89. Include "c-strtod.h".
296 (xstrtod): Call c_strtod, not strtod.
297 * src/sleep.c: Include "c-strtod.h".
298 (main): Update xstrtod call to include new argument, c_strtod.
299 * src/seq.c (scan_double_arg): Likewise.
300 * src/tail.c (parse_options): Likewise.
302 2003-11-24 Jim Meyering <jim@meyering.net>
304 * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM).
305 Reported by Mark Conty.
307 2003-11-22 Jim Meyering <jim@meyering.net>
309 * Makefile.maint (sc_xalloc_h_in_src): Remove rule. Subsumed by...
310 (sc_system_h_headers): Do this test only if sys2.h exists.
312 2003-11-20 Jim Meyering <jim@meyering.net>
314 * tests/help-version: Ensure that the bug-reporting address is
315 included in the --help output for every program.
316 * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.
318 * src/ptx.c (usage): Output bug-reporting address.
319 Reported by Dan Jacobson.
321 2003-11-19 Jim Meyering <jim@meyering.net>
323 * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted
324 on the join fields. Suggestion from Bruce Robertson.
326 2003-11-18 Jim Meyering <jim@meyering.net>
328 `od -c -w9999999' could segfault
329 * src/od.c (dump): Use xnmalloc/free, not alloca.
331 2003-11-16 Jim Meyering <jim@meyering.net>
333 * Use autoconf-2.59. Regenerate dependent files.
335 * tests/du/hard-link: Minor tweak: use mkdir -p.
337 Fix read-from-free'd-buffer error detected by valgrind.
338 * src/csplit.c (remove_line): Don't return a pointer to data in
339 a freed buffer. Instead, arrange to free the buffer on the
342 * tests/misc/csplit: New test for above fix.
344 2003-11-11 Jim Meyering <jim@meyering.net>
346 * src/ls.c (extract_dirs_from_files): Avoid useless copy operations.
347 This avoids a warning from valgrind about memcpy with overlapping
348 source and destination.
350 * configure.ac: Require automake-1.7.8.
352 2003-11-09 Jim Meyering <jim@meyering.net>
354 * Use automake-1.7.9. Regenerate dependent files.
356 * src/rm.c: Support new options: --preserve-root and --no-preserve-root.
357 * src/chown.c: Likewise.
359 * src/chown-core.c: Include "root-dev-ino.h".
360 (chopt_init): Initialize new member.
361 (change_file_owner): Support rm's new --preserve-root option.
363 * src/remove.c: Include "root-dev-ino.h".
364 (remove_cwd_entries): Remove now-obsolete FIXME comment.
365 (remove_dir): Support rm's new --preserve-root option.
367 * src/chown.c: Include "root-dev-ino.h".
368 Add new options: --preserve-root and --no-preserve-root.
370 * src/chmod.c: Include "root-dev-ino.h".
371 (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
372 ROOT_DEV_INO_WARN macros.
373 (get_root_dev_ino): Remove function definition, now that it's
374 been moved to a separate file.
375 (usage): Describe new options.
377 * src/mv.c (rm_option_init): Initialized new member.
379 * src/remove.h: Include "dev-ino.h".
380 (struct rm_options): Add new member: root_dev_ino.
381 * src/chown-core.h: Include "dev-ino.h".
382 (struct Chown_option): Add new member: root_dev_ino.
384 2003-11-06 Jim Meyering <jim@meyering.net>
386 * src/paste.c (paste_parallel): Use `sizeof *var' rather than
387 hard-coding `sizeof FILE*'.
389 2003-11-05 Dennis Smit <ds@nerds-incorporated.org>
391 * src/wc.c (main): Free `fstatus' so there is no confusion about
392 whether it's leaked or not.
393 * src/who.c (who): Likewise for `utmp_buf'.
395 2003-11-05 Paul Eggert <eggert@twinsun.com>
397 Fix 'cut' problems with size_t overflow and unsigned int.
398 More generally, resize integer variables to fit use more precisely.
399 * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens.
400 (struct range_pair): Make members to be of type size_t, not unsigned.
401 (max_range_endpoint, eol_range_start): Now size_t, not unsigned.
402 (suppress_non_delimited, output_delimiter_specified,
403 have_read_stdin, print_kth, set_fields): Now bool, nt int.
404 (delim): Now unsigned char, not int.
405 (mark_printable_field, is_printable_field, is_range_start_index,
406 set_fields, set_fields, cut_bytes, cut_fields):
407 Use size_t, not unsigned, for field and byte counts.
408 (hash_int): Use uintptr_t, not unsigned, for pointers converted
409 to integers. This squeezes more info out of them.
410 (set_fields, cut_bytes, cut_fields, main):
411 Use bool, not int, for booleans.
412 (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc.
414 2003-11-05 Paul Eggert <eggert@twinsun.com>
416 * man/Makefile.am (check-programs-vs-x):
417 Work even if $(programs) contains '$'.
418 Work even if 'missing=1' in environment.
419 Don't report an error simply because $(programs) outputs nothing.
421 2003-11-05 Jim Meyering <jim@meyering.net>
423 * Use autoconf-2.58. Regenerate dependent files.
425 * src/tr.c (spec_init): Fix typo in last change.
427 * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in
428 call to variadic version_etc function, so that it works even on systems
429 for which sizeof char* != sizeof int.
430 * src/true.c (main): Likewise.
431 * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c:
432 * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c:
433 * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c:
434 * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c:
435 Similarly, cast NULL to `(char *)' in call to variadic function,
436 parse_long_options, so that it works even on systems for which
437 sizeof char* != sizeof int.
438 A similar problem was reported by Harti Brandt in
439 http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html.
441 * src/users.c (users): Free `utmp_buf' explicitly so that people
442 don't mistake this for a real leak.
443 Patch by Dennis Smit <ds@nerds-incorporated.org.
445 2003-11-04 Paul Eggert <eggert@twinsun.com>
447 * README: Document _POSIX2_VERSION.
449 2003-11-04 Jim Meyering <jim@meyering.net>
451 * src/tac.c (memrchr): Remove #if-0'd function.
452 (tac_stdin_to_mem): Clean up #if-0'd code.
454 * src/od.c (decode_format_string): Remove unnecessary casts.
455 Use more maintainable `sizeof *var'.
456 (main): Call decode_format_string rather than decode_one_format,
457 now that `spec' may be NULL.
459 * src/chmod.c (AUTHORS): Add my name.
461 * src/split.c (next_file_name): Use `sizeof *var' rather than
462 hard-coding `sizeof size_t'.
464 * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...).
466 * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc,
467 to avoid potential overflow in pointer arithmetic.
468 (set_fields): Use not `1', but rather `sizeof *printable_field' as
469 second argument to xcalloc.
470 * src/od.c (decode_format_string, dump_strings): Use x2nrealloc
471 rather than xrealloc.
472 * src/date.c (show_date): Likewise.
473 * src/join.c (ADD_FIELD, initseq, getseq): Likewise.
474 * src/pr.c (store_char): Likewise.
475 * src/fold.c (fold_file): Likewise.
477 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
478 type changes (unsigned int -> size_t) in hash.c.
479 * src/cp-hash.c (src_to_dest_hash): Likewise.
480 * src/du.c (entry_hash): Likewise.
481 * src/ls.c (dev_ino_hash): Likewise.
482 * src/cut.c (hash_int): Likewise. Declare function as static.
484 2003-11-03 Jim Meyering <jim@meyering.net>
486 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
487 * tests/misc/fold: Fail the test immediately if we're not running
488 the expected version of fold.
490 2003-11-02 Jim Meyering <jim@meyering.net>
492 * src/tr.c (append_normal_char, append_range, append_char_class)
493 (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var'
494 rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable
496 * src/copy.c (copy_internal): Likewise.
497 * src/join.c (initseq, add_field, make_blank): Likewise.
498 * src/od.c (main): Likewise.
499 * src/cp.c (make_path_private): Likewise.
500 * src/tsort.c (new_item, record_relation): Likewise.
502 * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise.
503 (main): Also remove anachronistic cast of xmalloc return value.
504 * src/ptx.c (alloc_and_compile_regex, main): Likewise.
505 (main): Also remove anachronistic cast of xmalloc return value.
506 * src/sort.c (inittables): Likewise.
507 (sort): Also Split a long line.
509 2003-10-25 Jim Meyering <jim@meyering.net>
511 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
512 type changes (unsigned int -> size_t) in hash.c.
513 * src/cp-hash.c (src_to_dest_hash): Likewise.
514 * src/du.c (entry_hash): Likewise.
515 * src/ls.c (dev_ino_hash): Likewise.
516 * src/cut.c (hash_int): Likewise. Declare function as static.
518 2003-10-21 Jim Meyering <jim@meyering.net>
520 Don't fail when run with VERBOSE=yes.
521 * tests/chgrp/basic: Do `set +x' before starting the subshell
522 from which we invoke chgrp. Otherwise, the output from the
523 VERBOSE=yes-induced `set -x' would result in spurious differences.
524 Reported by Russel Coker via Michael Stone.
526 2003-10-19 Jim Meyering <jim@meyering.net>
528 chmod now uses fts to perform a directory traversal when -R is
529 specified. Before, it operated on full path names, and as such
530 would encounter the PATH_MAX (often 4096) limit.
532 * src/chmod.c: Include "xfts.h".
533 (process_file): Rename from change_file_mode.
534 Adapt to be used with fts.
535 (process_files): New function.
537 2003-10-18 Jim Meyering <jim@meyering.net>
539 * tests/du/deref-args: Ensure that du -D now dereferences all
540 symlinks specified on the command line, not just those that
541 reference directories.
543 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
544 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
545 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
546 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
547 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
548 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
549 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
550 * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
551 of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
552 Update the call to parse_long_options so that `AUTHORS, NULL' are the
554 * src/true.c (main): Append NULL to version_etc argument list.
555 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
557 2003-10-17 Andreas Schwab <schwab@suse.de>
559 * tests/mk-script: Get $srcdir from first parameter instead of
561 (main): Update usage.
563 * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as
564 first argument of mk-script.
565 ($(srcdir)/Makefile.am): Likewise. Prepend $(srcdir) to target.
567 2003-10-17 Jim Meyering <jim@meyering.net>
569 * src/mv.c (usage): Tweak descriptions of -i and -f so that the
570 generated `man' page is more readable. Suggestion from Dan Jacobson.
572 * src/chown-core.c (change_file_owner): Handle the cases in
573 which fts_info indicates an error with the given entry.
575 * src/du.c (main): Simply assign to bit_flags.
576 Don't bother with bit arithmetic.
578 * tests/chmod/no-x: New file.
579 * tests/chgrp/no-x: New file.
580 * tests/chmod/Makefile.am (TESTS): Add no-x.
581 * tests/chgrp/Makefile.am (TESTS): Likewise.
583 * src/du.c: Include "xfts.h".
584 (du_files): Use xfts_open, rather than fts_open.
585 * src/chown-core.c (chown_files): Likewise.
587 2003-10-16 Jim Meyering <jim@meyering.net>
589 * src/chgrp.c (main): Simply assign to bit_flags.
590 Don't bother with bit arithmetic.
591 * src/chown.c (main): Likewise.
592 Rename a couple of local variables.
593 Remove unnecessary casts.
595 * src/tail.c (start_bytes): Rename local, remainder, to avoid
596 gcc's warning about shadowing a global.
598 2003-10-15 Jim Meyering <jim@meyering.net>
600 chown and chgrp now accept POSIX-mandated -H, -L, -P options and
601 use fts to perform a directory traversal when -R is specified.
602 Before, they operated on full path names, and as such would
603 encounter the PATH_MAX (often 4096) limit.
604 They are more efficient. For example, before, chgrp -R would
605 take almost 5 seconds to change about 2000 directories and fail
606 (with `File name too long'), while now it succeeds on a hierarchy
607 of depth 20,000 in 1/10 the time.
609 * src/chown.c: Include "userspec.h" and "fts_.h".
610 (WRITTEN_BY): Add my name.
611 (getpwnam, getgrnam, getgrgid): Remove declarations.
612 (endpwent): Remove definition.
614 (main): Handle new options.
615 Call new function, chown_files rather than change_file_owner.
617 * src/chgrp.c: Include "fts_.h".
618 (WRITTEN_BY): Add my name.
619 (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of
622 (main): Handle new options.
623 Call new function, chown_files rather than change_file_owner.
625 Rewrite to iterate through hierarchies using fts rather than
626 via explicit recursion.
627 * src/chown-core.c: Include "fts_.h"
628 (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
629 on a single file at a time.
630 (chown_files): New function.
631 * src/chown-core.h [enum Dereference_symlink]: Remove declaration.
632 [struct Chown_option] (recurse, force_silent): Change type to `bool'.
633 [struct Chown_option] (dereference): Remove member with ambiguous name.
634 [struct Chown_option] (affect_symlink_referent): New member.
635 (chown_files): New prototype.
637 * tests/chgrp/recurse: Update tests accordingly.
638 * tests/chgrp/posix-H: New tests for the above.
639 * tests/chgrp/Makefile.am (TESTS): Add posix-H.
641 * src/ln.c (usage): Clarify that --directory, -d, -F probably won't
642 work even for superuser. Suggestion from Dan Jacobson.
644 2003-10-14 Paul Eggert <eggert@twinsun.com>
646 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
648 * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h,
649 lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib.
650 * src/sort.c (parse_field_count): Handle the case where overflow
651 and invalid suffix char are both reported.
653 2003-10-14 Jim Meyering <jim@meyering.net>
655 * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the
656 warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
659 2003-10-13 Paul Eggert <eggert@twinsun.com>
661 Fix to avoid a denial-of-service attack if the display width is
662 enormous. Also, clean up the code a bit by removing duplicate code.
664 * src/ls.c (init_column_info): Remove forward decl; no longer needed.
665 (calculate_columns): New function, that contains code that used
666 to be common to print_many_per_line and print_horizontal.
667 (print_many_per_line, print_horizontal): Use it.
668 (decode_switches): Set max_idx here, not in calculate_columns.
669 (print_current_files): Don't call init_column_info; calculate_columns
671 (init_column_info): Don't allocate a lot more space than is needed
672 to represent the current set of files. Allocate all the new
673 size_t cells in one call to xnmalloc, rather than a row at a time.
675 2003-10-13 Jim Meyering <jim@meyering.net>
677 * src/ls.c (init_column_info): Add another FIXME comment.
679 2003-10-13 Paul Eggert <eggert@twinsun.com>
681 Fix address-arithmetic bug in 'ls', reported by Georgi Guninski.
682 Remove several arbitrary limits on hosts where int cannot represent
685 * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent,
686 nfiles, files_index, tabsize, line_length, struct column_info.line_len,
687 struct column_info.col_arr[0], max_idx):
689 (get_funky_string): Return bool indicating success, instead of
690 a negative count to indicate failure. Store number of columns
691 through new parameter OUTPUT_COUNT; that way, they can never
692 go negative. Change equals_end from int to bool. All uses
694 (struct column_info.valid_len): Now bool, not int. All uses changed.
695 (dired_dump_obstack, get_funky_string, clear_files,
696 extract_dirs_from_files, print_current_files,
697 print_many_per_line, print_horizontal, init_column_info,
698 put_indicator, length_of_file_name_and_frills,
699 print_with_commas): Use size_t, not int, for local variables
701 (decode_switches): Decode sizes using xstrtoul, not xstrtol.
702 Check for TIOCGWINSZ returing negative values (or values greater
704 (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
706 Use xmalloc and xnmalloc, not XMALLOC.
707 (gobble_file): Use xnrealloc, not XREALLOC.
708 (print_color_indicator): Remove now-unnecessary cast to size_t.
710 2003-10-12 Paul Eggert <eggert@twinsun.com>
712 * tests/du/no-x: Change wording of diagnostic to match latest du.c.
713 * tests/sort/sort-tests: Remove from CVS; assume that people
714 brave enough to check coreutils out from CVS can rebuild it.
716 2003-10-12 Jim Meyering <jim@meyering.net>
718 New options: --preserve-root and --no-preserve-root.
719 * src/chmod.c (change_file_mode): Honor new option.
720 (change_file_mode): Strip trailing slashes on directory
721 argument passed to change_dir_mode.
722 (get_root_dev_ino): New function.
723 (main): Initialize global, root_dev_ino.
725 * src/copy.c (copy_internal): Don't #ifdef-out simple uses of
726 S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined
728 * src/chmod.c (change_file_mode): Likewise.
730 2003-10-08 Jim Meyering <jim@meyering.net>
732 * src/csplit.c (main): Remove obsolete FIXME.
734 2003-10-07 Jim Meyering <jim@meyering.net>
736 * Use automake-1.7.8. Regenerate dependent files.
738 2003-09-29 Paul Eggert <eggert@twinsun.com>
742 * doc/coreutils.texi (csplit invocation):
743 The regexp offset need not have a sign; POSIX requires support
746 Be more careful about int widths. For example, remove some
747 arbitrary limits by replacing 'unsigned' with 'size_t',
748 'uintmax_t', etc. Use standard bool rather than a homegrown type.
749 * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
750 * src/csplit.c (FALSE, TRUE, boolean): Remove. All uses changed
751 to <stdbool.h> usage.
752 (struct control): offset is now intmax_t, not int.
753 repeat_forever is now bool, not int.
754 (struct cstring): len is now size_t, not unsigned int.
755 (struct buffer_record): bytes_alloc, bytes_used, num_lines are now
756 size_t, not unsigned. start_line, first_available are now
757 uintmax_t, not unsigned.
758 (hold_count, control_used): Now size_t, not unsigned.
759 (last_line_number, current_line, bytes_written):
760 Now uintmax_t, not unsigned.
761 (save_to_hold_area, red_input, keep_new_line, record_line_starts,
762 create_new_buffer, get_new_buffer, load_buffer, find_line,
763 process_regexp, split_file, new_control_record, extract_regexp,
764 get_format_width, get_format_prec, max_out):
765 size args, locals, and returned values are now size_t, not unsigned
767 (get_first_line_in_buffer, find_line, write_to_file,
768 handle_line_error, process_line_count, regexp_error, process_regexp,
770 File line, byte, and repetition counts are now uintmax_t, not unsigned.
771 (check_for_offset): Don't require a sign before the offset.
772 Use xstrtoimax to do the real work.
773 (extract_regexp): Remove harmful cast of size to unsigned.
774 256 -> 1<<CHAR_BIT, for clarity.
775 (get_format_flags): Return at most 3, to avoid worries about overflow.
777 (bytes_to_octal_digits): Remove.
779 (cleanup): Don't check whether output_stream is NULL, since
780 close_output_file does that for us.
782 (new_line_control, create_new_buffer): Use "foo *p = xmalloc
783 (sizeof *p);" instead of the more long-winded alternatives.
785 (get_new_buffer): Use O(1) algorithm for resizing a buffer
786 to a much larger size, instead of an O(N) algorithm.
788 (process_regexp): Use plain NULL rather than casted 0.
790 (make_filename): Use %u, not %d, to format unsigned file number.
792 (new_control_record): Use xrealloc exclusively, since it handles
795 (extract_regexp): Change misspelled word in diagnostic.
797 (get_format_width): Even if a minimum field width is specified,
798 allow room for enough octal digits to represent the value of
799 the maximum representible integer. This fixes a potential
800 buffer overrun. Calculate this room at compile-time, not
801 at run-time; this removes the need for bytes_to_octal_digits.
802 Check for overflow; this removes a FIXME.
804 (get_format_prec): Don't allow precision to be signed; it's
805 not ANSI. Check for overflow. Remove hardcoded "11" as
806 default precision; this fixes a potential buffer overrun
807 on hosts with wider size_t.
809 (get_format_conv_type): Change local variable to be of type
810 unsigned char, not int; this removes a potential subscript
811 violation on hosts where char is signed.
813 (max_out): Replace "for (;*p;)" with more-standard "while (*p)".
814 Allow "%%" in format. Don't overflow when
815 counting lots of percents.
817 (usage): Default sprintf format is %02u, not %d.
819 2003-10-05 Jim Meyering <jim@meyering.net>
821 * src/chown-core.c (change_file_owner): Remove set-but-not-used local.
823 * src/du.c (du_files): Mark diagnostic for translation.
825 2003-10-04 Jim Meyering <jim@meyering.net>
827 * src/du.c (du_files): Ignore any failure of fts_close.
828 Give better diagnostics for failed fts_open.
830 * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition.
832 Deprecate existing use of -H (aka --si).
833 * src/du.c (enum) [HUMAN_SI_OPTION]: New member.
834 [long_options]: Use HUMAN_SI_OPTION, not 'H'.
835 (main): Warn that the meaning of -H will soon change to be
838 2003-10-03 Jim Meyering <jim@meyering.net>
840 * src/du.c: Accept --no-dereference (-P).
842 2003-10-02 Jim Meyering <jim@meyering.net>
844 * tests/du/trailing-slash: Adjust for slightly different output.
846 Rewrite du.c to use fts.
847 * src/du.c: Include "fts_.h", not ftw.h.
848 (opt_dereference_arguments, arg_length, suffix_length): Remove globals.
849 (IS_FTW_DIR_TYPE): Remove definition.
850 (IS_DIR_TYPE): Define.
851 (is_symlink_to_dir): Remove now-unnecessary function.
852 (process_file, du_files): Rewrite to use fts.
854 * tests/du/inaccessible-cwd: Ensure that even when run from an
855 inaccessible directory, du can still operate on accessible
856 directories elsewhere.
857 * tests/du/Makefile.am (TESTS): Add inaccessible-cwd.
859 * tests/rm/deep-1: Ensure that du can process a hierarchy
860 of depth 400 while using no more than 50KB of stack space.
862 2003-10-01 Akim Demaille <akim@epita.fr>
864 * announce-gen (print_news_deltas): New function, extracted from main.
865 (main): Make `news_file' an array.
866 Use '...=s' => \@var for --news and --url-directory specs.
867 Before there were a couple of portability problems.
869 2003-09-28 Jim Meyering <jim@meyering.net>
871 * Makefile.maint (sc_cast_of_alloca_return_value): New rule.
872 (syntax-check-rules): Add it.
874 * src/copy.c: Remove unnecessary cast of alloca, since now it's
875 guaranteed to be (void *).
876 * src/cp.c: Likewise.
877 * src/join.c: Likewise.
878 * src/ln.c: Likewise.
879 * src/ls.c: Likewise.
880 * src/od.c: Likewise.
881 * src/sys2.h (ASSIGN_STRDUPA): Likewise.
883 2003-09-27 Jim Meyering <jim@meyering.net>
885 Don't exhaust virtual memory when processing large inputs.
886 Fix this by removing csplit's internal free-list management;
887 instead rely on malloc for that.
889 * src/csplit.c (free_list): Remove global.
890 (clear_all_line_control): Remove function.
891 (get_new_buffer): Always use create_new_buffer to obtain a
892 new buffer, rather than searching free_list.
893 (free_buffer): Just call free.
894 Reported by Nikola Milutinovic.
896 2003-09-26 Jim Meyering <jim@meyering.net>
898 * man/rm.x: Also list `chattr' in SEE ALSO section.
899 Suggestion from Mark Hubbart.
901 2003-09-25 Jim Meyering <jim@meyering.net>
903 * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now
904 that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them.
906 * Use autoconf-2.57d. Regenerate dependent files.
908 2003-09-24 Jim Meyering <jim@meyering.net>
910 Minor efficiency tweak.
911 * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
914 2003-09-23 Jim Meyering <jim@meyering.net>
916 * src/paste.c (paste_serial): Save errno after input error,
917 to report proper errno value.
918 Based on a patch from Paul Eggert.
920 * src/tee.c (tee): Adjust fwrite arguments so that the return
921 value is the number of bytes written.
923 2003-09-16 Paul Eggert <eggert@twinsun.com>
925 Don't assume ferror sets errno. Bug reported by Bruno Haible.
927 * src/comm.c (compare_files): Save errno after input error,
928 to report proper errno value.
929 * src/fold.c (fold_file): Likewise.
930 * src/od.c (check_and_close, skip, read_char, read_block): Likewise.
931 * src/unexpand.c (unexpand): Likewise.
933 * src/csplit.c (close_output_file): Don't report bogus errno value
934 after ferror discovers an output error. We don't know the proper
935 errno value, since it might have been caused by any of a whole
936 bunch of calls, and it might have been trashed in the meantime.
937 Fixing this problem will require much more extensive changes;
938 in the meantime just say "write error".
939 * src/od.c (check_and_close, dump, dump_strings): Likewise.
940 * src/uniq.c (check_file): Likewise.
942 * src/join.c (get_line): Report error right away if I/O fails,
943 so that the proper errno value is used.
944 * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise.
945 * src/tee.c (tee): Likewise.
946 * src/uniq.c (check_file): Likewise.
948 * src/od.c (skip): If a read fails, don't retry it later, so
949 that we report the proper errno.
951 * src/tac.c (tac_mem): Don't return a value; nobody uses it.
953 * src/tee.c (tee): Once a write failure has occurred, don't bother
954 writing anything more to that stream.
956 * src/uniq.c (check_file): Check for ferror (stdout) even if
959 * src/yes.c (UNROLL): Remove.
960 (main): Exit immediately when write failure is detected.
961 Simplify code by assigning to argv when argc == 1.
963 2003-09-21 Paul Eggert <eggert@twinsun.com>
965 * src/ptx.c: Switch encoding from Latin-1 to UTF-8.
966 (WRITTEN_BY): Change "Franc,ois" (actually using
967 c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
970 2003-09-19 Jim Meyering <jim@meyering.net>
972 `du -D symlink-to-dir' would mistakenly omit the slash in
973 lines like this: 24 symlink-to-dir/subdir
974 * src/du.c (process_file): Fix offset calculation.
975 Reported by Jeff Sheinberg as Debian bug #211591;
976 http://bugs.debian.org/205251
978 * tests/du/deref-args: New file/test for the above.
979 * tests/du/Makefile.am (TESTS): Add deref-args.
981 * src/du.c (process_file): Remove useless disjunct.
983 * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
985 * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
986 Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
987 Mark each WRITTEN_BY string as translatable.
989 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
990 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
991 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
992 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
993 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
994 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
995 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
996 * who.c, whoami.c, yes.c: Revert yesterday's changes.
997 Instead, a subsequent change will embed `Written by ' in
998 each string along with the author names.
1000 * src/true.c: Revert yesterday's changes.
1001 * src/sys2.h: Likewise.
1003 2003-09-18 Jim Meyering <jim@meyering.net>
1005 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1006 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1007 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1008 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1009 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1010 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1011 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1012 * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
1013 comma-separated list of strings and/or update the call to
1014 parse_long_options so that `AUTHORS, NULL' are the last parameters.
1015 * src/true.c (main): Append NULL to version_etc argument list.
1016 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
1018 * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
1019 shadowing the math function name. Also rename loga to log_a.
1021 2003-09-14 Jim Meyering <jim@meyering.net>
1023 * src/factor.c (print_factors): Give a separate diagnostic
1024 for numbers that are too large, but otherwise valid.
1025 Reported by Dániel Varga.
1027 2003-09-10 Jim Meyering <jim@meyering.net>
1029 * Use automake-1.7.7. Regenerate dependent files.
1031 * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
1032 of `fmt -1'. Using the just-built tr is a little cleaner.
1033 Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
1034 * man/Makefile.am (programs, check-x-vs-1): Likewise.
1036 2003-09-09 Jim Meyering <jim@meyering.net>
1038 * src/copy.c: Alphabetize includes.
1039 Remove duplicate inclusion of "same.h".
1041 2003-09-08 Jim Meyering <jim@meyering.net>
1043 * Makefile.maint (GZIP_ENV): Remove --rsyncable.
1044 Didn't give enough of a benefit, mainly because it's not yet
1049 * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
1050 (check-programs-vs-x): Fail if $(programs) is empty.
1052 * src/remove.c: Add a comment.
1054 2003-09-07 Jim Meyering <jim@meyering.net>
1056 * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
1057 Don't define. These symbols are no longer used.
1059 * tests/misc/tty-eof: Write ^D as \cD.
1060 Complete the change of 2003-08-02.
1062 * Makefile.maint (po-check): Use cvsu, so that a temporary source
1063 file in lib/ or src/ doesn't induce an unwarranted failure.
1064 Add a kludge to filter out the sole generated source file that
1065 also has translatable messages: src/false.c.
1067 2003-09-06 Jim Meyering <jim@meyering.net>
1069 * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
1070 (parse_options): Give a diagnostic for (but still accept) the
1071 deprecated --allow-missing option.
1073 2003-09-04 Paul Eggert <eggert@twinsun.com>
1075 Don't ignore -S if input is a pipe. Bug report by Michael McFarland in
1076 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
1078 * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the
1079 size_bound ourselves. if an input file is a pipe and the user
1080 specified a size, use that size instead of trying to guess the
1081 pipe size. This has the beneficial side effect of avoiding the
1082 overhead of default_sort_size in that case. All callers changed.
1083 (sort): Remove static var size; now done by sort_buffer_size.
1085 2003-09-05 Jim Meyering <jim@meyering.net>
1087 * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files.
1089 * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
1090 to start, rather than just .1. Upon failure, print unexpected state.
1092 2003-09-04 Paul Eggert <eggert@twinsun.com>
1094 * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
1095 SAFE_READ_ERROR to tmp->nbytes.
1096 * src/tail.c (pipe_lines, pipe_bytes): Likewise.
1098 * src/head.c (struct linebuffer): Change nbytes and nlines
1099 from unsigned int to size_t. unsigned int is safe (after the
1100 2003-09-03 patch) but size_t is cleaner.
1101 * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
1102 (pipe_bytes): Likewise for local variable 'i', which was 'int'.
1104 Standardize on BUFSIZ as opposed to other macro names and values.
1105 * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ.
1106 * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
1107 stdio.h has always defined it,
1108 and other code already assumes it's defined.
1109 * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
1110 (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
1111 (io_buf): IO_BUF_SIZE -> BUFSIZ.
1113 2003-09-04 Paul Eggert <eggert@twinsun.com>
1115 * src/seq.c (step): Default to 1.
1116 (print_numbers): Allow the output to be empty.
1117 (main): The default step is 1, even if LAST < FIRST;
1118 as per documentation.
1119 * tests/seq/basic (onearg-2): Output should be empty.
1121 2003-09-05 Jim Meyering <jim@meyering.net>
1123 * Makefile.cfg (wget_files): Temporarily disable, until master
1124 versions are restored to ftp.gnu.org.
1126 * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
1128 Make seq's --width (-w) option work properly even when the
1129 endpoint requiring the larger width is negative and smaller than
1131 * src/seq.c (get_width_format): Include `-' in the set of bytes
1132 allowed in a `simple' number (no decimal point, no exponent).
1133 Reported by Patrick Mauritz.
1135 2003-09-02 Paul Eggert <eggert@twinsun.com>
1137 * NEWS: sort -t '\0' now uses a NUL tab.
1138 sort option order no longer matters, unless POSIX requires it.
1139 * src/sort.c (usage): Say "blanks" instead of "whitespace",
1140 Similar fixes for many comments.
1141 (TAB_DEFAULT): New constant, so that we can support NUL as
1142 the field separator.
1143 (tab): Now int, not char. Initialize to TAB_DEFAULT.
1144 (specify_sort_size): If multiple sizes are specified, use the largest.
1145 (begfield, limfield): Support NUL tab char.
1146 (set_ordering): Do not let -i override -d.
1147 (main): Report an error if incompatible -o or -t options are given.
1148 Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
1150 2003-09-05 Jim Meyering <jim@meyering.net>
1152 * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
1154 2003-09-03 Andreas Schwab <schwab@suse.de>
1156 Bug report and patch here:
1157 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
1158 * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
1159 * src/head.c (elide_tail_lines_pipe): Likewise.
1161 2003-09-03 Jim Meyering <jim@meyering.net>
1163 * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
1164 small amount of code from him was first moved to lib/human.c, and was
1165 subsequently rewritten entirely.
1166 * src/df.c (AUTHORS): Likewise.
1168 2003-08-22 Lawrence Teo <lcteo@uncc.edu>
1170 * src/md5sum.c (split_3): Accept the BSD format for generic
1171 message digest modes. Currently works with BSD's MD5 and SHA1
1172 formats since these are the two algorithms presently used in
1173 coreutils. Updated comments to reflect this change.
1174 (bsd_split_3): Updated comments.
1176 * tests/md5sum/basic-1: New test to make sure that
1177 `md5sum --check' doesn't accept the BSD SHA1 format (adapted
1178 from `check-bsd' test in tests/sha1sum/basic-1).
1180 * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
1181 --check exit status and BSD SHA1 format (adapted from tests
1182 in tests/md5sum/basic-1).
1184 2003-08-30 Jim Meyering <jim@meyering.net>
1186 * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
1188 When source and destination arguments refer to the same file, reside
1189 on a partition (e.g. VFAT) on which distinct names may refer to the
1190 same directory entry (often due to variations in case), and when the
1191 link count for the file is 1, mv no longer unlinks the file. Instead,
1192 it gives the expected diagnostic that the source and destination are
1193 the same. WARNING: this is an incomplete fix. If the file happens
1194 to have a link count of 2 or greater, such an erroneous mv command
1195 will still unlink it.
1196 Although that is not possible on vfat or umsdos, it is possible on
1197 other file system types, e.g., ntfs, and hpfs.
1198 * src/copy.c (same_file_ok): Invoke same_name (which might still
1199 return false for names that refer to the same directory entry)
1200 only if the link count is 2 or more.
1201 * tests/mv/vfat: Show how to demonstrate the above problem.
1202 This test is not run.
1203 * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
1205 2003-08-27 Jim Meyering <jim@meyering.net>
1207 * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
1208 who's -l option has been eliciting an unconditional warning about
1209 this impending change since sh-utils-2.0.12 (April 2002).
1211 * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
1212 This would happen for nonempty files not ending with a newline.
1213 Reported by Dan Jacobson.
1214 * tests/misc/paste-no-nl: New file. Test for above-fixed bug.
1215 * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
1217 * src/stat.c (print_it): Avoid buffer overrun that would
1218 occur when the user-specified format string ends with `%'.
1219 Patch by Tommi Kyntola.
1220 * tests/misc/stat-fmt: New file. Test for above-fixed bug.
1221 * tests/misc/Makefile.am (TESTS): Add stat-fmt.
1223 2003-08-26 Jim Meyering <jim@meyering.net>
1225 Apply changes from bison.
1226 * GNUmakefile (SHELL): Define to `sh', if necessary.
1228 * Makefile.maint (WGETFLAGS): Define to `-C off'.
1229 Update all uses of $(WGET).
1231 2003-08-22 Akim Demaille <akim@epita.fr>
1233 * Makefile.cfg (local-checks-to-skip): New.
1234 * Makefile.maint (local-check): Rename as...
1235 (local-checks-available): this.
1238 2003-08-26 Akim Demaille <akim@epita.fr>
1240 * announce-gen (print_changelog_deltas): Neutralize "<#" as
1241 "<\#" to avoid magic from Gnus when posting parts of this script.
1243 2003-08-25 Jim Meyering <jim@meyering.net>
1245 * src/stat.c (main): Warn about use of deprecated `-l' option.
1247 2003-08-22 Jim Meyering <jim@meyering.net>
1249 * src/stat.c (do_stat): For link count at end of line, use %h format,
1250 instead of %-5h. The latter would make stat emit trailing spaces.
1251 Reported by Dan Jacobson.
1253 2003-08-20 Jim Meyering <jim@meyering.net>
1255 * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
1257 2003-08-19 Jim Meyering <jim@meyering.net>
1259 * src/system.h: Include stdlib.h unconditionally,
1260 as we're now assuming that part of hosted C89.
1262 2003-08-18 Jim Meyering <jim@meyering.net>
1264 * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
1265 to avoid warnings from gcc.
1267 2003-08-17 Jim Meyering <jim@meyering.net>
1269 Avoid unnecessary and sometimes time-consuming hostname lookups.
1270 * src/who.c (print_user): Use strchr, not strrchr.
1271 * src/pinky.c (print_entry): Likewise.
1272 Patch by Michael Stone.
1273 This fixes a typo I introduced in who-users.c on 1996-02-23.
1275 * Makefile.maint (makefile-check): Add 0-9 to the range of characters
1276 disallowed between `@...@'.
1278 2003-08-16 Paul Eggert <eggert@twinsun.com>
1280 * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
1281 done by gnulib .m4 files.
1282 (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
1283 * src/sys2.h (strtoull): Remove unused declaration.
1285 2003-08-16 Jim Meyering <jim@meyering.net>
1287 * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
1290 * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
1291 race condition bug. The bug would be triggered when tailing a file
1292 with file pointer not at beginning of file, and where the file was
1293 truncated to have a length of less than the initial offset at just
1294 the right moment (between the two lseek calls in this function).
1296 An invalid initial value for *read_pos would result in
1297 `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
1298 busy-wait rather than sleeping between iterations. The bug manifests
1299 itself only when tailing regular files that are initially nonempty.
1300 * src/tail.c (tail_bytes): Set *read_pos to new file offset after
1302 (tail_lines): Likewise, after lseek calls.
1303 Reported by Nick Estes. See http://bugs.debian.org/205251 for details.
1304 * tests/tail-2/tail-n0f: New file. Test for above fix.
1305 * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
1307 2003-08-15 Jim Meyering <jim@meyering.net>
1309 * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
1310 (sc_sun_os_names): Likewise.
1311 * .x-sc_space_tab, .x-sc_sun_os_names: New files.
1313 * man/help2man: Remove some SPACEs before TAB.
1315 2003-08-14 Paul Eggert <eggert@twinsun.com>
1317 * Makefile.maint (LC_ALL): Set to C.
1318 * man/Makefile.am (ASSORT): New var.
1319 (check-x-vs-1, programs): Use it.
1320 * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
1321 * tests/Makefile.am (ASSORT, all_programs): Likewise.
1323 2003-08-11 Jim Meyering <jim@meyering.net>
1325 fold -s -wN would infloop for N < 8 with TABs in the input.
1326 E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
1327 * src/fold.c (fold_file): Move contents of `else'-block
1328 out of conditional so it's used also for --spaces (-s).
1329 * tests/misc/fold: Test for the above fix.
1330 * tests/misc/Makefile.am (TESTS): Add fold.
1332 2003-08-10 Jim Meyering <jim@meyering.net>
1334 * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
1335 system.h so the types from time.h and sys/time.h are available.
1336 It appears that this is necessary for OpenBSD, NetBSD, and
1337 Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
1339 2003-08-06 Paul Eggert <eggert@twinsun.com>
1341 * NEWS: Add support for setting file timestamps to microsecond
1342 resolution, on hosts that support this.
1343 * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
1344 * src/copy.c (copy_internal):
1345 Set file timestamps with utimens, not utime.
1346 * src/cp.c (re_protect): Likewise.
1347 * src/install.c (change_timestamps): Likewise.
1348 * src/touch.c (newtime, touch, main): Likewise.
1350 2003-08-09 Jim Meyering <jim@meyering.net>
1352 * Makefile.maint (sc_sun_os_names): New rule based on a regexp
1354 (syntax-check-rules): Add it.
1356 * src/tail.c (main): Tweak Solaris OS version number in comment.
1357 * src/wc.c (wc): Likewise
1358 * tests/tail-2/fflush: Likewise.
1360 * src/tail.c: Add new undocumented option, --presume-input-pipe.
1361 (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
1363 2003-08-08 Paul Eggert <eggert@twinsun.com>
1365 Use new gnulib 'extensions' module.
1366 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
1369 2003-08-08 Paul Eggert <eggert@twinsun.com>
1371 * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
1373 2003-08-09 Jim Meyering <jim@meyering.net>
1375 * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
1376 For tests of obsolete behavior, don't presume that unsetting
1377 _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
1379 2003-08-07 Paul Eggert <eggert@twinsun.com>
1381 * doc/coreutils.texi (split invocation):
1382 Add -d or --numeric-suffixes option to 'split'.
1383 From a suggestion by Jesse Kornblum.
1384 * src/split.c (suffix_alphabet): New var.
1385 (longopts, usage, next_file_name, main): Support -d.
1386 (next_file_name, main): Allow -a0, as POSIX requires.
1387 (next_file_name): Don't assume ASCII-like encoding;
1388 'a' through 'z' are not contiguous in EBCDIC.
1390 2003-08-05 Paul Eggert <eggert@twinsun.com>
1392 Merge getline from gnulib.
1393 * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
1394 * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
1395 New files, from gnulib.
1396 * lib/getdelim2.c, lib/getdelim2.h: Remove.
1397 * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
1398 getdelim2.h to getndelim2.c and getndelim2.h.
1399 * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
1400 checking for getdelim.
1401 (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
1402 than rolling our own.
1403 * src/cut.c: Include getndelim2.h rather than getdelim2.h.
1404 (cut_fields): Invoke getndelim2 rather than getdelim2.
1406 2003-08-04 Jim Meyering <jim@meyering.net>
1408 * src/sort.c (main): Use unsigned int instead of int for `nsigs'
1409 and for the indices to iterate through nsigs.
1411 2003-08-02 Paul Eggert <eggert@twinsun.com>
1413 * src/sort.c: Minor code cleanups, mostly to use more accurate
1414 types and to remove unnecessary casts.
1415 (min, max): Remove. All uses changed to MIN and MAX.
1416 (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
1417 keyfield.skipsblanks, struct keyfield.skipeblanks, struct
1418 keyfield.numeric, struct keyfield.general_numeric, struct
1419 keyfield.month, struct keyfield.reverse, reverse, unique,
1420 have_read_stdin): Now bool, not int. All uses changed.
1421 (eolchar): Now char, not int.
1422 (struct keyfield.ignore): Now bool const *, not int *.
1423 (struct keyfield.translate): Now char const *, not char *.
1424 (struct month.name): Likewise.
1425 (blanks, nonprinting, nondictionary): Now bool[], not int[].
1426 (cleanup, inittables, keycompare, check, mergefps, first_same_file,
1427 check, sort, main): Use const * pointers when possible.
1428 (month_cmp): Rewrite to avoid casts.
1429 (inittables): Initialize tables unconditionally, to avoid branches.
1430 (fillbuf): Return bool, not int. All uses changed.
1431 (fillbuf, keycompare, new_key, main):
1432 Use SIZE_MAX rather than (size_t) -1.
1433 (trailing_blanks): Renamed from trim_trailing_blanks.
1434 Return the number of blanks to trim. All uses changed.
1435 (getmonth): Use trailing_blanks rather than open code.
1436 (keycompare): Do not cast char * to unsigned char *; not needed.
1437 CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
1439 (compare, main): Use | rather than || to avoid jumps.
1440 Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
1442 (check, first_same_file, sort, main):
1443 Use bool instead of int local vars when possible.
1444 (check): Merge the old 'checkfp' and 'check' into a single function,
1445 that returns a boolean (true if the file was ordered).
1447 (main): Use int instead of unsigned for iterating through nsigs.
1448 Rename local var "posix_pedantic" to "posixly_correct".
1450 2003-08-02 Jim Meyering <jim@meyering.net>
1452 * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
1453 to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
1455 * src/cut.c (cut_fields): Don't read again after encountering an
1456 initial EOF. E.g., `cut -f2' would do so.
1457 * tests/misc/tty-eof: Add a test for the above fix.
1459 * src/sort.c (sortlines): Add description and references.
1462 * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
1463 the tests in help-version will use the just-built binaries.
1464 Reported by Christian Krackowizer.
1466 2003-07-31 Paul Eggert <eggert@twinsun.com>
1468 * NEWS: Add --rfc-2822 option to GNU date.
1469 * doc/coreutils.texi (Time directives, Options for date, Examples
1471 * src/date.c (long_options, usage, main): Likewise.
1472 * doc/getdate.texi (General date syntax): Likewise.
1473 * doc/coreutils.texi (Options for date): Fix a typo in format:
1474 it's now %d not %_d. Add URLs.
1476 2003-08-01 Jim Meyering <jim@meyering.net>
1478 * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
1479 Otherwise, with at least the /bin/sh from HPUX 10.20,
1480 the trap code would end up converting that to exit 1 and thus an
1481 unexpected test failure. Reported by Christian Krackowizer.
1483 2003-07-31 Paul Eggert <eggert@twinsun.com>
1485 * src/ptx.c: Do not include bumpalloc.h.
1486 (WORD_TABLE): New member alloc.
1487 (ALLOC_NEW_WORD): Remove.
1488 (occurs_alloc): New var.
1489 (digest_word_file, find_occurs_in_text): Check for arithmetic
1490 overflow when computing table size. Use xrealloc rather than
1491 bumpalloc primitives.
1493 2003-07-29 Jim Meyering <jim@meyering.net>
1497 * README: When running tests as root, suggest using
1498 sudo with NON_ROOT_USERNAME=$USER.
1500 * tests/Makefile.am (all_programs): Makefile is in ../src, not
1503 2003-07-28 Jim Meyering <jim@meyering.net>
1505 * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
1507 2003-07-28 Paul Eggert <eggert@twinsun.com>
1509 * lib/stdbool.hin (_Bool): Make it signed char, instead of
1510 an enum type, so that it's guaranteed to promote to int.
1511 * src/sort.c (sortlines_temp): Undo previous change.
1513 2003-07-28 Jim Meyering <jim@meyering.net>
1515 * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
1516 `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
1517 would cause lines[-1 - swap] (with swap = false) to evaluate to
1520 2003-07-27 Jim Meyering <jim@meyering.net>
1522 * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
1523 since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
1525 * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
1526 directories, as required by POSIX. Reported by Karl Berry.
1527 * tests/rm/dir-no-w: New file. Test for the above fix.
1528 * tests/rm/Makefile.am (TESTS): Add dir-no-w.
1530 * tests/mk-script: Emit `$xx', not its expansion.
1532 2003-07-27 Paul Eggert <eggert@twinsun.com>
1534 This change was inspired by a similar proposal by Stepan Kasal.
1535 * src/sort.c (mergelines, sortlines_temp): New functions.
1536 (sortlines): Use them, to reduce the number of times that
1537 we need to copy 'struct line' values. This improved CPU
1538 performance by about 30% on one 18 MB test.
1539 (sort): Don't invoke sortlines unless we have 2 or more lines.
1541 2003-07-26 Stepan Kasal <kasal@ucw.cz>
1543 * src/sort.c (sort): Don't require two `struct line's per text line,
1544 the new sort algorithm requires just 1.5.
1546 2003-07-27 Jim Meyering <jim@meyering.net>
1548 * src/pathchk.c (validate_path): Use %lu, not %ld.
1550 * src/cut.c (is_printable_field): Simplify bit arithmetic.
1552 * src/ls.c (sort_files): Put `volatile' in the right place.
1555 2003-07-26 Jim Meyering <jim@meyering.net>
1557 Use only one bit per field/offset in array, not one `int'.
1558 * src/cut.c (printable_field): Change type to `unsigned char'.
1559 (mark_printable_field, is_printable_field): New functions.
1560 Use them in place of all direct accesses of `printable_field'.
1562 * src/expand.c (parse_tabstops): Detect overflow properly.
1563 * src/cut.c (set_fields): Likewise.
1565 * src/rm.c: Include "dirname.h".
1566 (usage): Use base_name (program_name) in body of --help output.
1568 * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
1569 Idea from Brendan O'Dea, who suggested using
1570 `program_name = basename (argv[0]);' everywhere --
1571 can't do that, but using base_name works just fine here.
1573 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
1575 2003-07-24 Paul Eggert <eggert@twinsun.com>
1577 Fix some POSIX-compliance problems with 'test'. This makes
1578 'test' more compatible with Bash.
1580 * NEWS, doc/coreutils.texi: Document the following.
1581 * src/test.c: Include exitfail.h.
1582 (TEST_FAILURE): New constant, used for exit status if 'test' fails.
1583 (test-syntax_error): Use it.
1584 (binary_operator): Now takes bool arg specifying whether left operand
1585 is -l ARG, so that caller determines this rather than us.
1587 (term): Use posixtest to evaluate parenthesized subexpressions.
1588 (unary_operator, one_argument): Remove support for -t without operand.
1589 (one_argument): Take argument from argv[pos].
1590 (one_argument, two_arguments, three_arguments): Advance pos.
1591 All callers changed.
1592 (three_arguments): Look for binary ops before "!". Then look
1593 for parenthesized one_argument expressions, instead of trusting
1594 expr () to do the right thing.
1595 (posixtest): Now takes number of args. All callers changed.
1596 Treat "( A B )" like "A B".
1597 (main): Set exit_failure to TEST_FAILURE. Don't depend on
1598 POSIXLY_CORRECT, as we now conform to POSIX by default.
1599 (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
1600 * tests/test/Test.pm (test_vector): Add several tests to check
1601 the above. Syntax errors now exit with status 2, not 1.
1602 * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
1604 2003-07-26 Jim Meyering <jim@meyering.net>
1606 * tests/help-version: Adjust for above change in test behavior:
1607 `[' exits with 2, not 1, and test doesn't accept --help or --version.
1609 * Makefile.maint (ME): Don't use trick suggested in Make manual.
1610 It doesn't work for make-3.79.1. Reported by Christian Krackowizer.
1612 * Makefile.maint (sc_system_h_headers): Another syntax check.
1613 (syntax-check-rules): Add it to the list.
1615 * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
1616 so it matches `%ld' format even on 32-bit systems.
1618 * src/fmt.c (flush_paragraph): Cast field width to `int' to
1619 avoid warning on 64-bit systems.
1621 * src/ls.c (sort_files): Make `func' volatile, so it can't be
1622 clobbered by a `longjmp' into this function.
1624 2003-07-25 Jim Meyering <jim@meyering.net>
1626 * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
1629 * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
1630 because it'd evoke spurious failure on 64-bit systems.
1632 2003-07-24 Jim Meyering <jim@meyering.net>
1634 * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
1635 output its current record counts. Reported by Jurriaan.
1637 * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
1638 `wc' with no options. This goes along with the change of 2003-07-20.
1640 2003-07-23 Jim Meyering <jim@meyering.net>
1642 Don't include headers already included by system.h:
1643 * src/tr.c: Don't include errno.h.
1644 * src/true.c: Don't include version-etc.h.
1645 * src/test.c: Don't include limits.h or error.h.
1646 * src/stat.c: Don't include unistd.h or time.h.
1647 * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
1648 * src/pr.c: Don't include time.h.
1649 * src/pathchk.c: Don't include errno.h.
1650 * src/nice.c: Don't include sys/time.h.
1651 * src/ls.c: Don't include stdlib.h.
1653 * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
1654 * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
1655 * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
1656 * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
1657 * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
1658 * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
1659 * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
1660 * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
1661 Don't include closeout.h.
1663 * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
1664 can access the required version of rm.
1665 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
1667 * tests/cut/Test.pm (out-delim3a): New test.
1669 * man/help2man: Update to version 1.33.
1671 * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
1673 * src/dircolors.c: Include xstrndup.h.
1674 (xstrndup): Remove function, now that it's been factored out into
1677 2003-07-22 Paul Eggert <eggert@twinsun.com>
1679 * src/wc.c (wc): Fix typo in computation of file from file_x,
1680 which caused the former to be used uninitialized if file_x was
1683 2003-07-22 Jim Meyering <jim@meyering.net>
1685 * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
1687 * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
1688 help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by
1689 Thomas Luzat. See http://bugs.debian.org/202413 for details.
1691 * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
1693 * src/hostid.c: Don't include <unistd.h>. system.h already does that.
1695 * src/cut.c (set_fields): Mark all selected indices before trying to
1696 determine range endpoints.
1697 * tests/cut/Test.pm: New test for the above fix.
1699 Begin to address this comment: What if someone wants to
1700 extract the 1,000,000-th field of some huge input file?
1701 The first step is to rearrange things so that the values
1702 in the printable_field array are all 0/1 rather than 0/1/2.
1703 * src/cut.c (RANGE_START_SENTINEL): Remove.
1704 Store range-start indices in a hash table, rather than
1705 overloading the `printable_field' array.
1706 (range_start_ht): New global.
1707 (hash_int, hash_compare_ints, is_range_start_index): New functions.
1708 (print_kth): Use is_range_start_index; don't test printable_field.
1709 (set_fields): Detect overflow.
1710 (set_fields): Insert each range-start index into range_start_ht.
1711 (main): Call set_fields only once, and only after
1712 output_delimiter_specified and (if required) range_start_ht have
1715 2003-07-20 Paul Eggert <eggert@twinsun.com>
1717 * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
1718 invoked with a null pointer when there were no file arguments.
1720 2003-07-20 Jim Meyering <jim@meyering.net>
1722 * Makefile.maint (sc_changelog): Add another nit-picky check.
1724 * src/wc.c (write_counts): Add a comment.
1725 (wc): Rename `file' parameter.
1726 Set new local, `file', to be the file name, or (when it's NULL)
1727 _("standard output") so that all uses of `file' use the proper value.
1728 Use STREQ, not strcmp.
1730 2003-07-20 Paul Eggert <eggert@twinsun.com>
1732 wc count field widths now are heuristically adjusted depending
1733 on the input size, if known. If only one count is printed, it
1734 is guaranteed to be printed without leading spaces.
1736 Previously, wc did not align the count fields if
1737 POSIXLY_CORRECT was set, but POSIX did not actually require
1738 this undesirable behavior, so it has been removed.
1740 * NEWS: Document this.
1741 * doc/coreutils.texi (wc invocation): Likewise.
1743 * src/wc.c (number_width): New var.
1744 (posixly_correct): Remove.
1745 (struct fstatus): New struct.
1746 (write_counts): Output fields of width number_width.
1747 Do not worry about POSIXLY_CORRECT.
1748 Use null file, not empty-string file, to denote stdin,
1749 since "" is a valid file name on some hosts.
1750 (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
1752 (wc): Avoid problems if end_pos - current_pos overflows.
1753 Do not print odd message if stdin has a read error.
1754 (get_input_fstatus, compute_number_width): New functions.
1755 (main): Use them to implement the new behavior.
1756 Ignore POSIXLY_CORRECT.
1758 * tests/wc/Test.pm: Adjust to the new output widths.
1760 2003-07-19 Jim Meyering <jim@meyering.net>
1762 * tests/rm/fail-eperm: Don't create temporary directory --
1765 * tests/shred/remove: Don't open-code test for UID != 0.
1766 Use priv-check's require-non-root instead.
1767 Update to use newer framework.
1769 * tests/help-version (expected_failure_status_expr): Record that
1770 expr exits with status of 3 for e.g., a write error.
1772 * tests/priv-check: Use `id -u' to see if we're running as root,
1773 rather than trying go write to an write-protected file.
1774 When running as root, ensure $NON_ROOT_USERNAME is valid.
1775 When running as root with `require-non-root', ensure that `.'
1776 is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
1777 to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test.
1779 * src/printenv.c: Include "exitfail.h".
1780 (main): Set exit_failure rather than calling close_stdout_set_status.
1781 * src/date.c: Likewise.
1782 * src/sort.c: Likewise.
1783 * src/tty.c: Likewise.
1785 2003-07-18 Jim Meyering <jim@meyering.net>
1787 * tests/touch/not-owner: Update to use newer framework.
1789 * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
1790 directory, and remove Perl-coded `you may not run as root' test.
1791 * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
1792 hard-coding something not quite equivalent.
1793 Paul Jarc reported the inconsistent diagnostics.
1795 * src/sort.c (main): Use close_stdout via atexit.
1796 Now `sort --version' and `sort --help' fail, as they should
1797 when their output is redirected to /dev/full.
1799 * src/su.c (usage): Don't call close_stdout here.
1800 (main): Use close_stdout via atexit.
1801 Now `su --version > /dev/full' fails, as it should.
1802 Somehow, the change of 2000-05-07 that purports to fix this
1805 * tests/help-version (--help/--version vs. /dev/full): Special-case
1806 `[' to protect it from expected_failure_status-`eval'.
1808 * src/uniq.c (writeline): Use a SPACE, not a TAB between the
1809 count and the corresponding line, as required by POSIX.
1810 Reported by Clement Wang.
1811 * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
1813 * tests/expr/basic: Add tests for when exit status is 2.
1815 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
1816 Use an anonymous `enum', rather than #define.
1818 2003-07-17 Paul Eggert <eggert@twinsun.com>
1820 * src/expr.c: Include "exitfail.h", "quotearg.h".
1821 (EXPR_INVALID, EXPR_ERROR): New constants.
1822 (nomoreargs, null, toarith, nextarg): Return bool, not int.
1823 (syntax_error): New function, exiting with status 2. Use it
1824 insteading of printing "syntax error" ourselves.
1825 (main): Initialize exit_failure to EXPR_ERROR.
1826 Exit with EXPR_INVALID on syntax error (too few arguments).
1827 (nextarg): Use strcmp, not strcoll; strcoll might return
1828 an undesirable 0, or might fail.
1829 (docolon, eval4, eval3): Exit with status 3 on invalid argument type
1830 or other such error.
1831 (eval2): Report an error if strcoll fails in a string comparison.
1832 * src/sort.c: Include "exitfail.h".
1833 (main): Set exit_failure, not xalloc_exit_failure and
1834 xmemcoll_exit_failure.
1835 * tests/expr/basic: Invalid value exits with status 3, not 2.
1837 2003-07-16 Jim Meyering <jim@meyering.net>
1839 * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
1840 per GNU maintainer guidelines. The next non-beta release will be 5.1.
1842 This script would have caught at least two recent bugs:
1843 those in [ and kill.
1844 * tests/help-version: Revive this script.
1845 It wasn't doing anything useful, since $all_programs wasn't being
1846 defined by the invoking Makefile.am.
1847 Reflect that nohup is no longer a script, so don't exclude it.
1848 Add framework to handle the programs added since it was last run:
1849 kill, stat, unlink, [, link, readlink.
1850 Fix path-related problems deriving from the move of this script
1851 from src/ to its present location.
1852 * tests/Makefile.am (all_programs): Define.
1853 (TESTS_ENVIRONMENT): Use it.
1855 * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
1856 whereby kill would always attempt to operate on argv[0] and fail.
1858 * src/test.c (integer_expected_error): Improve diagnostic -- now,
1859 it also matches the one from bash's builtin test.
1860 (binary_operator): Add \n at end of diagnostic.
1862 * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ...
1863 * tests/priv-check: Move setuidgid-related and
1864 NON_ROOT_USERNAME-checking code to this file.
1866 * README: Update section on testing as `root'.
1867 Suggestion from Paul Jarc.
1869 * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
1870 names of authors that I just found in bash's builtins/test.def.
1872 Running `[' with no arguments would evoke a segfault.
1873 * src/test.c (main) [LBRACKET]: Move initialization of argv to
1874 precede potential use via test_syntax_error.
1876 * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
1877 warning from automake -Wall.
1879 2003-07-15 Jim Meyering <jim@meyering.net>
1883 * Makefile.maint (%.asc): Remove target first, so gpg doesn't
1886 * announce-gen (print_changelog_deltas): Relax tests for matching
1887 version-number line in NEWS.
1888 Change the .sig suffix to .asc here, too.
1890 2003-07-14 Jim Meyering <jim@meyering.net>
1892 * Makefile.maint (%.asc): Renamed from %.sig.
1893 Generate and use ascii-armored signatures.
1894 Use gpg's -o option.
1896 2003-07-13 Jim Meyering <jim@meyering.net>
1898 * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
1901 * Makefile.maint (syntax-check): Move each individual check into
1903 (syntax-check-rules): This is the list of syntax-check targets.
1904 (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
1905 (sc_cast_of_x_alloc_return_value, sc_space_tab):
1906 (sc_error_exit_success, sc_xalloc_h_in_src): New targets.
1908 2003-07-12 Jim Meyering <jim@meyering.net>
1910 * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
1911 traces of the nohup script.
1913 * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
1914 $(OPTIONAL_BIN_ZCRIPTS).
1916 * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
1917 target, not before the `>'.
1919 * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
1920 now that that function no longer calls `error'.
1922 * src/df.c (find_mount_point): Emit a diagnostic for each
1923 failed syscall, rather than relying on caller to do that.
1924 The caller couldn't do a good job, anyhow -- too many different
1925 ways to fail (each with a different referent).
1926 Give a diagnostic upon failed save_cwd, now that that function
1927 no longer calls `error'.
1928 (show_point): Don't diagnose find_mount_point's errors, now that
1929 it handles them itself.
1931 * src/df.c (find_mount_point): Don't let free clobber errno upon
1934 * src/sys2.h: Remove alloca-related block.
1935 * src/system.h: Include <alloca.h> here, instead.
1937 It appears that the `#pragma alloca' included via "system.h" is
1938 adequate, since join.c uses alloca, yet lacked an in-file #pragma.
1939 * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
1940 * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
1942 * src/chown-core.c (change_file_owner): Do not restore any special
1943 permission bits (e.g., set-user-ID, set-group-ID) that are reset
1944 by chown(2) on some systems. Suggestion and insistence :-) from
1947 * tests/input-tty: Also check `test -t 1'.
1948 This is necessary on linux-2.4.21. Otherwise, the stty/basic-1
1949 test would block when run in the background.
1951 2003-07-11 Jim Meyering <jim@meyering.net>
1953 * tests/sample-test: Also fail if cat-to-create-expected-output
1954 fails. Otherwise, if both `exp' and `out' were to end up empty
1955 because of e.g., a full disk, they would mistakenly compare equal.
1957 * src/nohup.c: New file. Rewrite of nohup.sh in C.
1958 This solves a portability problem: on at least Solaris systems,
1959 when nohup.sh used the vendor /bin/sh, it would exit with status
1960 of `1' rather than the required 126 or 127 upon failure to exec
1961 the specified program.
1963 * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
1964 (bin_PROGRAMS): Add nohup.
1965 (EXTRA_DIST): Remove nohup.sh.
1966 (all_programs): Remove use of $(EXTRA_SCRIPTS).
1967 * src/nohup.sh: Remove file.
1968 * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
1970 * tests/misc/nohup: Tests for the above.
1971 * tests/misc/Makefile.am (TESTS): Add nohup.
1973 * src/head.c (diagnose_copy_fd_failure): New function, renamed from
1974 the macro, COPY_FD_DIAGNOSE.
1975 (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
1976 (head_file): Likewise.
1978 * src/date.c: Include "quote.h".
1979 (batch_convert): Use the quote function rather than using literal `...'
1982 * src/setuidgid.c (main): Enclose diagnostic in _(...).
1983 * src/fmt.c (main): Likewise.
1984 * src/mknod.c (main): Likewise.
1985 * src/tac.c (tac_seekable): Likewise.
1986 * src/yes.c (main): Likewise.
1987 * src/od.c (main): Likewise.
1988 * src/install.c (change_attributes): Likewise.
1990 2003-07-10 Jim Meyering <jim@meyering.net>
1992 * src/head.c (usage): Use 1024*1024 in place of 1048576.
1993 * src/tail.c (usage): Likewise.
1995 * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
1996 place of the kludge in this test. Suggestion from Paul Jarc.
1998 * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
1999 * src/setuidgid.c: New program, solely for testing (not installed).
2001 * src/chown-core.c (change_file_owner): Don't leak file descriptors
2002 when dereferencing symlinks.
2004 2003-07-09 Jim Meyering <jim@meyering.net>
2006 * tests/du/slash: New file/test for today's lib/ftw.c fix.
2007 * tests/du/Makefile.am (TESTS): Add slash
2009 * src/tail.c (xlseek): Avoid warning about ``return without value
2010 from function returning non-void''.
2012 2003-07-08 Jim Meyering <jim@meyering.net>
2014 * man/help2man: Update to version 1.29.
2016 * man/help2man: Add END handler to close STDOUT and check for errors.
2018 2003-06-30 Paul Eggert <eggert@twinsun.com>
2020 Add support for a "[" that conforms to the GNU coding standards,
2021 i.e., that does not depend on its name.
2022 * src/lbracket.c: New file.
2024 * man/Makefile.am (programs): Ignore "[", since it doesn't have
2025 a separate man page.
2026 * src/Makefile.am (bin_PROGRAMS): Add "[".
2027 (__SOURCES): New var.
2028 * src/test.c (LBRACKET): Define to 0 if not defined.
2029 (main): Use LBRACKET rather than argv[0].
2031 * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
2032 Reported by Paul Jarc and Dan Jacobson.
2034 * src/test.c (main): Do not recognize --help or --version if
2035 POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
2036 Do not bother testing that margv[margc] is non-null.
2038 2003-07-04 Jim Meyering <jim@meyering.net>
2040 * src/who.c (print_line): Rewrite to use asprintf, in order to be
2041 able to avoid emitting trailing spaces. Reported by Dan Jacobson.
2043 * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
2044 option, and perform the +1600 invocations of head IFF the envvar
2045 RUN_EXPENSIVE_TESTS is set.
2047 2003-07-03 Jim Meyering <jim@meyering.net>
2049 * src/cp.c (do_copy): Give a better diagnostic when failing due
2050 to nonexistent destination directory. Reported by Dmitry Rutsky.
2051 See http://bugs.debian.org/199730 for details.
2053 2003-06-27 Jim Meyering <jim@meyering.net>
2055 split's --verbose option did nothing [broken in 4.5.10 and 5.0]
2056 * src/split.c (longopts): Use `1', not `0' as the value for
2057 for &verbose. Reported by Keith Thompson.
2059 Test for the above fix.
2060 * tests/misc/split-a: Also use --verbose and compare stderr
2061 output with what we'd expect.
2063 2003-06-20 Jim Meyering <jim@meyering.net>
2065 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2066 Use `error_t' (rather than int) as type for local `err'.
2067 From Alfred M. Szmidt.
2069 2003-06-19 Marcus Brinkmann <marcus@gnu.org>
2071 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2072 Fix author preservation code.
2074 2003-06-19 Jim Meyering <jim@meyering.net>
2076 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
2077 (do_link): Don't warn about hard link to symlink.
2079 2003-06-18 Jim Meyering <jim@meyering.net>
2081 * src/cut.c: Include "getdelim2.h", not "getstr.h".
2082 Reflect renaming: getstr -> getdelim2.
2084 * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
2085 readline -> readlinebuffer.
2087 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2089 * src/readlink.c: Include <sys/types.h> before system.h (because
2090 the latter includes <sys/stat.h>). Required on Ultrix 4.3.
2092 2003-06-17 Jim Meyering <jim@meyering.net>
2094 * src/system.h (initialize_main): Define.
2095 Use it in every `main'. Applied via this:
2096 p='initialize_main (&argc, &argv);'
2097 perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \
2098 $(grep -l program_name.=.argv.0 *.c)
2099 test.c uses margc/margv, so I made the change manually for that file.
2100 Based on a patch from Bernard Giroud.
2102 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2104 Fix for build failure on Ultrix 4.3.
2105 * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
2106 Include sys/param.h and sys/mount.h on ultrix.
2108 2003-06-16 Jim Meyering <jim@meyering.net>
2110 * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
2112 * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
2113 them here instead, but with one change: define EISDIR to -1, not 0.
2115 * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
2116 guaranteed to be defined.
2117 * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
2119 * README: Mention the CVS repository.
2120 Encourage addition of test cases.
2122 2003-06-12 Jim Meyering <jim@meyering.net>
2124 * src/touch.c (touch): Call close only if necessary.
2127 * src/wc.c (usage): Correct wording: wc prints counts in the order
2128 `newline, word, byte'. Reported by Keith M. Briggs.
2129 * man/wc.x: Fix it here, too. And change `lines' to `newlines'.
2131 2003-06-10 Jim Meyering <jim@meyering.net>
2133 * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
2135 2003-06-07 Jim Meyering <jim@meyering.net>
2137 * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
2140 2003-06-06 Jim Meyering <jim@meyering.net>
2142 * src/extract-magic (main): Avoid newer 3-arg form of open,
2143 so this script works also with e.g., perl5.005_03.
2144 Patch by John David Anglin.
2146 2003-06-04 Paul Eggert <eggert@twinsun.com>
2148 * src/system.h: Include <stdbool.h> unconditionally.
2150 2003-06-04 Jim Meyering <jim@meyering.net>
2152 * man/Makefile.am (check-programs-vs-x): Rename target
2153 from check-programs-vs-1. Adjust rule to check for the
2154 primary (.x) file, not the generated one (.1).
2156 2003-06-03 Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
2158 * man/kill.x: New file.
2159 * man/Makefile.am (dist_man_MANS): Add kill.1.
2162 2003-06-04 Jim Meyering <jim@meyering.net>
2164 Ensure that the .x file for a new program is never forgotten again.
2165 * man/Makefile.am (programs): Define.
2166 (check-programs-vs-1): New phony target.
2167 (check-local): Depend on it.
2169 2003-06-03 Jim Meyering <jim@meyering.net>
2171 Avoid unnecessary copying of environment.
2172 * src/env.c (main): Rather than clearing the environment and --
2173 unless told to ignore environment -- copying all settings from
2174 the saved, original environment, clear the environment only when
2175 that is requested. Suggested by Jens Elkner.
2177 2003-06-02 Jim Meyering <jim@meyering.net>
2179 * src/system.h: Always include <string.h>, since we assume C89.
2180 Include <limits.h> without checking for HAVE_LIMITS_H.
2182 * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
2183 (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
2185 2003-06-01 Jim Meyering <jim@meyering.net>
2187 Avoid a race condition in `tail -f' described by Ken Raeburn in
2188 http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
2189 * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
2190 (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
2191 (tail_bytes, tail_lines, tail): Likewise.
2192 (tail_file): Use the new `read_pos' value as the size,
2193 rather than stats.st_size from the fstat call.
2195 2003-05-28 Jim Meyering <jim@meyering.net>
2197 * src/extract-magic: Allow expansion of `$file' in the here-
2198 document corresponding to the comment at the top of fs.h.
2200 2003-05-26 Jim Meyering <jim@meyering.net>
2202 * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
2203 <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
2204 Use #if/#elif/... cascade so we get only one set of include files.
2205 Reported by Nelson Beebe.
2207 2003-05-24 Jim Meyering <jim@meyering.net>
2209 * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
2210 * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
2211 accept the BSD format.
2213 2003-03-28 Joe Orton <jorton@redhat.com>
2215 * src/md5sum.c (bsd_split_3): New function.
2216 (split_3): Detect checksums from BSD 'md5' command and handle them
2219 * tests/md5sum/basic-1: New tests for --check exit status, and for
2220 BSD-style checksum files.
2222 2003-05-21 Jim Meyering <jim@meyering.net>
2224 * src/head.c (elide_tail_lines_pipe): Fix a thinko.
2225 This sort of thing is why it'd be *Really Good* to factor
2226 out the common code used here and in tail.c.
2228 2003-05-14 Jim Meyering <jim@meyering.net>
2230 * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
2232 * tests/du/slink: Skip this test if `.' is on an XFS file system.
2234 * tests/du/fd-leak: New file. Test for the bug in du that
2235 was fixed by the 2003-05-12 change to lib/ftw.c.
2236 * tests/du/Makefile.am (TESTS): Add fd-leak.
2238 * src/head.c (AUTHORS): Enclose string in N_(...), now that it
2239 includes a translatable word, `and'.
2241 * src/dd.c (usage): Don't use `,' as the thousands separator
2242 in e.g. 1,000,000 and 1,048,576. Instead, do this:
2243 `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
2244 * src/df.c (usage): Likewise.
2245 * src/du.c (usage): Likewise.
2246 * src/ls.c (usage): Likewise.
2248 * Makefile.maint (syntax-check): Add another check.
2250 2003-05-13 Paul Eggert <eggert@twinsun.com>
2252 Fix uniq to conform to POSIX, which requires that "uniq -d -u"
2253 must output nothing. Problem reported by Josh Hyman.
2255 * src/uniq.c (enum output_mode, mode): Remove, replacing with:
2256 (output_unique, output_first_repeated, output_later_repeated):
2257 New vars. All uses of "mode" changed to use these variables,
2258 which are not mutually exclusive as "mode" was.
2259 (writeline): New arg "match", used to control whether to
2260 obey output_first_repeated or output_later_repeated.
2261 All callers changed.
2262 (check_file, main): Adjust to above changes.
2264 * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
2266 2003-05-14 Jim Meyering <jim@meyering.net>
2268 * tests/rm/rm3: Use tr's \n notation rather than \012.
2269 This package can afford to do that, since its tests are guaranteed use
2270 GNU tr, which has accepted the more modern notation for 10 years.
2271 * tests/rm/rm5: Likewise.
2272 * tests/cp/same-file: Likewise.
2273 * tests/stty/row-col-1: Likewise.
2274 * tests/stty/basic-1: Likewise.
2275 * tests/rm/deep-1: Likewise.
2276 * tests/mv/part-symlink: Likewise.
2277 * tests/mkdir/perm: Likewise.
2278 * tests/misc/nice: Likewise.
2280 2003-05-13 Jim Meyering <jim@meyering.net>
2282 * src/copy.c (struct F_triple) [name]: Remove const attribute.
2283 (triple_free): Don't apply cast to argument of free.
2284 (seen_file): Add cast here instead.
2286 * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
2287 (src_to_dest_free): Don't apply cast to argument of free.
2289 * src/sort.c (zaptemp): Don't apply cast to argument of free.
2290 * src/pr.c (init_fps, init_store_cols): Likewise.
2291 * src/join.c (delseq, freeline): Likewise.
2292 * src/expr.c (OLD): Likewise.
2293 * src/sort.c (sort): Likewise.
2294 * src/head.c (elide_tail_lines_pipe): Likewise.
2296 * src/tail.c: Include "quote.h".
2297 Use quote in diagnostics. Change many error format strings
2298 from just `%s' to e.g., `error reading %s'.
2299 (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
2300 Rewrite newline-counting loop to use memchr.
2302 * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
2303 Now that assert is no longer used, don't include <assert.h>.
2305 2003-05-12 Jim Meyering <jim@meyering.net>
2307 * src/head.c: Include <assert.h>.
2308 (AUTHORS): Add my name.
2309 (elide_tail_lines_pipe): New function.
2311 2003-05-10 Jim Meyering <jim@meyering.net>
2313 * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
2315 * src/readlink.c (main): Set program_name before first use.
2316 Remove that (redundant) first use.
2317 Don't exit successfully just because --verbose was specified.
2318 Pass 0, not EXIT_SUCCESS, as first argument to error; when that
2319 parameter is 0, error does not exit.
2321 * src/uname.c (main): When failing due to too many arguments, also say
2322 that, rather than just "Try `uname --help' for more information.".
2323 * src/comm.c (main): Likewise, but for too few arguments.
2324 * src/logname.c: Include error.h.
2325 (main): Say why we're failing.
2327 * src/uniq.c (main): Don't segfault when argc < optind.
2328 * src/who.c (main): Handle argc < optind.
2329 * src/df.c (main): Likewise.
2330 * src/install.c (main): Likewise.
2331 * src/mv.c (main): Likewise.
2332 * src/pwd.c (main): Likewise.
2333 * src/tty.c (main): Likewise.
2334 * src/chroot.c (main): Likewise.
2335 * src/hostname.c: Likewise.
2336 * src/du.c (main): Likewise.
2337 * src/expand.c (main): Likewise.
2338 * src/env.c (main): Likewise.
2339 * src/unexpand.c (main): Likewise.
2340 * src/printenv.c (main): Likewise.
2341 * src/sync.c (main): Handle argc == 0.
2342 * src/expr.c (main): Likewise.
2343 * src/printf.c (main): Likewise.
2344 * src/basename.c (main): Likewise.
2345 * src/ln.c (main): Test for `missing argument' before computing n_files.
2346 * src/tail.c (main): Test for the case of no arguments before
2349 * src/kill.c (send_signals): Don't check command line arguments here.
2350 (main): Check them here instead. Handle argc < optind.
2352 * src/logname.c (main): Use error, rather than fprintf, for the sake
2355 * src/rm.c (main): Don't overrun array bound if argc is 0.
2357 2003-05-09 Jim Meyering <jim@meyering.net>
2359 * src/sort.c (main): Don't overrun array bound if argc is 0.
2360 That would happen when invoked via: execl ("/usr/bin/sort", NULL);
2361 Reported by Wartan Hachaturow.
2363 2003-05-07 Jim Meyering <jim@meyering.net>
2365 Implement support so that `head --lines=-N' works on seekable files.
2366 * src/head.c (enum Copy_fd_status): Define.
2367 (COPY_FD_DIAGNOSE): New macro.
2368 (elide_tail_lines_seekable): New funtion.
2369 (elide_tail_lines_file): Call it here.
2371 2003-05-06 Jim Meyering <jim@meyering.net>
2373 * src/sys2.h (CHAR_BIT): Remove duplicate definition.
2375 2003-05-04 Jim Meyering <jim@meyering.net>
2377 * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
2378 caused the addition of thousands of small files to the tar archive.
2379 * tests/misc/head-elide-tail: New file. Add them here instead.
2380 * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
2382 2003-05-04 Paul Eggert <eggert@twinsun.com>
2384 * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
2385 (IF_READDIR_NEEDS_REWINDDIR): Remove.
2386 (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
2387 which was a bit weird because it couldn't be emulated by a function.
2389 2003-05-03 Jim Meyering <jim@meyering.net>
2391 Extend head to accept --lines=-N (--bytes=-N) and to print all
2392 but the N lines (bytes) at the end of the file.
2393 * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
2394 Use quote() in diagnostics, rather than literal `' marks.
2395 (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
2397 (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
2398 (head_file): Reorganize so as to call head from only one place.
2399 (main): Likewise, for head_file.
2400 Handle new, undocumented option, --presume-input-pipe.
2401 Handle negative line and byte counts.
2402 * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
2404 * tests/du/8gb: Skip test if the file system of `.' doesn't support
2405 sparse files -- otherwise it'd create a file of size 8GB.
2407 2003-05-02 Jim Meyering <jim@meyering.net>
2409 * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
2410 Instead explain about `-' and standard input.
2411 (main): Give a proper diagnostic for e.g., `fmt -c -72'.
2412 Reported by Keith Thompson.
2413 * tests/fmt/basic: Add test for the above fix.
2415 * src/fmt.c: Include "quote.h".
2416 Use quote() in diagnostics, rather than literal `' marks.
2417 (main): Exit nonzero when unable to open an input file.
2418 * tests/fmt/basic: Add test for the above fix.
2420 * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
2421 specifications like `-72x'.
2422 * tests/fmt/basic: Add test for the above fix.
2424 Work around nasty readdir bug on Darwin6.5.
2425 * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
2426 [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
2427 returned NULL and there has been at least one successful unlink or
2428 rmdir call since the opendir or previous rewinddir, then call
2429 rewinddir and reiterate the loop.
2431 Factor out common code.
2432 * src/remove.c (readdir_ignoring_dotdirs): New function.
2433 (is_empty_dir): Use it here.
2434 (remove_cwd_entries): Use it here.
2436 2003-05-01 Jim Meyering <jim@meyering.net>
2438 * tests/rm/r-3: Create 500 rather than just 300 files.
2439 There's a bug in Darwin6.5's readdir that shows up only with
2441 Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
2445 Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
2446 (dump_remainder): Move two declarations `down' into the scope
2447 where they are used.
2448 (xlseek): Return the resulting offset.
2449 (file_lines): Rename parameter, file_length, to end_pos.
2450 (pipe_lines): Don't coerce safe_read return value to `int'.
2451 Adapt tests accordingly.
2452 (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
2454 Change type of `total_bytes' from `int' to `size_t',
2455 since the former wouldn't always be wide enough.
2456 Don't coerce safe_read return value to `int',
2457 and adapt tests accordingly.
2458 Now that testing for a read error no longer involves
2459 using `tmp', handle that case *after* freeing `tmp'.
2460 (start_bytes): Clean up.
2461 (tail_bytes): Now that `n_bytes' may be larger than
2462 OFF_T_MAX, test for that condition and, if it's true, don't
2463 use lseek optimizations.
2464 (parse_options): Don't fail just because N_UNITS is larger than
2465 the maximum size of a file -- tail may be applied to an input
2466 stream (e.g., a pipe) with more data than that.
2468 * Makefile.maint (syntax-check): Rename from alloc-check.
2469 Also check for SPACE-TAB sequences.
2470 Also check for malloc/calloc/realloc casts.
2472 2003-05-01 Jim Meyering <jim@meyering.net>
2474 * src/tail.c (start_lines): Rewrite to use memchr. Clean up.
2476 2003-04-28 Jim Meyering <jim@meyering.net>
2478 * tests/misc/tty-eof: Send two tokens, not just one, so we don't
2479 make the now-more-picky tsort fail.
2481 2003-04-24 Jim Meyering <jim@meyering.net>
2483 * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
2484 (main): Minor syntactic clean-up.
2486 * src/tsort.c (tsort): Fail if the input contains an odd number of
2487 tokens. Reported by junkio@cox.net.
2489 * tests/tsort/basic-1: Test for the above fix.
2491 2003-04-21 Jim Meyering <jim@meyering.net>
2493 * tests/misc/printf: Add tests for the printf fixes below.
2495 * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
2497 2003-04-20 Paul Eggert <eggert@twinsun.com>
2499 Fix printf POSIX compatibility bug reported by Ben Harris in
2500 <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
2501 * doc/coreutils.texi (printf invocation): It's \NNN in the format,
2502 \0NNN in the %b operand.
2503 * src/printf.c (usage): Likewise.
2504 (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
2505 is desired. All uses changed. Behave like Bash printf if %b
2506 operand uses \NNN where the initial N is not 0.
2508 2003-04-17 Jim Meyering <jim@meyering.net>
2510 * src/stty.c: Remove uses of PROTOTYPE macro.
2512 2003-04-15 Jim Meyering <jim@meyering.net>
2514 * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
2515 each sequence of spaces before a TAB character.
2517 2003-04-13 Jim Meyering <jim@meyering.net>
2519 * src/remove.c (is_empty_dir): Don't closedir (NULL).
2521 2003-04-12 Jim Meyering <jim@meyering.net>
2523 Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
2524 --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
2525 FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
2526 * src/nl.c (main): Fix those problems and remove literal quote marks
2527 (e.g., "`%s'") from format string; instead use "%s" in each format
2528 string and `quote (optarg)' as the corresponding argument.
2529 Also, diagnose all invalid command line options before failing.
2531 * src/nl.c (proc_text): Fix a bug that would make nl output extra
2532 newlines in some cases. Details here: http://bugs.debian.org/177256.
2533 This bug was introduced on 2001-11-10 for textutils-2.0.17.
2534 * tests/misc/nl: Add test for the above-fixed bug.
2536 * tests/misc/readlink: New file. Test the --canonicalize option.
2537 * tests/misc/Makefile.am (TESTS): Add readlink.
2539 2003-04-11 Jim Meyering <jim@meyering.net>
2542 * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
2543 * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
2544 * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
2545 retain alignment) each sequence of spaces before a TAB character.
2547 * src/ls.c: Include <stdlib.h> unconditionally.
2549 * Makefile.maint (xalloc-check): Rename from header-check.
2551 * src/yes.c: Include error.h after system.h, not before.
2554 * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
2555 * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
2556 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
2557 * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
2558 * src/tr.c: * src/unexpand.c, src/users.c:
2559 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
2560 return values and of xrealloc's first argument.
2561 Fix the former with this:
2562 perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
2564 2003-04-10 Jim Meyering <jim@meyering.net>
2566 * src/stty.c (wrapf): Declare with format attribute.
2568 The S_MAGIC_... names shouldn't be maintained in two places (prior
2569 to this change, one would have to keep stat.c and fs.h in sync).
2570 This change makes it so those names and the corresponding
2571 hexadecimal constants all reside in stat.c. fs.h is now generated.
2572 * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
2573 (BUILT_SOURCES): Add fs.h, now that it's generated.
2574 (EXTRA_DIST): Add extract-magic.
2575 * src/extract-magic: New script to extract fs.h definitions from stat.c.
2576 * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
2577 fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
2579 * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
2580 file with nominal length > 4GB fails. Reported by Michael Deutschmann.
2582 * man/unexpand.x: Add `SEE ALSO' reference to expand.
2583 * man/expand.x: Add `SEE ALSO' reference to unexpand.
2584 Suggestion from Dan Jacobson.
2586 2003-04-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
2588 * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
2589 * src/stat.c (human_fstype): Handle Linux's devpts.
2591 2003-04-09 Paul Eggert <eggert@twinsun.com>
2593 * src/split.c (line_bytes_split): Arg is of type size_t, since
2594 that's all that is supported for now.
2595 (main): Check for overflow in obsolescent line count option.
2597 2003-04-09 Jim Meyering <jim@meyering.net>
2599 * tests/misc/split-fail: Add a new test for the above fix.
2601 * src/split.c (bytes_split): Use size_t temporary (rather than
2602 uintmax_t original) in remaining computations. From Paul Eggert.
2604 Handle command line option arguments larger than 2^31.
2605 This allows e.g., splitting into files of size 2GB and larger,
2606 and running split --lines=N with N=2^31 or more.
2607 But for --line-bytes=N, the restriction that N <= SIZE_MAX
2608 remains (for now), due to the way it is implemented.
2610 * src/split.c: Include "inttostr.h".
2611 (bytes_split, lines_split, line_bytes_split, main):
2612 Use uintmax_t, not size_t, for file sizes.
2613 (main): Give a better diagnostic for option arguments == 0.
2614 Use umaxtostr to print file sizes.
2615 Reported by Luke Hassell.
2617 2003-04-08 Jim Meyering <jim@meyering.net>
2619 * src/rm.c (usage): Mention that --directory (-d) works only
2620 on some systems. Suggestion from Samuel Tardieu.
2622 * tests/basename/basic: Run $PERL to see if it is available,
2623 rather than testing its value.
2624 * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
2625 * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
2626 * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
2627 * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
2628 * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
2629 * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
2630 * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
2631 * tests/sum/basic-1, tests/seq/basic: Likewise.
2633 * tests/misc/Makefile.am (TESTS): Add split-fail.
2634 * tests/misc/split-fail: New file.
2636 * src/split.c: Rename local variables: nchars -> n_bytes.
2637 (lines_split): Rename local, nlines -> n_lines.
2638 (main): Rename local variable: s/accum/n_units/.
2639 (main): Use STDIN_FILENO, not literal `0'.
2641 2003-04-07 Jim Meyering <jim@meyering.net>
2643 * src/stat.c: Add #include directives for Ultrix 4.4.
2644 Based on a suggested change from Bert Deknuydt.
2646 2003-04-06 Jim Meyering <jim@meyering.net>
2648 * Makefile.maint (makefile-check): New rule.
2649 (local-check): Add it.
2651 2003-04-05 Jim Meyering <jim@meyering.net>
2653 * Makefile.am (nearly all of them):
2654 Use $(VAR) rather than @VAR@, now that we can rely on automake to
2655 emit a definition for each substituted variable.
2656 * tests/Makefile.am.in: Likewise.
2658 * tests/rm/rm5: Add a comment explaining why this test fails when
2659 using Tru64's broken sed.
2660 * tests/rm/rm3: Likewise.
2662 Make `kill -t' output signal descriptions (not `?') on Tru64.
2663 * src/kill.c (sys_siglist): Also check for __sys_siglist.
2664 Patch by Tony Leneis.
2665 * configure.ac: Also check for declaration of __sys_siglist.
2666 Required for Tru64 4.0D, 4.0F, and 5.1.
2667 Reported by Tony Leneis.
2669 2003-04-04 Jim Meyering <jim@meyering.net>
2671 * src/Makefile.am (PERL): Remove unnecessary definition.
2673 Because of inappropriate (but POSIX-mandated) behavior of rename,
2674 `mv a b' would not remove `a' in some unusual cases. Work around
2675 this by unlinking `a' when necessary.
2677 * src/copy.c (same_file_ok): Add an output parameter.
2678 Set it in the offending case.
2679 (copy_internal): When necessary, unlink SRC_PATH and inform caller.
2680 Reported by Ed Avis.
2681 * tests/mv/hard-4: New test for the above.
2682 * tests/mv/Makefile.am (TESTS): Add hard-4.
2684 Clean up rules for automatically generated sources:
2685 * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
2686 Make each generated file be read-only.
2687 Add each file name to BUILT_SOURCES separately.
2688 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
2690 Put LOCALEDIR macro definition in new file: localedir.h.
2691 * src/Makefile.am (DEFS): Remove definition.
2692 (localedir.h): New rule.
2693 (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
2694 * src/system.h: Include "localedir.h".
2696 2003-04-02 Jim Meyering <jim@meyering.net>
2700 * tests/misc/Makefile.am (TESTS): Add false.
2702 * Makefile.maint (TMPDIR): Make sure it's defined.
2703 (my-distcheck): Build in $(TMPDIR), not `.'.
2705 * src/Makefile.am (false.c): Change all occurrences of
2706 `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
2707 unsuccessfully also with --help. Reported by Paul Jarc,
2708 * tests/misc/false: New test for the above.
2710 2003-03-30 Jim Meyering <jim@meyering.net>
2712 * NEWS: Note the location of older NEWS files.
2714 * src/remove.c (is_empty_dir): Don't let a failing closedir
2715 clobber errno. Spotted by Arnold Robbins.
2717 * src/env.c: Fix typo in comment. From Arnold Robbins.
2719 2003-03-29 Jim Meyering <jim@meyering.net>
2723 * README: Note to expect build problems for stat.c on Ultrix 4.3.
2724 Note that there are some harmless test failures when running
2725 `make check' as root on some systems.
2727 2003-03-28 Jim Meyering <jim@meyering.net>
2729 * tests/stty/row-col-1: Skip this test if stty can't get window size.
2730 This happens when connecting to sparc-solaris5.7 via ssh from within
2731 emacs. Reported by Karl Berry.
2733 * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
2734 Otherwise, on systems (DJGPP) that emulate pipes using files,
2735 this test would never complete, waiting for `yes' to terminate.
2736 * tests/du/slink: As above, use seq, not `yes' to generate link target.
2737 * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
2738 Reported by Rich Dawe.
2740 2003-03-27 Jim Meyering <jim@meyering.net>
2742 * src/id.c: Remove Arnold Robbins' obsolete e-mail address
2743 from `written by...' comment, at his request.
2745 2003-03-24 Paul Eggert <eggert@twinsun.com>
2747 Fix buffer overrun problem reported by TAKAI Kousuke, along
2748 with some other POSIX incompatibilities.
2750 * src/printf.c (print_esc): Do not treat \x specially if
2751 POSIXLY_CORRECT. Avoid buffer overrun if the format ends
2752 in backslash. Treat incomplete escape sequences as strings
2753 of characters, as POSIX requires.
2754 (print_formatted): Allow multiple flags. Avoid buffer overrun
2755 if the format is incomplete.
2757 2003-03-24 Jim Meyering <jim@meyering.net>
2759 * tests/misc/printf: Add tests for the above fixes and changes.
2761 2003-03-26 Jim Meyering <jim@meyering.net>
2763 * src/copy.h (struct cp_options): Add a comment.
2765 2003-03-23 Jim Meyering <jim@meyering.net>
2767 * README: Describe problem with 64-bit mode on HPUX 11.x,
2768 with patch for /usr/include/inttypes.h.
2769 * TODO: Plan to add an autoconf test to work around the bug.
2771 2003-03-22 Jim Meyering <jim@meyering.net>
2773 * src/stat.c: Don't include <sys/sysmacros.h>.
2774 That is already done via system.h. Otherwise, the multiple
2775 inclusion would evoke redefinition warnings from Cray's /bin/cc,
2776 aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28.
2777 (human_fstype): Factor some directives `up', out of this function.
2778 Cast away `const' to avoid error from Cray's /bin/cc.
2780 2003-03-20 Jim Meyering <jim@meyering.net>
2782 * announce-gen (print_changelog_deltas): Ensure that a newline
2783 precedes each row of `*'s.
2785 2003-03-20 Jim Meyering <jim@meyering.net>
2789 * src/seq.c (valid_format): Also accept ` ' and `'' as valid
2790 format flag characters.
2791 Do not require that a field width be specified.
2792 Do not fail when given a field width of `0'.
2793 Reported by Dan Jacobson.
2794 * tests/seq/basic: Add new tests for the above-fixed bug.
2796 * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
2797 (install-root): Likewise.
2798 (install-exec-local): Likewise.
2799 Based on a patch from Richard Dawe.
2801 2003-03-19 Jim Meyering <jim@meyering.net>
2803 * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
2804 because the DJGPP 2.03 port of 'ln -s' doesn't work.
2805 Include $(EXEEXT) in program names.
2806 Since $(LN_S) may degenerate to `cp -p', be careful
2807 to invoke it from the destination directory.
2808 Mostly from Richard Dawe.
2809 * configure.ac: Use AC_PROG_LN_S.
2811 * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the
2812 CDPATH shell variable set could cause this test to fail.
2813 Reported by Karl Berry.
2815 2003-03-18 Jim Meyering <jim@meyering.net>
2817 * src/fmt.c [struct Word] (paren, period, punct, final): Change the
2818 type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
2819 AIX 5.1's xlc could not compile the former.
2820 Patch by Petter Reinholdtsen. Also reported by Mike Jetzer.
2822 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
2824 * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
2825 program names, since automake only adds $(EXEEXT) to programs
2828 2003-03-16 Jim Meyering <jim@meyering.net>
2830 * src/remove.c (rm): Put two local variables in static storage,
2831 so they can't be clobbered by the potential longjmp.
2833 2003-03-15 Jim Meyering <jim@meyering.net>
2835 * Makefile.cfg (gnu_rel_host): Fix code to match the comment
2836 so that a version number with a two-digit component can still count
2837 as an alpha release. Reported by Richard A Downing.
2838 (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
2840 2003-03-14 Jim Meyering <jim@meyering.net>
2842 * src/ansi2knr.c: Remove no-longer-used file.
2843 * src/ansi2knr.1: Likewise.
2845 * Makefile.maint (prev_version_file): Don't use ?= for this particular
2846 assignment, since it causes trouble with old versions of GNU make
2847 (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here.
2848 http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
2849 Patch from Alexandre Duret-Lutz.
2851 * Use patched automake-1.7.3. Regenerate Makefile.in files in
2852 subdirectories so that each includes a definition of ACLOCAL_M4.
2854 * announce-gen (main): Label the compressed source URLs.
2858 * tests/du/slink: Relax the test for the `local'ness of a file system,
2859 so that now it works also for tmpfs.
2861 * tests/du/hard-link: Transform output from first du, so that this
2862 test doesn't fail on file systems like tmpfs that order directory
2863 entries differently.
2865 2003-03-13 Jim Meyering <jim@meyering.net>
2867 * tests/du/8gb: Work around what appears to be an NFS failure that
2868 would make this test fail on some systems.
2870 2003-03-11 Jim Meyering <jim@meyering.net>
2872 * tests/du/basic: Make the test file exactly 4k bytes long.
2874 * src/split.c (longopts): Don't hard-code `2' here.
2875 Instead, just specify `&verbose', and ...
2876 (main): ... remove the `case 2:' block for --verbose.
2878 * tests/du/basic: Make the test file larger than 64 bytes, so that
2879 we don't immediately disqualify file systems (e.g., NetApp) on which
2880 smaller files take up zero disk blocks. Reported by Vin Shelton.
2882 2003-03-10 Jim Meyering <jim@meyering.net>
2884 Don't segfault for a negative field width or precision in format string.
2885 Note that this is just a stopgap fix. The longer term solution may
2886 involve adapting bash's builtins/printf.def.
2888 * src/printf.c: (UNSPECIFIED): Define.
2889 (print_direc): Use the special value, UNSPECIFIED, to indicate
2890 that field_width or precision has not been specified.
2891 (print_formatted): Fail if field_width or precision is the
2892 special value, UNSPECIFIED.
2893 Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
2895 * src/sys2.h (INT_MIN): Define, if necessary.
2896 * tests/misc/printf: Add a test for the above-fixed bug.
2898 2003-03-09 Jim Meyering <jim@meyering.net>
2900 * src/remove.c (AD_stack_pop): Cast sizeof... to int before
2901 changing its sign. This avoids a warning from gcc on 64-bit systems.
2902 Reported by Bob Proulx.
2903 (pop_dir): Reverse order of sign change and cast, to be consistent
2906 2003-03-08 Jim Meyering <jim@meyering.net>
2908 * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
2909 shell variable, but only in the environment. With /bin/sh->bash, the
2910 shell variable is set to `y', and that would cause a spurious warning.
2911 Reported by Bob Proulx.
2913 * tests/Makefile.am (check-root): Remove touch/fifo.
2914 It doesn't appear to have to be run as root.
2916 * tests/rm/fail-2eperm: Rather than simply using the first non-root
2917 user name, make sure that the selected user name has a usable shell.
2918 Reported by Paul Jarc.
2920 Before, when using shred on a device, one had to specify --exact,
2921 or be careful to choose a size that would not be rounded up and
2922 exceed the maximum value; that could result in a failure of
2924 * src/shred.c (do_wipefd): --exact is now the default for non-regular
2925 files. Suggestion from Ben Elliston.
2928 * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
2929 Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
2930 Patch by Bob Proulx.
2932 * src/Makefile.am (check-misc): Check for use of `defined' in
2934 Change to $(srcdir) before running grep.
2936 * src/sleep.c: Remove now-unused #include and #define directives.
2938 * src/du.c (process_file): If a file's size is not being counted
2939 e.g., because it's a hard link to a file we've already counted,
2940 then don't print a line for it.
2942 * tests/du/hard-link: New test for the above-fixed bug.
2943 * tests/du/Makefile.am (TESTS): Add hard-link.
2946 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
2947 and make the two-array approach work.
2949 * tests/du/basic: Correct/add tests for the above fix.
2950 Set LC_ALL, etc., now that we use sort.
2951 Check the block/size of a small file, too.
2952 Correct expected results for simple dir1/dir2/file case.
2953 Add another test of du -S.
2955 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2957 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
2958 middle-end/9986). As one of GCC's optimizations, it transforms a
2959 fputs_unlocked call to a fputc_unlocked call when the string is
2960 one character long. However, hpux doesn't have fputc_unlocked.
2962 * expr.c (usage): Use putchar, not fputs, to output a single character.
2963 * ls.c (dired_dump_obstack): Likewise.
2964 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
2965 * stat.c (print_it): Likewise.
2967 2003-03-07 Jim Meyering <jim@meyering.net>
2969 * src/cp.c: Remove everything associated with mmap-stack.c.
2970 This reverts the two changes of 2003-02-21.
2971 * src/du.c: Remove everything associated with mmap-stack.c.
2972 This reverts the change of 2003-02-19.
2974 2003-03-06 Jim Meyering <jim@meyering.net>
2976 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
2977 CDPATH shell variable set could cause this test to fail.
2978 Reported by Karl Berry.
2980 2003-03-05 Jim Meyering <jim@meyering.net>
2984 * src/printf.c (print_esc): Remove pointless comparison of unsigned
2985 integer with zero, to avoid a warning from Intel's ecc.
2986 Reported by Nelson Beebe.
2988 * src/du.c (process_file): Sizes must all be of type uintmax_t.
2989 Otherwise, for files or totals that are too big, numbers would
2990 be truncated. Patch mostly by Michael Stone.
2991 Reported by Ingo Saitz as Debian bug #183210.
2993 * tests/du/8gb: New test for the above-fixed bug.
2994 * tests/du/Makefile.am (TESTS): Add 8gb.
2996 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
2997 rather than UTILS_OPEN_MAX - 10.
2999 2003-03-04 Jim Meyering <jim@meyering.net>
3001 * README: Refer new feature discussion to bug-coreutils@gnu.org,
3002 rather than bug-gnu-utils, now that the former is better known.
3003 Suggestion from Göran Uddeborg.
3005 * src/stat.c (usage): Capitalize consistently.
3006 Reported by Göran Uddeborg.
3008 * Makefile.maint (rel-files): Include $(signatures), so that
3009 those files are also copied into $(release_archive_dir).
3011 * src/df.c (find_mount_point): Call error here, now that restore_cwd
3013 * src/remove.c (AD_pop_and_chdir): Likewise.
3015 * tests/Makefile.am (check-root): Add fail-2eperm.
3017 2003-03-03 Jim Meyering <jim@meyering.net>
3019 * src/remove.c (remove_cwd_entries): Include the full filename of
3020 the offending file, not just the basename.
3022 * tests/misc/tty-eof: Set $ME properly.
3024 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
3025 Remove now-unused variables.
3026 (tag-prev-version, prev-cvs-tag): Likewise.
3028 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
3029 accurate diagnostic when failing to remove a file owned by some other
3030 user. Reported by Ivo Timmermans via Michael Stone.
3031 This fixes Debian bug# 178471.
3033 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
3034 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
3035 Based on a report from Ivo Timmermans.
3037 2003-03-02 Jim Meyering <jim@meyering.net>
3039 * src/copy.c (copy_internal) [un_backup]: When recovering from a
3040 failure to create a hard link, do not remove the entry associating
3041 the source dev/ino with the destination file name.
3042 * tests/mv/Makefile.am (TESTS): Add hard-3.
3043 * tests/mv/hard-3: New test, for the above-fixed bug.
3044 Inspired by a report from Iida Yosiaki.
3046 2003-03-01 Jim Meyering <jim@meyering.net>
3048 * src/df.c (print_header): Don't embed spaces in a separate `Type'
3049 header string. Instead, put `Filesystem' and `Type' headers in the
3050 same string, so translators can use horizontal space as needed.
3051 Reported by Jean Charles Delepine.
3053 2003-02-28 Jim Meyering <jim@meyering.net>
3055 * src/copy.c (copy_internal): When link fails because of an
3056 existing destination file, unlink that file and try again.
3057 Reported by Iida Yosiaki.
3059 * tests/mv/Makefile.am (TESTS): Add hard-2.
3060 * tests/mv/hard-2: New test for the above-fixed bug.
3061 Based on a test case from Iida Yosiaki.
3063 2003-02-26 Jim Meyering <jim@meyering.net>
3065 * tests/du/basic: Don't test du's -b option here. Directory byte
3066 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
3067 and IBM AIX 4.2. Reported by Nelson Beebe.
3069 2003-02-25 Jim Meyering <jim@meyering.net>
3071 * Makefile.maint (announcement): Now that ChangeLog entries
3072 are output by announce-gen, don't do it here.
3073 * announce-gen (print_changelog_deltas): New function.
3076 2003-02-22 Jim Meyering <jim@meyering.net>
3078 * announce-gen: New option: --release-type=TYPE
3079 * Makefile.maint (beta, major): New targets. Remove `release'.
3080 Put them all together on a line.
3081 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
3082 invocation of `announcement'.
3083 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
3085 * announce-gen: New option: --news=NEWS_FILE.
3086 Extract NEWS entries here, not via rules in Makefile.maint.
3087 * Makefile.maint (announcement): Now that NEWS entries are
3088 extracted by announce-gen, don't do it here.
3089 (news-r1, news-r2): Remove now-unused definitions.
3091 2003-02-21 Jim Meyering <jim@meyering.net>
3095 Merge in changes from autoconf's version of this file.
3096 * Makefile.maint (www-gnu): Define.
3097 (standards.texi-url_prefix): Use $(www-gnu).
3098 (make-stds.texi-url_prefix): Likewise.
3100 * src/cp.c: Include "mmap-stack.h".
3101 (main): Invoke `run' through a macro that (when possible) runs it
3102 with a large, mmap'd stack.
3104 * src/cp.c (run): New function, preparing for the above.
3105 Exit from this function, not from main
3108 * src/du.c: New option: --apparent-size.
3109 (enum) [APPARENT_SIZE_OPTION]: New member.
3110 (long_options): Add it.
3111 (usage): Describe it.
3113 ['b']: Set apparent_size.
3114 David Eisner reported that the behavior of --bytes had changed.
3115 Paul Eggert proposed the use of a new option, --apparent-size.
3117 * src/du.c (apparent_size): New global.
3118 (print_only_size): Reflect the fact that we're printing byte counts,
3119 not ST_NBLOCKSIZE-byte-block counts.
3120 (print_size): Call print_only_size rather than duplicating its code.
3121 (process_file): Accumulate byte counts, rather than block counts.
3123 * src/du.c (process_file): Always reset size_to_propagate_to_parent
3124 for --separate-dirs (-S).
3126 2003-02-20 Jim Meyering <jim@meyering.net>
3128 * Use automake-1.7.3. Regenerate dependent files.
3130 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
3131 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
3132 (usage) [%B]: Describe it.
3135 * src/du.c (process_file): Reorganize the code to use only
3136 one `sum' array, and change how -S works back to the way it was
3137 before 2003-01-31. Patch by Bruno Haible.
3139 * tests/du/basic: New test.
3140 * tests/du/Makefile.am (TESTS): Add basic.
3142 * tests/envvar-check: Add checks for the following:
3143 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
3145 * tests/Makefile.am: Rename phony target envvar-check to evar-check
3146 so as not to conflict with the distributed file by the same name.
3148 * src/du.c (process_file): Set info->skip before any possible return.
3150 Report correct usage for directories, not 0.
3151 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
3152 _before_ recording the dev/ino of a directory.
3153 Reported by Bruno Haible.
3155 Now, df always displays the device file name corresponding to the
3156 listed mount point under `Filesystem'. Before, for an unmounted
3157 block- or character-special file argument, it would display the
3158 command-line argument instead.
3159 * src/df.c (show_disk): Return a value indicating whether
3160 there was a match. Don't try to find a mount point here.
3161 (show_entry): If show_disk doesn't find a match, call show_point.
3163 2003-02-19 Jim Meyering <jim@meyering.net>
3165 * src/du.c: Include "mmap-stack.h".
3166 (du_files): Add prototype with ATTRIBUTE_NORETURN.
3167 Exit from this function, not from...
3169 Instead, if possible, invoke du_files through a macro that
3170 runs it with a large, mmap'd stack.
3172 * src/join.c (usage): Change wording in --help output:
3173 use FILENUM instead of `SIDE' and say what FILENUM means.
3174 Reported by Bernhard Gabler.
3176 * src/df.c (print_header): Rather than using a hard-coded literal
3177 string of spaces matching the length of the English `...Type' header,
3178 output the right number of spaces to match the selected translation.
3179 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
3181 * src/split.c (bytes_split): Remove unnecessary `else' after break.
3182 (lines_split): Likewise. and correct misleading indentation.
3184 * src/split.c: Include "full-read.h".
3185 (bytes_split, lines_split, line_bytes_split): Use full_read,
3186 not safe_read. The way split was using the latter, a short read
3187 could cause split to terminate before EOF.
3189 * tests/misc/tty-eof: Test all programs that can read stdin,
3190 requiring no arguments and that write to standard output.
3192 * tests/misc/tty-eof: New file. Renamed from ...
3193 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
3194 * tests/misc/Makefile.am (TESTS): Reflect renaming.
3196 2003-02-18 Jim Meyering <jim@meyering.net>
3198 cksum would perform an extra read after encountering EOF
3199 * src/cksum.c (cksum): Exit the loop upon EOF, too.
3200 Patch by Michael Bacarella.
3202 Test for the bug fixed today in cksum, md5sum, and sha1sum.
3203 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
3204 cat, cksum, md5sum, and sha1sum all in the same loop.
3206 2003-02-14 Jim Meyering <jim@meyering.net>
3208 * src/remove.c: Include "euidaccess.h".
3209 Remove declaration of euidaccess.
3211 2003-02-12 Jim Meyering <jim@meyering.net>
3213 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
3214 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
3216 2003-02-10 Jim Meyering <jim@meyering.net>
3218 * src/test.c: Don't include group-member.h.
3219 Include euidaccess.h.
3220 (eaccess): Rewrite function to set the real uid and gid temporarily
3221 to the effective uid and gid, then invoke 'access', and then set the
3222 real uid and gid back. On systems that lack setreuid or setregid,
3223 fall back on the kludges in euidaccess. Before, it would not work
3224 for e.g., files with ACLs, files that were marked immutable,
3225 or on file systems mounted read-only. Nelson Beebe raised the issue.
3226 Paul Eggert suggested the new implementation.
3228 2003-02-09 Jim Meyering <jim@meyering.net>
3230 * src/test.c (test_stat): Remove function. It's job is done (only
3231 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
3233 2003-02-08 Jim Meyering <jim@meyering.net>
3237 * tests/mv/part-symlink: Don't assume that the file owner username
3238 length is less than 9 in ls output: instead, omit that field
3239 altogether. Reported by, and suggested fix from, Ferdinand.
3241 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
3242 * tests/du/Makefile.am (TESTS): Add restore-wd.
3244 * src/rm.c: Correct now-invalid comment about cycle-detection.
3246 2003-02-06 Jim Meyering <jim@meyering.net>
3248 * NEWS: Add entries from old/*/NEWS
3249 from fileutils-4.1 through 4.1.11 and
3250 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
3254 * src/du.c (process_file): Don't return early for excluded files
3255 or for files whose dev/inode we've already seen.
3257 2003-02-05 Jim Meyering <jim@meyering.net>
3259 * tests/du/exclude: New file.
3260 * tests/du/Makefile.am (TESTS): Add exclude.
3262 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
3264 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
3265 Fix memory allocation arithmetic.
3267 2003-02-04 Jim Meyering <jim@meyering.net>
3269 `df /dev/block-or-char-device-file--not-mounted' now reports
3270 the name of the file system on which the file resides, usually `/'.
3271 Before, it would leave the `Mounted on' field blank.
3272 * src/df.c (show_disk): Move function to precede find_mount_point.
3273 (show_disk): Add parameter: STATP.
3274 If we don't find a matching device name, then resort to calling
3275 find_mount_point. Reported by Bob Proulx.
3277 2003-02-03 Andreas Schwab <schwab@suse.de>
3279 * tests/rm/cycle: Require non-root.
3280 * tests/rm/isatty: Likewise.
3282 2003-02-02 Jim Meyering <jim@meyering.net>
3286 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
3288 Ensure that there are no offending uses of `:'.
3289 * Makefile.maint (makefile_path_separator_check): New rule.
3290 (local-check): Add it to the list.
3292 2003-02-01 Jim Meyering <jim@meyering.net>
3294 * src/du.c (MAX_N_DESCRIPTORS): Define.
3296 * src/stat.c (G_fail): New global.
3297 (human_time): Diagnose failed localtime, not failed nstrftime.
3298 (main): Fail if G_fail is set.
3300 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3302 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
3303 hard-coding the path-separator. Also double-quote the new PATH,
3304 to avoid problems when the path-separator is a semi-colon or when
3305 `pwd` contains e.g. a space.
3306 * tests/chgrp/Makefile.am: Likewise.
3307 * tests/chmod/Makefile.am: Likewise.
3308 * tests/chown/Makefile.am: Likewise.
3309 * tests/cp/Makefile.am: Likewise.
3310 * tests/dd/Makefile.am: Likewise.
3311 * tests/dircolors/Makefile.am: Likewise.
3312 * tests/du/Makefile.am: Likewise.
3313 * tests/expr/Makefile.am: Likewise.
3314 * tests/factor/Makefile.am: Likewise.
3315 * tests/fmt/Makefile.am: Likewise.
3316 * tests/install/Makefile.am: Likewise.
3317 * tests/ln/Makefile.am: Likewise.
3318 * tests/ls/Makefile.am: Likewise.
3319 * tests/ls-2/Makefile.am: Likewise.
3320 * tests/md5sum/Makefile.am: Likewise.
3321 * tests/misc/Makefile.am: Likewise.
3322 * tests/mkdir/Makefile.am: Likewise.
3323 * tests/mv/Makefile.am: Likewise.
3324 * tests/od/Makefile.am: Likewise.
3325 * tests/rm/Makefile.am: Likewise.
3326 * tests/rmdir/Makefile.am: Likewise.
3327 * tests/seq/Makefile.am: Likewise.
3328 * tests/sha1sum/Makefile.am: Likewise.
3329 * tests/shred/Makefile.am: Likewise.
3330 * tests/stty/Makefile.am: Likewise.
3331 * tests/sum/Makefile.am: Likewise.
3332 * tests/tail-2/Makefile.am: Likewise.
3333 * tests/touch/Makefile.am: Likewise.
3334 * tests/tsort/Makefile.am: Likewise.
3335 * tests/unexpand/Makefile.am: Likewise.
3337 2003-01-31 Jim Meyering <jim@meyering.net>
3339 * src/stat.c: Include "file-type.h"
3340 (print_human_type): Remove function.
3341 (human_access): Rename from print_human_access. Return a string.
3342 (human_time): Rename from print_human_time. Return a string.
3343 (print_stat): Arrange so that field width and an alignment specifier
3344 are honored for the %A, %F, %x, %y, and %z formats.
3345 [%F]: Use file_type; this gives slightly different file type strings,
3346 e.g., `directory' instead of `Directory' and `regular file' or
3347 `regular empty file' instead of `Regular file'.
3348 Prompted by a report from Richard Dawe that the uses of
3349 S_IFSOCK and S_IFIFO in print_human_time were not portable
3350 to systems using e.g., DJGPP.
3352 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3354 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
3355 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
3357 2003-01-31 Jim Meyering <jim@meyering.net>
3359 * src/du.c (main): Upon processing an invalid option or an invalid
3360 --exclude-from or --max-depth option argument, don't exit right away,
3361 in case there are others. Rather record the failure and exit after
3362 processing other options.
3364 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
3365 tar archive easier to reproduce.
3367 Rewrite to perform directory traversal using nftw.
3369 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
3370 (AUTHORS): Add self.
3371 (opt_one_file_system): Move global into `main'.
3372 (path, xstat, exit_status): Remove declarations.
3373 (arg_length, suffix_length): New globals.
3374 (G_fail): New global, sort of like the old `exit_status'.
3375 (IS_FTW_DIR_TYPE): Define.
3376 (print_only_size): New function.
3377 (process_file): New function.
3378 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
3379 (str_trunc, pop_dir, count_entry): Likewise.
3380 (du_files): Rewrite to use nftw.
3382 2003-01-30 Jim Meyering <jim@meyering.net>
3384 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
3385 symlink-to-directory with -L, even without the trailing slash.
3387 2003-01-27 Jim Meyering <jim@meyering.net>
3389 * src/Makefile.am (check-misc): Check for st_blocks, too.
3391 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
3392 Reported by Richard Dawe.
3394 2003-01-27 Andreas Schwab <schwab@suse.de>
3396 * src/ls.c (quote_name): Add fourth parameter, width, into which to
3397 store the screen columns, and return the number of bytes instead.
3398 (print_dir): Pass NULL as fourth parameter of quote_name.
3399 (print_name_with_quoting): Likewise.
3400 (length_of_file_name_and_frills): Get the width from the fourth
3401 parameter of quote_name instead of return value.
3403 2003-01-27 Jim Meyering <jim@meyering.net>
3405 * src/ls.c (decode_switches): If `dired' is set without
3406 `format == long_format', then silently reset dired. This doesn't
3407 change the behavior of ls (all prior uses of dired were protected
3408 by `&& format == long_format'), and lets us...
3409 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
3410 (PUSH_CURRENT_DIRED_POS): Likewise.
3413 2003-01-22 Jim Meyering <jim@meyering.net>
3415 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
3416 * tests/du/Makefile.am (TESTS): Add no-x.
3418 2003-01-21 Jim Meyering <jim@meyering.net>
3420 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
3421 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
3422 it may still be a directory -- or not (e.g., with FreeBSD on an
3423 NFS-mounted file system), so resort to calling lstat to find out.
3424 Based on a patch by Michael van Elst.
3426 * tests/cp/same-file: Don't assume that the file owner username
3427 length is less than 9 in ls output: instead, omit that field
3428 altogether. Reported by, and suggested fix from, Ferdinand.
3430 2003-01-20 Jim Meyering <jim@meyering.net>
3432 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
3433 large format widths no longer cause strftime to infloop.
3435 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
3437 2003-01-19 Jim Meyering <jim@meyering.net>
3439 * src/readlink.c: Include "canonicalize.h".
3441 2003-01-18 Jim Meyering <jim@meyering.net>
3443 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
3445 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
3446 (long_options): Add option --dereference-command-line-symlink-to-dir.
3447 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
3448 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
3449 -d, -F, -l options is specified.
3450 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
3451 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
3452 Change --dereference-command-line (-H) to dereference *all*
3453 command line arguments, including broken symlinks.
3455 2003-01-15 Paul Eggert <eggert@twinsun.com>
3457 Change ls -H back to the way it was yesterday, since this is
3458 compatible with FreeBSD and the POSIX spec is confusing
3459 and somewhat contradictory.
3461 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
3462 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
3463 (long_options): Change the long option name back.
3464 (usage): Change the usage back.
3465 (gobble_file): When -H is specified, dereference a top-level
3466 arg even if it points to a non-directory.
3468 2003-01-15 Jim Meyering <jim@meyering.net>
3470 * src/ls.c (gobble_file): Fall back on using lstat when required:
3471 when --dereference (-L) is not specified, and
3472 - when operating on a dangling symlink
3473 - when operating on command-line-symlink-to-directories
3474 This fixes numerous problems. Here are examples:
3475 - `ls dangling-symlink' would fail with `no such file...'
3476 Now it prints `dangling-symlink'.
3477 - `ls -i symlink' would mistakenly print the inode of the referent.
3478 Now it prints the inode of the symlink. Likewise for --size (-s).
3479 Based on a patch from Michael Stone.
3480 Reported by Deepak Goel as Debian bug #173793.
3482 Rename ls's --dereference-command-line (-H)
3483 option to --dereference-command-line-symlink-to-dir.
3484 * src/ls.c [enum Dereference_symlink]
3485 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
3486 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
3487 (long_options): Rename the long option.
3488 (usage): Say that --dereference-... changes how ls treats
3489 only symlinks to directories specified on the command line.
3491 2003-01-14 Jim Meyering <jim@meyering.net>
3493 * tests/ls/dangle: New file/test, for the above fix.
3494 * tests/ls/inode: Another new file/test, for the above fix.
3495 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
3497 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
3498 so that ls --color would no longer highlight the names of files with
3499 the execute bit set when not specified on the command line.
3500 Patch by Michael Stone. Reported by Stephen Depooter as
3503 * tests/ls-2/tests (color-exe): New test, for the above fix.
3505 2003-01-13 Jim Meyering <jim@meyering.net>
3507 * tests/shred/exact: Also test for just fixed bug with --zero.
3509 * src/shred.c (long_opts): --zero does not require an argument.
3510 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
3512 2003-01-12 Jim Meyering <jim@meyering.net>
3514 * Makefile.maint (cvs-update): Skip any file with local modifications.
3516 * src/unexpand.c (usage): Document --first-only and mention that
3517 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
3519 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
3521 * src/df.c: Include "canonicalize.h".
3522 Use canonicalize_file_name unconditionally.
3524 2003-01-09 Jim Meyering <jim@meyering.net>
3526 * README: Add readlink.
3528 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3530 * src/df.c: Include "xgetcwd.h".
3531 * src/pwd.c: Likewise.
3533 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3535 * src/shred.c: Remove declaration of xstrdup.
3536 We already get it via xalloc.h which is included via system.h.
3538 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
3540 New program: readlink.
3542 * src/Makefile.am (bin_PROGRAMS): Add readlink.
3543 * src/readlink.c: New file.
3545 * man/readlink.x: New file.
3546 * man/Makefile.am (dist_man_MANS): Add readlink.1.
3547 (readlink.1): New rule.
3549 2003-01-09 Jim Meyering <jim@meyering.net>
3551 When selecting ranges of byte offsets (as opposed to ranges of fields)
3552 and when --output-delimiter=STRING is specified, output STRING between
3553 ranges of selected bytes.
3554 * src/cut.c (RANGE_START_SENTINEL): Define.
3555 (output_delimiter_specified): New global.
3556 (print_kth): Add parameter. Adjust all callers.
3557 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
3558 (cut_bytes): When requested, output STRING between ranges of
3560 (main): Make a diagnostic a little clearer.
3561 Based on a patch from Jan Nieuwenhuizen.
3563 * tests/cut/Test.pm: New tests for the above.
3565 * src/cut.c (set_fields): Make code agree with comment:
3566 Don't merge abutting ranges like 4- and 2-3. This makes no
3567 difference currently, but is required to support an upcoming change.
3569 2003-01-07 Jim Meyering <jim@meyering.net>
3571 * src/cut.c (set_fields): Fix typo in comment.
3573 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
3574 * tests/touch/Makefile.am (TESTS): Add not-owner.
3575 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
3576 Now, this tests only the nonexistent-directory diagnostic.
3577 Suggestion from Michael Stone.
3579 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
3581 2003-01-04 Jim Meyering <jim@meyering.net>
3583 * src/copy.h: Remove use of PARAMS.
3584 * src/remove.h: Likewise.
3585 * src/chown-core.h: Likewise.
3587 rm could be tricked into mistakenly reporting a cycle.
3588 * src/remove.c: [cycle_check_state]: New global.
3589 (remove_cwd_entries): Adapt to new semantics of cycle_check.
3590 (rm): Call cycle_check_init and cycle_check_free for each file.
3591 * tests/rm/cycle (rm): New test, for the above fix.
3592 * tests/rm/Makefile.am (TESTS): Add cycle.
3594 When rm detects a cycle, don't abort the entire command,
3595 but rather just the affected command line argument.
3596 * src/remove.c: Include <setjmp.h>
3597 (struct dirstack_state) [current_arg_jumpbuf]: New member.
3598 (remove_cwd_entries): Call longjmp if we detect a cycle.
3599 (rm): Call setjmp here.
3601 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
3602 Instead, include cycle-check.h and use it.
3604 * src/remove.h (struct dev_ino): Remove declaration.
3606 * src/remove.c (remove_cwd_entries): Fix typos in comment.
3608 Don't include trailing /. in diagnostics about directories.
3609 * src/remove.c (full_filename_): When FILENAME is just `.'
3610 and there is a nonempty directory-name part, don't append `/.'.
3611 * tests/rm/unread2: Remove trailing /. from diagnostic.
3612 * tests/rm/rm2: Likewise.
3614 * src/remove.c (struct dirstack_state): Define.
3615 To be used in place of these file-scoped globals ...
3616 (dir_stack, len_stack, Active_dir): Remove globals.
3617 (ds_init, ds_free): New functions.
3618 (full_filename): Define.
3619 (full_filename_): Rename from full_filename.
3621 Begin to make AD_* functions more generic.
3622 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
3623 (AD_push): Likewise.
3624 (AD_INIT_OTHER_MEMBERS): Define.
3625 (remove_dir): Define the `status' member manually after each
3626 call to AD_push or AD_push_initial.
3628 * src/Makefile.am (check-misc): New rule, to ensure that no more
3629 S_IS* macro definitions sneak into the code.
3630 (check): Depend on check-misc.
3632 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
3633 * src/du.c (count_entry) [S_ISLNK]: Don't define.
3634 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
3636 2003-01-03 Jim Meyering <jim@meyering.net>
3638 * src/true.c: Add copyright.
3639 (AUTHORS): I suppose I've written it.
3641 * src/Makefile.am (false.c): Make the generated file be read-only.
3643 2003-01-04 Jim Meyering <jim@meyering.net>
3645 * src/ls.c: Include "dev-ino.h".
3646 [struct dev_ino]: Remove declaration.
3648 2003-01-02 Jim Meyering <jim@meyering.net>
3650 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
3651 from mv: s/missing file arguments/missing file argument/.
3652 With --target-directory=DIR, cp and mv work with a single file argument.
3653 Reported by Karl Berry.
3655 * tests/rm/isatty: Enable this test.
3657 2002-12-31 Jim Meyering <jim@meyering.net>
3659 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
3660 (AD_push): Likewise.
3661 (AD_INIT_OTHER_MEMBERS): Define.
3662 (remove_dir): Define the `status' member manually after each
3663 call to AD_push or AD_push_initial.
3665 * src/ls.c [struct dev_ino]: Remove definition.
3666 Include "dev-ino.h" instead.
3668 2002-12-28 Jim Meyering <jim@meyering.net>
3670 * tests/du/Makefile.am (TESTS): Add no-deref.
3671 * tests/du/no-deref: New script.
3673 2002-12-23 Jim Meyering <jim@meyering.net>
3675 * src/remove.c (remove_cwd_entries): Fix typo in comment.
3677 2002-12-21 Jim Meyering <jim@meyering.net>
3679 * announce-gen: Generate MML-formatted announcement.
3680 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
3682 2002-12-20 Jim Meyering <jim@meyering.net>
3684 * src/touch.c (touch): Change the wording of a diagnostic so
3685 that it makes sense both when the file exists and when it doesn't.
3686 Suggestion from Michael Stone.
3688 2002-12-18 Jim Meyering <jim@meyering.net>
3690 * src/stty.c (valid_options): Declare to be static.
3692 2002-12-15 Jim Meyering <jim@meyering.net>
3694 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
3696 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
3697 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
3698 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
3699 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
3700 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
3702 * src/remove.c (PARAMS): Remove definition.
3703 * src/sys2.h: Likewise.
3705 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
3706 Include strftime.h instead.
3708 2002-12-14 Jim Meyering <jim@meyering.net>
3710 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
3712 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
3713 This is necessary at least for Irix6.5 when using c89.
3714 Reported by Nelson Beebe.
3716 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
3718 * tests/misc/cat-tty-eof: New test.
3720 * src/mknod.c (usage): Specify how major and minor mode numbers
3721 are interpreted. Report forwarded by Kristin E Thomas.
3722 * src/mknod.c: Remove now-redundant usage-specifying comment.
3724 2002-12-13 Jim Meyering <jim@meyering.net>
3728 * tests/du/trailing-slash: Allow for a directory of size `0'.
3729 That happens at least on file systems of type tmpfs on linux-2.4.18.
3731 * announce-gen: New script to begin replacing the commands
3732 associated with the rule here...
3733 * Makefile.maint (announcement): Invoke announce-gen.
3734 * Makefile.am (EXTRA_DIST): Add announce-gen.
3736 * tests/cp/preserve-2: New file/test, for latest fix.
3737 * tests/cp/Makefile.am (TESTS): Add preserve-2.
3739 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
3741 Fix a bug whereby cp would fail to parse an option like
3742 --preserve=mode,ownership.
3743 * src/cp.c (decode_preserve_arg): Advance `comma' to
3744 point the character following the comma.
3746 2002-12-11 Jim Meyering <jim@meyering.net>
3748 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
3749 in case it's already defined.
3751 2002-12-09 Jim Meyering <jim@meyering.net>
3753 * tests/touch/fail-diag: Don't get a test failure if /no exists.
3754 Instead, evoke a framework failure if /no-$$ exists.
3755 Reported by Michael Stone.
3757 2002-12-08 Jim Meyering <jim@meyering.net>
3759 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
3760 Define to rpl_lstat, so that even on systems like Solaris 5.8,
3761 du honors (per POSIX) the trailing slash on an argument referring
3762 to a symlink-to-directory.
3764 2002-12-06 Jim Meyering <jim@meyering.net>
3766 * Use autoconf-2.57. Regenerate dependent files.
3767 * Use automake-1.7.2. Regenerate dependent files.
3769 * src/ls.c (gobble_file): Also stat the file if it's a
3770 regular file and --indicator-style=classify (aka -F).
3771 Thanks to Ed Santiago for opening my eyes.
3773 * tests/ls/file-type: New file. Test for the above.
3774 A test to contrast ls -F and ls --indicator-style=file-type.
3775 * tests/ls/Makefile.am (TESTS): Add file-type.
3777 2002-12-04 Jim Meyering <jim@meyering.net>
3779 * tests/ls/follow-slink: Make sure the symlink was created.
3780 Richard Dawe reported that `ln -s link link' succeeds, but creates
3781 no file on systems running some version of the DJGPP libc.
3783 2002-12-03 Jim Meyering <jim@meyering.net>
3785 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
3786 since this package no longer panders to K&R compilers.
3788 2002-12-02 Jim Meyering <jim@meyering.net>
3790 * tests/du/slink: Skip this test if `.' is on a non-local file system.
3792 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
3793 something to replace.
3795 2002-12-01 Jim Meyering <jim@meyering.net>
3797 * src/stat.c: Don't include <string.h> or <ctype.h>.
3798 That's already done via system.h.
3799 * src/dircolors.c: Don't include <ctype.h>.
3801 2002-11-30 Jim Meyering <jim@meyering.net>
3803 * ls.c (gobble_file): Remove the block of code that caused
3804 `ls --color -F symlink-to-dir' to list the files in
3805 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
3806 like `ls -F symlink-to-dir') but with the addition of highlighting.
3807 Similarly, `ls --color -dF symlink-to-dir' would print
3808 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
3809 Reported by Jeff Sheinberg as Debian bug #168203.
3810 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
3812 ls is now more efficient: with certain options, it no longer needs
3813 to stat each directory entry on systems with valid dirent.d_type.
3814 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
3815 (main): Make --recursive set format_needs_type, not format_needs_stat.
3816 (gobble_file): Remove a FIXME comment, now that it's fixed.
3818 2002-11-24 Jim Meyering <jim@meyering.net>
3820 * src/du.c (du_files): Don't strip any trailing slash.
3821 Rewrite so that `/' is no longer represented internally as
3823 (count_entry): When appending a file name component,
3824 account for the fact that the current path may end in `/'.
3825 François Pinard reported that `du symlink-to-dir/' was not
3826 equivalent to `du symlink-to-dir/.'. Now it is.
3827 * tests/du/trailing-slash: New file/test, for the above fix.
3828 * tests/du/Makefile.am (TESTS): Add trailing-slash.
3830 2002-11-23 Jim Meyering <jim@meyering.net>
3832 * src/tac.c (output): Declare some local variables to be of type size_t,
3833 rather than `int' to avoid warnings from gcc.
3835 2002-11-21 Paul Eggert <eggert@twinsun.com>
3837 * src/ls.c (decode_switches): Use case-sensitive matching to
3838 decode the QUOTING_STYLE environment variable. This is more
3839 consistent with the documentation, and with --quoting-style.
3841 2002-11-21 Martin Buck <martin.buck@ascom.ch
3843 * src/stty.c (struct speeds): Add support for all baud rates defined
3846 2002-11-19 Jim Meyering <jim@meyering.net>
3848 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
3849 run in a UTF locale. Report and suggested fix by Bruno Haible.
3850 * tests/fmt/basic: Likewise.
3852 2002-11-17 Jim Meyering <jim@meyering.net>
3854 * configure.ac: Update via autoupdate.
3855 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
3857 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
3858 Reported by Hans Ginzel.
3860 2002-11-15 Jim Meyering <jim@meyering.net>
3862 * Makefile.cfg (gnu_rel_host): Define.
3863 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
3864 on whether $(VERSION) looks like a major release number.
3866 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
3867 (release): Rename from `alpha'.
3868 (alpha): Depend on release.
3870 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
3872 2002-11-14 Jim Meyering <jim@meyering.net>
3874 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
3875 (announcement): Use the new variable.
3877 * Makefile.maint: Sync with Bison, i.e.:
3878 (po-check): Scan .l and .y files instead of the
3879 .c and the .h files that they generate. This fixes the bug
3880 reported by Tim Van Holder in:
3881 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
3882 Look for N_ as well as for _. Try to avoid matching #define for
3886 2002-11-12 Jim Meyering <jim@meyering.net>
3888 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
3889 Replace sole use with equivalent `#ifdef S_ISLNK'.
3890 Inconsistency reported by Dmitry V. Levin.
3892 2002-11-11 Jim Meyering <jim@meyering.net>
3894 * src/stat.c (usage): Transform --help items output via s/ - / /,
3895 so that help2man produces properly formatted man pages.
3896 Reported by Herbert Xu as Debian bug #168400.
3898 2002-11-10 Jim Meyering <jim@meyering.net>
3900 * src/ls.c (sighandler): Handle SIGTSTP specially.
3901 Based on suggestions from Solar Designer and Dmitry V. Levin.
3904 * Makefile.cfg (cvs_files): Define. From autoconf.
3905 (local_updates): Likewise.
3907 * src/ls.c (restore_default_color_handler, sigtstp_handler):
3909 (sighandler): New function, based on the one in sort.c.
3910 (main): Use sigaction, if possible; otherwise signal.
3911 Handle these signals:
3912 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
3913 Don't register our handler if the signal is already being ignored.
3915 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
3916 * src/csplit.c (interrupt_handler): Likewise.
3917 * src/sort.c (sighandler): Likewise.
3918 (main): Declare `i' and `nsigs' to be unsigned, not int.
3920 2002-11-09 Jim Meyering <jim@meyering.net>
3922 ls --color: restore terminal text color upon signal.
3923 * src/ls.c: Include "full-write.h" and <signal.h>.
3924 (restore_default_color, restore_default_color_handler): New functions.
3925 (sigtstp_handler, put_indicator_direct): New functions.
3926 (main) [print_with_color]: Register signal handlers.
3927 Patch mostly by Solar Designer and Stanislav Ievlev.
3929 Update from autoconf.
3930 * Makefile.maint (AMTAR): Remove definition.
3931 (update, cvs-update, po-update, do-po-update): New rules.
3932 (wget-update): Update (thus renaming to cvs-update).
3933 (automake_repo): Use anoncvs@sources.redhat.com.
3935 2002-11-06 Jim Meyering <jim@meyering.net>
3937 * tests/misc/Makefile.am (TESTS): Add printf-hex.
3939 * tests/misc/printf: Be careful to test the code in this package,
3940 not the shell built-in function.
3942 * src/printf.c (print_esc): A hexadecimal escape sequence has
3943 at most two hex. digits, not three. Reported by Padraig Brady.
3944 (usage): Update description.
3945 * tests/misc/printf-hex: New file/test, for the above fix.
3947 2002-10-07 Paul Eggert <eggert@twinsun.com>
3949 Add support for locale-specific size indications (e.g.,
3950 thousands-separators) and for explicit size suffixes on output.
3952 * doc/coreutils.texi (Block size): Say that:
3953 This affects display format as well as block size.
3954 Fractional block counts are rounded up.
3955 ls file size blocksize defaults to 1.
3956 A block size spec preceded by ' generates thousands separators.
3957 A suffix without a preceding integer generates suffixes.
3958 (tail invocation): 32k -> 32 KiB.
3959 (What information is listed): ls -h is now equivalent to
3960 ls --block-size=human, and ls -H is now equivalent to
3961 ls --block-size=si. Displayed file size is now always affected by
3964 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
3965 lib/umaxtostr.c: New files, taken from GNU tar.
3967 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
3969 (EXTRA_DIST): Add inttostr.c.
3971 * lib/human.c, lib/human.h: Rewrite to support locale-specific
3972 notations like thousands separators.
3973 Specify what includer of include.h must include beforehand.
3974 (human_group_digits, human_suppress_point_zero, human_autoscale,
3975 human_base_1024, human_SI, human_B): New enum values.
3976 (human_readable): Rename from human_readable_inexact; put the
3977 options before the sizes. All uses changed. The old human_readable
3978 function has been removed; use inttostr.h instead.
3979 (human_options): Renamed from human_block_size, with new signature
3980 that allows block sizes up to UINTMAX_MAX. All callers changed.
3982 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
3983 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
3984 freestanding C89. No need to check for stdlib.h or string.h since
3985 autoconf does this now.
3987 * src/cksum.c (cksum): Use primitives from inttostr.h, not
3988 human.h, to print large numbers simply.
3989 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
3990 * src/dd.c (print_stats, main): Likewise.
3991 * src/df.c (print_header): Likewise.
3992 * src/factor.c (print_factors): Likewise.
3993 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
3994 * src/shred.c (dopass): Likewise.
3995 * src/sort.c (checkfp): Likewise.
3996 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
3997 * src/tail.c (xlseek): Likewise.
3998 * src/wc.c (write_counts, wc): Likewise.
4000 * src/df.c (human_output_opts): New var.
4001 (output_block_size): Now uintmax_t, not int, to handle larger
4002 block sizes. All uses changed.
4003 * src/du.c: Likewise.
4004 * src/ls.c: Likewise.
4006 * src/df.c (print_header): In the header line, prefer SI to human
4007 representation if it's shorter; if neither is shorter, try to
4008 intuit what the user would prefer.
4010 * src/expr.c (inttostr): Remove; use new imaxtostr library
4013 * src/ls.c (file_output_block_size): New var, to distinguish
4014 file sizes from other sizes.
4015 (decode_switches): Set it.
4017 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
4018 (dopass): When printing progress, use floor for what has been done
4019 so far (since we should be conservative there), and ceiling for
4020 what needs to be done (since that's what other programs use).
4022 2002-10-19 Jim Meyering <jim@meyering.net>
4024 * src/pinky.c (print_heading): Align TTY and Name headings.
4025 Reported by Karl Eichwalder.
4027 2002-10-18 Jim Meyering <jim@meyering.net>
4029 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
4030 Remove now-useless cast.
4031 (stdread): Remove function.
4032 (bytes_split): Use size_t instead of int.
4033 Use safe_read, not stdread.
4034 (lines_split): Likewise.
4035 Use memchr rather than a `while' loop.
4036 (line_bytes_split): Use size_t instead of int.
4037 Use safe_read, not stdread.
4038 (main): Add some FIXME comments to remind me to remove casts.
4040 * src/system.h (ST_BLKSIZE): Correct comment describing how to
4041 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
4043 2002-10-17 Jim Meyering <jim@meyering.net>
4045 Fix a problem that could make e.g., `cat' misbehave on systems which
4046 give invalid (unreasonably large) values for stat.st_blksize.
4047 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
4048 Reported by Petter Reinholdtsen.
4050 2002-10-14 Jim Meyering <jim@meyering.net>
4052 Specifying a printf conversion specifer as nl's separator string
4053 could cause nl to segfault.
4054 * src/nl.c (build_print_fmt): Don't include separator string
4055 in the printf format; it might contain `%'.
4056 Use a better bound on the length of the print_fmt buffer.
4057 (print_lineno): Print the separator here instead.
4058 Reported by Doug Coleman.
4060 * tests/misc/nl: New file/tests, including a test for the above.
4061 * tests/misc/Makefile.am (TESTS): Add nl.
4063 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
4064 * tests/misc/Makefile.am (TESTS): Add split-l.
4066 2002-10-13 Jim Meyering <jim@meyering.net>
4070 * src/du.c (usage): Tweak description of --dereference-args/-D.
4072 * src/du.c (count_entry): Also save cwd when dereferencing (via
4073 --dereference-args, -D) a command-line argument.
4074 Reported by Michal Svec. Based on a patch by Andreas Schwab.
4076 * src/Makefile.am (../AUTHORS): New target/rule.
4078 2002-10-12 Jim Meyering <jim@meyering.net>
4080 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
4081 of type size_t, since that's the way it's used and avoids a warning.
4083 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
4084 since that's how it's always used and avoids a new warning from gcc.
4085 (read_input): Adapt to new safe_read ABI.
4087 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
4090 * src/pinky.c (print_long_entry): fread returns size_t.
4091 Declare local `bytes' accordingly, to avoid warning.
4093 tail -c +N would perform an extra read after encountering EOF
4094 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
4095 * src/tail.c (start_bytes): Detect EOF, inform caller.
4096 (tail_bytes): Upon EOF in start_bytes, return immediately.
4097 (file_lines): Reorganize to use memrchr rather than an explicit loop.
4098 Adapt to new safe_read ABI.
4100 2002-10-11 Jim Meyering <jim@meyering.net>
4102 * tests/du/deref: New file/test, for the above fix.
4103 * tests/du/Makefile.am (TESTS): Add deref.
4105 2002-10-10 Jim Meyering <jim@meyering.net>
4107 * tests/ln/Makefile.am (TESTS): Add target-1.
4108 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
4110 2002-10-09 Jim Meyering <jim@meyering.net>
4112 * tests/cp/backup-is-src: Ensure that certain environment variables
4113 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
4115 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
4116 consume 4GB of disk space on systems without support for sparse files.
4117 Fix a logic error that'd make it `cat err' even though dd didn't fail.
4119 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
4120 Patch by steven@magelico.net, forwarded by Michael Stone.
4122 * tests/ls/dired: Ensure that ls produces English messages.
4123 Patch by Alexey Vyskubov, forwarded by Michael Stone.
4125 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
4127 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
4129 2002-10-08 Jim Meyering <jim@meyering.net>
4131 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
4132 Fix syntax in test: use =, not ==.
4133 Reported by Bob Proulx.
4134 Change all the rest like this: grep -lR "testing framework'" .\
4135 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
4137 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
4138 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
4139 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
4140 * src/wc.c (wc): Likewise.
4142 2002-10-07 Paul Eggert <eggert@twinsun.com>
4145 Don't advance the write pointer past the end of the write buffer.
4146 * src/sort.c (begfield, limfield): Likewise.
4148 2002-10-07 Jim Meyering <jim@meyering.net>
4150 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
4151 * src/head.c (head_bytes, head_lines): Likewise.
4153 2002-10-06 Jim Meyering <jim@meyering.net>
4155 * src/dd.c (scanargs): Ensure that specified block sizes (specified
4156 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
4157 (skip, dd_copy): Adapt to new safe_read ABI.
4159 * Makefile.maint (signatures): Define.
4161 (announcement): Depend on $(signatures).
4163 * Makefile.maint (announcement): Output all URLs for detached
4164 signatures, not just the last one from the previous loop.
4166 2002-10-05 Jim Meyering <jim@meyering.net>
4170 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
4171 don't recurse into directory, DIR. Prompted by a report from
4174 * tests/rm/i-no-r: New file/test, for the above fix.
4175 * tests/rm/Makefile.am (TESTS): Add i-no-r.
4177 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
4178 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
4180 2002-10-03 Jim Meyering <jim@meyering.net>
4182 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
4183 * src/df.c (AUTHORS): Likewise.
4184 * src/du.c (AUTHORS): Likewise.
4185 * src/tail.c (AUTHORS): Likewise.
4186 * src/touch.c (AUTHORS): Likewise.
4188 2002-10-02 Jim Meyering <jim@meyering.net>
4190 * Makefile.am (SUBDIRS): Remove `old'.
4191 (EXTRA_DIST): List the files in old/.
4192 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
4193 Suggestion from Akim Demaille.
4195 2002-10-01 Jim Meyering <jim@meyering.net>
4197 * src/sys2.h (SSIZE_MAX): Define.
4199 2002-09-30 Jim Meyering <jim@meyering.net>
4201 * src/csplit.c: Don't include stdlib.h here. It's already included
4204 2002-09-29 Jim Meyering <jim@meyering.net>
4206 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
4207 expression to avoid bogus warning from gcc.
4209 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
4210 (cat): Declare insize and outsize to be of type size_t, not int.
4211 Rearrange pointer/integer expressions to avoid bogus warnings.
4212 (main): Declare insize and outsize to be of type size_t, not int.
4214 * src/tail.c (parse_options): Give a sensible diagnostic for
4215 an invalid byte or line count. Reported by Mikko Tuumanen.
4217 * src/touch.c (main): Split a long line.
4219 * tests/du/Makefile.am (TESTS): Add slink.
4220 * tests/du/slink: New test for system.h change of 2002-08-31.
4222 In move mode, always first try to rename. Before, upon failure to
4223 rename a directory, this code would never attempt to rename any
4224 other file in that directory, but would thenceforth always copy.
4225 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
4226 may fail with EXDEV, yet renaming files within that directory to
4227 a newly-created destination directory succeeds.
4228 * src/copy.c (copy_internal): Remove local, move_mode;
4229 use x->move_mode instead. Based on a patch from Tom Haynes.
4231 2002-09-28 Jim Meyering <jim@meyering.net>
4233 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
4234 Factor out some duplication.
4236 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
4238 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
4240 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
4241 to avoid compiler warnings.
4243 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
4246 Fix things so `mkdir -p' can create very deep directories, e.g.,
4247 mkdir -p $(perl -e 'print "a/" x 40000') now works.
4248 * src/mkdir.c (main): For --parents (-p), call make_path with the
4249 entire directory name, so we don't ever require that file operations
4250 like stat or chmod be performed on the entire command line argument.
4251 * makepath.c (make_path): Restore umask *before* creating the final
4254 2002-09-27 Andreas Schwab <schwab@suse.de>
4256 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
4257 to avoid overflow. Reported by Hans Lermen.
4259 2002-09-26 Jim Meyering <jim@meyering.net>
4261 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
4263 2002-09-25 Jim Meyering <jim@meyering.net>
4265 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
4266 and add a cast, to avoid a warning about `signed and unsigned type in
4267 conditional expression'.
4269 2002-09-22 Jim Meyering <jim@meyering.net>
4271 * src/rmdir.c: Include "dirname.h", for declaration of
4272 strip_trailing_slashes.
4274 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
4275 Now they're defined through system.h.
4277 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
4278 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
4279 since it's already included from sys2.h via system.h.
4281 * Use automake-1.6f. Regenerate dependent files.
4283 * src/Makefile.am (PERL): Remove duplicate definition.
4285 fmt's -s, -t, -c options didn't work properly for long lines.
4286 Since get_line may end up calling put_paragraph (for long lines),
4287 be sure to set global, `other_indent', before it is used there.
4289 * src/fmt.c (set_other_indent): New function, factored out of...
4290 (get_paragraph): ... here. Call it.
4291 (get_line): Call set_other_indent before calling flush_paragraph,
4292 which calls fmt_paragraph, which in turn calls put_paragraph,
4293 which uses other_indent.
4295 * tests/fmt/Makefile.am (TESTS): Add long-line.
4296 * tests/fmt/long-line: New file/test, for the above fix.
4298 2002-09-21 Jim Meyering <jim@meyering.net>
4300 * src/od.c: No longer include deprecated <values.h>.
4301 It was required solely for now-removed reference to BITSPERBYTE.
4302 * src/install.c: Likewise.
4303 Suggestion from Bruno Haible.
4305 2002-09-06 Andreas Schwab <schwab@suse.de>
4307 `rmdir -p dir-specified-with-trailing-slash/' would fail.
4308 * src/rmdir.c (remove_parents): Strip trailing slashes.
4310 2002-09-20 Jim Meyering <jim@meyering.net>
4312 * tests/rmdir/t-slash: New file/test, for the above fix.
4313 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
4315 * Makefile.maint (announcement): Arrange to gpg-sign the message.
4316 Add a URL for each detached signature file.
4318 2002-09-07 Bruno Haible <bruno@clisp.org>
4320 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
4322 2002-09-18 Jim Meyering <jim@meyering.net>
4324 `od -t x8' used the wrong (`l'-prefixed) printf format.
4325 Likewise for the o8 and u8 formats.
4326 * src/od.c (ISPEC_TO_FORMAT): Define macro.
4327 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
4328 Reported by Arun Sharma.
4330 2002-09-17 Jim Meyering <jim@meyering.net>
4332 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
4333 From gettext's intl/loadmsgcat.c.
4335 * tests/od/x8: New file/test, for the above fix.
4336 * tests/od/Makefile.am (TESTS): Add x8.
4338 2002-09-15 Jim Meyering <jim@meyering.net>
4340 * Use autoconf-2.54. Regenerate dependent files.
4342 * src/csplit.c (get_format_width): Add cast to avoid
4343 warning about `signed and unsigned type in conditional expression'.
4345 2002-09-14 Jim Meyering <jim@meyering.net>
4347 * src/who.c (print_user): Change type of local to size_t
4348 to avoid warnings about `comparison between signed and unsigned'.
4349 * src/ptx.c (generate_all_output): Likewise.
4351 * src/dd.c (main, skip): Add casts to avoid warnings about
4352 `comparison between signed and unsigned'.
4354 * src/id.c (print_full_info, print_group_list): Add casts to avoid
4355 warnings about `signed and unsigned type in conditional expression'.
4357 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
4358 to avoid warnings about `comparison between signed and unsigned'.
4359 (split_3): Change parameter names to be readable and add comment.
4360 Clean up the test for whether a line may be ignored.
4362 2002-09-13 Jim Meyering <jim@meyering.net>
4364 * src/printf.c (main): Handle leading command line argument of `--'.
4365 Reported by Raul: DervishD <raul@pleyades.net>
4366 * tests/misc/printf: New file: test for the above.
4367 * tests/misc/Makefile.am (TESTS): Add printf.
4369 * src/date.c (usage): Explain that %S's range of [0..60] is required --
4370 rather than 0..59 -- to accommodate the occasional positive leap second.
4371 Reported by Richard Neill.
4373 2002-09-12 Jim Meyering <jim@meyering.net>
4375 * src/Makefile.am (nanosec_libs): Define.
4376 (sleep_LDADD, tail_LDADD): Use it here.
4378 Factor nanosleep-related code into ../lib/xnanosleep.c.
4379 * src/sleep.c: Include xnanosleep.h.
4380 Factor out fenv.h-related code.
4381 (timespec_subtract): Remove function.
4382 (main): Remove code that deals with computing start and stop times
4383 as well as the loop around nanosleep. Now that's in xnanosleep.c.
4385 Allow S (in --sleep-interval=S) to be a floating point value.
4386 * src/tail.c: Include xnanosleep.h and xstrtod.h.
4387 Move declaration of global variable, sleep_interval, to ...
4389 (usage): Update description of --sleep-interval option.
4390 (tail_forever): New parameter, sleep_interval. Update caller.
4391 Use xnanosleep, rather than sleep.
4392 (parse_options): New parameter, sleep_interval. Update caller.
4393 Use xstrtod, now that we accept floating point values.
4394 Prompted by a patch from Augey Mikus.
4396 2002-09-06 Jim Meyering <jim@meyering.net>
4398 * src/remove.c (prompt): Change comment to give a better note to
4399 translators. From Michael Piefel.
4401 2002-09-02 Jim Meyering <jim@meyering.net>
4403 * README: A good problem report/patch includes diffs against
4404 the most recent test release.
4406 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
4407 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
4409 * src/kill.c (print_table_row): Use an unsigned type for widths
4410 to avoid warning about comparison between signed and unsigned.
4411 (list_signals): Likewise.
4413 * src/od.c (skip): Add a cast to avoid warning about comparison
4414 between signed and unsigned.
4415 * src/install.c (get_ids): Likewise. Also rearrange range-checking
4416 comparisons to make them more readable.
4418 2002-09-01 Jim Meyering <jim@meyering.net>
4422 2002-08-31 Jim Meyering <jim@meyering.net>
4424 Symlinks were always reported as using 0 blocks.
4425 * src/system.h (ST_NBLOCKS): Don't depend on file type.
4426 This reverts the change of 2000-01-30.
4427 Based on a report and patch from Neil Brown via Michael Stone.
4428 This fixes Debian Bug#156358.
4430 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
4431 `exit (1)' to `exit (EXIT_FAILURE)', and
4432 `usage (1)' to `usage (EXIT_FAILURE)'.
4434 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
4435 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
4436 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
4437 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
4438 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
4439 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
4440 error never exits successfully.
4442 2002-08-29 Jim Meyering <jim@meyering.net>
4444 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
4445 when ignoring any return value.
4447 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
4448 failures. On some systems (at least EMC Celerra and Solaris5.8),
4449 this appears to be necessary.
4450 (is_empty_dir): Likewise. Also, always close directory handle.
4451 * src/ls.c (print_dir): Likewise.
4452 (print_dir): Rename local variable: reading -> dirp.
4453 Reported by Mike Coleman.
4455 2002-08-28 Jim Meyering <jim@meyering.net>
4457 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
4458 Give a diagnostic and fail if closedir fails.
4460 2002-08-26 Jim Meyering <jim@meyering.net>
4462 * Makefile.am (THANKS-to-translators): New rule.
4463 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
4464 * THANKStt.in: New file.
4466 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
4468 (main): Register it with atexit.
4469 Close STDOUT_FILENO, to avoid a problem when writing to
4470 /dev/audio on at least Solaris 5.7 and 5.8 systems.
4471 Reported by Shing-Shong Shei.
4473 2002-08-25 Jim Meyering <jim@meyering.net>
4475 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
4476 * src/tac.c (main): Likewise.
4477 * src/tail.c (main): Likewise.
4478 * src/tee.c (main): Likewise.
4479 * src/tr.c (main): Likewise.
4480 * src/wc.c (main): Likewise.
4482 2002-08-20 Jim Meyering <jim@meyering.net>
4484 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
4486 2002-08-10 Paul Eggert <eggert@twinsun.com>
4488 * src/nohup.sh: Don't use "exec --"; it's not portable and
4489 shouldn't be needed.
4491 2002-08-09 Jim Meyering <jim@meyering.net>
4493 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
4494 (usage): Clarify help text for the -COLUMN option.
4495 Patch by Padraig Brady.
4496 * tests/pr/Test.pm [col-last]: New test for the above.
4498 * configure.ac: Start with version 4.5.1, chosen so that it's larger
4499 than the latest version numbers of the component packages.
4501 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
4504 2002-08-08 Jim Meyering <jim@meyering.net>
4506 * src/date.c: Guard inclusion of <langinfo.h> with
4507 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
4508 * src/sort.c: Likewise.
4509 Patch by GOTO Masanori.
4511 2002-08-05 Paul Eggert <eggert@twinsun.com>
4513 Fix some minor time-related bugs with POSIX time arguments.
4514 Some valid time stamps were being rejected (notably -1, and
4515 time stamps before 1900 on 64-bit hosts). And some invalid
4516 time stamps were being accepted, e.g. September 31.
4518 * src/date.c (main): Adjust to posixtime signature change.
4519 * src/touch.c (main): Likewise. Remove unnecessary initialization.
4520 Use localtime, not posixtm, to warn about obsolete "touch".
4522 2002-08-05 Jim Meyering <jim@meyering.net>
4524 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
4526 2002-08-04 Jim Meyering <jim@meyering.net>
4528 * src/Makefile.am (check-README): New target/rule.
4529 (check): Depend on it.
4531 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
4533 2002-08-03 Jim Meyering <jim@meyering.net>
4535 * Makefile.am (SUBDIRS): Add old.
4536 * old/: New directory, containing legacy ChangeLog* and NEWS files
4537 from the fileutils, sh-utils, and textutils packages.
4539 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
4541 2002-08-02 Paul Eggert <eggert@twinsun.com>
4543 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
4545 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
4546 (hard_LC_COLLATE): New var.
4547 (different): Args are now char *, not const char *.
4548 Use xmemcoll instead of memcmp to compare lines, so that
4549 LC_COLLATE has effect. However, use memcmp if it is an
4551 (check_file): Do not include newline in comparison, so that
4552 xmemcoll has a byte to stomp on temporarily.
4553 (main): Set hard_LC_COLLATE.
4555 2002-07-29 Jim Meyering <jim@meyering.net>
4557 * Makefile.am (SUBDIRS): Remove djgpp, for now.
4559 2002-07-20 Jim Meyering <jim@meyering.net>
4561 * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
4562 into EXIT_FAILURE. Otherwise, false --help and false --version
4565 2002-07-08 Jim Meyering <jim@meyering.net>
4567 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
4568 rather than the hard-coded `sh-utils'.
4570 2002-07-01 Jim Meyering <jim@meyering.net>
4572 * configure.ac: Merge the three files from fileutils,
4573 textutils, and sh-utils.
4574 * Makefile.am: Likewise.
4575 * src/Makefile.am: Likewise.