1 2004-01-25 Jim Meyering <jim@meyering.net>
5 * Makefile.maint (signatures): Comment out definition.
7 2004-01-23 Jim Meyering <jim@meyering.net>
9 * Makefile.maint (header_regexp): Add exitfail.
11 * man/Makefile.am (EXTRA_DIST): Add help2man.
12 Reported by Nelson H. F. Beebe.
14 * man/Makefile.am (.x.1): Prefix help2man invocation with `$(PERL) --'
15 so it works on systems with Perl installed somewhere other than in
18 * src/paste.c (paste_parallel): Declare local, chr, to be of type
19 `int', not `char', since it must hold EOF. This bug would make
20 paste infloop on some systems. Test failures reported by
21 Nelson H. F. Beebe and Christian Krackowizer.
23 2004-01-22 Jim Meyering <jim@meyering.net>
25 * tests/rmdir/fail-perm: New file. Test for just-fixed rmdir bug.
26 * tests/rmdir/Makefile.am (TESTS): Add fail-perm.
28 * man/help2man: Fix it so using --info-page='coreutils PROG' works.
29 * man/Makefile.am (.x.1): Invoke our own (tweaked) copy of help2man.
30 Use --info-page='coreutils PROG' option.
31 Now, readlink.1 refers the user to `info coreutils readlink'
32 rather than to `info readlink'. Reported by Matt Swift.
34 2004-01-21 Paul Eggert <eggert@twinsun.com>
38 * src/basename.c (usage): Use EXIT_SUCCESS, not 0, for clarity.
39 * src/cat.c, src/chgrp.c, src/chmod.c, src/chown.c, src/chroot.c,
40 * src/cksum.c, src/comm.c, src/cp.c, src/csplit.c, src/cut.c,
41 * src/date.c, src/dd.c, src/df.c, src/dircolors.c, src/dirname.c,
42 * src/du.c, src/echo.c, src/env.c, src/expand.c, src/expr.c,
43 * src/factor.c, src/fmt.c, src/fold.c, src/head.c, src/hostid.c,
44 * src/hostname.c, src/id.c, src/install.c, src/join.c, src/kill.c,
45 * src/link.c, src/ln.c, src/logname.c, src/ls.c, src/md5sum.c,
46 * src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c,
47 * src/nl.c, src/nohup.c, src/od.c, src/paste.c, src/pathchk.c,
48 * src/pinky.c, src/pr.c, src/printenv.c, src/printf.c, src/pwd.c,
49 * src/rm.c, src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c,
50 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c,
51 * src/su.c, src/sum.c, src/sync.c, src/tac.c, src/tail.c, src/tee.c,
52 * src/test.c, src/touch.c, src/tr.c, src/tsort.c, src/tty.c,
53 * src/uname.c, src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c,
54 * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c: Likewise.
56 * src/cat.c (usage): Don't bother normalizing exit status
57 since the arg is already the correct exit status now.
58 * src/cksum.c, src/comm.c, src/csplit.c, src/cut.c,
59 * src/dircolors.c, src/expand.c, src/fmt.c, src/fold.c, src/head.c,
60 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c,
61 * src/pr.c, src/split.c, src/sum.c, src/tac.c, src/tail.c, src/tr.c,
62 * src/tsort.c, unexpand.c, src/src/uniq.c, src/src/wc.c: Likewise.
64 * src/chown.c (main): Removed unused local 'fail'.
66 * src/chroot.c (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE):
69 * src/chroot.c (main): Initialize exit_failure to EXIT_FAIL.
70 * src/env.c, src/nice.c, src/su.c: Likewise.
71 * src/nohup.c (main): Likewise, to NOHUP_FAILURE.
72 * src/setuidgid.c (main): Likewise, to SETUIDGID_FAILURE.
73 * src/expr.c (main): Use initialize_exit_failure rather than
74 setting exit_failure directly; this optimizes away redundant
76 * src/printenv.c, src/sort.c, src/test.c, src/tty.c: Likewise.
78 * src/chroot.c (main): Exit with status 1 rather than 127
79 if chroot itself fails, as per documentation.
81 * src/chroot.c (main): Use EXIT_ENOENT and EXIT_CANNOT_INVOKE
82 rather than roll-your-own symbols or integers.
83 * src/env.c (main): Likewise.
84 * src/nohup.c (main): Likewise.
85 * src/su.c (run_shell): Likewise.
87 * src/cp.c (exit_status): Remove static var....
88 (main): Making it local here instead. Use =, not |=, to set it.
90 * src/cut.c (FATAL_ERROR, main): Exit with status EXIT_FAILURE,
92 * src/date.c (batch_convert, main): Likewise.
93 * src/dd.c (dd_copy): Likewise.
94 * src/pr.c (first_last_page, main, getoptarg): Likewise.
95 * src/tr.c (main): Likewise.
96 * src/date.c (main): Don't assume EXIT_FAILURE == 1, as
97 POSIX doesn't require it.
98 * src/dd.c (write_output, skip, dd_copy): Likewise.
99 * src/df.c (main): Likewise.
100 * src/id.c (main): Likewise.
101 * src/install.c (main): Likewise.
102 * src/ln.c (main): Likewise.
103 * src/ls.c (main): Likewise.
104 * src/mv.c (main): Likewise.
105 * src/shred.c (main): Likewise.
107 * src/env.c (main): Exit with status 1, not 2, on errors detected
109 * src/hostname.c (main): Likewise.
110 * src/nl.c (main): Likewise.
111 * src/stty.c (main): Likewise.
113 * src/expr.c (EXPR_FAILURE): Renamed from EXPR_ERROR, for
114 consistency with the other programs' naming conventions.
117 * src/factor.c (main): Do not report a usage error simply
118 because stdin has bad numbers.
120 * src/id.c (problems): Now a boolean int, not a counter,
121 so that we don't have to worry about int overflow. All uses changed.
122 * src/touch.c (err): Likewise.
124 * src/md5sum.c (main): Use int, not size_t, to store boolean int.
126 * src/mkfifo.c (main): Exit with status 1, not 4, if not implemented.
127 * src/mknod.c: Likewise.
129 * src/nice.c (main): Exit with status EXIT_FAIL, not EXIT_FAILURE,
130 on error; this is in case EXIT_FAILURE is unusual.
131 * src/su.c (main): Likewise.
133 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE): Remove; all uses
134 changed to EXIT_CANNOT_INVOKE.
136 * src/printenv.c (PRINTENV_FAILURE): New constant.
137 (main): Exit with status PRINTENV_FAILURE, not EXIT_FAILURE, on
138 command-line syntax problems.
140 * src/rmdir.c (remove_parents): Don't set 'fail' to a negative number.
141 (main): Avoid integer overflow when seeing whether errors occurred.
143 * src/seq.c (print_numbers): Now returns void, not (zero) int.
145 (main): Remove unused local variable 'errs'. Always exit successfully
148 * src/setuidgid.c (SETUIDGID_FAILURE): Renamed from FAIL_STATUS,
149 for consistency with other programs here. All uses changed.
150 (main): Use 'error' to exit rather than invoking 'exit' here.
152 * src/sort.c: Don't include <assert.h>.
153 (SORT_OUT_OF_ORDER, SORT_FAILURE): Now enums, not macros.
154 (usage): Don't use 'assert'.
155 (main): Remove redundant assignment to exit_failure.
157 * src/system.h (EXIT_FAIL, EXIT_CANNOT_INVOKE, EXIT_ENOENT):
159 (initialize_exit_failure): New inline function.
160 Include exitfail.h here, since we refer to exit_failure.
161 All callers changed to not include exitfail.h.
163 * src/tty.c (TTY_FAILURE, TTY_WRITE_ERROR): New enum values;
164 substitute them for the corresponding integer constants.
166 * tests/help-version (expected_failure_status_date): Remove, as
167 'date' is now normal.
168 (expected_failure_status_nohup): New var.
170 2004-01-21 Jim Meyering <jim@meyering.net>
172 * tests/touch/relative: Remove `command' syntax.
173 Thanks to Nelson H. F. Beebe and Paul Eggert.
175 * tests/touch/relative: Test only year/month/day, not hours/min/sec,
176 so as to avoid problems with systems using TAI clocks.
177 Although it's no longer necessary, set TZ=UTC0 also for the
178 initial touch command. Reported by Paul Jarc here:
179 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/1504
181 2004-01-20 Diego Biurrun <diego@biurrun.de>
183 * src/dircolors.hin: Add .mov to the list of media files.
185 2004-01-19 Paul Eggert <eggert@twinsun.com>
187 * tests/touch/relative: Use TZ=UTC0, not TZ=utc (which isn't
188 portable). Problem reported by Christian Krackowizer. Also, use
189 +0000 rather than +0 to specify a time zone, as the documentation
190 requires four digits.
192 2004-01-19 Jim Meyering <jim@meyering.net>
194 * tests/mv/hard-4: Run envvar-check in case SIMPLE_BACKUP_SUFFIX is set.
195 * tests/mv/backup-is-src: Likewise.
196 Problem reported by Peter Horst
198 2004-01-17 Jim Meyering <jim@meyering.net>
200 * announce-gen (print_changelog_deltas): Use .sig suffix, not .asc.
204 2003-12-15 Paul Eggert <eggert@twinsun.com>
206 * NEWS, doc/coreutils.texi: touch -r and -d can now both be specified,
207 with -r specifying the origin for -d.
208 * src/touch.c (flexible_date): Remove static var.
209 (get_reldate): New function.
210 (main): Use it, to implement this new behavior.
212 2004-01-16 Jim Meyering <jim@meyering.net>
214 * tests/touch/relative: New test for the above.
215 * tests/touch/Makefile.am (TESTS): Add relative.
217 2004-01-13 Jim Meyering <jim@meyering.net>
219 * src/system.h: Include contents of sys2.h.
220 * src/sys2.h: Remove file.
221 * src/Makefile.am (noinst_HEADERS): Remove sys2.h.
223 * Use automake-1.8.2. Regenerate dependent files.
225 * Update to gettext-0.13.1.
226 * configure.ac: Use gettext-0.13.1.
227 * .x-sc_space_tab: Add m4/po.m4 to the list of exceptions.
229 2004-01-12 Jim Meyering <jim@meyering.net>
231 * Makefile.maint (%.sig): Use .sig suffix rather than .asc.
233 * Makefile.maint (po-check): Ensure that cvsu works before using it.
234 Reported by Alexandre Duret-Lutz.
236 * src/tail.c (main): Warn about following stdin only when it's a tty.
238 * configure.ac: Use gl_DEFAULT_POSIX2_VERSION.
240 2004-01-10 Jim Meyering <jim@meyering.net>
242 * tests/misc/stat-fmt: Use backticks, not `$()' notation.
244 2004-01-09 Jim Meyering <jim@meyering.net>
246 * configure.ac: Quote underquoted `jm_DUMMY_1' to avoid new warning.
248 2004-01-08 Jim Meyering <jim@meyering.net>
250 * src/stat.c (human_fstype): Use %lx, not %x format for `unsigned long'.
253 * tests/Makefile.am (TESTS_ENVIRONMENT): Remove `/vg' (prerelease test
254 remnant) from PATH component. That would cause tests in this directory
255 not to run the just-built binaries, but rather whatever happened
256 to be in one's PATH. Reported by Christian Krackowizer.
258 2004-01-04 Jim Meyering <jim@meyering.net>
260 * src/csplit.c (new_control_record): Use x2nrealloc
261 rather than xrealloc.
263 * src/cp.c (re_protect): Use ASSIGN_STRDUPA rather than
265 (make_path_private): Likewise.
267 2004-01-03 Jim Meyering <jim@meyering.net>
269 * src/paste.c: Use `bool' (not int) as the type for a few
271 (collapse_escapes): Rewrite to set globals rather than modifying
273 Use size_t (not int) for all counters and related index variables.
274 (paste_parallel): Remove needless complexity of
275 using xrealloc in the loop; just allocate the buffers up front.
276 Free the two temporary buffers.
277 Move declarations of locals `down' into scope where used.
278 (paste_serial): Remove `register' attributes.
279 (main): Simplify delim-related code.
280 Free `delims', now that it's malloc'd.
282 2004-01-02 Jim Meyering <jim@meyering.net>
284 * src/chroot.c: Include "quote.h".
285 (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): Define.
286 (main): Exit with status of 127, not 1, for too-few-args,
287 chroot failure, or chdir failure.
288 Give a better diagnostic upon execvp failure.
290 * src/du.c (usage): Mention that, with its current meaning,
293 * src/tail.c (main): Warn about following stdin when it's a tty.
294 Fail when following by name but no names are specified.
296 2003-12-30 Jim Meyering <jim@meyering.net>
298 * src/fold.c (main): Use memcpy, not strcpy.
300 * src/copy.c (copy_internal): Use ASSIGN_STRDUPA rather than
303 2003-12-28 Jim Meyering <jim@meyering.net>
305 * src/unexpand.c (n_tabs_allocated): New global.
306 (add_tabstop): Use x2nrealloc rather than xrealloc.
307 * src/expand.c: Likewise.
309 * tests/misc/expand: New file.
310 * tests/misc/Makefile.am (TESTS): Add expand.
312 * src/sort.c (add_temp_dir): Use x2nrealloc rather than xrealloc.
313 (fillbuf): Use x2nrealloc rather than xrealloc.
314 (sort): Use xnmalloc rather than xmalloc.
317 2003-12-27 Jim Meyering <jim@meyering.net>
319 * src/tee.c (tee): Use xnmalloc rather than xmalloc.
321 2003-12-29 Paul Eggert <eggert@twinsun.com>
323 * NEWS: Remove support for join -j1 FIELD, -j2 FIELD, and -o LIST1
324 LIST2 in POSIX 1003.1-2001 hosts, as required by POSIX.
326 * doc/coreutils.texi (join invocation): Remove documentation
327 accordingly. Document that -t makes all separators significant.
329 * src/join.c: Include posixver.h.
330 (obsolete_usage): New var.
331 (longopts): Put obsolete options first.
332 (OBSOLETE_LONG_OPTIONS): New constant.
333 (get_option, add_file_name): New functions.
334 (main): Use them to support new behavior.
335 (usage): Remove documentation for -j1 FIELD and -j2 FIELD.
336 Do not mark -j FIELD as obsolescent; it is longstanding
337 UNIX tradition and is a valid extension to POSIX.
339 * tests/join/Test.pm (tv): Avoid obsolete -o usage.
341 2003-12-28 Paul Eggert <eggert@twinsun.com>
343 * src/join.c (add_field_list): Don't use alloca with unbounded
344 size; just modify the argument, which is no longer const *.
346 Various other minor cleanups, mostly to avoid the need for casts.
348 (extract_field): Renamed from ADD_FIELD, as it's now a function.
350 (struct field.beg): Now char *, not unsigned char const *. All
351 uses changed. It shouldn't be const since xmemcoll writes on its
353 (extract_field): Likewise, for 2nd arg.
354 (keycmp): Remove now-unnecessary cast of xmemcoll args.
356 (is_blank): New function, to avoid need to cast arg to unsigned char.
357 (extract_field): Use it.
359 (xfields): Rewrite pretty much from scratch.
361 (hard_LC_COLLATE): Now bool, not int.
362 (get_line, getseq, add_field_list): Now returns bool, not int.
363 (decode_field_spec, add_field_list): Return true on success (not
364 false), for consistency with the rest of the code. All uses changed.
366 (tab): Now char, not unsigned char. This wasn't 100% necessary
367 but is slightly cleaner.
368 (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler.
370 (empty_filler): Now const *.
372 (make_blank): Remove; wasn't needed. Remove all calls.
373 (main): Don't set uni_blank.nfields; zero is fine.
375 2003-12-27 Jim Meyering <jim@meyering.net>
377 * src/join.c: Include "quote.h".
378 (min, max): Remove definitions.
379 Make a few function parameters and corresponding
380 locals `const'. Use bool for boolean variables.
381 Use size_t (not int) for all counters and related index variables.
382 (prjoin): Remove now-useless assertion.
383 (string_to_join_field): New function.
384 (main): Accept join fields as large as SIZE_MAX.
385 (keycmp): Rename `min' to MIN and max to MAX.
387 2003-12-26 Jim Meyering <jim@meyering.net>
389 fold -s didn't work on e.g., alpha-based systems.
390 * src/fold.c (fold_file): Adjust types (int->size_t) so that using
391 x2nrealloc works properly on systems with differing sizes for int
392 and size_t. Reported by Nelson Beebe.
394 * src/fold.c: Use `bool' (not int) as the type for a few
397 2003-12-23 Paul Eggert <eggert@twinsun.com>
399 * src/ls.c (length_of_file_names_and_frills):
400 Remove forward decl; not needed.
401 (print_file_name_and_frills, length_of_file_name_and_frills):
402 With -m, don't output spaces before inum or size.
403 (print_with_commas): Don't output space just before newline.
405 2003-12-24 Jim Meyering <jim@meyering.net>
407 * tests/ls/Makefile.am (TESTS): Add m-option.
408 * tests/ls/m-option: New file. Test for above fixes.
410 2003-12-20 Jim Meyering <jim@meyering.net>
414 * src/pr.c: Change type of global, buff_allocated, to size_t.
416 * src/join.c [struct seq]: Change types of members count and alloc
417 from `int' to `size_t'.
419 * tests/Makefile.am (root-hint): Tweak wording.
421 * src/du.c: Accept new option (-0, --null) that makes it so each
422 output line is NUL-terminated rather than newline-terminated.
424 * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync.
425 Reported by Volker Paul.
426 * tests/dd/Makefile.am (TESTS): Add unblock-sync.
427 * tests/dd/unblock-sync: New test for the above.
429 2003-12-19 Jim Meyering <jim@meyering.net>
431 * tests/misc/nohup: Double quote back-ticked expression,
432 in case it ends up having an unexpected value.
434 * tests/ls/no-arg: Use ls's -1 option in both runs.
436 * src/du.c (fts_debug): New global.
437 (FTS_CROSS_CHECK, DEBUG_OPT): Define.
438 (main): Make fts use FTS_TIGHT_CYCLE_CHECK.
439 (main) [DU_DEBUG]: Accept -d option.
441 2003-12-18 Jim Meyering <jim@meyering.net>
443 * src/ls.c (format_user): Increment dired_pos via two statements,
444 `dired_pos += width; dired_pos++;' rather than one,
445 `dired_pos += width + 1;' since the latter could conceivably overflow.
446 (format_group): Likewise.
449 * configure.ac: Require automake-1.8.
451 2003-12-12 Jim Meyering <jim@meyering.net>
453 * Use automake-1.8. Regenerate dependent files.
455 2003-12-08 Jim Meyering <jim@meyering.net>
457 * Makefile.maint (news-date-check): New rule.
458 (alpha beta major): Depend on it.
460 2003-12-03 Paul Eggert <eggert@twinsun.com>
462 * NEWS: ls -l (and similar options) now adjust all columns to
463 fit the data. Generalized from a suggestion by Leah Q for file sizes.
464 * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
465 (format_user_width, format_group_width, unsigned_file_size,
466 format_group): New functions.
467 (block_size_width): Renamed from block_size_size.
468 (inode_number_width, nlink_width, owner_width, group_width,
469 author_width, major_device_number_width, minor_device_number_width,
470 file_size_width): New vars.
471 (clear_files): Initialize them.
472 (gobble_file): Set them. Don't ceiling block_size_width to 7.
473 (print_long_file): Use them.
474 (gobble_file): Use a new local variable 'f' to make the code
475 smaller and more consistent with other functions.
476 (format_user): Output to stdout, not to a buffer, so that we
477 don't have to worry about buffer overrun. Update dired_pos.
478 (print_long_file): Don't put owner, group, author into buffer;
479 just print them directly. Don't assume link counts and
480 major and minor numbers fit into unsigned long int.
481 * tests/cp/same-file, tests/mv/part-symlink: Don't assume that
482 'ls' output is fixed-width.
484 2003-12-02 Jim Meyering <jim@meyering.net>
486 * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h.
488 2003-11-27 Jim Meyering <jim@meyering.net>
490 * Use automake-1.7f. Regenerate dependent files.
492 2003-11-24 Paul Eggert <eggert@twinsun.com>
494 Parse floating-point operands and options in the C locale.
495 POSIX requires this for printf, and we might as well be
496 consistent elsewhere (tail, sleep, seq).
498 * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer
499 needed now that we assume C89. Include "c-strtod.h".
500 (xstrtod): Call c_strtod, not strtod.
501 * src/sleep.c: Include "c-strtod.h".
502 (main): Update xstrtod call to include new argument, c_strtod.
503 * src/seq.c (scan_double_arg): Likewise.
504 * src/tail.c (parse_options): Likewise.
506 2003-11-24 Jim Meyering <jim@meyering.net>
508 * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM).
509 Reported by Mark Conty.
511 2003-11-22 Jim Meyering <jim@meyering.net>
513 * Makefile.maint (sc_xalloc_h_in_src): Remove rule. Subsumed by...
514 (sc_system_h_headers): Do this test only if sys2.h exists.
516 2003-11-20 Jim Meyering <jim@meyering.net>
518 * tests/help-version: Ensure that the bug-reporting address is
519 included in the --help output for every program.
520 * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.
522 * src/ptx.c (usage): Output bug-reporting address.
523 Reported by Dan Jacobson.
525 2003-11-19 Jim Meyering <jim@meyering.net>
527 * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted
528 on the join fields. Suggestion from Bruce Robertson.
530 2003-11-18 Jim Meyering <jim@meyering.net>
532 `od -c -w9999999' could segfault
533 * src/od.c (dump): Use xnmalloc/free, not alloca.
535 2003-11-16 Jim Meyering <jim@meyering.net>
537 * Use autoconf-2.59. Regenerate dependent files.
539 * tests/du/hard-link: Minor tweak: use mkdir -p.
541 Fix read-from-free'd-buffer error detected by valgrind.
542 * src/csplit.c (remove_line): Don't return a pointer to data in
543 a freed buffer. Instead, arrange to free the buffer on the
546 * tests/misc/csplit: New test for above fix.
548 2003-11-11 Jim Meyering <jim@meyering.net>
550 * src/ls.c (extract_dirs_from_files): Avoid useless copy operations.
551 This avoids a warning from valgrind about memcpy with overlapping
552 source and destination.
554 * configure.ac: Require automake-1.7.8.
556 2003-11-09 Jim Meyering <jim@meyering.net>
558 * Use automake-1.7.9. Regenerate dependent files.
560 * src/rm.c: Support new options: --preserve-root and --no-preserve-root.
561 * src/chown.c: Likewise.
563 * src/chown-core.c: Include "root-dev-ino.h".
564 (chopt_init): Initialize new member.
565 (change_file_owner): Support rm's new --preserve-root option.
567 * src/remove.c: Include "root-dev-ino.h".
568 (remove_cwd_entries): Remove now-obsolete FIXME comment.
569 (remove_dir): Support rm's new --preserve-root option.
571 * src/chown.c: Include "root-dev-ino.h".
572 Add new options: --preserve-root and --no-preserve-root.
574 * src/chmod.c: Include "root-dev-ino.h".
575 (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
576 ROOT_DEV_INO_WARN macros.
577 (get_root_dev_ino): Remove function definition, now that it's
578 been moved to a separate file.
579 (usage): Describe new options.
581 * src/mv.c (rm_option_init): Initialized new member.
583 * src/remove.h: Include "dev-ino.h".
584 (struct rm_options): Add new member: root_dev_ino.
585 * src/chown-core.h: Include "dev-ino.h".
586 (struct Chown_option): Add new member: root_dev_ino.
588 2003-11-06 Jim Meyering <jim@meyering.net>
590 * src/paste.c (paste_parallel): Use `sizeof *var' rather than
591 hard-coding `sizeof FILE*'.
593 2003-11-05 Dennis Smit <ds@nerds-incorporated.org>
595 * src/wc.c (main): Free `fstatus' so there is no confusion about
596 whether it's leaked or not.
597 * src/who.c (who): Likewise for `utmp_buf'.
599 2003-11-05 Paul Eggert <eggert@twinsun.com>
601 Fix 'cut' problems with size_t overflow and unsigned int.
602 More generally, resize integer variables to fit use more precisely.
603 * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens.
604 (struct range_pair): Make members to be of type size_t, not unsigned.
605 (max_range_endpoint, eol_range_start): Now size_t, not unsigned.
606 (suppress_non_delimited, output_delimiter_specified,
607 have_read_stdin, print_kth, set_fields): Now bool, nt int.
608 (delim): Now unsigned char, not int.
609 (mark_printable_field, is_printable_field, is_range_start_index,
610 set_fields, set_fields, cut_bytes, cut_fields):
611 Use size_t, not unsigned, for field and byte counts.
612 (hash_int): Use uintptr_t, not unsigned, for pointers converted
613 to integers. This squeezes more info out of them.
614 (set_fields, cut_bytes, cut_fields, main):
615 Use bool, not int, for booleans.
616 (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc.
618 2003-11-05 Paul Eggert <eggert@twinsun.com>
620 * man/Makefile.am (check-programs-vs-x):
621 Work even if $(programs) contains '$'.
622 Work even if 'missing=1' in environment.
623 Don't report an error simply because $(programs) outputs nothing.
625 2003-11-05 Jim Meyering <jim@meyering.net>
627 * Use autoconf-2.58. Regenerate dependent files.
629 * src/tr.c (spec_init): Fix typo in last change.
631 * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in
632 call to variadic version_etc function, so that it works even on systems
633 for which sizeof char* != sizeof int.
634 * src/true.c (main): Likewise.
635 * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c:
636 * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c:
637 * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c:
638 * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c:
639 Similarly, cast NULL to `(char *)' in call to variadic function,
640 parse_long_options, so that it works even on systems for which
641 sizeof char* != sizeof int.
642 A similar problem was reported by Harti Brandt in
643 http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html.
645 * src/users.c (users): Free `utmp_buf' explicitly so that people
646 don't mistake this for a real leak.
647 Patch by Dennis Smit <ds@nerds-incorporated.org.
649 2003-11-04 Paul Eggert <eggert@twinsun.com>
651 * README: Document _POSIX2_VERSION.
653 2003-11-04 Jim Meyering <jim@meyering.net>
655 * src/tac.c (memrchr): Remove #if-0'd function.
656 (tac_stdin_to_mem): Clean up #if-0'd code.
658 * src/od.c (decode_format_string): Remove unnecessary casts.
659 Use more maintainable `sizeof *var'.
660 (main): Call decode_format_string rather than decode_one_format,
661 now that `spec' may be NULL.
663 * src/chmod.c (AUTHORS): Add my name.
665 * src/split.c (next_file_name): Use `sizeof *var' rather than
666 hard-coding `sizeof size_t'.
668 * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...).
670 * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc,
671 to avoid potential overflow in pointer arithmetic.
672 (set_fields): Use not `1', but rather `sizeof *printable_field' as
673 second argument to xcalloc.
674 * src/od.c (decode_format_string, dump_strings): Use x2nrealloc
675 rather than xrealloc.
676 * src/date.c (show_date): Likewise.
677 * src/join.c (ADD_FIELD, initseq, getseq): Likewise.
678 * src/pr.c (store_char): Likewise.
679 * src/fold.c (fold_file): Likewise.
681 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
682 type changes (unsigned int -> size_t) in hash.c.
683 * src/cp-hash.c (src_to_dest_hash): Likewise.
684 * src/du.c (entry_hash): Likewise.
685 * src/ls.c (dev_ino_hash): Likewise.
686 * src/cut.c (hash_int): Likewise. Declare function as static.
688 2003-11-03 Jim Meyering <jim@meyering.net>
690 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
691 * tests/misc/fold: Fail the test immediately if we're not running
692 the expected version of fold.
694 2003-11-02 Jim Meyering <jim@meyering.net>
696 * src/tr.c (append_normal_char, append_range, append_char_class)
697 (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var'
698 rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable
700 * src/copy.c (copy_internal): Likewise.
701 * src/join.c (initseq, add_field, make_blank): Likewise.
702 * src/od.c (main): Likewise.
703 * src/cp.c (make_path_private): Likewise.
704 * src/tsort.c (new_item, record_relation): Likewise.
706 * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise.
707 (main): Also remove anachronistic cast of xmalloc return value.
708 * src/ptx.c (alloc_and_compile_regex, main): Likewise.
709 (main): Also remove anachronistic cast of xmalloc return value.
710 * src/sort.c (inittables): Likewise.
711 (sort): Also Split a long line.
713 2003-10-25 Jim Meyering <jim@meyering.net>
715 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
716 type changes (unsigned int -> size_t) in hash.c.
717 * src/cp-hash.c (src_to_dest_hash): Likewise.
718 * src/du.c (entry_hash): Likewise.
719 * src/ls.c (dev_ino_hash): Likewise.
720 * src/cut.c (hash_int): Likewise. Declare function as static.
722 2003-10-21 Jim Meyering <jim@meyering.net>
724 Don't fail when run with VERBOSE=yes.
725 * tests/chgrp/basic: Do `set +x' before starting the subshell
726 from which we invoke chgrp. Otherwise, the output from the
727 VERBOSE=yes-induced `set -x' would result in spurious differences.
728 Reported by Russel Coker via Michael Stone.
730 2003-10-19 Jim Meyering <jim@meyering.net>
732 chmod now uses fts to perform a directory traversal when -R is
733 specified. Before, it operated on full path names, and as such
734 would encounter the PATH_MAX (often 4096) limit.
736 * src/chmod.c: Include "xfts.h".
737 (process_file): Rename from change_file_mode.
738 Adapt to be used with fts.
739 (process_files): New function.
741 2003-10-18 Jim Meyering <jim@meyering.net>
743 * tests/du/deref-args: Ensure that du -D now dereferences all
744 symlinks specified on the command line, not just those that
745 reference directories.
747 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
748 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
749 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
750 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
751 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
752 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
753 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
754 * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
755 of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
756 Update the call to parse_long_options so that `AUTHORS, NULL' are the
758 * src/true.c (main): Append NULL to version_etc argument list.
759 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
761 2003-10-17 Andreas Schwab <schwab@suse.de>
763 * tests/mk-script: Get $srcdir from first parameter instead of
765 (main): Update usage.
767 * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as
768 first argument of mk-script.
769 ($(srcdir)/Makefile.am): Likewise. Prepend $(srcdir) to target.
771 2003-10-17 Jim Meyering <jim@meyering.net>
773 * src/mv.c (usage): Tweak descriptions of -i and -f so that the
774 generated `man' page is more readable. Suggestion from Dan Jacobson.
776 * src/chown-core.c (change_file_owner): Handle the cases in
777 which fts_info indicates an error with the given entry.
779 * src/du.c (main): Simply assign to bit_flags.
780 Don't bother with bit arithmetic.
782 * tests/chmod/no-x: New file.
783 * tests/chgrp/no-x: New file.
784 * tests/chmod/Makefile.am (TESTS): Add no-x.
785 * tests/chgrp/Makefile.am (TESTS): Likewise.
787 * src/du.c: Include "xfts.h".
788 (du_files): Use xfts_open, rather than fts_open.
789 * src/chown-core.c (chown_files): Likewise.
791 2003-10-16 Jim Meyering <jim@meyering.net>
793 * src/chgrp.c (main): Simply assign to bit_flags.
794 Don't bother with bit arithmetic.
795 * src/chown.c (main): Likewise.
796 Rename a couple of local variables.
797 Remove unnecessary casts.
799 * src/tail.c (start_bytes): Rename local, remainder, to avoid
800 gcc's warning about shadowing a global.
802 2003-10-15 Jim Meyering <jim@meyering.net>
804 chown and chgrp now accept POSIX-mandated -H, -L, -P options and
805 use fts to perform a directory traversal when -R is specified.
806 Before, they operated on full path names, and as such would
807 encounter the PATH_MAX (often 4096) limit.
808 They are more efficient. For example, before, chgrp -R would
809 take almost 5 seconds to change about 2000 directories and fail
810 (with `File name too long'), while now it succeeds on a hierarchy
811 of depth 20,000 in 1/10 the time.
813 * src/chown.c: Include "userspec.h" and "fts_.h".
814 (WRITTEN_BY): Add my name.
815 (getpwnam, getgrnam, getgrgid): Remove declarations.
816 (endpwent): Remove definition.
818 (main): Handle new options.
819 Call new function, chown_files rather than change_file_owner.
821 * src/chgrp.c: Include "fts_.h".
822 (WRITTEN_BY): Add my name.
823 (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of
826 (main): Handle new options.
827 Call new function, chown_files rather than change_file_owner.
829 Rewrite to iterate through hierarchies using fts rather than
830 via explicit recursion.
831 * src/chown-core.c: Include "fts_.h"
832 (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
833 on a single file at a time.
834 (chown_files): New function.
835 * src/chown-core.h [enum Dereference_symlink]: Remove declaration.
836 [struct Chown_option] (recurse, force_silent): Change type to `bool'.
837 [struct Chown_option] (dereference): Remove member with ambiguous name.
838 [struct Chown_option] (affect_symlink_referent): New member.
839 (chown_files): New prototype.
841 * tests/chgrp/recurse: Update tests accordingly.
842 * tests/chgrp/posix-H: New tests for the above.
843 * tests/chgrp/Makefile.am (TESTS): Add posix-H.
845 * src/ln.c (usage): Clarify that --directory, -d, -F probably won't
846 work even for superuser. Suggestion from Dan Jacobson.
848 2003-10-14 Paul Eggert <eggert@twinsun.com>
850 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
852 * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h,
853 lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib.
854 * src/sort.c (parse_field_count): Handle the case where overflow
855 and invalid suffix char are both reported.
857 2003-10-14 Jim Meyering <jim@meyering.net>
859 * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the
860 warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
863 2003-10-13 Paul Eggert <eggert@twinsun.com>
865 Fix to avoid a denial-of-service attack if the display width is
866 enormous. Also, clean up the code a bit by removing duplicate code.
868 * src/ls.c (init_column_info): Remove forward decl; no longer needed.
869 (calculate_columns): New function, that contains code that used
870 to be common to print_many_per_line and print_horizontal.
871 (print_many_per_line, print_horizontal): Use it.
872 (decode_switches): Set max_idx here, not in calculate_columns.
873 (print_current_files): Don't call init_column_info; calculate_columns
875 (init_column_info): Don't allocate a lot more space than is needed
876 to represent the current set of files. Allocate all the new
877 size_t cells in one call to xnmalloc, rather than a row at a time.
879 2003-10-13 Jim Meyering <jim@meyering.net>
881 * src/ls.c (init_column_info): Add another FIXME comment.
883 2003-10-13 Paul Eggert <eggert@twinsun.com>
885 Fix address-arithmetic bug in 'ls', reported by Georgi Guninski.
886 Remove several arbitrary limits on hosts where int cannot represent
889 * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent,
890 nfiles, files_index, tabsize, line_length, struct column_info.line_len,
891 struct column_info.col_arr[0], max_idx):
893 (get_funky_string): Return bool indicating success, instead of
894 a negative count to indicate failure. Store number of columns
895 through new parameter OUTPUT_COUNT; that way, they can never
896 go negative. Change equals_end from int to bool. All uses
898 (struct column_info.valid_len): Now bool, not int. All uses changed.
899 (dired_dump_obstack, get_funky_string, clear_files,
900 extract_dirs_from_files, print_current_files,
901 print_many_per_line, print_horizontal, init_column_info,
902 put_indicator, length_of_file_name_and_frills,
903 print_with_commas): Use size_t, not int, for local variables
905 (decode_switches): Decode sizes using xstrtoul, not xstrtol.
906 Check for TIOCGWINSZ returing negative values (or values greater
908 (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
910 Use xmalloc and xnmalloc, not XMALLOC.
911 (gobble_file): Use xnrealloc, not XREALLOC.
912 (print_color_indicator): Remove now-unnecessary cast to size_t.
914 2003-10-12 Paul Eggert <eggert@twinsun.com>
916 * tests/du/no-x: Change wording of diagnostic to match latest du.c.
917 * tests/sort/sort-tests: Remove from CVS; assume that people
918 brave enough to check coreutils out from CVS can rebuild it.
920 2003-10-12 Jim Meyering <jim@meyering.net>
922 New options: --preserve-root and --no-preserve-root.
923 * src/chmod.c (change_file_mode): Honor new option.
924 (change_file_mode): Strip trailing slashes on directory
925 argument passed to change_dir_mode.
926 (get_root_dev_ino): New function.
927 (main): Initialize global, root_dev_ino.
929 * src/copy.c (copy_internal): Don't #ifdef-out simple uses of
930 S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined
932 * src/chmod.c (change_file_mode): Likewise.
934 2003-10-08 Jim Meyering <jim@meyering.net>
936 * src/csplit.c (main): Remove obsolete FIXME.
938 2003-10-07 Jim Meyering <jim@meyering.net>
940 * Use automake-1.7.8. Regenerate dependent files.
942 2003-09-29 Paul Eggert <eggert@twinsun.com>
946 * doc/coreutils.texi (csplit invocation):
947 The regexp offset need not have a sign; POSIX requires support
950 Be more careful about int widths. For example, remove some
951 arbitrary limits by replacing 'unsigned' with 'size_t',
952 'uintmax_t', etc. Use standard bool rather than a homegrown type.
953 * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
954 * src/csplit.c (FALSE, TRUE, boolean): Remove. All uses changed
955 to <stdbool.h> usage.
956 (struct control): offset is now intmax_t, not int.
957 repeat_forever is now bool, not int.
958 (struct cstring): len is now size_t, not unsigned int.
959 (struct buffer_record): bytes_alloc, bytes_used, num_lines are now
960 size_t, not unsigned. start_line, first_available are now
961 uintmax_t, not unsigned.
962 (hold_count, control_used): Now size_t, not unsigned.
963 (last_line_number, current_line, bytes_written):
964 Now uintmax_t, not unsigned.
965 (save_to_hold_area, red_input, keep_new_line, record_line_starts,
966 create_new_buffer, get_new_buffer, load_buffer, find_line,
967 process_regexp, split_file, new_control_record, extract_regexp,
968 get_format_width, get_format_prec, max_out):
969 size args, locals, and returned values are now size_t, not unsigned
971 (get_first_line_in_buffer, find_line, write_to_file,
972 handle_line_error, process_line_count, regexp_error, process_regexp,
974 File line, byte, and repetition counts are now uintmax_t, not unsigned.
975 (check_for_offset): Don't require a sign before the offset.
976 Use xstrtoimax to do the real work.
977 (extract_regexp): Remove harmful cast of size to unsigned.
978 256 -> 1<<CHAR_BIT, for clarity.
979 (get_format_flags): Return at most 3, to avoid worries about overflow.
981 (bytes_to_octal_digits): Remove.
983 (cleanup): Don't check whether output_stream is NULL, since
984 close_output_file does that for us.
986 (new_line_control, create_new_buffer): Use "foo *p = xmalloc
987 (sizeof *p);" instead of the more long-winded alternatives.
989 (get_new_buffer): Use O(1) algorithm for resizing a buffer
990 to a much larger size, instead of an O(N) algorithm.
992 (process_regexp): Use plain NULL rather than casted 0.
994 (make_filename): Use %u, not %d, to format unsigned file number.
996 (new_control_record): Use xrealloc exclusively, since it handles
999 (extract_regexp): Change misspelled word in diagnostic.
1001 (get_format_width): Even if a minimum field width is specified,
1002 allow room for enough octal digits to represent the value of
1003 the maximum representible integer. This fixes a potential
1004 buffer overrun. Calculate this room at compile-time, not
1005 at run-time; this removes the need for bytes_to_octal_digits.
1006 Check for overflow; this removes a FIXME.
1008 (get_format_prec): Don't allow precision to be signed; it's
1009 not ANSI. Check for overflow. Remove hardcoded "11" as
1010 default precision; this fixes a potential buffer overrun
1011 on hosts with wider size_t.
1013 (get_format_conv_type): Change local variable to be of type
1014 unsigned char, not int; this removes a potential subscript
1015 violation on hosts where char is signed.
1017 (max_out): Replace "for (;*p;)" with more-standard "while (*p)".
1018 Allow "%%" in format. Don't overflow when
1019 counting lots of percents.
1021 (usage): Default sprintf format is %02u, not %d.
1023 2003-10-05 Jim Meyering <jim@meyering.net>
1025 * src/chown-core.c (change_file_owner): Remove set-but-not-used local.
1027 * src/du.c (du_files): Mark diagnostic for translation.
1029 2003-10-04 Jim Meyering <jim@meyering.net>
1031 * src/du.c (du_files): Ignore any failure of fts_close.
1032 Give better diagnostics for failed fts_open.
1034 * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition.
1036 Deprecate existing use of -H (aka --si).
1037 * src/du.c (enum) [HUMAN_SI_OPTION]: New member.
1038 [long_options]: Use HUMAN_SI_OPTION, not 'H'.
1039 (main): Warn that the meaning of -H will soon change to be
1042 2003-10-03 Jim Meyering <jim@meyering.net>
1044 * src/du.c: Accept --no-dereference (-P).
1046 2003-10-02 Jim Meyering <jim@meyering.net>
1048 * tests/du/trailing-slash: Adjust for slightly different output.
1050 Rewrite du.c to use fts.
1051 * src/du.c: Include "fts_.h", not ftw.h.
1052 (opt_dereference_arguments, arg_length, suffix_length): Remove globals.
1053 (IS_FTW_DIR_TYPE): Remove definition.
1054 (IS_DIR_TYPE): Define.
1055 (is_symlink_to_dir): Remove now-unnecessary function.
1056 (process_file, du_files): Rewrite to use fts.
1058 * tests/du/inaccessible-cwd: Ensure that even when run from an
1059 inaccessible directory, du can still operate on accessible
1060 directories elsewhere.
1061 * tests/du/Makefile.am (TESTS): Add inaccessible-cwd.
1063 * tests/rm/deep-1: Ensure that du can process a hierarchy
1064 of depth 400 while using no more than 50KB of stack space.
1066 2003-10-01 Akim Demaille <akim@epita.fr>
1068 * announce-gen (print_news_deltas): New function, extracted from main.
1069 (main): Make `news_file' an array.
1070 Use '...=s' => \@var for --news and --url-directory specs.
1071 Before there were a couple of portability problems.
1073 2003-09-28 Jim Meyering <jim@meyering.net>
1075 * Makefile.maint (sc_cast_of_alloca_return_value): New rule.
1076 (syntax-check-rules): Add it.
1078 * src/copy.c: Remove unnecessary cast of alloca, since now it's
1079 guaranteed to be (void *).
1080 * src/cp.c: Likewise.
1081 * src/join.c: Likewise.
1082 * src/ln.c: Likewise.
1083 * src/ls.c: Likewise.
1084 * src/od.c: Likewise.
1085 * src/sys2.h (ASSIGN_STRDUPA): Likewise.
1087 2003-09-27 Jim Meyering <jim@meyering.net>
1089 Don't exhaust virtual memory when processing large inputs.
1090 Fix this by removing csplit's internal free-list management;
1091 instead rely on malloc for that.
1093 * src/csplit.c (free_list): Remove global.
1094 (clear_all_line_control): Remove function.
1095 (get_new_buffer): Always use create_new_buffer to obtain a
1096 new buffer, rather than searching free_list.
1097 (free_buffer): Just call free.
1098 Reported by Nikola Milutinovic.
1100 2003-09-26 Jim Meyering <jim@meyering.net>
1102 * man/rm.x: Also list `chattr' in SEE ALSO section.
1103 Suggestion from Mark Hubbart.
1105 2003-09-25 Jim Meyering <jim@meyering.net>
1107 * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now
1108 that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them.
1110 * Use autoconf-2.57d. Regenerate dependent files.
1112 2003-09-24 Jim Meyering <jim@meyering.net>
1114 Minor efficiency tweak.
1115 * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
1116 (do_link): Likewise.
1118 2003-09-23 Jim Meyering <jim@meyering.net>
1120 * src/paste.c (paste_serial): Save errno after input error,
1121 to report proper errno value.
1122 Based on a patch from Paul Eggert.
1124 * src/tee.c (tee): Adjust fwrite arguments so that the return
1125 value is the number of bytes written.
1127 2003-09-16 Paul Eggert <eggert@twinsun.com>
1129 Don't assume ferror sets errno. Bug reported by Bruno Haible.
1131 * src/comm.c (compare_files): Save errno after input error,
1132 to report proper errno value.
1133 * src/fold.c (fold_file): Likewise.
1134 * src/od.c (check_and_close, skip, read_char, read_block): Likewise.
1135 * src/unexpand.c (unexpand): Likewise.
1137 * src/csplit.c (close_output_file): Don't report bogus errno value
1138 after ferror discovers an output error. We don't know the proper
1139 errno value, since it might have been caused by any of a whole
1140 bunch of calls, and it might have been trashed in the meantime.
1141 Fixing this problem will require much more extensive changes;
1142 in the meantime just say "write error".
1143 * src/od.c (check_and_close, dump, dump_strings): Likewise.
1144 * src/uniq.c (check_file): Likewise.
1146 * src/join.c (get_line): Report error right away if I/O fails,
1147 so that the proper errno value is used.
1148 * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise.
1149 * src/tee.c (tee): Likewise.
1150 * src/uniq.c (check_file): Likewise.
1152 * src/od.c (skip): If a read fails, don't retry it later, so
1153 that we report the proper errno.
1155 * src/tac.c (tac_mem): Don't return a value; nobody uses it.
1157 * src/tee.c (tee): Once a write failure has occurred, don't bother
1158 writing anything more to that stream.
1160 * src/uniq.c (check_file): Check for ferror (stdout) even if
1163 * src/yes.c (UNROLL): Remove.
1164 (main): Exit immediately when write failure is detected.
1165 Simplify code by assigning to argv when argc == 1.
1167 2003-09-21 Paul Eggert <eggert@twinsun.com>
1169 * src/ptx.c: Switch encoding from Latin-1 to UTF-8.
1170 (WRITTEN_BY): Change "Franc,ois" (actually using
1171 c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
1174 2003-09-19 Jim Meyering <jim@meyering.net>
1176 `du -D symlink-to-dir' would mistakenly omit the slash in
1177 lines like this: 24 symlink-to-dir/subdir
1178 * src/du.c (process_file): Fix offset calculation.
1179 Reported by Jeff Sheinberg as Debian bug #211591;
1180 http://bugs.debian.org/205251
1182 * tests/du/deref-args: New file/test for the above.
1183 * tests/du/Makefile.am (TESTS): Add deref-args.
1185 * src/du.c (process_file): Remove useless disjunct.
1187 * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
1189 * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
1190 Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
1191 Mark each WRITTEN_BY string as translatable.
1193 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1194 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1195 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1196 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1197 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1198 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1199 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1200 * who.c, whoami.c, yes.c: Revert yesterday's changes.
1201 Instead, a subsequent change will embed `Written by ' in
1202 each string along with the author names.
1204 * src/true.c: Revert yesterday's changes.
1205 * src/sys2.h: Likewise.
1207 2003-09-18 Jim Meyering <jim@meyering.net>
1209 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1210 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1211 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1212 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1213 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1214 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1215 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1216 * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
1217 comma-separated list of strings and/or update the call to
1218 parse_long_options so that `AUTHORS, NULL' are the last parameters.
1219 * src/true.c (main): Append NULL to version_etc argument list.
1220 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
1222 * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
1223 shadowing the math function name. Also rename loga to log_a.
1225 2003-09-14 Jim Meyering <jim@meyering.net>
1227 * src/factor.c (print_factors): Give a separate diagnostic
1228 for numbers that are too large, but otherwise valid.
1229 Reported by Dániel Varga.
1231 2003-09-10 Jim Meyering <jim@meyering.net>
1233 * Use automake-1.7.7. Regenerate dependent files.
1235 * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
1236 of `fmt -1'. Using the just-built tr is a little cleaner.
1237 Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
1238 * man/Makefile.am (programs, check-x-vs-1): Likewise.
1240 2003-09-09 Jim Meyering <jim@meyering.net>
1242 * src/copy.c: Alphabetize includes.
1243 Remove duplicate inclusion of "same.h".
1245 2003-09-08 Jim Meyering <jim@meyering.net>
1247 * Makefile.maint (GZIP_ENV): Remove --rsyncable.
1248 Didn't give enough of a benefit, mainly because it's not yet
1253 * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
1254 (check-programs-vs-x): Fail if $(programs) is empty.
1256 * src/remove.c: Add a comment.
1258 2003-09-07 Jim Meyering <jim@meyering.net>
1260 * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
1261 Don't define. These symbols are no longer used.
1263 * tests/misc/tty-eof: Write ^D as \cD.
1264 Complete the change of 2003-08-02.
1266 * Makefile.maint (po-check): Use cvsu, so that a temporary source
1267 file in lib/ or src/ doesn't induce an unwarranted failure.
1268 Add a kludge to filter out the sole generated source file that
1269 also has translatable messages: src/false.c.
1271 2003-09-06 Jim Meyering <jim@meyering.net>
1273 * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
1274 (parse_options): Give a diagnostic for (but still accept) the
1275 deprecated --allow-missing option.
1277 2003-09-04 Paul Eggert <eggert@twinsun.com>
1279 Don't ignore -S if input is a pipe. Bug report by Michael McFarland in
1280 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
1282 * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the
1283 size_bound ourselves. if an input file is a pipe and the user
1284 specified a size, use that size instead of trying to guess the
1285 pipe size. This has the beneficial side effect of avoiding the
1286 overhead of default_sort_size in that case. All callers changed.
1287 (sort): Remove static var size; now done by sort_buffer_size.
1289 2003-09-05 Jim Meyering <jim@meyering.net>
1291 * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files.
1293 * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
1294 to start, rather than just .1. Upon failure, print unexpected state.
1296 2003-09-04 Paul Eggert <eggert@twinsun.com>
1298 * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
1299 SAFE_READ_ERROR to tmp->nbytes.
1300 * src/tail.c (pipe_lines, pipe_bytes): Likewise.
1302 * src/head.c (struct linebuffer): Change nbytes and nlines
1303 from unsigned int to size_t. unsigned int is safe (after the
1304 2003-09-03 patch) but size_t is cleaner.
1305 * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
1306 (pipe_bytes): Likewise for local variable 'i', which was 'int'.
1308 Standardize on BUFSIZ as opposed to other macro names and values.
1309 * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ.
1310 * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
1311 stdio.h has always defined it,
1312 and other code already assumes it's defined.
1313 * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
1314 (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
1315 (io_buf): IO_BUF_SIZE -> BUFSIZ.
1317 2003-09-04 Paul Eggert <eggert@twinsun.com>
1319 * src/seq.c (step): Default to 1.
1320 (print_numbers): Allow the output to be empty.
1321 (main): The default step is 1, even if LAST < FIRST;
1322 as per documentation.
1323 * tests/seq/basic (onearg-2): Output should be empty.
1325 2003-09-05 Jim Meyering <jim@meyering.net>
1327 * Makefile.cfg (wget_files): Temporarily disable, until master
1328 versions are restored to ftp.gnu.org.
1330 * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
1332 Make seq's --width (-w) option work properly even when the
1333 endpoint requiring the larger width is negative and smaller than
1335 * src/seq.c (get_width_format): Include `-' in the set of bytes
1336 allowed in a `simple' number (no decimal point, no exponent).
1337 Reported by Patrick Mauritz.
1339 2003-09-02 Paul Eggert <eggert@twinsun.com>
1341 * NEWS: sort -t '\0' now uses a NUL tab.
1342 sort option order no longer matters, unless POSIX requires it.
1343 * src/sort.c (usage): Say "blanks" instead of "whitespace",
1344 Similar fixes for many comments.
1345 (TAB_DEFAULT): New constant, so that we can support NUL as
1346 the field separator.
1347 (tab): Now int, not char. Initialize to TAB_DEFAULT.
1348 (specify_sort_size): If multiple sizes are specified, use the largest.
1349 (begfield, limfield): Support NUL tab char.
1350 (set_ordering): Do not let -i override -d.
1351 (main): Report an error if incompatible -o or -t options are given.
1352 Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
1354 2003-09-05 Jim Meyering <jim@meyering.net>
1356 * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
1358 2003-09-03 Andreas Schwab <schwab@suse.de>
1360 Bug report and patch here:
1361 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
1362 * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
1363 * src/head.c (elide_tail_lines_pipe): Likewise.
1365 2003-09-03 Jim Meyering <jim@meyering.net>
1367 * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
1368 small amount of code from him was first moved to lib/human.c, and was
1369 subsequently rewritten entirely.
1370 * src/df.c (AUTHORS): Likewise.
1372 2003-08-22 Lawrence Teo <lcteo@uncc.edu>
1374 * src/md5sum.c (split_3): Accept the BSD format for generic
1375 message digest modes. Currently works with BSD's MD5 and SHA1
1376 formats since these are the two algorithms presently used in
1377 coreutils. Updated comments to reflect this change.
1378 (bsd_split_3): Updated comments.
1380 * tests/md5sum/basic-1: New test to make sure that
1381 `md5sum --check' doesn't accept the BSD SHA1 format (adapted
1382 from `check-bsd' test in tests/sha1sum/basic-1).
1384 * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
1385 --check exit status and BSD SHA1 format (adapted from tests
1386 in tests/md5sum/basic-1).
1388 2003-08-30 Jim Meyering <jim@meyering.net>
1390 * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
1392 When source and destination arguments refer to the same file, reside
1393 on a partition (e.g. VFAT) on which distinct names may refer to the
1394 same directory entry (often due to variations in case), and when the
1395 link count for the file is 1, mv no longer unlinks the file. Instead,
1396 it gives the expected diagnostic that the source and destination are
1397 the same. WARNING: this is an incomplete fix. If the file happens
1398 to have a link count of 2 or greater, such an erroneous mv command
1399 will still unlink it.
1400 Although that is not possible on vfat or umsdos, it is possible on
1401 other file system types, e.g., ntfs, and hpfs.
1402 * src/copy.c (same_file_ok): Invoke same_name (which might still
1403 return false for names that refer to the same directory entry)
1404 only if the link count is 2 or more.
1405 * tests/mv/vfat: Show how to demonstrate the above problem.
1406 This test is not run.
1407 * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
1409 2003-08-27 Jim Meyering <jim@meyering.net>
1411 * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
1412 who's -l option has been eliciting an unconditional warning about
1413 this impending change since sh-utils-2.0.12 (April 2002).
1415 * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
1416 This would happen for nonempty files not ending with a newline.
1417 Reported by Dan Jacobson.
1418 * tests/misc/paste-no-nl: New file. Test for above-fixed bug.
1419 * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
1421 * src/stat.c (print_it): Avoid buffer overrun that would
1422 occur when the user-specified format string ends with `%'.
1423 Patch by Tommi Kyntola.
1424 * tests/misc/stat-fmt: New file. Test for above-fixed bug.
1425 * tests/misc/Makefile.am (TESTS): Add stat-fmt.
1427 2003-08-26 Jim Meyering <jim@meyering.net>
1429 Apply changes from bison.
1430 * GNUmakefile (SHELL): Define to `sh', if necessary.
1432 * Makefile.maint (WGETFLAGS): Define to `-C off'.
1433 Update all uses of $(WGET).
1435 2003-08-22 Akim Demaille <akim@epita.fr>
1437 * Makefile.cfg (local-checks-to-skip): New.
1438 * Makefile.maint (local-check): Rename as...
1439 (local-checks-available): this.
1442 2003-08-26 Akim Demaille <akim@epita.fr>
1444 * announce-gen (print_changelog_deltas): Neutralize "<#" as
1445 "<\#" to avoid magic from Gnus when posting parts of this script.
1447 2003-08-25 Jim Meyering <jim@meyering.net>
1449 * src/stat.c (main): Warn about use of deprecated `-l' option.
1451 2003-08-22 Jim Meyering <jim@meyering.net>
1453 * src/stat.c (do_stat): For link count at end of line, use %h format,
1454 instead of %-5h. The latter would make stat emit trailing spaces.
1455 Reported by Dan Jacobson.
1457 2003-08-20 Jim Meyering <jim@meyering.net>
1459 * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
1461 2003-08-19 Jim Meyering <jim@meyering.net>
1463 * src/system.h: Include stdlib.h unconditionally,
1464 as we're now assuming that part of hosted C89.
1466 2003-08-18 Jim Meyering <jim@meyering.net>
1468 * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
1469 to avoid warnings from gcc.
1471 2003-08-17 Jim Meyering <jim@meyering.net>
1473 Avoid unnecessary and sometimes time-consuming hostname lookups.
1474 * src/who.c (print_user): Use strchr, not strrchr.
1475 * src/pinky.c (print_entry): Likewise.
1476 Patch by Michael Stone.
1477 This fixes a typo I introduced in who-users.c on 1996-02-23.
1479 * Makefile.maint (makefile-check): Add 0-9 to the range of characters
1480 disallowed between `@...@'.
1482 2003-08-16 Paul Eggert <eggert@twinsun.com>
1484 * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
1485 done by gnulib .m4 files.
1486 (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
1487 * src/sys2.h (strtoull): Remove unused declaration.
1489 2003-08-16 Jim Meyering <jim@meyering.net>
1491 * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
1494 * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
1495 race condition bug. The bug would be triggered when tailing a file
1496 with file pointer not at beginning of file, and where the file was
1497 truncated to have a length of less than the initial offset at just
1498 the right moment (between the two lseek calls in this function).
1500 An invalid initial value for *read_pos would result in
1501 `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
1502 busy-wait rather than sleeping between iterations. The bug manifests
1503 itself only when tailing regular files that are initially nonempty.
1504 * src/tail.c (tail_bytes): Set *read_pos to new file offset after
1506 (tail_lines): Likewise, after lseek calls.
1507 Reported by Nick Estes. See http://bugs.debian.org/205251 for details.
1508 * tests/tail-2/tail-n0f: New file. Test for above fix.
1509 * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
1511 2003-08-15 Jim Meyering <jim@meyering.net>
1513 * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
1514 (sc_sun_os_names): Likewise.
1515 * .x-sc_space_tab, .x-sc_sun_os_names: New files.
1517 * man/help2man: Remove some SPACEs before TAB.
1519 2003-08-14 Paul Eggert <eggert@twinsun.com>
1521 * Makefile.maint (LC_ALL): Set to C.
1522 * man/Makefile.am (ASSORT): New var.
1523 (check-x-vs-1, programs): Use it.
1524 * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
1525 * tests/Makefile.am (ASSORT, all_programs): Likewise.
1527 2003-08-11 Jim Meyering <jim@meyering.net>
1529 fold -s -wN would infloop for N < 8 with TABs in the input.
1530 E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
1531 * src/fold.c (fold_file): Move contents of `else'-block
1532 out of conditional so it's used also for --spaces (-s).
1533 * tests/misc/fold: Test for the above fix.
1534 * tests/misc/Makefile.am (TESTS): Add fold.
1536 2003-08-10 Jim Meyering <jim@meyering.net>
1538 * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
1539 system.h so the types from time.h and sys/time.h are available.
1540 It appears that this is necessary for OpenBSD, NetBSD, and
1541 Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
1543 2003-08-06 Paul Eggert <eggert@twinsun.com>
1545 * NEWS: Add support for setting file timestamps to microsecond
1546 resolution, on hosts that support this.
1547 * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
1548 * src/copy.c (copy_internal):
1549 Set file timestamps with utimens, not utime.
1550 * src/cp.c (re_protect): Likewise.
1551 * src/install.c (change_timestamps): Likewise.
1552 * src/touch.c (newtime, touch, main): Likewise.
1554 2003-08-09 Jim Meyering <jim@meyering.net>
1556 * Makefile.maint (sc_sun_os_names): New rule based on a regexp
1558 (syntax-check-rules): Add it.
1560 * src/tail.c (main): Tweak Solaris OS version number in comment.
1561 * src/wc.c (wc): Likewise
1562 * tests/tail-2/fflush: Likewise.
1564 * src/tail.c: Add new undocumented option, --presume-input-pipe.
1565 (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
1567 2003-08-08 Paul Eggert <eggert@twinsun.com>
1569 Use new gnulib 'extensions' module.
1570 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
1573 2003-08-08 Paul Eggert <eggert@twinsun.com>
1575 * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
1577 2003-08-09 Jim Meyering <jim@meyering.net>
1579 * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
1580 For tests of obsolete behavior, don't presume that unsetting
1581 _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
1583 2003-08-07 Paul Eggert <eggert@twinsun.com>
1585 * doc/coreutils.texi (split invocation):
1586 Add -d or --numeric-suffixes option to 'split'.
1587 From a suggestion by Jesse Kornblum.
1588 * src/split.c (suffix_alphabet): New var.
1589 (longopts, usage, next_file_name, main): Support -d.
1590 (next_file_name, main): Allow -a0, as POSIX requires.
1591 (next_file_name): Don't assume ASCII-like encoding;
1592 'a' through 'z' are not contiguous in EBCDIC.
1594 2003-08-05 Paul Eggert <eggert@twinsun.com>
1596 Merge getline from gnulib.
1597 * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
1598 * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
1599 New files, from gnulib.
1600 * lib/getdelim2.c, lib/getdelim2.h: Remove.
1601 * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
1602 getdelim2.h to getndelim2.c and getndelim2.h.
1603 * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
1604 checking for getdelim.
1605 (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
1606 than rolling our own.
1607 * src/cut.c: Include getndelim2.h rather than getdelim2.h.
1608 (cut_fields): Invoke getndelim2 rather than getdelim2.
1610 2003-08-04 Jim Meyering <jim@meyering.net>
1612 * src/sort.c (main): Use unsigned int instead of int for `nsigs'
1613 and for the indices to iterate through nsigs.
1615 2003-08-02 Paul Eggert <eggert@twinsun.com>
1617 * src/sort.c: Minor code cleanups, mostly to use more accurate
1618 types and to remove unnecessary casts.
1619 (min, max): Remove. All uses changed to MIN and MAX.
1620 (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
1621 keyfield.skipsblanks, struct keyfield.skipeblanks, struct
1622 keyfield.numeric, struct keyfield.general_numeric, struct
1623 keyfield.month, struct keyfield.reverse, reverse, unique,
1624 have_read_stdin): Now bool, not int. All uses changed.
1625 (eolchar): Now char, not int.
1626 (struct keyfield.ignore): Now bool const *, not int *.
1627 (struct keyfield.translate): Now char const *, not char *.
1628 (struct month.name): Likewise.
1629 (blanks, nonprinting, nondictionary): Now bool[], not int[].
1630 (cleanup, inittables, keycompare, check, mergefps, first_same_file,
1631 check, sort, main): Use const * pointers when possible.
1632 (month_cmp): Rewrite to avoid casts.
1633 (inittables): Initialize tables unconditionally, to avoid branches.
1634 (fillbuf): Return bool, not int. All uses changed.
1635 (fillbuf, keycompare, new_key, main):
1636 Use SIZE_MAX rather than (size_t) -1.
1637 (trailing_blanks): Renamed from trim_trailing_blanks.
1638 Return the number of blanks to trim. All uses changed.
1639 (getmonth): Use trailing_blanks rather than open code.
1640 (keycompare): Do not cast char * to unsigned char *; not needed.
1641 CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
1643 (compare, main): Use | rather than || to avoid jumps.
1644 Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
1646 (check, first_same_file, sort, main):
1647 Use bool instead of int local vars when possible.
1648 (check): Merge the old 'checkfp' and 'check' into a single function,
1649 that returns a boolean (true if the file was ordered).
1651 (main): Use int instead of unsigned for iterating through nsigs.
1652 Rename local var "posix_pedantic" to "posixly_correct".
1654 2003-08-02 Jim Meyering <jim@meyering.net>
1656 * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
1657 to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
1659 * src/cut.c (cut_fields): Don't read again after encountering an
1660 initial EOF. E.g., `cut -f2' would do so.
1661 * tests/misc/tty-eof: Add a test for the above fix.
1663 * src/sort.c (sortlines): Add description and references.
1666 * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
1667 the tests in help-version will use the just-built binaries.
1668 Reported by Christian Krackowizer.
1670 2003-07-31 Paul Eggert <eggert@twinsun.com>
1672 * NEWS: Add --rfc-2822 option to GNU date.
1673 * doc/coreutils.texi (Time directives, Options for date, Examples
1675 * src/date.c (long_options, usage, main): Likewise.
1676 * doc/getdate.texi (General date syntax): Likewise.
1677 * doc/coreutils.texi (Options for date): Fix a typo in format:
1678 it's now %d not %_d. Add URLs.
1680 2003-08-01 Jim Meyering <jim@meyering.net>
1682 * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
1683 Otherwise, with at least the /bin/sh from HPUX 10.20,
1684 the trap code would end up converting that to exit 1 and thus an
1685 unexpected test failure. Reported by Christian Krackowizer.
1687 2003-07-31 Paul Eggert <eggert@twinsun.com>
1689 * src/ptx.c: Do not include bumpalloc.h.
1690 (WORD_TABLE): New member alloc.
1691 (ALLOC_NEW_WORD): Remove.
1692 (occurs_alloc): New var.
1693 (digest_word_file, find_occurs_in_text): Check for arithmetic
1694 overflow when computing table size. Use xrealloc rather than
1695 bumpalloc primitives.
1697 2003-07-29 Jim Meyering <jim@meyering.net>
1701 * README: When running tests as root, suggest using
1702 sudo with NON_ROOT_USERNAME=$USER.
1704 * tests/Makefile.am (all_programs): Makefile is in ../src, not
1707 2003-07-28 Jim Meyering <jim@meyering.net>
1709 * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
1711 2003-07-28 Paul Eggert <eggert@twinsun.com>
1713 * lib/stdbool.hin (_Bool): Make it signed char, instead of
1714 an enum type, so that it's guaranteed to promote to int.
1715 * src/sort.c (sortlines_temp): Undo previous change.
1717 2003-07-28 Jim Meyering <jim@meyering.net>
1719 * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
1720 `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
1721 would cause lines[-1 - swap] (with swap = false) to evaluate to
1724 2003-07-27 Jim Meyering <jim@meyering.net>
1726 * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
1727 since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
1729 * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
1730 directories, as required by POSIX. Reported by Karl Berry.
1731 * tests/rm/dir-no-w: New file. Test for the above fix.
1732 * tests/rm/Makefile.am (TESTS): Add dir-no-w.
1734 * tests/mk-script: Emit `$xx', not its expansion.
1736 2003-07-27 Paul Eggert <eggert@twinsun.com>
1738 This change was inspired by a similar proposal by Stepan Kasal.
1739 * src/sort.c (mergelines, sortlines_temp): New functions.
1740 (sortlines): Use them, to reduce the number of times that
1741 we need to copy 'struct line' values. This improved CPU
1742 performance by about 30% on one 18 MB test.
1743 (sort): Don't invoke sortlines unless we have 2 or more lines.
1745 2003-07-26 Stepan Kasal <kasal@ucw.cz>
1747 * src/sort.c (sort): Don't require two `struct line's per text line,
1748 the new sort algorithm requires just 1.5.
1750 2003-07-27 Jim Meyering <jim@meyering.net>
1752 * src/pathchk.c (validate_path): Use %lu, not %ld.
1754 * src/cut.c (is_printable_field): Simplify bit arithmetic.
1756 * src/ls.c (sort_files): Put `volatile' in the right place.
1759 2003-07-26 Jim Meyering <jim@meyering.net>
1761 Use only one bit per field/offset in array, not one `int'.
1762 * src/cut.c (printable_field): Change type to `unsigned char'.
1763 (mark_printable_field, is_printable_field): New functions.
1764 Use them in place of all direct accesses of `printable_field'.
1766 * src/expand.c (parse_tabstops): Detect overflow properly.
1767 * src/cut.c (set_fields): Likewise.
1769 * src/rm.c: Include "dirname.h".
1770 (usage): Use base_name (program_name) in body of --help output.
1772 * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
1773 Idea from Brendan O'Dea, who suggested using
1774 `program_name = basename (argv[0]);' everywhere --
1775 can't do that, but using base_name works just fine here.
1777 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
1779 2003-07-24 Paul Eggert <eggert@twinsun.com>
1781 Fix some POSIX-compliance problems with 'test'. This makes
1782 'test' more compatible with Bash.
1784 * NEWS, doc/coreutils.texi: Document the following.
1785 * src/test.c: Include exitfail.h.
1786 (TEST_FAILURE): New constant, used for exit status if 'test' fails.
1787 (test-syntax_error): Use it.
1788 (binary_operator): Now takes bool arg specifying whether left operand
1789 is -l ARG, so that caller determines this rather than us.
1791 (term): Use posixtest to evaluate parenthesized subexpressions.
1792 (unary_operator, one_argument): Remove support for -t without operand.
1793 (one_argument): Take argument from argv[pos].
1794 (one_argument, two_arguments, three_arguments): Advance pos.
1795 All callers changed.
1796 (three_arguments): Look for binary ops before "!". Then look
1797 for parenthesized one_argument expressions, instead of trusting
1798 expr () to do the right thing.
1799 (posixtest): Now takes number of args. All callers changed.
1800 Treat "( A B )" like "A B".
1801 (main): Set exit_failure to TEST_FAILURE. Don't depend on
1802 POSIXLY_CORRECT, as we now conform to POSIX by default.
1803 (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
1804 * tests/test/Test.pm (test_vector): Add several tests to check
1805 the above. Syntax errors now exit with status 2, not 1.
1806 * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
1808 2003-07-26 Jim Meyering <jim@meyering.net>
1810 * tests/help-version: Adjust for above change in test behavior:
1811 `[' exits with 2, not 1, and test doesn't accept --help or --version.
1813 * Makefile.maint (ME): Don't use trick suggested in Make manual.
1814 It doesn't work for make-3.79.1. Reported by Christian Krackowizer.
1816 * Makefile.maint (sc_system_h_headers): Another syntax check.
1817 (syntax-check-rules): Add it to the list.
1819 * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
1820 so it matches `%ld' format even on 32-bit systems.
1822 * src/fmt.c (flush_paragraph): Cast field width to `int' to
1823 avoid warning on 64-bit systems.
1825 * src/ls.c (sort_files): Make `func' volatile, so it can't be
1826 clobbered by a `longjmp' into this function.
1828 2003-07-25 Jim Meyering <jim@meyering.net>
1830 * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
1833 * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
1834 because it'd evoke spurious failure on 64-bit systems.
1836 2003-07-24 Jim Meyering <jim@meyering.net>
1838 * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
1839 output its current record counts. Reported by Jurriaan.
1841 * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
1842 `wc' with no options. This goes along with the change of 2003-07-20.
1844 2003-07-23 Jim Meyering <jim@meyering.net>
1846 Don't include headers already included by system.h:
1847 * src/tr.c: Don't include errno.h.
1848 * src/true.c: Don't include version-etc.h.
1849 * src/test.c: Don't include limits.h or error.h.
1850 * src/stat.c: Don't include unistd.h or time.h.
1851 * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
1852 * src/pr.c: Don't include time.h.
1853 * src/pathchk.c: Don't include errno.h.
1854 * src/nice.c: Don't include sys/time.h.
1855 * src/ls.c: Don't include stdlib.h.
1857 * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
1858 * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
1859 * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
1860 * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
1861 * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
1862 * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
1863 * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
1864 * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
1865 Don't include closeout.h.
1867 * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
1868 can access the required version of rm.
1869 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
1871 * tests/cut/Test.pm (out-delim3a): New test.
1873 * man/help2man: Update to version 1.33.
1875 * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
1877 * src/dircolors.c: Include xstrndup.h.
1878 (xstrndup): Remove function, now that it's been factored out into
1881 2003-07-22 Paul Eggert <eggert@twinsun.com>
1883 * src/wc.c (wc): Fix typo in computation of file from file_x,
1884 which caused the former to be used uninitialized if file_x was
1887 2003-07-22 Jim Meyering <jim@meyering.net>
1889 * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
1891 * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
1892 help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by
1893 Thomas Luzat. See http://bugs.debian.org/202413 for details.
1895 * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
1897 * src/hostid.c: Don't include <unistd.h>. system.h already does that.
1899 * src/cut.c (set_fields): Mark all selected indices before trying to
1900 determine range endpoints.
1901 * tests/cut/Test.pm: New test for the above fix.
1903 Begin to address this comment: What if someone wants to
1904 extract the 1,000,000-th field of some huge input file?
1905 The first step is to rearrange things so that the values
1906 in the printable_field array are all 0/1 rather than 0/1/2.
1907 * src/cut.c (RANGE_START_SENTINEL): Remove.
1908 Store range-start indices in a hash table, rather than
1909 overloading the `printable_field' array.
1910 (range_start_ht): New global.
1911 (hash_int, hash_compare_ints, is_range_start_index): New functions.
1912 (print_kth): Use is_range_start_index; don't test printable_field.
1913 (set_fields): Detect overflow.
1914 (set_fields): Insert each range-start index into range_start_ht.
1915 (main): Call set_fields only once, and only after
1916 output_delimiter_specified and (if required) range_start_ht have
1919 2003-07-20 Paul Eggert <eggert@twinsun.com>
1921 * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
1922 invoked with a null pointer when there were no file arguments.
1924 2003-07-20 Jim Meyering <jim@meyering.net>
1926 * Makefile.maint (sc_changelog): Add another nit-picky check.
1928 * src/wc.c (write_counts): Add a comment.
1929 (wc): Rename `file' parameter.
1930 Set new local, `file', to be the file name, or (when it's NULL)
1931 _("standard output") so that all uses of `file' use the proper value.
1932 Use STREQ, not strcmp.
1934 2003-07-20 Paul Eggert <eggert@twinsun.com>
1936 wc count field widths now are heuristically adjusted depending
1937 on the input size, if known. If only one count is printed, it
1938 is guaranteed to be printed without leading spaces.
1940 Previously, wc did not align the count fields if
1941 POSIXLY_CORRECT was set, but POSIX did not actually require
1942 this undesirable behavior, so it has been removed.
1944 * NEWS: Document this.
1945 * doc/coreutils.texi (wc invocation): Likewise.
1947 * src/wc.c (number_width): New var.
1948 (posixly_correct): Remove.
1949 (struct fstatus): New struct.
1950 (write_counts): Output fields of width number_width.
1951 Do not worry about POSIXLY_CORRECT.
1952 Use null file, not empty-string file, to denote stdin,
1953 since "" is a valid file name on some hosts.
1954 (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
1956 (wc): Avoid problems if end_pos - current_pos overflows.
1957 Do not print odd message if stdin has a read error.
1958 (get_input_fstatus, compute_number_width): New functions.
1959 (main): Use them to implement the new behavior.
1960 Ignore POSIXLY_CORRECT.
1962 * tests/wc/Test.pm: Adjust to the new output widths.
1964 2003-07-19 Jim Meyering <jim@meyering.net>
1966 * tests/rm/fail-eperm: Don't create temporary directory --
1969 * tests/shred/remove: Don't open-code test for UID != 0.
1970 Use priv-check's require-non-root instead.
1971 Update to use newer framework.
1973 * tests/help-version (expected_failure_status_expr): Record that
1974 expr exits with status of 3 for e.g., a write error.
1976 * tests/priv-check: Use `id -u' to see if we're running as root,
1977 rather than trying go write to an write-protected file.
1978 When running as root, ensure $NON_ROOT_USERNAME is valid.
1979 When running as root with `require-non-root', ensure that `.'
1980 is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
1981 to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test.
1983 * src/printenv.c: Include "exitfail.h".
1984 (main): Set exit_failure rather than calling close_stdout_set_status.
1985 * src/date.c: Likewise.
1986 * src/sort.c: Likewise.
1987 * src/tty.c: Likewise.
1989 2003-07-18 Jim Meyering <jim@meyering.net>
1991 * tests/touch/not-owner: Update to use newer framework.
1993 * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
1994 directory, and remove Perl-coded `you may not run as root' test.
1995 * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
1996 hard-coding something not quite equivalent.
1997 Paul Jarc reported the inconsistent diagnostics.
1999 * src/sort.c (main): Use close_stdout via atexit.
2000 Now `sort --version' and `sort --help' fail, as they should
2001 when their output is redirected to /dev/full.
2003 * src/su.c (usage): Don't call close_stdout here.
2004 (main): Use close_stdout via atexit.
2005 Now `su --version > /dev/full' fails, as it should.
2006 Somehow, the change of 2000-05-07 that purports to fix this
2009 * tests/help-version (--help/--version vs. /dev/full): Special-case
2010 `[' to protect it from expected_failure_status-`eval'.
2012 * src/uniq.c (writeline): Use a SPACE, not a TAB between the
2013 count and the corresponding line, as required by POSIX.
2014 Reported by Clement Wang.
2015 * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
2017 * tests/expr/basic: Add tests for when exit status is 2.
2019 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
2020 Use an anonymous `enum', rather than #define.
2022 2003-07-17 Paul Eggert <eggert@twinsun.com>
2024 * src/expr.c: Include "exitfail.h", "quotearg.h".
2025 (EXPR_INVALID, EXPR_ERROR): New constants.
2026 (nomoreargs, null, toarith, nextarg): Return bool, not int.
2027 (syntax_error): New function, exiting with status 2. Use it
2028 insteading of printing "syntax error" ourselves.
2029 (main): Initialize exit_failure to EXPR_ERROR.
2030 Exit with EXPR_INVALID on syntax error (too few arguments).
2031 (nextarg): Use strcmp, not strcoll; strcoll might return
2032 an undesirable 0, or might fail.
2033 (docolon, eval4, eval3): Exit with status 3 on invalid argument type
2034 or other such error.
2035 (eval2): Report an error if strcoll fails in a string comparison.
2036 * src/sort.c: Include "exitfail.h".
2037 (main): Set exit_failure, not xalloc_exit_failure and
2038 xmemcoll_exit_failure.
2039 * tests/expr/basic: Invalid value exits with status 3, not 2.
2041 2003-07-16 Jim Meyering <jim@meyering.net>
2043 * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
2044 per GNU maintainer guidelines. The next non-beta release will be 5.1.
2046 This script would have caught at least two recent bugs:
2047 those in [ and kill.
2048 * tests/help-version: Revive this script.
2049 It wasn't doing anything useful, since $all_programs wasn't being
2050 defined by the invoking Makefile.am.
2051 Reflect that nohup is no longer a script, so don't exclude it.
2052 Add framework to handle the programs added since it was last run:
2053 kill, stat, unlink, [, link, readlink.
2054 Fix path-related problems deriving from the move of this script
2055 from src/ to its present location.
2056 * tests/Makefile.am (all_programs): Define.
2057 (TESTS_ENVIRONMENT): Use it.
2059 * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
2060 whereby kill would always attempt to operate on argv[0] and fail.
2062 * src/test.c (integer_expected_error): Improve diagnostic -- now,
2063 it also matches the one from bash's builtin test.
2064 (binary_operator): Add \n at end of diagnostic.
2066 * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ...
2067 * tests/priv-check: Move setuidgid-related and
2068 NON_ROOT_USERNAME-checking code to this file.
2070 * README: Update section on testing as `root'.
2071 Suggestion from Paul Jarc.
2073 * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
2074 names of authors that I just found in bash's builtins/test.def.
2076 Running `[' with no arguments would evoke a segfault.
2077 * src/test.c (main) [LBRACKET]: Move initialization of argv to
2078 precede potential use via test_syntax_error.
2080 * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
2081 warning from automake -Wall.
2083 2003-07-15 Jim Meyering <jim@meyering.net>
2087 * Makefile.maint (%.asc): Remove target first, so gpg doesn't
2090 * announce-gen (print_changelog_deltas): Relax tests for matching
2091 version-number line in NEWS.
2092 Change the .sig suffix to .asc here, too.
2094 2003-07-14 Jim Meyering <jim@meyering.net>
2096 * Makefile.maint (%.asc): Renamed from %.sig.
2097 Generate and use ascii-armored signatures.
2098 Use gpg's -o option.
2100 2003-07-13 Jim Meyering <jim@meyering.net>
2102 * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
2105 * Makefile.maint (syntax-check): Move each individual check into
2107 (syntax-check-rules): This is the list of syntax-check targets.
2108 (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
2109 (sc_cast_of_x_alloc_return_value, sc_space_tab):
2110 (sc_error_exit_success, sc_xalloc_h_in_src): New targets.
2112 2003-07-12 Jim Meyering <jim@meyering.net>
2114 * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
2115 traces of the nohup script.
2117 * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
2118 $(OPTIONAL_BIN_ZCRIPTS).
2120 * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
2121 target, not before the `>'.
2123 * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
2124 now that that function no longer calls `error'.
2126 * src/df.c (find_mount_point): Emit a diagnostic for each
2127 failed syscall, rather than relying on caller to do that.
2128 The caller couldn't do a good job, anyhow -- too many different
2129 ways to fail (each with a different referent).
2130 Give a diagnostic upon failed save_cwd, now that that function
2131 no longer calls `error'.
2132 (show_point): Don't diagnose find_mount_point's errors, now that
2133 it handles them itself.
2135 * src/df.c (find_mount_point): Don't let free clobber errno upon
2138 * src/sys2.h: Remove alloca-related block.
2139 * src/system.h: Include <alloca.h> here, instead.
2141 It appears that the `#pragma alloca' included via "system.h" is
2142 adequate, since join.c uses alloca, yet lacked an in-file #pragma.
2143 * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
2144 * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
2146 * src/chown-core.c (change_file_owner): Do not restore any special
2147 permission bits (e.g., set-user-ID, set-group-ID) that are reset
2148 by chown(2) on some systems. Suggestion and insistence :-) from
2151 * tests/input-tty: Also check `test -t 1'.
2152 This is necessary on linux-2.4.21. Otherwise, the stty/basic-1
2153 test would block when run in the background.
2155 2003-07-11 Jim Meyering <jim@meyering.net>
2157 * tests/sample-test: Also fail if cat-to-create-expected-output
2158 fails. Otherwise, if both `exp' and `out' were to end up empty
2159 because of e.g., a full disk, they would mistakenly compare equal.
2161 * src/nohup.c: New file. Rewrite of nohup.sh in C.
2162 This solves a portability problem: on at least Solaris systems,
2163 when nohup.sh used the vendor /bin/sh, it would exit with status
2164 of `1' rather than the required 126 or 127 upon failure to exec
2165 the specified program.
2167 * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
2168 (bin_PROGRAMS): Add nohup.
2169 (EXTRA_DIST): Remove nohup.sh.
2170 (all_programs): Remove use of $(EXTRA_SCRIPTS).
2171 * src/nohup.sh: Remove file.
2172 * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
2174 * tests/misc/nohup: Tests for the above.
2175 * tests/misc/Makefile.am (TESTS): Add nohup.
2177 * src/head.c (diagnose_copy_fd_failure): New function, renamed from
2178 the macro, COPY_FD_DIAGNOSE.
2179 (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
2180 (head_file): Likewise.
2182 * src/date.c: Include "quote.h".
2183 (batch_convert): Use the quote function rather than using literal `...'
2186 * src/setuidgid.c (main): Enclose diagnostic in _(...).
2187 * src/fmt.c (main): Likewise.
2188 * src/mknod.c (main): Likewise.
2189 * src/tac.c (tac_seekable): Likewise.
2190 * src/yes.c (main): Likewise.
2191 * src/od.c (main): Likewise.
2192 * src/install.c (change_attributes): Likewise.
2194 2003-07-10 Jim Meyering <jim@meyering.net>
2196 * src/head.c (usage): Use 1024*1024 in place of 1048576.
2197 * src/tail.c (usage): Likewise.
2199 * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
2200 place of the kludge in this test. Suggestion from Paul Jarc.
2202 * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
2203 * src/setuidgid.c: New program, solely for testing (not installed).
2205 * src/chown-core.c (change_file_owner): Don't leak file descriptors
2206 when dereferencing symlinks.
2208 2003-07-09 Jim Meyering <jim@meyering.net>
2210 * tests/du/slash: New file/test for today's lib/ftw.c fix.
2211 * tests/du/Makefile.am (TESTS): Add slash
2213 * src/tail.c (xlseek): Avoid warning about ``return without value
2214 from function returning non-void''.
2216 2003-07-08 Jim Meyering <jim@meyering.net>
2218 * man/help2man: Update to version 1.29.
2220 * man/help2man: Add END handler to close STDOUT and check for errors.
2222 2003-06-30 Paul Eggert <eggert@twinsun.com>
2224 Add support for a "[" that conforms to the GNU coding standards,
2225 i.e., that does not depend on its name.
2226 * src/lbracket.c: New file.
2228 * man/Makefile.am (programs): Ignore "[", since it doesn't have
2229 a separate man page.
2230 * src/Makefile.am (bin_PROGRAMS): Add "[".
2231 (__SOURCES): New var.
2232 * src/test.c (LBRACKET): Define to 0 if not defined.
2233 (main): Use LBRACKET rather than argv[0].
2235 * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
2236 Reported by Paul Jarc and Dan Jacobson.
2238 * src/test.c (main): Do not recognize --help or --version if
2239 POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
2240 Do not bother testing that margv[margc] is non-null.
2242 2003-07-04 Jim Meyering <jim@meyering.net>
2244 * src/who.c (print_line): Rewrite to use asprintf, in order to be
2245 able to avoid emitting trailing spaces. Reported by Dan Jacobson.
2247 * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
2248 option, and perform the +1600 invocations of head IFF the envvar
2249 RUN_EXPENSIVE_TESTS is set.
2251 2003-07-03 Jim Meyering <jim@meyering.net>
2253 * src/cp.c (do_copy): Give a better diagnostic when failing due
2254 to nonexistent destination directory. Reported by Dmitry Rutsky.
2255 See http://bugs.debian.org/199730 for details.
2257 2003-06-27 Jim Meyering <jim@meyering.net>
2259 split's --verbose option did nothing [broken in 4.5.10 and 5.0]
2260 * src/split.c (longopts): Use `1', not `0' as the value for
2261 for &verbose. Reported by Keith Thompson.
2263 Test for the above fix.
2264 * tests/misc/split-a: Also use --verbose and compare stderr
2265 output with what we'd expect.
2267 2003-06-20 Jim Meyering <jim@meyering.net>
2269 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2270 Use `error_t' (rather than int) as type for local `err'.
2271 From Alfred M. Szmidt.
2273 2003-06-19 Marcus Brinkmann <marcus@gnu.org>
2275 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2276 Fix author preservation code.
2278 2003-06-19 Jim Meyering <jim@meyering.net>
2280 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
2281 (do_link): Don't warn about hard link to symlink.
2283 2003-06-18 Jim Meyering <jim@meyering.net>
2285 * src/cut.c: Include "getdelim2.h", not "getstr.h".
2286 Reflect renaming: getstr -> getdelim2.
2288 * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
2289 readline -> readlinebuffer.
2291 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2293 * src/readlink.c: Include <sys/types.h> before system.h (because
2294 the latter includes <sys/stat.h>). Required on Ultrix 4.3.
2296 2003-06-17 Jim Meyering <jim@meyering.net>
2298 * src/system.h (initialize_main): Define.
2299 Use it in every `main'. Applied via this:
2300 p='initialize_main (&argc, &argv);'
2301 perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \
2302 $(grep -l program_name.=.argv.0 *.c)
2303 test.c uses margc/margv, so I made the change manually for that file.
2304 Based on a patch from Bernard Giroud.
2306 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2308 Fix for build failure on Ultrix 4.3.
2309 * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
2310 Include sys/param.h and sys/mount.h on ultrix.
2312 2003-06-16 Jim Meyering <jim@meyering.net>
2314 * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
2316 * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
2317 them here instead, but with one change: define EISDIR to -1, not 0.
2319 * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
2320 guaranteed to be defined.
2321 * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
2323 * README: Mention the CVS repository.
2324 Encourage addition of test cases.
2326 2003-06-12 Jim Meyering <jim@meyering.net>
2328 * src/touch.c (touch): Call close only if necessary.
2331 * src/wc.c (usage): Correct wording: wc prints counts in the order
2332 `newline, word, byte'. Reported by Keith M. Briggs.
2333 * man/wc.x: Fix it here, too. And change `lines' to `newlines'.
2335 2003-06-10 Jim Meyering <jim@meyering.net>
2337 * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
2339 2003-06-07 Jim Meyering <jim@meyering.net>
2341 * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
2344 2003-06-06 Jim Meyering <jim@meyering.net>
2346 * src/extract-magic (main): Avoid newer 3-arg form of open,
2347 so this script works also with e.g., perl5.005_03.
2348 Patch by John David Anglin.
2350 2003-06-04 Paul Eggert <eggert@twinsun.com>
2352 * src/system.h: Include <stdbool.h> unconditionally.
2354 2003-06-04 Jim Meyering <jim@meyering.net>
2356 * man/Makefile.am (check-programs-vs-x): Rename target
2357 from check-programs-vs-1. Adjust rule to check for the
2358 primary (.x) file, not the generated one (.1).
2360 2003-06-03 Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
2362 * man/kill.x: New file.
2363 * man/Makefile.am (dist_man_MANS): Add kill.1.
2366 2003-06-04 Jim Meyering <jim@meyering.net>
2368 Ensure that the .x file for a new program is never forgotten again.
2369 * man/Makefile.am (programs): Define.
2370 (check-programs-vs-1): New phony target.
2371 (check-local): Depend on it.
2373 2003-06-03 Jim Meyering <jim@meyering.net>
2375 Avoid unnecessary copying of environment.
2376 * src/env.c (main): Rather than clearing the environment and --
2377 unless told to ignore environment -- copying all settings from
2378 the saved, original environment, clear the environment only when
2379 that is requested. Suggested by Jens Elkner.
2381 2003-06-02 Jim Meyering <jim@meyering.net>
2383 * src/system.h: Always include <string.h>, since we assume C89.
2384 Include <limits.h> without checking for HAVE_LIMITS_H.
2386 * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
2387 (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
2389 2003-06-01 Jim Meyering <jim@meyering.net>
2391 Avoid a race condition in `tail -f' described by Ken Raeburn in
2392 http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
2393 * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
2394 (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
2395 (tail_bytes, tail_lines, tail): Likewise.
2396 (tail_file): Use the new `read_pos' value as the size,
2397 rather than stats.st_size from the fstat call.
2399 2003-05-28 Jim Meyering <jim@meyering.net>
2401 * src/extract-magic: Allow expansion of `$file' in the here-
2402 document corresponding to the comment at the top of fs.h.
2404 2003-05-26 Jim Meyering <jim@meyering.net>
2406 * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
2407 <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
2408 Use #if/#elif/... cascade so we get only one set of include files.
2409 Reported by Nelson Beebe.
2411 2003-05-24 Jim Meyering <jim@meyering.net>
2413 * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
2414 * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
2415 accept the BSD format.
2417 2003-03-28 Joe Orton <jorton@redhat.com>
2419 * src/md5sum.c (bsd_split_3): New function.
2420 (split_3): Detect checksums from BSD 'md5' command and handle them
2423 * tests/md5sum/basic-1: New tests for --check exit status, and for
2424 BSD-style checksum files.
2426 2003-05-21 Jim Meyering <jim@meyering.net>
2428 * src/head.c (elide_tail_lines_pipe): Fix a thinko.
2429 This sort of thing is why it'd be *Really Good* to factor
2430 out the common code used here and in tail.c.
2432 2003-05-14 Jim Meyering <jim@meyering.net>
2434 * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
2436 * tests/du/slink: Skip this test if `.' is on an XFS file system.
2438 * tests/du/fd-leak: New file. Test for the bug in du that
2439 was fixed by the 2003-05-12 change to lib/ftw.c.
2440 * tests/du/Makefile.am (TESTS): Add fd-leak.
2442 * src/head.c (AUTHORS): Enclose string in N_(...), now that it
2443 includes a translatable word, `and'.
2445 * src/dd.c (usage): Don't use `,' as the thousands separator
2446 in e.g. 1,000,000 and 1,048,576. Instead, do this:
2447 `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
2448 * src/df.c (usage): Likewise.
2449 * src/du.c (usage): Likewise.
2450 * src/ls.c (usage): Likewise.
2452 * Makefile.maint (syntax-check): Add another check.
2454 2003-05-13 Paul Eggert <eggert@twinsun.com>
2456 Fix uniq to conform to POSIX, which requires that "uniq -d -u"
2457 must output nothing. Problem reported by Josh Hyman.
2459 * src/uniq.c (enum output_mode, mode): Remove, replacing with:
2460 (output_unique, output_first_repeated, output_later_repeated):
2461 New vars. All uses of "mode" changed to use these variables,
2462 which are not mutually exclusive as "mode" was.
2463 (writeline): New arg "match", used to control whether to
2464 obey output_first_repeated or output_later_repeated.
2465 All callers changed.
2466 (check_file, main): Adjust to above changes.
2468 * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
2470 2003-05-14 Jim Meyering <jim@meyering.net>
2472 * tests/rm/rm3: Use tr's \n notation rather than \012.
2473 This package can afford to do that, since its tests are guaranteed use
2474 GNU tr, which has accepted the more modern notation for 10 years.
2475 * tests/rm/rm5: Likewise.
2476 * tests/cp/same-file: Likewise.
2477 * tests/stty/row-col-1: Likewise.
2478 * tests/stty/basic-1: Likewise.
2479 * tests/rm/deep-1: Likewise.
2480 * tests/mv/part-symlink: Likewise.
2481 * tests/mkdir/perm: Likewise.
2482 * tests/misc/nice: Likewise.
2484 2003-05-13 Jim Meyering <jim@meyering.net>
2486 * src/copy.c (struct F_triple) [name]: Remove const attribute.
2487 (triple_free): Don't apply cast to argument of free.
2488 (seen_file): Add cast here instead.
2490 * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
2491 (src_to_dest_free): Don't apply cast to argument of free.
2493 * src/sort.c (zaptemp): Don't apply cast to argument of free.
2494 * src/pr.c (init_fps, init_store_cols): Likewise.
2495 * src/join.c (delseq, freeline): Likewise.
2496 * src/expr.c (OLD): Likewise.
2497 * src/sort.c (sort): Likewise.
2498 * src/head.c (elide_tail_lines_pipe): Likewise.
2500 * src/tail.c: Include "quote.h".
2501 Use quote in diagnostics. Change many error format strings
2502 from just `%s' to e.g., `error reading %s'.
2503 (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
2504 Rewrite newline-counting loop to use memchr.
2506 * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
2507 Now that assert is no longer used, don't include <assert.h>.
2509 2003-05-12 Jim Meyering <jim@meyering.net>
2511 * src/head.c: Include <assert.h>.
2512 (AUTHORS): Add my name.
2513 (elide_tail_lines_pipe): New function.
2515 2003-05-10 Jim Meyering <jim@meyering.net>
2517 * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
2519 * src/readlink.c (main): Set program_name before first use.
2520 Remove that (redundant) first use.
2521 Don't exit successfully just because --verbose was specified.
2522 Pass 0, not EXIT_SUCCESS, as first argument to error; when that
2523 parameter is 0, error does not exit.
2525 * src/uname.c (main): When failing due to too many arguments, also say
2526 that, rather than just "Try `uname --help' for more information.".
2527 * src/comm.c (main): Likewise, but for too few arguments.
2528 * src/logname.c: Include error.h.
2529 (main): Say why we're failing.
2531 * src/uniq.c (main): Don't segfault when argc < optind.
2532 * src/who.c (main): Handle argc < optind.
2533 * src/df.c (main): Likewise.
2534 * src/install.c (main): Likewise.
2535 * src/mv.c (main): Likewise.
2536 * src/pwd.c (main): Likewise.
2537 * src/tty.c (main): Likewise.
2538 * src/chroot.c (main): Likewise.
2539 * src/hostname.c: Likewise.
2540 * src/du.c (main): Likewise.
2541 * src/expand.c (main): Likewise.
2542 * src/env.c (main): Likewise.
2543 * src/unexpand.c (main): Likewise.
2544 * src/printenv.c (main): Likewise.
2545 * src/sync.c (main): Handle argc == 0.
2546 * src/expr.c (main): Likewise.
2547 * src/printf.c (main): Likewise.
2548 * src/basename.c (main): Likewise.
2549 * src/ln.c (main): Test for `missing argument' before computing n_files.
2550 * src/tail.c (main): Test for the case of no arguments before
2553 * src/kill.c (send_signals): Don't check command line arguments here.
2554 (main): Check them here instead. Handle argc < optind.
2556 * src/logname.c (main): Use error, rather than fprintf, for the sake
2559 * src/rm.c (main): Don't overrun array bound if argc is 0.
2561 2003-05-09 Jim Meyering <jim@meyering.net>
2563 * src/sort.c (main): Don't overrun array bound if argc is 0.
2564 That would happen when invoked via: execl ("/usr/bin/sort", NULL);
2565 Reported by Wartan Hachaturow.
2567 2003-05-07 Jim Meyering <jim@meyering.net>
2569 Implement support so that `head --lines=-N' works on seekable files.
2570 * src/head.c (enum Copy_fd_status): Define.
2571 (COPY_FD_DIAGNOSE): New macro.
2572 (elide_tail_lines_seekable): New funtion.
2573 (elide_tail_lines_file): Call it here.
2575 2003-05-06 Jim Meyering <jim@meyering.net>
2577 * src/sys2.h (CHAR_BIT): Remove duplicate definition.
2579 2003-05-04 Jim Meyering <jim@meyering.net>
2581 * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
2582 caused the addition of thousands of small files to the tar archive.
2583 * tests/misc/head-elide-tail: New file. Add them here instead.
2584 * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
2586 2003-05-04 Paul Eggert <eggert@twinsun.com>
2588 * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
2589 (IF_READDIR_NEEDS_REWINDDIR): Remove.
2590 (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
2591 which was a bit weird because it couldn't be emulated by a function.
2593 2003-05-03 Jim Meyering <jim@meyering.net>
2595 Extend head to accept --lines=-N (--bytes=-N) and to print all
2596 but the N lines (bytes) at the end of the file.
2597 * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
2598 Use quote() in diagnostics, rather than literal `' marks.
2599 (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
2601 (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
2602 (head_file): Reorganize so as to call head from only one place.
2603 (main): Likewise, for head_file.
2604 Handle new, undocumented option, --presume-input-pipe.
2605 Handle negative line and byte counts.
2606 * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
2608 * tests/du/8gb: Skip test if the file system of `.' doesn't support
2609 sparse files -- otherwise it'd create a file of size 8GB.
2611 2003-05-02 Jim Meyering <jim@meyering.net>
2613 * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
2614 Instead explain about `-' and standard input.
2615 (main): Give a proper diagnostic for e.g., `fmt -c -72'.
2616 Reported by Keith Thompson.
2617 * tests/fmt/basic: Add test for the above fix.
2619 * src/fmt.c: Include "quote.h".
2620 Use quote() in diagnostics, rather than literal `' marks.
2621 (main): Exit nonzero when unable to open an input file.
2622 * tests/fmt/basic: Add test for the above fix.
2624 * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
2625 specifications like `-72x'.
2626 * tests/fmt/basic: Add test for the above fix.
2628 Work around nasty readdir bug on Darwin6.5.
2629 * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
2630 [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
2631 returned NULL and there has been at least one successful unlink or
2632 rmdir call since the opendir or previous rewinddir, then call
2633 rewinddir and reiterate the loop.
2635 Factor out common code.
2636 * src/remove.c (readdir_ignoring_dotdirs): New function.
2637 (is_empty_dir): Use it here.
2638 (remove_cwd_entries): Use it here.
2640 2003-05-01 Jim Meyering <jim@meyering.net>
2642 * tests/rm/r-3: Create 500 rather than just 300 files.
2643 There's a bug in Darwin6.5's readdir that shows up only with
2645 Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
2649 Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
2650 (dump_remainder): Move two declarations `down' into the scope
2651 where they are used.
2652 (xlseek): Return the resulting offset.
2653 (file_lines): Rename parameter, file_length, to end_pos.
2654 (pipe_lines): Don't coerce safe_read return value to `int'.
2655 Adapt tests accordingly.
2656 (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
2658 Change type of `total_bytes' from `int' to `size_t',
2659 since the former wouldn't always be wide enough.
2660 Don't coerce safe_read return value to `int',
2661 and adapt tests accordingly.
2662 Now that testing for a read error no longer involves
2663 using `tmp', handle that case *after* freeing `tmp'.
2664 (start_bytes): Clean up.
2665 (tail_bytes): Now that `n_bytes' may be larger than
2666 OFF_T_MAX, test for that condition and, if it's true, don't
2667 use lseek optimizations.
2668 (parse_options): Don't fail just because N_UNITS is larger than
2669 the maximum size of a file -- tail may be applied to an input
2670 stream (e.g., a pipe) with more data than that.
2672 * Makefile.maint (syntax-check): Rename from alloc-check.
2673 Also check for SPACE-TAB sequences.
2674 Also check for malloc/calloc/realloc casts.
2676 2003-05-01 Jim Meyering <jim@meyering.net>
2678 * src/tail.c (start_lines): Rewrite to use memchr. Clean up.
2680 2003-04-28 Jim Meyering <jim@meyering.net>
2682 * tests/misc/tty-eof: Send two tokens, not just one, so we don't
2683 make the now-more-picky tsort fail.
2685 2003-04-24 Jim Meyering <jim@meyering.net>
2687 * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
2688 (main): Minor syntactic clean-up.
2690 * src/tsort.c (tsort): Fail if the input contains an odd number of
2691 tokens. Reported by junkio@cox.net.
2693 * tests/tsort/basic-1: Test for the above fix.
2695 2003-04-21 Jim Meyering <jim@meyering.net>
2697 * tests/misc/printf: Add tests for the printf fixes below.
2699 * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
2701 2003-04-20 Paul Eggert <eggert@twinsun.com>
2703 Fix printf POSIX compatibility bug reported by Ben Harris in
2704 <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
2705 * doc/coreutils.texi (printf invocation): It's \NNN in the format,
2706 \0NNN in the %b operand.
2707 * src/printf.c (usage): Likewise.
2708 (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
2709 is desired. All uses changed. Behave like Bash printf if %b
2710 operand uses \NNN where the initial N is not 0.
2712 2003-04-17 Jim Meyering <jim@meyering.net>
2714 * src/stty.c: Remove uses of PROTOTYPE macro.
2716 2003-04-15 Jim Meyering <jim@meyering.net>
2718 * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
2719 each sequence of spaces before a TAB character.
2721 2003-04-13 Jim Meyering <jim@meyering.net>
2723 * src/remove.c (is_empty_dir): Don't closedir (NULL).
2725 2003-04-12 Jim Meyering <jim@meyering.net>
2727 Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
2728 --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
2729 FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
2730 * src/nl.c (main): Fix those problems and remove literal quote marks
2731 (e.g., "`%s'") from format string; instead use "%s" in each format
2732 string and `quote (optarg)' as the corresponding argument.
2733 Also, diagnose all invalid command line options before failing.
2735 * src/nl.c (proc_text): Fix a bug that would make nl output extra
2736 newlines in some cases. Details here: http://bugs.debian.org/177256.
2737 This bug was introduced on 2001-11-10 for textutils-2.0.17.
2738 * tests/misc/nl: Add test for the above-fixed bug.
2740 * tests/misc/readlink: New file. Test the --canonicalize option.
2741 * tests/misc/Makefile.am (TESTS): Add readlink.
2743 2003-04-11 Jim Meyering <jim@meyering.net>
2746 * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
2747 * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
2748 * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
2749 retain alignment) each sequence of spaces before a TAB character.
2751 * src/ls.c: Include <stdlib.h> unconditionally.
2753 * Makefile.maint (xalloc-check): Rename from header-check.
2755 * src/yes.c: Include error.h after system.h, not before.
2758 * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
2759 * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
2760 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
2761 * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
2762 * src/tr.c: * src/unexpand.c, src/users.c:
2763 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
2764 return values and of xrealloc's first argument.
2765 Fix the former with this:
2766 perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
2768 2003-04-10 Jim Meyering <jim@meyering.net>
2770 * src/stty.c (wrapf): Declare with format attribute.
2772 The S_MAGIC_... names shouldn't be maintained in two places (prior
2773 to this change, one would have to keep stat.c and fs.h in sync).
2774 This change makes it so those names and the corresponding
2775 hexadecimal constants all reside in stat.c. fs.h is now generated.
2776 * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
2777 (BUILT_SOURCES): Add fs.h, now that it's generated.
2778 (EXTRA_DIST): Add extract-magic.
2779 * src/extract-magic: New script to extract fs.h definitions from stat.c.
2780 * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
2781 fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
2783 * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
2784 file with nominal length > 4GB fails. Reported by Michael Deutschmann.
2786 * man/unexpand.x: Add `SEE ALSO' reference to expand.
2787 * man/expand.x: Add `SEE ALSO' reference to unexpand.
2788 Suggestion from Dan Jacobson.
2790 2003-04-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
2792 * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
2793 * src/stat.c (human_fstype): Handle Linux's devpts.
2795 2003-04-09 Paul Eggert <eggert@twinsun.com>
2797 * src/split.c (line_bytes_split): Arg is of type size_t, since
2798 that's all that is supported for now.
2799 (main): Check for overflow in obsolescent line count option.
2801 2003-04-09 Jim Meyering <jim@meyering.net>
2803 * tests/misc/split-fail: Add a new test for the above fix.
2805 * src/split.c (bytes_split): Use size_t temporary (rather than
2806 uintmax_t original) in remaining computations. From Paul Eggert.
2808 Handle command line option arguments larger than 2^31.
2809 This allows e.g., splitting into files of size 2GB and larger,
2810 and running split --lines=N with N=2^31 or more.
2811 But for --line-bytes=N, the restriction that N <= SIZE_MAX
2812 remains (for now), due to the way it is implemented.
2814 * src/split.c: Include "inttostr.h".
2815 (bytes_split, lines_split, line_bytes_split, main):
2816 Use uintmax_t, not size_t, for file sizes.
2817 (main): Give a better diagnostic for option arguments == 0.
2818 Use umaxtostr to print file sizes.
2819 Reported by Luke Hassell.
2821 2003-04-08 Jim Meyering <jim@meyering.net>
2823 * src/rm.c (usage): Mention that --directory (-d) works only
2824 on some systems. Suggestion from Samuel Tardieu.
2826 * tests/basename/basic: Run $PERL to see if it is available,
2827 rather than testing its value.
2828 * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
2829 * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
2830 * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
2831 * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
2832 * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
2833 * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
2834 * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
2835 * tests/sum/basic-1, tests/seq/basic: Likewise.
2837 * tests/misc/Makefile.am (TESTS): Add split-fail.
2838 * tests/misc/split-fail: New file.
2840 * src/split.c: Rename local variables: nchars -> n_bytes.
2841 (lines_split): Rename local, nlines -> n_lines.
2842 (main): Rename local variable: s/accum/n_units/.
2843 (main): Use STDIN_FILENO, not literal `0'.
2845 2003-04-07 Jim Meyering <jim@meyering.net>
2847 * src/stat.c: Add #include directives for Ultrix 4.4.
2848 Based on a suggested change from Bert Deknuydt.
2850 2003-04-06 Jim Meyering <jim@meyering.net>
2852 * Makefile.maint (makefile-check): New rule.
2853 (local-check): Add it.
2855 2003-04-05 Jim Meyering <jim@meyering.net>
2857 * Makefile.am (nearly all of them):
2858 Use $(VAR) rather than @VAR@, now that we can rely on automake to
2859 emit a definition for each substituted variable.
2860 * tests/Makefile.am.in: Likewise.
2862 * tests/rm/rm5: Add a comment explaining why this test fails when
2863 using Tru64's broken sed.
2864 * tests/rm/rm3: Likewise.
2866 Make `kill -t' output signal descriptions (not `?') on Tru64.
2867 * src/kill.c (sys_siglist): Also check for __sys_siglist.
2868 Patch by Tony Leneis.
2869 * configure.ac: Also check for declaration of __sys_siglist.
2870 Required for Tru64 4.0D, 4.0F, and 5.1.
2871 Reported by Tony Leneis.
2873 2003-04-04 Jim Meyering <jim@meyering.net>
2875 * src/Makefile.am (PERL): Remove unnecessary definition.
2877 Because of inappropriate (but POSIX-mandated) behavior of rename,
2878 `mv a b' would not remove `a' in some unusual cases. Work around
2879 this by unlinking `a' when necessary.
2881 * src/copy.c (same_file_ok): Add an output parameter.
2882 Set it in the offending case.
2883 (copy_internal): When necessary, unlink SRC_PATH and inform caller.
2884 Reported by Ed Avis.
2885 * tests/mv/hard-4: New test for the above.
2886 * tests/mv/Makefile.am (TESTS): Add hard-4.
2888 Clean up rules for automatically generated sources:
2889 * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
2890 Make each generated file be read-only.
2891 Add each file name to BUILT_SOURCES separately.
2892 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
2894 Put LOCALEDIR macro definition in new file: localedir.h.
2895 * src/Makefile.am (DEFS): Remove definition.
2896 (localedir.h): New rule.
2897 (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
2898 * src/system.h: Include "localedir.h".
2900 2003-04-02 Jim Meyering <jim@meyering.net>
2904 * tests/misc/Makefile.am (TESTS): Add false.
2906 * Makefile.maint (TMPDIR): Make sure it's defined.
2907 (my-distcheck): Build in $(TMPDIR), not `.'.
2909 * src/Makefile.am (false.c): Change all occurrences of
2910 `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
2911 unsuccessfully also with --help. Reported by Paul Jarc,
2912 * tests/misc/false: New test for the above.
2914 2003-03-30 Jim Meyering <jim@meyering.net>
2916 * NEWS: Note the location of older NEWS files.
2918 * src/remove.c (is_empty_dir): Don't let a failing closedir
2919 clobber errno. Spotted by Arnold Robbins.
2921 * src/env.c: Fix typo in comment. From Arnold Robbins.
2923 2003-03-29 Jim Meyering <jim@meyering.net>
2927 * README: Note to expect build problems for stat.c on Ultrix 4.3.
2928 Note that there are some harmless test failures when running
2929 `make check' as root on some systems.
2931 2003-03-28 Jim Meyering <jim@meyering.net>
2933 * tests/stty/row-col-1: Skip this test if stty can't get window size.
2934 This happens when connecting to sparc-solaris5.7 via ssh from within
2935 emacs. Reported by Karl Berry.
2937 * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
2938 Otherwise, on systems (DJGPP) that emulate pipes using files,
2939 this test would never complete, waiting for `yes' to terminate.
2940 * tests/du/slink: As above, use seq, not `yes' to generate link target.
2941 * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
2942 Reported by Rich Dawe.
2944 2003-03-27 Jim Meyering <jim@meyering.net>
2946 * src/id.c: Remove Arnold Robbins' obsolete e-mail address
2947 from `written by...' comment, at his request.
2949 2003-03-24 Paul Eggert <eggert@twinsun.com>
2951 Fix buffer overrun problem reported by TAKAI Kousuke, along
2952 with some other POSIX incompatibilities.
2954 * src/printf.c (print_esc): Do not treat \x specially if
2955 POSIXLY_CORRECT. Avoid buffer overrun if the format ends
2956 in backslash. Treat incomplete escape sequences as strings
2957 of characters, as POSIX requires.
2958 (print_formatted): Allow multiple flags. Avoid buffer overrun
2959 if the format is incomplete.
2961 2003-03-24 Jim Meyering <jim@meyering.net>
2963 * tests/misc/printf: Add tests for the above fixes and changes.
2965 2003-03-26 Jim Meyering <jim@meyering.net>
2967 * src/copy.h (struct cp_options): Add a comment.
2969 2003-03-23 Jim Meyering <jim@meyering.net>
2971 * README: Describe problem with 64-bit mode on HPUX 11.x,
2972 with patch for /usr/include/inttypes.h.
2973 * TODO: Plan to add an autoconf test to work around the bug.
2975 2003-03-22 Jim Meyering <jim@meyering.net>
2977 * src/stat.c: Don't include <sys/sysmacros.h>.
2978 That is already done via system.h. Otherwise, the multiple
2979 inclusion would evoke redefinition warnings from Cray's /bin/cc,
2980 aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28.
2981 (human_fstype): Factor some directives `up', out of this function.
2982 Cast away `const' to avoid error from Cray's /bin/cc.
2984 2003-03-20 Jim Meyering <jim@meyering.net>
2986 * announce-gen (print_changelog_deltas): Ensure that a newline
2987 precedes each row of `*'s.
2989 2003-03-20 Jim Meyering <jim@meyering.net>
2993 * src/seq.c (valid_format): Also accept ` ' and `'' as valid
2994 format flag characters.
2995 Do not require that a field width be specified.
2996 Do not fail when given a field width of `0'.
2997 Reported by Dan Jacobson.
2998 * tests/seq/basic: Add new tests for the above-fixed bug.
3000 * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
3001 (install-root): Likewise.
3002 (install-exec-local): Likewise.
3003 Based on a patch from Richard Dawe.
3005 2003-03-19 Jim Meyering <jim@meyering.net>
3007 * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
3008 because the DJGPP 2.03 port of 'ln -s' doesn't work.
3009 Include $(EXEEXT) in program names.
3010 Since $(LN_S) may degenerate to `cp -p', be careful
3011 to invoke it from the destination directory.
3012 Mostly from Richard Dawe.
3013 * configure.ac: Use AC_PROG_LN_S.
3015 * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the
3016 CDPATH shell variable set could cause this test to fail.
3017 Reported by Karl Berry.
3019 2003-03-18 Jim Meyering <jim@meyering.net>
3021 * src/fmt.c [struct Word] (paren, period, punct, final): Change the
3022 type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
3023 AIX 5.1's xlc could not compile the former.
3024 Patch by Petter Reinholdtsen. Also reported by Mike Jetzer.
3026 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
3028 * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
3029 program names, since automake only adds $(EXEEXT) to programs
3032 2003-03-16 Jim Meyering <jim@meyering.net>
3034 * src/remove.c (rm): Put two local variables in static storage,
3035 so they can't be clobbered by the potential longjmp.
3037 2003-03-15 Jim Meyering <jim@meyering.net>
3039 * Makefile.cfg (gnu_rel_host): Fix code to match the comment
3040 so that a version number with a two-digit component can still count
3041 as an alpha release. Reported by Richard A Downing.
3042 (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
3044 2003-03-14 Jim Meyering <jim@meyering.net>
3046 * src/ansi2knr.c: Remove no-longer-used file.
3047 * src/ansi2knr.1: Likewise.
3049 * Makefile.maint (prev_version_file): Don't use ?= for this particular
3050 assignment, since it causes trouble with old versions of GNU make
3051 (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here.
3052 http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
3053 Patch from Alexandre Duret-Lutz.
3055 * Use patched automake-1.7.3. Regenerate Makefile.in files in
3056 subdirectories so that each includes a definition of ACLOCAL_M4.
3058 * announce-gen (main): Label the compressed source URLs.
3062 * tests/du/slink: Relax the test for the `local'ness of a file system,
3063 so that now it works also for tmpfs.
3065 * tests/du/hard-link: Transform output from first du, so that this
3066 test doesn't fail on file systems like tmpfs that order directory
3067 entries differently.
3069 2003-03-13 Jim Meyering <jim@meyering.net>
3071 * tests/du/8gb: Work around what appears to be an NFS failure that
3072 would make this test fail on some systems.
3074 2003-03-11 Jim Meyering <jim@meyering.net>
3076 * tests/du/basic: Make the test file exactly 4k bytes long.
3078 * src/split.c (longopts): Don't hard-code `2' here.
3079 Instead, just specify `&verbose', and ...
3080 (main): ... remove the `case 2:' block for --verbose.
3082 * tests/du/basic: Make the test file larger than 64 bytes, so that
3083 we don't immediately disqualify file systems (e.g., NetApp) on which
3084 smaller files take up zero disk blocks. Reported by Vin Shelton.
3086 2003-03-10 Jim Meyering <jim@meyering.net>
3088 Don't segfault for a negative field width or precision in format string.
3089 Note that this is just a stopgap fix. The longer term solution may
3090 involve adapting bash's builtins/printf.def.
3092 * src/printf.c: (UNSPECIFIED): Define.
3093 (print_direc): Use the special value, UNSPECIFIED, to indicate
3094 that field_width or precision has not been specified.
3095 (print_formatted): Fail if field_width or precision is the
3096 special value, UNSPECIFIED.
3097 Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
3099 * src/sys2.h (INT_MIN): Define, if necessary.
3100 * tests/misc/printf: Add a test for the above-fixed bug.
3102 2003-03-09 Jim Meyering <jim@meyering.net>
3104 * src/remove.c (AD_stack_pop): Cast sizeof... to int before
3105 changing its sign. This avoids a warning from gcc on 64-bit systems.
3106 Reported by Bob Proulx.
3107 (pop_dir): Reverse order of sign change and cast, to be consistent
3110 2003-03-08 Jim Meyering <jim@meyering.net>
3112 * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
3113 shell variable, but only in the environment. With /bin/sh->bash, the
3114 shell variable is set to `y', and that would cause a spurious warning.
3115 Reported by Bob Proulx.
3117 * tests/Makefile.am (check-root): Remove touch/fifo.
3118 It doesn't appear to have to be run as root.
3120 * tests/rm/fail-2eperm: Rather than simply using the first non-root
3121 user name, make sure that the selected user name has a usable shell.
3122 Reported by Paul Jarc.
3124 Before, when using shred on a device, one had to specify --exact,
3125 or be careful to choose a size that would not be rounded up and
3126 exceed the maximum value; that could result in a failure of
3128 * src/shred.c (do_wipefd): --exact is now the default for non-regular
3129 files. Suggestion from Ben Elliston.
3132 * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
3133 Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
3134 Patch by Bob Proulx.
3136 * src/Makefile.am (check-misc): Check for use of `defined' in
3138 Change to $(srcdir) before running grep.
3140 * src/sleep.c: Remove now-unused #include and #define directives.
3142 * src/du.c (process_file): If a file's size is not being counted
3143 e.g., because it's a hard link to a file we've already counted,
3144 then don't print a line for it.
3146 * tests/du/hard-link: New test for the above-fixed bug.
3147 * tests/du/Makefile.am (TESTS): Add hard-link.
3150 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
3151 and make the two-array approach work.
3153 * tests/du/basic: Correct/add tests for the above fix.
3154 Set LC_ALL, etc., now that we use sort.
3155 Check the block/size of a small file, too.
3156 Correct expected results for simple dir1/dir2/file case.
3157 Add another test of du -S.
3159 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
3161 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
3162 middle-end/9986). As one of GCC's optimizations, it transforms a
3163 fputs_unlocked call to a fputc_unlocked call when the string is
3164 one character long. However, hpux doesn't have fputc_unlocked.
3166 * expr.c (usage): Use putchar, not fputs, to output a single character.
3167 * ls.c (dired_dump_obstack): Likewise.
3168 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
3169 * stat.c (print_it): Likewise.
3171 2003-03-07 Jim Meyering <jim@meyering.net>
3173 * src/cp.c: Remove everything associated with mmap-stack.c.
3174 This reverts the two changes of 2003-02-21.
3175 * src/du.c: Remove everything associated with mmap-stack.c.
3176 This reverts the change of 2003-02-19.
3178 2003-03-06 Jim Meyering <jim@meyering.net>
3180 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
3181 CDPATH shell variable set could cause this test to fail.
3182 Reported by Karl Berry.
3184 2003-03-05 Jim Meyering <jim@meyering.net>
3188 * src/printf.c (print_esc): Remove pointless comparison of unsigned
3189 integer with zero, to avoid a warning from Intel's ecc.
3190 Reported by Nelson Beebe.
3192 * src/du.c (process_file): Sizes must all be of type uintmax_t.
3193 Otherwise, for files or totals that are too big, numbers would
3194 be truncated. Patch mostly by Michael Stone.
3195 Reported by Ingo Saitz as Debian bug #183210.
3197 * tests/du/8gb: New test for the above-fixed bug.
3198 * tests/du/Makefile.am (TESTS): Add 8gb.
3200 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
3201 rather than UTILS_OPEN_MAX - 10.
3203 2003-03-04 Jim Meyering <jim@meyering.net>
3205 * README: Refer new feature discussion to bug-coreutils@gnu.org,
3206 rather than bug-gnu-utils, now that the former is better known.
3207 Suggestion from Göran Uddeborg.
3209 * src/stat.c (usage): Capitalize consistently.
3210 Reported by Göran Uddeborg.
3212 * Makefile.maint (rel-files): Include $(signatures), so that
3213 those files are also copied into $(release_archive_dir).
3215 * src/df.c (find_mount_point): Call error here, now that restore_cwd
3217 * src/remove.c (AD_pop_and_chdir): Likewise.
3219 * tests/Makefile.am (check-root): Add fail-2eperm.
3221 2003-03-03 Jim Meyering <jim@meyering.net>
3223 * src/remove.c (remove_cwd_entries): Include the full filename of
3224 the offending file, not just the basename.
3226 * tests/misc/tty-eof: Set $ME properly.
3228 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
3229 Remove now-unused variables.
3230 (tag-prev-version, prev-cvs-tag): Likewise.
3232 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
3233 accurate diagnostic when failing to remove a file owned by some other
3234 user. Reported by Ivo Timmermans via Michael Stone.
3235 This fixes Debian bug# 178471.
3237 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
3238 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
3239 Based on a report from Ivo Timmermans.
3241 2003-03-02 Jim Meyering <jim@meyering.net>
3243 * src/copy.c (copy_internal) [un_backup]: When recovering from a
3244 failure to create a hard link, do not remove the entry associating
3245 the source dev/ino with the destination file name.
3246 * tests/mv/Makefile.am (TESTS): Add hard-3.
3247 * tests/mv/hard-3: New test, for the above-fixed bug.
3248 Inspired by a report from Iida Yosiaki.
3250 2003-03-01 Jim Meyering <jim@meyering.net>
3252 * src/df.c (print_header): Don't embed spaces in a separate `Type'
3253 header string. Instead, put `Filesystem' and `Type' headers in the
3254 same string, so translators can use horizontal space as needed.
3255 Reported by Jean Charles Delepine.
3257 2003-02-28 Jim Meyering <jim@meyering.net>
3259 * src/copy.c (copy_internal): When link fails because of an
3260 existing destination file, unlink that file and try again.
3261 Reported by Iida Yosiaki.
3263 * tests/mv/Makefile.am (TESTS): Add hard-2.
3264 * tests/mv/hard-2: New test for the above-fixed bug.
3265 Based on a test case from Iida Yosiaki.
3267 2003-02-26 Jim Meyering <jim@meyering.net>
3269 * tests/du/basic: Don't test du's -b option here. Directory byte
3270 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
3271 and IBM AIX 4.2. Reported by Nelson Beebe.
3273 2003-02-25 Jim Meyering <jim@meyering.net>
3275 * Makefile.maint (announcement): Now that ChangeLog entries
3276 are output by announce-gen, don't do it here.
3277 * announce-gen (print_changelog_deltas): New function.
3280 2003-02-22 Jim Meyering <jim@meyering.net>
3282 * announce-gen: New option: --release-type=TYPE
3283 * Makefile.maint (beta, major): New targets. Remove `release'.
3284 Put them all together on a line.
3285 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
3286 invocation of `announcement'.
3287 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
3289 * announce-gen: New option: --news=NEWS_FILE.
3290 Extract NEWS entries here, not via rules in Makefile.maint.
3291 * Makefile.maint (announcement): Now that NEWS entries are
3292 extracted by announce-gen, don't do it here.
3293 (news-r1, news-r2): Remove now-unused definitions.
3295 2003-02-21 Jim Meyering <jim@meyering.net>
3299 Merge in changes from autoconf's version of this file.
3300 * Makefile.maint (www-gnu): Define.
3301 (standards.texi-url_prefix): Use $(www-gnu).
3302 (make-stds.texi-url_prefix): Likewise.
3304 * src/cp.c: Include "mmap-stack.h".
3305 (main): Invoke `run' through a macro that (when possible) runs it
3306 with a large, mmap'd stack.
3308 * src/cp.c (run): New function, preparing for the above.
3309 Exit from this function, not from main
3312 * src/du.c: New option: --apparent-size.
3313 (enum) [APPARENT_SIZE_OPTION]: New member.
3314 (long_options): Add it.
3315 (usage): Describe it.
3317 ['b']: Set apparent_size.
3318 David Eisner reported that the behavior of --bytes had changed.
3319 Paul Eggert proposed the use of a new option, --apparent-size.
3321 * src/du.c (apparent_size): New global.
3322 (print_only_size): Reflect the fact that we're printing byte counts,
3323 not ST_NBLOCKSIZE-byte-block counts.
3324 (print_size): Call print_only_size rather than duplicating its code.
3325 (process_file): Accumulate byte counts, rather than block counts.
3327 * src/du.c (process_file): Always reset size_to_propagate_to_parent
3328 for --separate-dirs (-S).
3330 2003-02-20 Jim Meyering <jim@meyering.net>
3332 * Use automake-1.7.3. Regenerate dependent files.
3334 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
3335 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
3336 (usage) [%B]: Describe it.
3339 * src/du.c (process_file): Reorganize the code to use only
3340 one `sum' array, and change how -S works back to the way it was
3341 before 2003-01-31. Patch by Bruno Haible.
3343 * tests/du/basic: New test.
3344 * tests/du/Makefile.am (TESTS): Add basic.
3346 * tests/envvar-check: Add checks for the following:
3347 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
3349 * tests/Makefile.am: Rename phony target envvar-check to evar-check
3350 so as not to conflict with the distributed file by the same name.
3352 * src/du.c (process_file): Set info->skip before any possible return.
3354 Report correct usage for directories, not 0.
3355 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
3356 _before_ recording the dev/ino of a directory.
3357 Reported by Bruno Haible.
3359 Now, df always displays the device file name corresponding to the
3360 listed mount point under `Filesystem'. Before, for an unmounted
3361 block- or character-special file argument, it would display the
3362 command-line argument instead.
3363 * src/df.c (show_disk): Return a value indicating whether
3364 there was a match. Don't try to find a mount point here.
3365 (show_entry): If show_disk doesn't find a match, call show_point.
3367 2003-02-19 Jim Meyering <jim@meyering.net>
3369 * src/du.c: Include "mmap-stack.h".
3370 (du_files): Add prototype with ATTRIBUTE_NORETURN.
3371 Exit from this function, not from...
3373 Instead, if possible, invoke du_files through a macro that
3374 runs it with a large, mmap'd stack.
3376 * src/join.c (usage): Change wording in --help output:
3377 use FILENUM instead of `SIDE' and say what FILENUM means.
3378 Reported by Bernhard Gabler.
3380 * src/df.c (print_header): Rather than using a hard-coded literal
3381 string of spaces matching the length of the English `...Type' header,
3382 output the right number of spaces to match the selected translation.
3383 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
3385 * src/split.c (bytes_split): Remove unnecessary `else' after break.
3386 (lines_split): Likewise. and correct misleading indentation.
3388 * src/split.c: Include "full-read.h".
3389 (bytes_split, lines_split, line_bytes_split): Use full_read,
3390 not safe_read. The way split was using the latter, a short read
3391 could cause split to terminate before EOF.
3393 * tests/misc/tty-eof: Test all programs that can read stdin,
3394 requiring no arguments and that write to standard output.
3396 * tests/misc/tty-eof: New file. Renamed from ...
3397 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
3398 * tests/misc/Makefile.am (TESTS): Reflect renaming.
3400 2003-02-18 Jim Meyering <jim@meyering.net>
3402 cksum would perform an extra read after encountering EOF
3403 * src/cksum.c (cksum): Exit the loop upon EOF, too.
3404 Patch by Michael Bacarella.
3406 Test for the bug fixed today in cksum, md5sum, and sha1sum.
3407 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
3408 cat, cksum, md5sum, and sha1sum all in the same loop.
3410 2003-02-14 Jim Meyering <jim@meyering.net>
3412 * src/remove.c: Include "euidaccess.h".
3413 Remove declaration of euidaccess.
3415 2003-02-12 Jim Meyering <jim@meyering.net>
3417 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
3418 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
3420 2003-02-10 Jim Meyering <jim@meyering.net>
3422 * src/test.c: Don't include group-member.h.
3423 Include euidaccess.h.
3424 (eaccess): Rewrite function to set the real uid and gid temporarily
3425 to the effective uid and gid, then invoke 'access', and then set the
3426 real uid and gid back. On systems that lack setreuid or setregid,
3427 fall back on the kludges in euidaccess. Before, it would not work
3428 for e.g., files with ACLs, files that were marked immutable,
3429 or on file systems mounted read-only. Nelson Beebe raised the issue.
3430 Paul Eggert suggested the new implementation.
3432 2003-02-09 Jim Meyering <jim@meyering.net>
3434 * src/test.c (test_stat): Remove function. It's job is done (only
3435 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
3437 2003-02-08 Jim Meyering <jim@meyering.net>
3441 * tests/mv/part-symlink: Don't assume that the file owner username
3442 length is less than 9 in ls output: instead, omit that field
3443 altogether. Reported by, and suggested fix from, Ferdinand.
3445 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
3446 * tests/du/Makefile.am (TESTS): Add restore-wd.
3448 * src/rm.c: Correct now-invalid comment about cycle-detection.
3450 2003-02-06 Jim Meyering <jim@meyering.net>
3452 * NEWS: Add entries from old/*/NEWS
3453 from fileutils-4.1 through 4.1.11 and
3454 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
3458 * src/du.c (process_file): Don't return early for excluded files
3459 or for files whose dev/inode we've already seen.
3461 2003-02-05 Jim Meyering <jim@meyering.net>
3463 * tests/du/exclude: New file.
3464 * tests/du/Makefile.am (TESTS): Add exclude.
3466 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
3468 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
3469 Fix memory allocation arithmetic.
3471 2003-02-04 Jim Meyering <jim@meyering.net>
3473 `df /dev/block-or-char-device-file--not-mounted' now reports
3474 the name of the file system on which the file resides, usually `/'.
3475 Before, it would leave the `Mounted on' field blank.
3476 * src/df.c (show_disk): Move function to precede find_mount_point.
3477 (show_disk): Add parameter: STATP.
3478 If we don't find a matching device name, then resort to calling
3479 find_mount_point. Reported by Bob Proulx.
3481 2003-02-03 Andreas Schwab <schwab@suse.de>
3483 * tests/rm/cycle: Require non-root.
3484 * tests/rm/isatty: Likewise.
3486 2003-02-02 Jim Meyering <jim@meyering.net>
3490 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
3492 Ensure that there are no offending uses of `:'.
3493 * Makefile.maint (makefile_path_separator_check): New rule.
3494 (local-check): Add it to the list.
3496 2003-02-01 Jim Meyering <jim@meyering.net>
3498 * src/du.c (MAX_N_DESCRIPTORS): Define.
3500 * src/stat.c (G_fail): New global.
3501 (human_time): Diagnose failed localtime, not failed nstrftime.
3502 (main): Fail if G_fail is set.
3504 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3506 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
3507 hard-coding the path-separator. Also double-quote the new PATH,
3508 to avoid problems when the path-separator is a semi-colon or when
3509 `pwd` contains e.g. a space.
3510 * tests/chgrp/Makefile.am: Likewise.
3511 * tests/chmod/Makefile.am: Likewise.
3512 * tests/chown/Makefile.am: Likewise.
3513 * tests/cp/Makefile.am: Likewise.
3514 * tests/dd/Makefile.am: Likewise.
3515 * tests/dircolors/Makefile.am: Likewise.
3516 * tests/du/Makefile.am: Likewise.
3517 * tests/expr/Makefile.am: Likewise.
3518 * tests/factor/Makefile.am: Likewise.
3519 * tests/fmt/Makefile.am: Likewise.
3520 * tests/install/Makefile.am: Likewise.
3521 * tests/ln/Makefile.am: Likewise.
3522 * tests/ls/Makefile.am: Likewise.
3523 * tests/ls-2/Makefile.am: Likewise.
3524 * tests/md5sum/Makefile.am: Likewise.
3525 * tests/misc/Makefile.am: Likewise.
3526 * tests/mkdir/Makefile.am: Likewise.
3527 * tests/mv/Makefile.am: Likewise.
3528 * tests/od/Makefile.am: Likewise.
3529 * tests/rm/Makefile.am: Likewise.
3530 * tests/rmdir/Makefile.am: Likewise.
3531 * tests/seq/Makefile.am: Likewise.
3532 * tests/sha1sum/Makefile.am: Likewise.
3533 * tests/shred/Makefile.am: Likewise.
3534 * tests/stty/Makefile.am: Likewise.
3535 * tests/sum/Makefile.am: Likewise.
3536 * tests/tail-2/Makefile.am: Likewise.
3537 * tests/touch/Makefile.am: Likewise.
3538 * tests/tsort/Makefile.am: Likewise.
3539 * tests/unexpand/Makefile.am: Likewise.
3541 2003-01-31 Jim Meyering <jim@meyering.net>
3543 * src/stat.c: Include "file-type.h"
3544 (print_human_type): Remove function.
3545 (human_access): Rename from print_human_access. Return a string.
3546 (human_time): Rename from print_human_time. Return a string.
3547 (print_stat): Arrange so that field width and an alignment specifier
3548 are honored for the %A, %F, %x, %y, and %z formats.
3549 [%F]: Use file_type; this gives slightly different file type strings,
3550 e.g., `directory' instead of `Directory' and `regular file' or
3551 `regular empty file' instead of `Regular file'.
3552 Prompted by a report from Richard Dawe that the uses of
3553 S_IFSOCK and S_IFIFO in print_human_time were not portable
3554 to systems using e.g., DJGPP.
3556 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3558 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
3559 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
3561 2003-01-31 Jim Meyering <jim@meyering.net>
3563 * src/du.c (main): Upon processing an invalid option or an invalid
3564 --exclude-from or --max-depth option argument, don't exit right away,
3565 in case there are others. Rather record the failure and exit after
3566 processing other options.
3568 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
3569 tar archive easier to reproduce.
3571 Rewrite to perform directory traversal using nftw.
3573 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
3574 (AUTHORS): Add self.
3575 (opt_one_file_system): Move global into `main'.
3576 (path, xstat, exit_status): Remove declarations.
3577 (arg_length, suffix_length): New globals.
3578 (G_fail): New global, sort of like the old `exit_status'.
3579 (IS_FTW_DIR_TYPE): Define.
3580 (print_only_size): New function.
3581 (process_file): New function.
3582 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
3583 (str_trunc, pop_dir, count_entry): Likewise.
3584 (du_files): Rewrite to use nftw.
3586 2003-01-30 Jim Meyering <jim@meyering.net>
3588 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
3589 symlink-to-directory with -L, even without the trailing slash.
3591 2003-01-27 Jim Meyering <jim@meyering.net>
3593 * src/Makefile.am (check-misc): Check for st_blocks, too.
3595 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
3596 Reported by Richard Dawe.
3598 2003-01-27 Andreas Schwab <schwab@suse.de>
3600 * src/ls.c (quote_name): Add fourth parameter, width, into which to
3601 store the screen columns, and return the number of bytes instead.
3602 (print_dir): Pass NULL as fourth parameter of quote_name.
3603 (print_name_with_quoting): Likewise.
3604 (length_of_file_name_and_frills): Get the width from the fourth
3605 parameter of quote_name instead of return value.
3607 2003-01-27 Jim Meyering <jim@meyering.net>
3609 * src/ls.c (decode_switches): If `dired' is set without
3610 `format == long_format', then silently reset dired. This doesn't
3611 change the behavior of ls (all prior uses of dired were protected
3612 by `&& format == long_format'), and lets us...
3613 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
3614 (PUSH_CURRENT_DIRED_POS): Likewise.
3617 2003-01-22 Jim Meyering <jim@meyering.net>
3619 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
3620 * tests/du/Makefile.am (TESTS): Add no-x.
3622 2003-01-21 Jim Meyering <jim@meyering.net>
3624 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
3625 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
3626 it may still be a directory -- or not (e.g., with FreeBSD on an
3627 NFS-mounted file system), so resort to calling lstat to find out.
3628 Based on a patch by Michael van Elst.
3630 * tests/cp/same-file: Don't assume that the file owner username
3631 length is less than 9 in ls output: instead, omit that field
3632 altogether. Reported by, and suggested fix from, Ferdinand.
3634 2003-01-20 Jim Meyering <jim@meyering.net>
3636 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
3637 large format widths no longer cause strftime to infloop.
3639 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
3641 2003-01-19 Jim Meyering <jim@meyering.net>
3643 * src/readlink.c: Include "canonicalize.h".
3645 2003-01-18 Jim Meyering <jim@meyering.net>
3647 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
3649 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
3650 (long_options): Add option --dereference-command-line-symlink-to-dir.
3651 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
3652 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
3653 -d, -F, -l options is specified.
3654 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
3655 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
3656 Change --dereference-command-line (-H) to dereference *all*
3657 command line arguments, including broken symlinks.
3659 2003-01-15 Paul Eggert <eggert@twinsun.com>
3661 Change ls -H back to the way it was yesterday, since this is
3662 compatible with FreeBSD and the POSIX spec is confusing
3663 and somewhat contradictory.
3665 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
3666 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
3667 (long_options): Change the long option name back.
3668 (usage): Change the usage back.
3669 (gobble_file): When -H is specified, dereference a top-level
3670 arg even if it points to a non-directory.
3672 2003-01-15 Jim Meyering <jim@meyering.net>
3674 * src/ls.c (gobble_file): Fall back on using lstat when required:
3675 when --dereference (-L) is not specified, and
3676 - when operating on a dangling symlink
3677 - when operating on command-line-symlink-to-directories
3678 This fixes numerous problems. Here are examples:
3679 - `ls dangling-symlink' would fail with `no such file...'
3680 Now it prints `dangling-symlink'.
3681 - `ls -i symlink' would mistakenly print the inode of the referent.
3682 Now it prints the inode of the symlink. Likewise for --size (-s).
3683 Based on a patch from Michael Stone.
3684 Reported by Deepak Goel as Debian bug #173793.
3686 Rename ls's --dereference-command-line (-H)
3687 option to --dereference-command-line-symlink-to-dir.
3688 * src/ls.c [enum Dereference_symlink]
3689 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
3690 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
3691 (long_options): Rename the long option.
3692 (usage): Say that --dereference-... changes how ls treats
3693 only symlinks to directories specified on the command line.
3695 2003-01-14 Jim Meyering <jim@meyering.net>
3697 * tests/ls/dangle: New file/test, for the above fix.
3698 * tests/ls/inode: Another new file/test, for the above fix.
3699 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
3701 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
3702 so that ls --color would no longer highlight the names of files with
3703 the execute bit set when not specified on the command line.
3704 Patch by Michael Stone. Reported by Stephen Depooter as
3707 * tests/ls-2/tests (color-exe): New test, for the above fix.
3709 2003-01-13 Jim Meyering <jim@meyering.net>
3711 * tests/shred/exact: Also test for just fixed bug with --zero.
3713 * src/shred.c (long_opts): --zero does not require an argument.
3714 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
3716 2003-01-12 Jim Meyering <jim@meyering.net>
3718 * Makefile.maint (cvs-update): Skip any file with local modifications.
3720 * src/unexpand.c (usage): Document --first-only and mention that
3721 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
3723 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
3725 * src/df.c: Include "canonicalize.h".
3726 Use canonicalize_file_name unconditionally.
3728 2003-01-09 Jim Meyering <jim@meyering.net>
3730 * README: Add readlink.
3732 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3734 * src/df.c: Include "xgetcwd.h".
3735 * src/pwd.c: Likewise.
3737 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3739 * src/shred.c: Remove declaration of xstrdup.
3740 We already get it via xalloc.h which is included via system.h.
3742 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
3744 New program: readlink.
3746 * src/Makefile.am (bin_PROGRAMS): Add readlink.
3747 * src/readlink.c: New file.
3749 * man/readlink.x: New file.
3750 * man/Makefile.am (dist_man_MANS): Add readlink.1.
3751 (readlink.1): New rule.
3753 2003-01-09 Jim Meyering <jim@meyering.net>
3755 When selecting ranges of byte offsets (as opposed to ranges of fields)
3756 and when --output-delimiter=STRING is specified, output STRING between
3757 ranges of selected bytes.
3758 * src/cut.c (RANGE_START_SENTINEL): Define.
3759 (output_delimiter_specified): New global.
3760 (print_kth): Add parameter. Adjust all callers.
3761 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
3762 (cut_bytes): When requested, output STRING between ranges of
3764 (main): Make a diagnostic a little clearer.
3765 Based on a patch from Jan Nieuwenhuizen.
3767 * tests/cut/Test.pm: New tests for the above.
3769 * src/cut.c (set_fields): Make code agree with comment:
3770 Don't merge abutting ranges like 4- and 2-3. This makes no
3771 difference currently, but is required to support an upcoming change.
3773 2003-01-07 Jim Meyering <jim@meyering.net>
3775 * src/cut.c (set_fields): Fix typo in comment.
3777 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
3778 * tests/touch/Makefile.am (TESTS): Add not-owner.
3779 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
3780 Now, this tests only the nonexistent-directory diagnostic.
3781 Suggestion from Michael Stone.
3783 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
3785 2003-01-04 Jim Meyering <jim@meyering.net>
3787 * src/copy.h: Remove use of PARAMS.
3788 * src/remove.h: Likewise.
3789 * src/chown-core.h: Likewise.
3791 rm could be tricked into mistakenly reporting a cycle.
3792 * src/remove.c: [cycle_check_state]: New global.
3793 (remove_cwd_entries): Adapt to new semantics of cycle_check.
3794 (rm): Call cycle_check_init and cycle_check_free for each file.
3795 * tests/rm/cycle (rm): New test, for the above fix.
3796 * tests/rm/Makefile.am (TESTS): Add cycle.
3798 When rm detects a cycle, don't abort the entire command,
3799 but rather just the affected command line argument.
3800 * src/remove.c: Include <setjmp.h>
3801 (struct dirstack_state) [current_arg_jumpbuf]: New member.
3802 (remove_cwd_entries): Call longjmp if we detect a cycle.
3803 (rm): Call setjmp here.
3805 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
3806 Instead, include cycle-check.h and use it.
3808 * src/remove.h (struct dev_ino): Remove declaration.
3810 * src/remove.c (remove_cwd_entries): Fix typos in comment.
3812 Don't include trailing /. in diagnostics about directories.
3813 * src/remove.c (full_filename_): When FILENAME is just `.'
3814 and there is a nonempty directory-name part, don't append `/.'.
3815 * tests/rm/unread2: Remove trailing /. from diagnostic.
3816 * tests/rm/rm2: Likewise.
3818 * src/remove.c (struct dirstack_state): Define.
3819 To be used in place of these file-scoped globals ...
3820 (dir_stack, len_stack, Active_dir): Remove globals.
3821 (ds_init, ds_free): New functions.
3822 (full_filename): Define.
3823 (full_filename_): Rename from full_filename.
3825 Begin to make AD_* functions more generic.
3826 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
3827 (AD_push): Likewise.
3828 (AD_INIT_OTHER_MEMBERS): Define.
3829 (remove_dir): Define the `status' member manually after each
3830 call to AD_push or AD_push_initial.
3832 * src/Makefile.am (check-misc): New rule, to ensure that no more
3833 S_IS* macro definitions sneak into the code.
3834 (check): Depend on check-misc.
3836 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
3837 * src/du.c (count_entry) [S_ISLNK]: Don't define.
3838 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
3840 2003-01-03 Jim Meyering <jim@meyering.net>
3842 * src/true.c: Add copyright.
3843 (AUTHORS): I suppose I've written it.
3845 * src/Makefile.am (false.c): Make the generated file be read-only.
3847 2003-01-04 Jim Meyering <jim@meyering.net>
3849 * src/ls.c: Include "dev-ino.h".
3850 [struct dev_ino]: Remove declaration.
3852 2003-01-02 Jim Meyering <jim@meyering.net>
3854 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
3855 from mv: s/missing file arguments/missing file argument/.
3856 With --target-directory=DIR, cp and mv work with a single file argument.
3857 Reported by Karl Berry.
3859 * tests/rm/isatty: Enable this test.
3861 2002-12-31 Jim Meyering <jim@meyering.net>
3863 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
3864 (AD_push): Likewise.
3865 (AD_INIT_OTHER_MEMBERS): Define.
3866 (remove_dir): Define the `status' member manually after each
3867 call to AD_push or AD_push_initial.
3869 * src/ls.c [struct dev_ino]: Remove definition.
3870 Include "dev-ino.h" instead.
3872 2002-12-28 Jim Meyering <jim@meyering.net>
3874 * tests/du/Makefile.am (TESTS): Add no-deref.
3875 * tests/du/no-deref: New script.
3877 2002-12-23 Jim Meyering <jim@meyering.net>
3879 * src/remove.c (remove_cwd_entries): Fix typo in comment.
3881 2002-12-21 Jim Meyering <jim@meyering.net>
3883 * announce-gen: Generate MML-formatted announcement.
3884 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
3886 2002-12-20 Jim Meyering <jim@meyering.net>
3888 * src/touch.c (touch): Change the wording of a diagnostic so
3889 that it makes sense both when the file exists and when it doesn't.
3890 Suggestion from Michael Stone.
3892 2002-12-18 Jim Meyering <jim@meyering.net>
3894 * src/stty.c (valid_options): Declare to be static.
3896 2002-12-15 Jim Meyering <jim@meyering.net>
3898 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
3900 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
3901 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
3902 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
3903 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
3904 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
3906 * src/remove.c (PARAMS): Remove definition.
3907 * src/sys2.h: Likewise.
3909 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
3910 Include strftime.h instead.
3912 2002-12-14 Jim Meyering <jim@meyering.net>
3914 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
3916 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
3917 This is necessary at least for Irix6.5 when using c89.
3918 Reported by Nelson Beebe.
3920 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
3922 * tests/misc/cat-tty-eof: New test.
3924 * src/mknod.c (usage): Specify how major and minor mode numbers
3925 are interpreted. Report forwarded by Kristin E Thomas.
3926 * src/mknod.c: Remove now-redundant usage-specifying comment.
3928 2002-12-13 Jim Meyering <jim@meyering.net>
3932 * tests/du/trailing-slash: Allow for a directory of size `0'.
3933 That happens at least on file systems of type tmpfs on linux-2.4.18.
3935 * announce-gen: New script to begin replacing the commands
3936 associated with the rule here...
3937 * Makefile.maint (announcement): Invoke announce-gen.
3938 * Makefile.am (EXTRA_DIST): Add announce-gen.
3940 * tests/cp/preserve-2: New file/test, for latest fix.
3941 * tests/cp/Makefile.am (TESTS): Add preserve-2.
3943 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
3945 Fix a bug whereby cp would fail to parse an option like
3946 --preserve=mode,ownership.
3947 * src/cp.c (decode_preserve_arg): Advance `comma' to
3948 point the character following the comma.
3950 2002-12-11 Jim Meyering <jim@meyering.net>
3952 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
3953 in case it's already defined.
3955 2002-12-09 Jim Meyering <jim@meyering.net>
3957 * tests/touch/fail-diag: Don't get a test failure if /no exists.
3958 Instead, evoke a framework failure if /no-$$ exists.
3959 Reported by Michael Stone.
3961 2002-12-08 Jim Meyering <jim@meyering.net>
3963 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
3964 Define to rpl_lstat, so that even on systems like Solaris 5.8,
3965 du honors (per POSIX) the trailing slash on an argument referring
3966 to a symlink-to-directory.
3968 2002-12-06 Jim Meyering <jim@meyering.net>
3970 * Use autoconf-2.57. Regenerate dependent files.
3971 * Use automake-1.7.2. Regenerate dependent files.
3973 * src/ls.c (gobble_file): Also stat the file if it's a
3974 regular file and --indicator-style=classify (aka -F).
3975 Thanks to Ed Santiago for opening my eyes.
3977 * tests/ls/file-type: New file. Test for the above.
3978 A test to contrast ls -F and ls --indicator-style=file-type.
3979 * tests/ls/Makefile.am (TESTS): Add file-type.
3981 2002-12-04 Jim Meyering <jim@meyering.net>
3983 * tests/ls/follow-slink: Make sure the symlink was created.
3984 Richard Dawe reported that `ln -s link link' succeeds, but creates
3985 no file on systems running some version of the DJGPP libc.
3987 2002-12-03 Jim Meyering <jim@meyering.net>
3989 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
3990 since this package no longer panders to K&R compilers.
3992 2002-12-02 Jim Meyering <jim@meyering.net>
3994 * tests/du/slink: Skip this test if `.' is on a non-local file system.
3996 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
3997 something to replace.
3999 2002-12-01 Jim Meyering <jim@meyering.net>
4001 * src/stat.c: Don't include <string.h> or <ctype.h>.
4002 That's already done via system.h.
4003 * src/dircolors.c: Don't include <ctype.h>.
4005 2002-11-30 Jim Meyering <jim@meyering.net>
4007 * ls.c (gobble_file): Remove the block of code that caused
4008 `ls --color -F symlink-to-dir' to list the files in
4009 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
4010 like `ls -F symlink-to-dir') but with the addition of highlighting.
4011 Similarly, `ls --color -dF symlink-to-dir' would print
4012 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
4013 Reported by Jeff Sheinberg as Debian bug #168203.
4014 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
4016 ls is now more efficient: with certain options, it no longer needs
4017 to stat each directory entry on systems with valid dirent.d_type.
4018 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
4019 (main): Make --recursive set format_needs_type, not format_needs_stat.
4020 (gobble_file): Remove a FIXME comment, now that it's fixed.
4022 2002-11-24 Jim Meyering <jim@meyering.net>
4024 * src/du.c (du_files): Don't strip any trailing slash.
4025 Rewrite so that `/' is no longer represented internally as
4027 (count_entry): When appending a file name component,
4028 account for the fact that the current path may end in `/'.
4029 François Pinard reported that `du symlink-to-dir/' was not
4030 equivalent to `du symlink-to-dir/.'. Now it is.
4031 * tests/du/trailing-slash: New file/test, for the above fix.
4032 * tests/du/Makefile.am (TESTS): Add trailing-slash.
4034 2002-11-23 Jim Meyering <jim@meyering.net>
4036 * src/tac.c (output): Declare some local variables to be of type size_t,
4037 rather than `int' to avoid warnings from gcc.
4039 2002-11-21 Paul Eggert <eggert@twinsun.com>
4041 * src/ls.c (decode_switches): Use case-sensitive matching to
4042 decode the QUOTING_STYLE environment variable. This is more
4043 consistent with the documentation, and with --quoting-style.
4045 2002-11-21 Martin Buck <martin.buck@ascom.ch
4047 * src/stty.c (struct speeds): Add support for all baud rates defined
4050 2002-11-19 Jim Meyering <jim@meyering.net>
4052 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
4053 run in a UTF locale. Report and suggested fix by Bruno Haible.
4054 * tests/fmt/basic: Likewise.
4056 2002-11-17 Jim Meyering <jim@meyering.net>
4058 * configure.ac: Update via autoupdate.
4059 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
4061 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
4062 Reported by Hans Ginzel.
4064 2002-11-15 Jim Meyering <jim@meyering.net>
4066 * Makefile.cfg (gnu_rel_host): Define.
4067 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
4068 on whether $(VERSION) looks like a major release number.
4070 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
4071 (release): Rename from `alpha'.
4072 (alpha): Depend on release.
4074 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
4076 2002-11-14 Jim Meyering <jim@meyering.net>
4078 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
4079 (announcement): Use the new variable.
4081 * Makefile.maint: Sync with Bison, i.e.:
4082 (po-check): Scan .l and .y files instead of the
4083 .c and the .h files that they generate. This fixes the bug
4084 reported by Tim Van Holder in:
4085 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
4086 Look for N_ as well as for _. Try to avoid matching #define for
4090 2002-11-12 Jim Meyering <jim@meyering.net>
4092 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
4093 Replace sole use with equivalent `#ifdef S_ISLNK'.
4094 Inconsistency reported by Dmitry V. Levin.
4096 2002-11-11 Jim Meyering <jim@meyering.net>
4098 * src/stat.c (usage): Transform --help items output via s/ - / /,
4099 so that help2man produces properly formatted man pages.
4100 Reported by Herbert Xu as Debian bug #168400.
4102 2002-11-10 Jim Meyering <jim@meyering.net>
4104 * src/ls.c (sighandler): Handle SIGTSTP specially.
4105 Based on suggestions from Solar Designer and Dmitry V. Levin.
4108 * Makefile.cfg (cvs_files): Define. From autoconf.
4109 (local_updates): Likewise.
4111 * src/ls.c (restore_default_color_handler, sigtstp_handler):
4113 (sighandler): New function, based on the one in sort.c.
4114 (main): Use sigaction, if possible; otherwise signal.
4115 Handle these signals:
4116 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
4117 Don't register our handler if the signal is already being ignored.
4119 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
4120 * src/csplit.c (interrupt_handler): Likewise.
4121 * src/sort.c (sighandler): Likewise.
4122 (main): Declare `i' and `nsigs' to be unsigned, not int.
4124 2002-11-09 Jim Meyering <jim@meyering.net>
4126 ls --color: restore terminal text color upon signal.
4127 * src/ls.c: Include "full-write.h" and <signal.h>.
4128 (restore_default_color, restore_default_color_handler): New functions.
4129 (sigtstp_handler, put_indicator_direct): New functions.
4130 (main) [print_with_color]: Register signal handlers.
4131 Patch mostly by Solar Designer and Stanislav Ievlev.
4133 Update from autoconf.
4134 * Makefile.maint (AMTAR): Remove definition.
4135 (update, cvs-update, po-update, do-po-update): New rules.
4136 (wget-update): Update (thus renaming to cvs-update).
4137 (automake_repo): Use anoncvs@sources.redhat.com.
4139 2002-11-06 Jim Meyering <jim@meyering.net>
4141 * tests/misc/Makefile.am (TESTS): Add printf-hex.
4143 * tests/misc/printf: Be careful to test the code in this package,
4144 not the shell built-in function.
4146 * src/printf.c (print_esc): A hexadecimal escape sequence has
4147 at most two hex. digits, not three. Reported by Padraig Brady.
4148 (usage): Update description.
4149 * tests/misc/printf-hex: New file/test, for the above fix.
4151 2002-10-07 Paul Eggert <eggert@twinsun.com>
4153 Add support for locale-specific size indications (e.g.,
4154 thousands-separators) and for explicit size suffixes on output.
4156 * doc/coreutils.texi (Block size): Say that:
4157 This affects display format as well as block size.
4158 Fractional block counts are rounded up.
4159 ls file size blocksize defaults to 1.
4160 A block size spec preceded by ' generates thousands separators.
4161 A suffix without a preceding integer generates suffixes.
4162 (tail invocation): 32k -> 32 KiB.
4163 (What information is listed): ls -h is now equivalent to
4164 ls --block-size=human, and ls -H is now equivalent to
4165 ls --block-size=si. Displayed file size is now always affected by
4168 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
4169 lib/umaxtostr.c: New files, taken from GNU tar.
4171 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
4173 (EXTRA_DIST): Add inttostr.c.
4175 * lib/human.c, lib/human.h: Rewrite to support locale-specific
4176 notations like thousands separators.
4177 Specify what includer of include.h must include beforehand.
4178 (human_group_digits, human_suppress_point_zero, human_autoscale,
4179 human_base_1024, human_SI, human_B): New enum values.
4180 (human_readable): Rename from human_readable_inexact; put the
4181 options before the sizes. All uses changed. The old human_readable
4182 function has been removed; use inttostr.h instead.
4183 (human_options): Renamed from human_block_size, with new signature
4184 that allows block sizes up to UINTMAX_MAX. All callers changed.
4186 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
4187 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
4188 freestanding C89. No need to check for stdlib.h or string.h since
4189 autoconf does this now.
4191 * src/cksum.c (cksum): Use primitives from inttostr.h, not
4192 human.h, to print large numbers simply.
4193 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
4194 * src/dd.c (print_stats, main): Likewise.
4195 * src/df.c (print_header): Likewise.
4196 * src/factor.c (print_factors): Likewise.
4197 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
4198 * src/shred.c (dopass): Likewise.
4199 * src/sort.c (checkfp): Likewise.
4200 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
4201 * src/tail.c (xlseek): Likewise.
4202 * src/wc.c (write_counts, wc): Likewise.
4204 * src/df.c (human_output_opts): New var.
4205 (output_block_size): Now uintmax_t, not int, to handle larger
4206 block sizes. All uses changed.
4207 * src/du.c: Likewise.
4208 * src/ls.c: Likewise.
4210 * src/df.c (print_header): In the header line, prefer SI to human
4211 representation if it's shorter; if neither is shorter, try to
4212 intuit what the user would prefer.
4214 * src/expr.c (inttostr): Remove; use new imaxtostr library
4217 * src/ls.c (file_output_block_size): New var, to distinguish
4218 file sizes from other sizes.
4219 (decode_switches): Set it.
4221 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
4222 (dopass): When printing progress, use floor for what has been done
4223 so far (since we should be conservative there), and ceiling for
4224 what needs to be done (since that's what other programs use).
4226 2002-10-19 Jim Meyering <jim@meyering.net>
4228 * src/pinky.c (print_heading): Align TTY and Name headings.
4229 Reported by Karl Eichwalder.
4231 2002-10-18 Jim Meyering <jim@meyering.net>
4233 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
4234 Remove now-useless cast.
4235 (stdread): Remove function.
4236 (bytes_split): Use size_t instead of int.
4237 Use safe_read, not stdread.
4238 (lines_split): Likewise.
4239 Use memchr rather than a `while' loop.
4240 (line_bytes_split): Use size_t instead of int.
4241 Use safe_read, not stdread.
4242 (main): Add some FIXME comments to remind me to remove casts.
4244 * src/system.h (ST_BLKSIZE): Correct comment describing how to
4245 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
4247 2002-10-17 Jim Meyering <jim@meyering.net>
4249 Fix a problem that could make e.g., `cat' misbehave on systems which
4250 give invalid (unreasonably large) values for stat.st_blksize.
4251 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
4252 Reported by Petter Reinholdtsen.
4254 2002-10-14 Jim Meyering <jim@meyering.net>
4256 Specifying a printf conversion specifer as nl's separator string
4257 could cause nl to segfault.
4258 * src/nl.c (build_print_fmt): Don't include separator string
4259 in the printf format; it might contain `%'.
4260 Use a better bound on the length of the print_fmt buffer.
4261 (print_lineno): Print the separator here instead.
4262 Reported by Doug Coleman.
4264 * tests/misc/nl: New file/tests, including a test for the above.
4265 * tests/misc/Makefile.am (TESTS): Add nl.
4267 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
4268 * tests/misc/Makefile.am (TESTS): Add split-l.
4270 2002-10-13 Jim Meyering <jim@meyering.net>
4274 * src/du.c (usage): Tweak description of --dereference-args/-D.
4276 * src/du.c (count_entry): Also save cwd when dereferencing (via
4277 --dereference-args, -D) a command-line argument.
4278 Reported by Michal Svec. Based on a patch by Andreas Schwab.
4280 * src/Makefile.am (../AUTHORS): New target/rule.
4282 2002-10-12 Jim Meyering <jim@meyering.net>
4284 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
4285 of type size_t, since that's the way it's used and avoids a warning.
4287 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
4288 since that's how it's always used and avoids a new warning from gcc.
4289 (read_input): Adapt to new safe_read ABI.
4291 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
4294 * src/pinky.c (print_long_entry): fread returns size_t.
4295 Declare local `bytes' accordingly, to avoid warning.
4297 tail -c +N would perform an extra read after encountering EOF
4298 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
4299 * src/tail.c (start_bytes): Detect EOF, inform caller.
4300 (tail_bytes): Upon EOF in start_bytes, return immediately.
4301 (file_lines): Reorganize to use memrchr rather than an explicit loop.
4302 Adapt to new safe_read ABI.
4304 2002-10-11 Jim Meyering <jim@meyering.net>
4306 * tests/du/deref: New file/test, for the above fix.
4307 * tests/du/Makefile.am (TESTS): Add deref.
4309 2002-10-10 Jim Meyering <jim@meyering.net>
4311 * tests/ln/Makefile.am (TESTS): Add target-1.
4312 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
4314 2002-10-09 Jim Meyering <jim@meyering.net>
4316 * tests/cp/backup-is-src: Ensure that certain environment variables
4317 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
4319 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
4320 consume 4GB of disk space on systems without support for sparse files.
4321 Fix a logic error that'd make it `cat err' even though dd didn't fail.
4323 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
4324 Patch by steven@magelico.net, forwarded by Michael Stone.
4326 * tests/ls/dired: Ensure that ls produces English messages.
4327 Patch by Alexey Vyskubov, forwarded by Michael Stone.
4329 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
4331 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
4333 2002-10-08 Jim Meyering <jim@meyering.net>
4335 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
4336 Fix syntax in test: use =, not ==.
4337 Reported by Bob Proulx.
4338 Change all the rest like this: grep -lR "testing framework'" .\
4339 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
4341 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
4342 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
4343 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
4344 * src/wc.c (wc): Likewise.
4346 2002-10-07 Paul Eggert <eggert@twinsun.com>
4349 Don't advance the write pointer past the end of the write buffer.
4350 * src/sort.c (begfield, limfield): Likewise.
4352 2002-10-07 Jim Meyering <jim@meyering.net>
4354 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
4355 * src/head.c (head_bytes, head_lines): Likewise.
4357 2002-10-06 Jim Meyering <jim@meyering.net>
4359 * src/dd.c (scanargs): Ensure that specified block sizes (specified
4360 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
4361 (skip, dd_copy): Adapt to new safe_read ABI.
4363 * Makefile.maint (signatures): Define.
4365 (announcement): Depend on $(signatures).
4367 * Makefile.maint (announcement): Output all URLs for detached
4368 signatures, not just the last one from the previous loop.
4370 2002-10-05 Jim Meyering <jim@meyering.net>
4374 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
4375 don't recurse into directory, DIR. Prompted by a report from
4378 * tests/rm/i-no-r: New file/test, for the above fix.
4379 * tests/rm/Makefile.am (TESTS): Add i-no-r.
4381 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
4382 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
4384 2002-10-03 Jim Meyering <jim@meyering.net>
4386 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
4387 * src/df.c (AUTHORS): Likewise.
4388 * src/du.c (AUTHORS): Likewise.
4389 * src/tail.c (AUTHORS): Likewise.
4390 * src/touch.c (AUTHORS): Likewise.
4392 2002-10-02 Jim Meyering <jim@meyering.net>
4394 * Makefile.am (SUBDIRS): Remove `old'.
4395 (EXTRA_DIST): List the files in old/.
4396 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
4397 Suggestion from Akim Demaille.
4399 2002-10-01 Jim Meyering <jim@meyering.net>
4401 * src/sys2.h (SSIZE_MAX): Define.
4403 2002-09-30 Jim Meyering <jim@meyering.net>
4405 * src/csplit.c: Don't include stdlib.h here. It's already included
4408 2002-09-29 Jim Meyering <jim@meyering.net>
4410 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
4411 expression to avoid bogus warning from gcc.
4413 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
4414 (cat): Declare insize and outsize to be of type size_t, not int.
4415 Rearrange pointer/integer expressions to avoid bogus warnings.
4416 (main): Declare insize and outsize to be of type size_t, not int.
4418 * src/tail.c (parse_options): Give a sensible diagnostic for
4419 an invalid byte or line count. Reported by Mikko Tuumanen.
4421 * src/touch.c (main): Split a long line.
4423 * tests/du/Makefile.am (TESTS): Add slink.
4424 * tests/du/slink: New test for system.h change of 2002-08-31.
4426 In move mode, always first try to rename. Before, upon failure to
4427 rename a directory, this code would never attempt to rename any
4428 other file in that directory, but would thenceforth always copy.
4429 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
4430 may fail with EXDEV, yet renaming files within that directory to
4431 a newly-created destination directory succeeds.
4432 * src/copy.c (copy_internal): Remove local, move_mode;
4433 use x->move_mode instead. Based on a patch from Tom Haynes.
4435 2002-09-28 Jim Meyering <jim@meyering.net>
4437 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
4438 Factor out some duplication.
4440 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
4442 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
4444 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
4445 to avoid compiler warnings.
4447 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
4450 Fix things so `mkdir -p' can create very deep directories, e.g.,
4451 mkdir -p $(perl -e 'print "a/" x 40000') now works.
4452 * src/mkdir.c (main): For --parents (-p), call make_path with the
4453 entire directory name, so we don't ever require that file operations
4454 like stat or chmod be performed on the entire command line argument.
4455 * makepath.c (make_path): Restore umask *before* creating the final
4458 2002-09-27 Andreas Schwab <schwab@suse.de>
4460 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
4461 to avoid overflow. Reported by Hans Lermen.
4463 2002-09-26 Jim Meyering <jim@meyering.net>
4465 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
4467 2002-09-25 Jim Meyering <jim@meyering.net>
4469 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
4470 and add a cast, to avoid a warning about `signed and unsigned type in
4471 conditional expression'.
4473 2002-09-22 Jim Meyering <jim@meyering.net>
4475 * src/rmdir.c: Include "dirname.h", for declaration of
4476 strip_trailing_slashes.
4478 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
4479 Now they're defined through system.h.
4481 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
4482 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
4483 since it's already included from sys2.h via system.h.
4485 * Use automake-1.6f. Regenerate dependent files.
4487 * src/Makefile.am (PERL): Remove duplicate definition.
4489 fmt's -s, -t, -c options didn't work properly for long lines.
4490 Since get_line may end up calling put_paragraph (for long lines),
4491 be sure to set global, `other_indent', before it is used there.
4493 * src/fmt.c (set_other_indent): New function, factored out of...
4494 (get_paragraph): ... here. Call it.
4495 (get_line): Call set_other_indent before calling flush_paragraph,
4496 which calls fmt_paragraph, which in turn calls put_paragraph,
4497 which uses other_indent.
4499 * tests/fmt/Makefile.am (TESTS): Add long-line.
4500 * tests/fmt/long-line: New file/test, for the above fix.
4502 2002-09-21 Jim Meyering <jim@meyering.net>
4504 * src/od.c: No longer include deprecated <values.h>.
4505 It was required solely for now-removed reference to BITSPERBYTE.
4506 * src/install.c: Likewise.
4507 Suggestion from Bruno Haible.
4509 2002-09-06 Andreas Schwab <schwab@suse.de>
4511 `rmdir -p dir-specified-with-trailing-slash/' would fail.
4512 * src/rmdir.c (remove_parents): Strip trailing slashes.
4514 2002-09-20 Jim Meyering <jim@meyering.net>
4516 * tests/rmdir/t-slash: New file/test, for the above fix.
4517 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
4519 * Makefile.maint (announcement): Arrange to gpg-sign the message.
4520 Add a URL for each detached signature file.
4522 2002-09-07 Bruno Haible <bruno@clisp.org>
4524 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
4526 2002-09-18 Jim Meyering <jim@meyering.net>
4528 `od -t x8' used the wrong (`l'-prefixed) printf format.
4529 Likewise for the o8 and u8 formats.
4530 * src/od.c (ISPEC_TO_FORMAT): Define macro.
4531 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
4532 Reported by Arun Sharma.
4534 2002-09-17 Jim Meyering <jim@meyering.net>
4536 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
4537 From gettext's intl/loadmsgcat.c.
4539 * tests/od/x8: New file/test, for the above fix.
4540 * tests/od/Makefile.am (TESTS): Add x8.
4542 2002-09-15 Jim Meyering <jim@meyering.net>
4544 * Use autoconf-2.54. Regenerate dependent files.
4546 * src/csplit.c (get_format_width): Add cast to avoid
4547 warning about `signed and unsigned type in conditional expression'.
4549 2002-09-14 Jim Meyering <jim@meyering.net>
4551 * src/who.c (print_user): Change type of local to size_t
4552 to avoid warnings about `comparison between signed and unsigned'.
4553 * src/ptx.c (generate_all_output): Likewise.
4555 * src/dd.c (main, skip): Add casts to avoid warnings about
4556 `comparison between signed and unsigned'.
4558 * src/id.c (print_full_info, print_group_list): Add casts to avoid
4559 warnings about `signed and unsigned type in conditional expression'.
4561 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
4562 to avoid warnings about `comparison between signed and unsigned'.
4563 (split_3): Change parameter names to be readable and add comment.
4564 Clean up the test for whether a line may be ignored.
4566 2002-09-13 Jim Meyering <jim@meyering.net>
4568 * src/printf.c (main): Handle leading command line argument of `--'.
4569 Reported by Raul: DervishD <raul@pleyades.net>
4570 * tests/misc/printf: New file: test for the above.
4571 * tests/misc/Makefile.am (TESTS): Add printf.
4573 * src/date.c (usage): Explain that %S's range of [0..60] is required --
4574 rather than 0..59 -- to accommodate the occasional positive leap second.
4575 Reported by Richard Neill.
4577 2002-09-12 Jim Meyering <jim@meyering.net>
4579 * src/Makefile.am (nanosec_libs): Define.
4580 (sleep_LDADD, tail_LDADD): Use it here.
4582 Factor nanosleep-related code into ../lib/xnanosleep.c.
4583 * src/sleep.c: Include xnanosleep.h.
4584 Factor out fenv.h-related code.
4585 (timespec_subtract): Remove function.
4586 (main): Remove code that deals with computing start and stop times
4587 as well as the loop around nanosleep. Now that's in xnanosleep.c.
4589 Allow S (in --sleep-interval=S) to be a floating point value.
4590 * src/tail.c: Include xnanosleep.h and xstrtod.h.
4591 Move declaration of global variable, sleep_interval, to ...
4593 (usage): Update description of --sleep-interval option.
4594 (tail_forever): New parameter, sleep_interval. Update caller.
4595 Use xnanosleep, rather than sleep.
4596 (parse_options): New parameter, sleep_interval. Update caller.
4597 Use xstrtod, now that we accept floating point values.
4598 Prompted by a patch from Augey Mikus.
4600 2002-09-06 Jim Meyering <jim@meyering.net>
4602 * src/remove.c (prompt): Change comment to give a better note to
4603 translators. From Michael Piefel.
4605 2002-09-02 Jim Meyering <jim@meyering.net>
4607 * README: A good problem report/patch includes diffs against
4608 the most recent test release.
4610 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
4611 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
4613 * src/kill.c (print_table_row): Use an unsigned type for widths
4614 to avoid warning about comparison between signed and unsigned.
4615 (list_signals): Likewise.
4617 * src/od.c (skip): Add a cast to avoid warning about comparison
4618 between signed and unsigned.
4619 * src/install.c (get_ids): Likewise. Also rearrange range-checking
4620 comparisons to make them more readable.
4622 2002-09-01 Jim Meyering <jim@meyering.net>
4626 2002-08-31 Jim Meyering <jim@meyering.net>
4628 Symlinks were always reported as using 0 blocks.
4629 * src/system.h (ST_NBLOCKS): Don't depend on file type.
4630 This reverts the change of 2000-01-30.
4631 Based on a report and patch from Neil Brown via Michael Stone.
4632 This fixes Debian Bug#156358.
4634 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
4635 `exit (1)' to `exit (EXIT_FAILURE)', and
4636 `usage (1)' to `usage (EXIT_FAILURE)'.
4638 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
4639 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
4640 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
4641 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
4642 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
4643 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
4644 error never exits successfully.
4646 2002-08-29 Jim Meyering <jim@meyering.net>
4648 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
4649 when ignoring any return value.
4651 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
4652 failures. On some systems (at least EMC Celerra and Solaris5.8),
4653 this appears to be necessary.
4654 (is_empty_dir): Likewise. Also, always close directory handle.
4655 * src/ls.c (print_dir): Likewise.
4656 (print_dir): Rename local variable: reading -> dirp.
4657 Reported by Mike Coleman.
4659 2002-08-28 Jim Meyering <jim@meyering.net>
4661 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
4662 Give a diagnostic and fail if closedir fails.
4664 2002-08-26 Jim Meyering <jim@meyering.net>
4666 * Makefile.am (THANKS-to-translators): New rule.
4667 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
4668 * THANKStt.in: New file.
4670 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
4672 (main): Register it with atexit.
4673 Close STDOUT_FILENO, to avoid a problem when writing to
4674 /dev/audio on at least Solaris 5.7 and 5.8 systems.
4675 Reported by Shing-Shong Shei.
4677 2002-08-25 Jim Meyering <jim@meyering.net>
4679 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
4680 * src/tac.c (main): Likewise.
4681 * src/tail.c (main): Likewise.
4682 * src/tee.c (main): Likewise.
4683 * src/tr.c (main): Likewise.
4684 * src/wc.c (main): Likewise.
4686 2002-08-20 Jim Meyering <jim@meyering.net>
4688 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
4690 2002-08-10 Paul Eggert <eggert@twinsun.com>
4692 * src/nohup.sh: Don't use "exec --"; it's not portable and
4693 shouldn't be needed.
4695 2002-08-09 Jim Meyering <jim@meyering.net>
4697 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
4698 (usage): Clarify help text for the -COLUMN option.
4699 Patch by Padraig Brady.
4700 * tests/pr/Test.pm [col-last]: New test for the above.
4702 * configure.ac: Start with version 4.5.1, chosen so that it's larger
4703 than the latest version numbers of the component packages.
4705 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
4708 2002-08-08 Jim Meyering <jim@meyering.net>
4710 * src/date.c: Guard inclusion of <langinfo.h> with
4711 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
4712 * src/sort.c: Likewise.
4713 Patch by GOTO Masanori.
4715 2002-08-05 Paul Eggert <eggert@twinsun.com>
4717 Fix some minor time-related bugs with POSIX time arguments.
4718 Some valid time stamps were being rejected (notably -1, and
4719 time stamps before 1900 on 64-bit hosts). And some invalid
4720 time stamps were being accepted, e.g. September 31.
4722 * src/date.c (main): Adjust to posixtime signature change.
4723 * src/touch.c (main): Likewise. Remove unnecessary initialization.
4724 Use localtime, not posixtm, to warn about obsolete "touch".
4726 2002-08-05 Jim Meyering <jim@meyering.net>
4728 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
4730 2002-08-04 Jim Meyering <jim@meyering.net>
4732 * src/Makefile.am (check-README): New target/rule.
4733 (check): Depend on it.
4735 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
4737 2002-08-03 Jim Meyering <jim@meyering.net>
4739 * Makefile.am (SUBDIRS): Add old.
4740 * old/: New directory, containing legacy ChangeLog* and NEWS files
4741 from the fileutils, sh-utils, and textutils packages.
4743 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
4745 2002-08-02 Paul Eggert <eggert@twinsun.com>
4747 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
4749 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
4750 (hard_LC_COLLATE): New var.
4751 (different): Args are now char *, not const char *.
4752 Use xmemcoll instead of memcmp to compare lines, so that
4753 LC_COLLATE has effect. However, use memcmp if it is an
4755 (check_file): Do not include newline in comparison, so that
4756 xmemcoll has a byte to stomp on temporarily.
4757 (main): Set hard_LC_COLLATE.
4759 2002-07-29 Jim Meyering <jim@meyering.net>
4761 * Makefile.am (SUBDIRS): Remove djgpp, for now.
4763 2002-07-20 Jim Meyering <jim@meyering.net>
4765 * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
4766 into EXIT_FAILURE. Otherwise, false --help and false --version
4769 2002-07-08 Jim Meyering <jim@meyering.net>
4771 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
4772 rather than the hard-coded `sh-utils'.
4774 2002-07-01 Jim Meyering <jim@meyering.net>
4776 * configure.ac: Merge the three files from fileutils,
4777 textutils, and sh-utils.
4778 * Makefile.am: Likewise.
4779 * src/Makefile.am: Likewise.