1 2004-02-02 Jim Meyering <jim@meyering.net>
5 Print actual fractional seconds in time stamps, not just `.00000000'.
6 * src/stat.c (human_time): Add and use new parameter, t_ns.
7 (print_stat): Update callers.
8 * src/ls.c (TIMESPEC_NS): Remove definition.
9 * src/system.h (TIMESPEC_NS): Define here, instead, now that stat.c
11 Nelson H. F. Beebe noticed that ls --full-time printed nonzero
12 fractional seconds for files on an XFS file system, but that stat's
13 fractional seconds were always zero.
15 2004-01-27 Jim Meyering <jim@meyering.net>
17 * src/seq.c (usage): Mention that if INCREMENT is omitted,
18 it defaults to 1, even when FIRST is larger than LAST.
19 Reword so as not to exclude the possibility that INCREMENT be zero.
21 2004-01-25 Jim Meyering <jim@meyering.net>
25 * Makefile.maint (signatures): Comment out definition.
27 2004-01-23 Jim Meyering <jim@meyering.net>
29 * Makefile.maint (header_regexp): Add exitfail.
31 * man/Makefile.am (EXTRA_DIST): Add help2man.
32 Reported by Nelson H. F. Beebe.
34 * man/Makefile.am (.x.1): Prefix help2man invocation with `$(PERL) --'
35 so it works on systems with Perl installed somewhere other than in
38 * src/paste.c (paste_parallel): Declare local, chr, to be of type
39 `int', not `char', since it must hold EOF. This bug would make
40 paste infloop on some systems. Test failures reported by
41 Nelson H. F. Beebe and Christian Krackowizer.
43 2004-01-22 Jim Meyering <jim@meyering.net>
45 * tests/rmdir/fail-perm: New file. Test for just-fixed rmdir bug.
46 * tests/rmdir/Makefile.am (TESTS): Add fail-perm.
48 * man/help2man: Fix it so using --info-page='coreutils PROG' works.
49 * man/Makefile.am (.x.1): Invoke our own (tweaked) copy of help2man.
50 Use --info-page='coreutils PROG' option.
51 Now, readlink.1 refers the user to `info coreutils readlink'
52 rather than to `info readlink'. Reported by Matt Swift.
54 2004-01-21 Paul Eggert <eggert@twinsun.com>
58 * src/basename.c (usage): Use EXIT_SUCCESS, not 0, for clarity.
59 * src/cat.c, src/chgrp.c, src/chmod.c, src/chown.c, src/chroot.c,
60 * src/cksum.c, src/comm.c, src/cp.c, src/csplit.c, src/cut.c,
61 * src/date.c, src/dd.c, src/df.c, src/dircolors.c, src/dirname.c,
62 * src/du.c, src/echo.c, src/env.c, src/expand.c, src/expr.c,
63 * src/factor.c, src/fmt.c, src/fold.c, src/head.c, src/hostid.c,
64 * src/hostname.c, src/id.c, src/install.c, src/join.c, src/kill.c,
65 * src/link.c, src/ln.c, src/logname.c, src/ls.c, src/md5sum.c,
66 * src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c,
67 * src/nl.c, src/nohup.c, src/od.c, src/paste.c, src/pathchk.c,
68 * src/pinky.c, src/pr.c, src/printenv.c, src/printf.c, src/pwd.c,
69 * src/rm.c, src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c,
70 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c,
71 * src/su.c, src/sum.c, src/sync.c, src/tac.c, src/tail.c, src/tee.c,
72 * src/test.c, src/touch.c, src/tr.c, src/tsort.c, src/tty.c,
73 * src/uname.c, src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c,
74 * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c: Likewise.
76 * src/cat.c (usage): Don't bother normalizing exit status
77 since the arg is already the correct exit status now.
78 * src/cksum.c, src/comm.c, src/csplit.c, src/cut.c,
79 * src/dircolors.c, src/expand.c, src/fmt.c, src/fold.c, src/head.c,
80 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c,
81 * src/pr.c, src/split.c, src/sum.c, src/tac.c, src/tail.c, src/tr.c,
82 * src/tsort.c, unexpand.c, src/src/uniq.c, src/src/wc.c: Likewise.
84 * src/chown.c (main): Removed unused local 'fail'.
86 * src/chroot.c (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE):
89 * src/chroot.c (main): Initialize exit_failure to EXIT_FAIL.
90 * src/env.c, src/nice.c, src/su.c: Likewise.
91 * src/nohup.c (main): Likewise, to NOHUP_FAILURE.
92 * src/setuidgid.c (main): Likewise, to SETUIDGID_FAILURE.
93 * src/expr.c (main): Use initialize_exit_failure rather than
94 setting exit_failure directly; this optimizes away redundant
96 * src/printenv.c, src/sort.c, src/test.c, src/tty.c: Likewise.
98 * src/chroot.c (main): Exit with status 1 rather than 127
99 if chroot itself fails, as per documentation.
101 * src/chroot.c (main): Use EXIT_ENOENT and EXIT_CANNOT_INVOKE
102 rather than roll-your-own symbols or integers.
103 * src/env.c (main): Likewise.
104 * src/nohup.c (main): Likewise.
105 * src/su.c (run_shell): Likewise.
107 * src/cp.c (exit_status): Remove static var....
108 (main): Making it local here instead. Use =, not |=, to set it.
110 * src/cut.c (FATAL_ERROR, main): Exit with status EXIT_FAILURE,
112 * src/date.c (batch_convert, main): Likewise.
113 * src/dd.c (dd_copy): Likewise.
114 * src/pr.c (first_last_page, main, getoptarg): Likewise.
115 * src/tr.c (main): Likewise.
116 * src/date.c (main): Don't assume EXIT_FAILURE == 1, as
117 POSIX doesn't require it.
118 * src/dd.c (write_output, skip, dd_copy): Likewise.
119 * src/df.c (main): Likewise.
120 * src/id.c (main): Likewise.
121 * src/install.c (main): Likewise.
122 * src/ln.c (main): Likewise.
123 * src/ls.c (main): Likewise.
124 * src/mv.c (main): Likewise.
125 * src/shred.c (main): Likewise.
127 * src/env.c (main): Exit with status 1, not 2, on errors detected
129 * src/hostname.c (main): Likewise.
130 * src/nl.c (main): Likewise.
131 * src/stty.c (main): Likewise.
133 * src/expr.c (EXPR_FAILURE): Renamed from EXPR_ERROR, for
134 consistency with the other programs' naming conventions.
137 * src/factor.c (main): Do not report a usage error simply
138 because stdin has bad numbers.
140 * src/id.c (problems): Now a boolean int, not a counter,
141 so that we don't have to worry about int overflow. All uses changed.
142 * src/touch.c (err): Likewise.
144 * src/md5sum.c (main): Use int, not size_t, to store boolean int.
146 * src/mkfifo.c (main): Exit with status 1, not 4, if not implemented.
147 * src/mknod.c: Likewise.
149 * src/nice.c (main): Exit with status EXIT_FAIL, not EXIT_FAILURE,
150 on error; this is in case EXIT_FAILURE is unusual.
151 * src/su.c (main): Likewise.
153 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE): Remove; all uses
154 changed to EXIT_CANNOT_INVOKE.
156 * src/printenv.c (PRINTENV_FAILURE): New constant.
157 (main): Exit with status PRINTENV_FAILURE, not EXIT_FAILURE, on
158 command-line syntax problems.
160 * src/rmdir.c (remove_parents): Don't set 'fail' to a negative number.
161 (main): Avoid integer overflow when seeing whether errors occurred.
163 * src/seq.c (print_numbers): Now returns void, not (zero) int.
165 (main): Remove unused local variable 'errs'. Always exit successfully
168 * src/setuidgid.c (SETUIDGID_FAILURE): Renamed from FAIL_STATUS,
169 for consistency with other programs here. All uses changed.
170 (main): Use 'error' to exit rather than invoking 'exit' here.
172 * src/sort.c: Don't include <assert.h>.
173 (SORT_OUT_OF_ORDER, SORT_FAILURE): Now enums, not macros.
174 (usage): Don't use 'assert'.
175 (main): Remove redundant assignment to exit_failure.
177 * src/system.h (EXIT_FAIL, EXIT_CANNOT_INVOKE, EXIT_ENOENT):
179 (initialize_exit_failure): New inline function.
180 Include exitfail.h here, since we refer to exit_failure.
181 All callers changed to not include exitfail.h.
183 * src/tty.c (TTY_FAILURE, TTY_WRITE_ERROR): New enum values;
184 substitute them for the corresponding integer constants.
186 * tests/help-version (expected_failure_status_date): Remove, as
187 'date' is now normal.
188 (expected_failure_status_nohup): New var.
190 2004-01-21 Jim Meyering <jim@meyering.net>
192 * tests/touch/relative: Remove `command' syntax.
193 Thanks to Nelson H. F. Beebe and Paul Eggert.
195 * tests/touch/relative: Test only year/month/day, not hours/min/sec,
196 so as to avoid problems with systems using TAI clocks.
197 Although it's no longer necessary, set TZ=UTC0 also for the
198 initial touch command. Reported by Paul Jarc here:
199 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/1504
201 2004-01-20 Diego Biurrun <diego@biurrun.de>
203 * src/dircolors.hin: Add .mov to the list of media files.
205 2004-01-19 Paul Eggert <eggert@twinsun.com>
207 * tests/touch/relative: Use TZ=UTC0, not TZ=utc (which isn't
208 portable). Problem reported by Christian Krackowizer. Also, use
209 +0000 rather than +0 to specify a time zone, as the documentation
210 requires four digits.
212 2004-01-19 Jim Meyering <jim@meyering.net>
214 * tests/mv/hard-4: Run envvar-check in case SIMPLE_BACKUP_SUFFIX is set.
215 * tests/mv/backup-is-src: Likewise.
216 Problem reported by Peter Horst
218 2004-01-17 Jim Meyering <jim@meyering.net>
220 * announce-gen (print_changelog_deltas): Use .sig suffix, not .asc.
224 2003-12-15 Paul Eggert <eggert@twinsun.com>
226 * NEWS, doc/coreutils.texi: touch -r and -d can now both be specified,
227 with -r specifying the origin for -d.
228 * src/touch.c (flexible_date): Remove static var.
229 (get_reldate): New function.
230 (main): Use it, to implement this new behavior.
232 2004-01-16 Jim Meyering <jim@meyering.net>
234 * tests/touch/relative: New test for the above.
235 * tests/touch/Makefile.am (TESTS): Add relative.
237 2004-01-13 Jim Meyering <jim@meyering.net>
239 * src/system.h: Include contents of sys2.h.
240 * src/sys2.h: Remove file.
241 * src/Makefile.am (noinst_HEADERS): Remove sys2.h.
243 * Use automake-1.8.2. Regenerate dependent files.
245 * Update to gettext-0.13.1.
246 * configure.ac: Use gettext-0.13.1.
247 * .x-sc_space_tab: Add m4/po.m4 to the list of exceptions.
249 2004-01-12 Jim Meyering <jim@meyering.net>
251 * Makefile.maint (%.sig): Use .sig suffix rather than .asc.
253 * Makefile.maint (po-check): Ensure that cvsu works before using it.
254 Reported by Alexandre Duret-Lutz.
256 * src/tail.c (main): Warn about following stdin only when it's a tty.
258 * configure.ac: Use gl_DEFAULT_POSIX2_VERSION.
260 2004-01-10 Jim Meyering <jim@meyering.net>
262 * tests/misc/stat-fmt: Use backticks, not `$()' notation.
264 2004-01-09 Jim Meyering <jim@meyering.net>
266 * configure.ac: Quote underquoted `jm_DUMMY_1' to avoid new warning.
268 2004-01-08 Jim Meyering <jim@meyering.net>
270 * src/stat.c (human_fstype): Use %lx, not %x format for `unsigned long'.
273 * tests/Makefile.am (TESTS_ENVIRONMENT): Remove `/vg' (prerelease test
274 remnant) from PATH component. That would cause tests in this directory
275 not to run the just-built binaries, but rather whatever happened
276 to be in one's PATH. Reported by Christian Krackowizer.
278 2004-01-04 Jim Meyering <jim@meyering.net>
280 * src/csplit.c (new_control_record): Use x2nrealloc
281 rather than xrealloc.
283 * src/cp.c (re_protect): Use ASSIGN_STRDUPA rather than
285 (make_path_private): Likewise.
287 2004-01-03 Jim Meyering <jim@meyering.net>
289 * src/paste.c: Use `bool' (not int) as the type for a few
291 (collapse_escapes): Rewrite to set globals rather than modifying
293 Use size_t (not int) for all counters and related index variables.
294 (paste_parallel): Remove needless complexity of
295 using xrealloc in the loop; just allocate the buffers up front.
296 Free the two temporary buffers.
297 Move declarations of locals `down' into scope where used.
298 (paste_serial): Remove `register' attributes.
299 (main): Simplify delim-related code.
300 Free `delims', now that it's malloc'd.
302 2004-01-02 Jim Meyering <jim@meyering.net>
304 * src/chroot.c: Include "quote.h".
305 (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): Define.
306 (main): Exit with status of 127, not 1, for too-few-args,
307 chroot failure, or chdir failure.
308 Give a better diagnostic upon execvp failure.
310 * src/du.c (usage): Mention that, with its current meaning,
313 * src/tail.c (main): Warn about following stdin when it's a tty.
314 Fail when following by name but no names are specified.
316 2003-12-30 Jim Meyering <jim@meyering.net>
318 * src/fold.c (main): Use memcpy, not strcpy.
320 * src/copy.c (copy_internal): Use ASSIGN_STRDUPA rather than
323 2003-12-28 Jim Meyering <jim@meyering.net>
325 * src/unexpand.c (n_tabs_allocated): New global.
326 (add_tabstop): Use x2nrealloc rather than xrealloc.
327 * src/expand.c: Likewise.
329 * tests/misc/expand: New file.
330 * tests/misc/Makefile.am (TESTS): Add expand.
332 * src/sort.c (add_temp_dir): Use x2nrealloc rather than xrealloc.
333 (fillbuf): Use x2nrealloc rather than xrealloc.
334 (sort): Use xnmalloc rather than xmalloc.
337 2003-12-27 Jim Meyering <jim@meyering.net>
339 * src/tee.c (tee): Use xnmalloc rather than xmalloc.
341 2003-12-29 Paul Eggert <eggert@twinsun.com>
343 * NEWS: Remove support for join -j1 FIELD, -j2 FIELD, and -o LIST1
344 LIST2 in POSIX 1003.1-2001 hosts, as required by POSIX.
346 * doc/coreutils.texi (join invocation): Remove documentation
347 accordingly. Document that -t makes all separators significant.
349 * src/join.c: Include posixver.h.
350 (obsolete_usage): New var.
351 (longopts): Put obsolete options first.
352 (OBSOLETE_LONG_OPTIONS): New constant.
353 (get_option, add_file_name): New functions.
354 (main): Use them to support new behavior.
355 (usage): Remove documentation for -j1 FIELD and -j2 FIELD.
356 Do not mark -j FIELD as obsolescent; it is longstanding
357 UNIX tradition and is a valid extension to POSIX.
359 * tests/join/Test.pm (tv): Avoid obsolete -o usage.
361 2003-12-28 Paul Eggert <eggert@twinsun.com>
363 * src/join.c (add_field_list): Don't use alloca with unbounded
364 size; just modify the argument, which is no longer const *.
366 Various other minor cleanups, mostly to avoid the need for casts.
368 (extract_field): Renamed from ADD_FIELD, as it's now a function.
370 (struct field.beg): Now char *, not unsigned char const *. All
371 uses changed. It shouldn't be const since xmemcoll writes on its
373 (extract_field): Likewise, for 2nd arg.
374 (keycmp): Remove now-unnecessary cast of xmemcoll args.
376 (is_blank): New function, to avoid need to cast arg to unsigned char.
377 (extract_field): Use it.
379 (xfields): Rewrite pretty much from scratch.
381 (hard_LC_COLLATE): Now bool, not int.
382 (get_line, getseq, add_field_list): Now returns bool, not int.
383 (decode_field_spec, add_field_list): Return true on success (not
384 false), for consistency with the rest of the code. All uses changed.
386 (tab): Now char, not unsigned char. This wasn't 100% necessary
387 but is slightly cleaner.
388 (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler.
390 (empty_filler): Now const *.
392 (make_blank): Remove; wasn't needed. Remove all calls.
393 (main): Don't set uni_blank.nfields; zero is fine.
395 2003-12-27 Jim Meyering <jim@meyering.net>
397 * src/join.c: Include "quote.h".
398 (min, max): Remove definitions.
399 Make a few function parameters and corresponding
400 locals `const'. Use bool for boolean variables.
401 Use size_t (not int) for all counters and related index variables.
402 (prjoin): Remove now-useless assertion.
403 (string_to_join_field): New function.
404 (main): Accept join fields as large as SIZE_MAX.
405 (keycmp): Rename `min' to MIN and max to MAX.
407 2003-12-26 Jim Meyering <jim@meyering.net>
409 fold -s didn't work on e.g., alpha-based systems.
410 * src/fold.c (fold_file): Adjust types (int->size_t) so that using
411 x2nrealloc works properly on systems with differing sizes for int
412 and size_t. Reported by Nelson Beebe.
414 * src/fold.c: Use `bool' (not int) as the type for a few
417 2003-12-23 Paul Eggert <eggert@twinsun.com>
419 * src/ls.c (length_of_file_names_and_frills):
420 Remove forward decl; not needed.
421 (print_file_name_and_frills, length_of_file_name_and_frills):
422 With -m, don't output spaces before inum or size.
423 (print_with_commas): Don't output space just before newline.
425 2003-12-24 Jim Meyering <jim@meyering.net>
427 * tests/ls/Makefile.am (TESTS): Add m-option.
428 * tests/ls/m-option: New file. Test for above fixes.
430 2003-12-20 Jim Meyering <jim@meyering.net>
434 * src/pr.c: Change type of global, buff_allocated, to size_t.
436 * src/join.c [struct seq]: Change types of members count and alloc
437 from `int' to `size_t'.
439 * tests/Makefile.am (root-hint): Tweak wording.
441 * src/du.c: Accept new option (-0, --null) that makes it so each
442 output line is NUL-terminated rather than newline-terminated.
444 * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync.
445 Reported by Volker Paul.
446 * tests/dd/Makefile.am (TESTS): Add unblock-sync.
447 * tests/dd/unblock-sync: New test for the above.
449 2003-12-19 Jim Meyering <jim@meyering.net>
451 * tests/misc/nohup: Double quote back-ticked expression,
452 in case it ends up having an unexpected value.
454 * tests/ls/no-arg: Use ls's -1 option in both runs.
456 * src/du.c (fts_debug): New global.
457 (FTS_CROSS_CHECK, DEBUG_OPT): Define.
458 (main): Make fts use FTS_TIGHT_CYCLE_CHECK.
459 (main) [DU_DEBUG]: Accept -d option.
461 2003-12-18 Jim Meyering <jim@meyering.net>
463 * src/ls.c (format_user): Increment dired_pos via two statements,
464 `dired_pos += width; dired_pos++;' rather than one,
465 `dired_pos += width + 1;' since the latter could conceivably overflow.
466 (format_group): Likewise.
469 * configure.ac: Require automake-1.8.
471 2003-12-12 Jim Meyering <jim@meyering.net>
473 * Use automake-1.8. Regenerate dependent files.
475 2003-12-08 Jim Meyering <jim@meyering.net>
477 * Makefile.maint (news-date-check): New rule.
478 (alpha beta major): Depend on it.
480 2003-12-03 Paul Eggert <eggert@twinsun.com>
482 * NEWS: ls -l (and similar options) now adjust all columns to
483 fit the data. Generalized from a suggestion by Leah Q for file sizes.
484 * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
485 (format_user_width, format_group_width, unsigned_file_size,
486 format_group): New functions.
487 (block_size_width): Renamed from block_size_size.
488 (inode_number_width, nlink_width, owner_width, group_width,
489 author_width, major_device_number_width, minor_device_number_width,
490 file_size_width): New vars.
491 (clear_files): Initialize them.
492 (gobble_file): Set them. Don't ceiling block_size_width to 7.
493 (print_long_file): Use them.
494 (gobble_file): Use a new local variable 'f' to make the code
495 smaller and more consistent with other functions.
496 (format_user): Output to stdout, not to a buffer, so that we
497 don't have to worry about buffer overrun. Update dired_pos.
498 (print_long_file): Don't put owner, group, author into buffer;
499 just print them directly. Don't assume link counts and
500 major and minor numbers fit into unsigned long int.
501 * tests/cp/same-file, tests/mv/part-symlink: Don't assume that
502 'ls' output is fixed-width.
504 2003-12-02 Jim Meyering <jim@meyering.net>
506 * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h.
508 2003-11-27 Jim Meyering <jim@meyering.net>
510 * Use automake-1.7f. Regenerate dependent files.
512 2003-11-24 Paul Eggert <eggert@twinsun.com>
514 Parse floating-point operands and options in the C locale.
515 POSIX requires this for printf, and we might as well be
516 consistent elsewhere (tail, sleep, seq).
518 * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer
519 needed now that we assume C89. Include "c-strtod.h".
520 (xstrtod): Call c_strtod, not strtod.
521 * src/sleep.c: Include "c-strtod.h".
522 (main): Update xstrtod call to include new argument, c_strtod.
523 * src/seq.c (scan_double_arg): Likewise.
524 * src/tail.c (parse_options): Likewise.
526 2003-11-24 Jim Meyering <jim@meyering.net>
528 * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM).
529 Reported by Mark Conty.
531 2003-11-22 Jim Meyering <jim@meyering.net>
533 * Makefile.maint (sc_xalloc_h_in_src): Remove rule. Subsumed by...
534 (sc_system_h_headers): Do this test only if sys2.h exists.
536 2003-11-20 Jim Meyering <jim@meyering.net>
538 * tests/help-version: Ensure that the bug-reporting address is
539 included in the --help output for every program.
540 * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.
542 * src/ptx.c (usage): Output bug-reporting address.
543 Reported by Dan Jacobson.
545 2003-11-19 Jim Meyering <jim@meyering.net>
547 * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted
548 on the join fields. Suggestion from Bruce Robertson.
550 2003-11-18 Jim Meyering <jim@meyering.net>
552 `od -c -w9999999' could segfault
553 * src/od.c (dump): Use xnmalloc/free, not alloca.
555 2003-11-16 Jim Meyering <jim@meyering.net>
557 * Use autoconf-2.59. Regenerate dependent files.
559 * tests/du/hard-link: Minor tweak: use mkdir -p.
561 Fix read-from-free'd-buffer error detected by valgrind.
562 * src/csplit.c (remove_line): Don't return a pointer to data in
563 a freed buffer. Instead, arrange to free the buffer on the
566 * tests/misc/csplit: New test for above fix.
568 2003-11-11 Jim Meyering <jim@meyering.net>
570 * src/ls.c (extract_dirs_from_files): Avoid useless copy operations.
571 This avoids a warning from valgrind about memcpy with overlapping
572 source and destination.
574 * configure.ac: Require automake-1.7.8.
576 2003-11-09 Jim Meyering <jim@meyering.net>
578 * Use automake-1.7.9. Regenerate dependent files.
580 * src/rm.c: Support new options: --preserve-root and --no-preserve-root.
581 * src/chown.c: Likewise.
583 * src/chown-core.c: Include "root-dev-ino.h".
584 (chopt_init): Initialize new member.
585 (change_file_owner): Support rm's new --preserve-root option.
587 * src/remove.c: Include "root-dev-ino.h".
588 (remove_cwd_entries): Remove now-obsolete FIXME comment.
589 (remove_dir): Support rm's new --preserve-root option.
591 * src/chown.c: Include "root-dev-ino.h".
592 Add new options: --preserve-root and --no-preserve-root.
594 * src/chmod.c: Include "root-dev-ino.h".
595 (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
596 ROOT_DEV_INO_WARN macros.
597 (get_root_dev_ino): Remove function definition, now that it's
598 been moved to a separate file.
599 (usage): Describe new options.
601 * src/mv.c (rm_option_init): Initialized new member.
603 * src/remove.h: Include "dev-ino.h".
604 (struct rm_options): Add new member: root_dev_ino.
605 * src/chown-core.h: Include "dev-ino.h".
606 (struct Chown_option): Add new member: root_dev_ino.
608 2003-11-06 Jim Meyering <jim@meyering.net>
610 * src/paste.c (paste_parallel): Use `sizeof *var' rather than
611 hard-coding `sizeof FILE*'.
613 2003-11-05 Dennis Smit <ds@nerds-incorporated.org>
615 * src/wc.c (main): Free `fstatus' so there is no confusion about
616 whether it's leaked or not.
617 * src/who.c (who): Likewise for `utmp_buf'.
619 2003-11-05 Paul Eggert <eggert@twinsun.com>
621 Fix 'cut' problems with size_t overflow and unsigned int.
622 More generally, resize integer variables to fit use more precisely.
623 * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens.
624 (struct range_pair): Make members to be of type size_t, not unsigned.
625 (max_range_endpoint, eol_range_start): Now size_t, not unsigned.
626 (suppress_non_delimited, output_delimiter_specified,
627 have_read_stdin, print_kth, set_fields): Now bool, nt int.
628 (delim): Now unsigned char, not int.
629 (mark_printable_field, is_printable_field, is_range_start_index,
630 set_fields, set_fields, cut_bytes, cut_fields):
631 Use size_t, not unsigned, for field and byte counts.
632 (hash_int): Use uintptr_t, not unsigned, for pointers converted
633 to integers. This squeezes more info out of them.
634 (set_fields, cut_bytes, cut_fields, main):
635 Use bool, not int, for booleans.
636 (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc.
638 2003-11-05 Paul Eggert <eggert@twinsun.com>
640 * man/Makefile.am (check-programs-vs-x):
641 Work even if $(programs) contains '$'.
642 Work even if 'missing=1' in environment.
643 Don't report an error simply because $(programs) outputs nothing.
645 2003-11-05 Jim Meyering <jim@meyering.net>
647 * Use autoconf-2.58. Regenerate dependent files.
649 * src/tr.c (spec_init): Fix typo in last change.
651 * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in
652 call to variadic version_etc function, so that it works even on systems
653 for which sizeof char* != sizeof int.
654 * src/true.c (main): Likewise.
655 * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c:
656 * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c:
657 * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c:
658 * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c:
659 Similarly, cast NULL to `(char *)' in call to variadic function,
660 parse_long_options, so that it works even on systems for which
661 sizeof char* != sizeof int.
662 A similar problem was reported by Harti Brandt in
663 http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html.
665 * src/users.c (users): Free `utmp_buf' explicitly so that people
666 don't mistake this for a real leak.
667 Patch by Dennis Smit <ds@nerds-incorporated.org.
669 2003-11-04 Paul Eggert <eggert@twinsun.com>
671 * README: Document _POSIX2_VERSION.
673 2003-11-04 Jim Meyering <jim@meyering.net>
675 * src/tac.c (memrchr): Remove #if-0'd function.
676 (tac_stdin_to_mem): Clean up #if-0'd code.
678 * src/od.c (decode_format_string): Remove unnecessary casts.
679 Use more maintainable `sizeof *var'.
680 (main): Call decode_format_string rather than decode_one_format,
681 now that `spec' may be NULL.
683 * src/chmod.c (AUTHORS): Add my name.
685 * src/split.c (next_file_name): Use `sizeof *var' rather than
686 hard-coding `sizeof size_t'.
688 * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...).
690 * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc,
691 to avoid potential overflow in pointer arithmetic.
692 (set_fields): Use not `1', but rather `sizeof *printable_field' as
693 second argument to xcalloc.
694 * src/od.c (decode_format_string, dump_strings): Use x2nrealloc
695 rather than xrealloc.
696 * src/date.c (show_date): Likewise.
697 * src/join.c (ADD_FIELD, initseq, getseq): Likewise.
698 * src/pr.c (store_char): Likewise.
699 * src/fold.c (fold_file): Likewise.
701 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
702 type changes (unsigned int -> size_t) in hash.c.
703 * src/cp-hash.c (src_to_dest_hash): Likewise.
704 * src/du.c (entry_hash): Likewise.
705 * src/ls.c (dev_ino_hash): Likewise.
706 * src/cut.c (hash_int): Likewise. Declare function as static.
708 2003-11-03 Jim Meyering <jim@meyering.net>
710 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
711 * tests/misc/fold: Fail the test immediately if we're not running
712 the expected version of fold.
714 2003-11-02 Jim Meyering <jim@meyering.net>
716 * src/tr.c (append_normal_char, append_range, append_char_class)
717 (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var'
718 rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable
720 * src/copy.c (copy_internal): Likewise.
721 * src/join.c (initseq, add_field, make_blank): Likewise.
722 * src/od.c (main): Likewise.
723 * src/cp.c (make_path_private): Likewise.
724 * src/tsort.c (new_item, record_relation): Likewise.
726 * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise.
727 (main): Also remove anachronistic cast of xmalloc return value.
728 * src/ptx.c (alloc_and_compile_regex, main): Likewise.
729 (main): Also remove anachronistic cast of xmalloc return value.
730 * src/sort.c (inittables): Likewise.
731 (sort): Also Split a long line.
733 2003-10-25 Jim Meyering <jim@meyering.net>
735 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
736 type changes (unsigned int -> size_t) in hash.c.
737 * src/cp-hash.c (src_to_dest_hash): Likewise.
738 * src/du.c (entry_hash): Likewise.
739 * src/ls.c (dev_ino_hash): Likewise.
740 * src/cut.c (hash_int): Likewise. Declare function as static.
742 2003-10-21 Jim Meyering <jim@meyering.net>
744 Don't fail when run with VERBOSE=yes.
745 * tests/chgrp/basic: Do `set +x' before starting the subshell
746 from which we invoke chgrp. Otherwise, the output from the
747 VERBOSE=yes-induced `set -x' would result in spurious differences.
748 Reported by Russel Coker via Michael Stone.
750 2003-10-19 Jim Meyering <jim@meyering.net>
752 chmod now uses fts to perform a directory traversal when -R is
753 specified. Before, it operated on full path names, and as such
754 would encounter the PATH_MAX (often 4096) limit.
756 * src/chmod.c: Include "xfts.h".
757 (process_file): Rename from change_file_mode.
758 Adapt to be used with fts.
759 (process_files): New function.
761 2003-10-18 Jim Meyering <jim@meyering.net>
763 * tests/du/deref-args: Ensure that du -D now dereferences all
764 symlinks specified on the command line, not just those that
765 reference directories.
767 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
768 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
769 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
770 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
771 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
772 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
773 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
774 * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
775 of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
776 Update the call to parse_long_options so that `AUTHORS, NULL' are the
778 * src/true.c (main): Append NULL to version_etc argument list.
779 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
781 2003-10-17 Andreas Schwab <schwab@suse.de>
783 * tests/mk-script: Get $srcdir from first parameter instead of
785 (main): Update usage.
787 * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as
788 first argument of mk-script.
789 ($(srcdir)/Makefile.am): Likewise. Prepend $(srcdir) to target.
791 2003-10-17 Jim Meyering <jim@meyering.net>
793 * src/mv.c (usage): Tweak descriptions of -i and -f so that the
794 generated `man' page is more readable. Suggestion from Dan Jacobson.
796 * src/chown-core.c (change_file_owner): Handle the cases in
797 which fts_info indicates an error with the given entry.
799 * src/du.c (main): Simply assign to bit_flags.
800 Don't bother with bit arithmetic.
802 * tests/chmod/no-x: New file.
803 * tests/chgrp/no-x: New file.
804 * tests/chmod/Makefile.am (TESTS): Add no-x.
805 * tests/chgrp/Makefile.am (TESTS): Likewise.
807 * src/du.c: Include "xfts.h".
808 (du_files): Use xfts_open, rather than fts_open.
809 * src/chown-core.c (chown_files): Likewise.
811 2003-10-16 Jim Meyering <jim@meyering.net>
813 * src/chgrp.c (main): Simply assign to bit_flags.
814 Don't bother with bit arithmetic.
815 * src/chown.c (main): Likewise.
816 Rename a couple of local variables.
817 Remove unnecessary casts.
819 * src/tail.c (start_bytes): Rename local, remainder, to avoid
820 gcc's warning about shadowing a global.
822 2003-10-15 Jim Meyering <jim@meyering.net>
824 chown and chgrp now accept POSIX-mandated -H, -L, -P options and
825 use fts to perform a directory traversal when -R is specified.
826 Before, they operated on full path names, and as such would
827 encounter the PATH_MAX (often 4096) limit.
828 They are more efficient. For example, before, chgrp -R would
829 take almost 5 seconds to change about 2000 directories and fail
830 (with `File name too long'), while now it succeeds on a hierarchy
831 of depth 20,000 in 1/10 the time.
833 * src/chown.c: Include "userspec.h" and "fts_.h".
834 (WRITTEN_BY): Add my name.
835 (getpwnam, getgrnam, getgrgid): Remove declarations.
836 (endpwent): Remove definition.
838 (main): Handle new options.
839 Call new function, chown_files rather than change_file_owner.
841 * src/chgrp.c: Include "fts_.h".
842 (WRITTEN_BY): Add my name.
843 (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of
846 (main): Handle new options.
847 Call new function, chown_files rather than change_file_owner.
849 Rewrite to iterate through hierarchies using fts rather than
850 via explicit recursion.
851 * src/chown-core.c: Include "fts_.h"
852 (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
853 on a single file at a time.
854 (chown_files): New function.
855 * src/chown-core.h [enum Dereference_symlink]: Remove declaration.
856 [struct Chown_option] (recurse, force_silent): Change type to `bool'.
857 [struct Chown_option] (dereference): Remove member with ambiguous name.
858 [struct Chown_option] (affect_symlink_referent): New member.
859 (chown_files): New prototype.
861 * tests/chgrp/recurse: Update tests accordingly.
862 * tests/chgrp/posix-H: New tests for the above.
863 * tests/chgrp/Makefile.am (TESTS): Add posix-H.
865 * src/ln.c (usage): Clarify that --directory, -d, -F probably won't
866 work even for superuser. Suggestion from Dan Jacobson.
868 2003-10-14 Paul Eggert <eggert@twinsun.com>
870 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
872 * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h,
873 lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib.
874 * src/sort.c (parse_field_count): Handle the case where overflow
875 and invalid suffix char are both reported.
877 2003-10-14 Jim Meyering <jim@meyering.net>
879 * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the
880 warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
883 2003-10-13 Paul Eggert <eggert@twinsun.com>
885 Fix to avoid a denial-of-service attack if the display width is
886 enormous. Also, clean up the code a bit by removing duplicate code.
888 * src/ls.c (init_column_info): Remove forward decl; no longer needed.
889 (calculate_columns): New function, that contains code that used
890 to be common to print_many_per_line and print_horizontal.
891 (print_many_per_line, print_horizontal): Use it.
892 (decode_switches): Set max_idx here, not in calculate_columns.
893 (print_current_files): Don't call init_column_info; calculate_columns
895 (init_column_info): Don't allocate a lot more space than is needed
896 to represent the current set of files. Allocate all the new
897 size_t cells in one call to xnmalloc, rather than a row at a time.
899 2003-10-13 Jim Meyering <jim@meyering.net>
901 * src/ls.c (init_column_info): Add another FIXME comment.
903 2003-10-13 Paul Eggert <eggert@twinsun.com>
905 Fix address-arithmetic bug in 'ls', reported by Georgi Guninski.
906 Remove several arbitrary limits on hosts where int cannot represent
909 * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent,
910 nfiles, files_index, tabsize, line_length, struct column_info.line_len,
911 struct column_info.col_arr[0], max_idx):
913 (get_funky_string): Return bool indicating success, instead of
914 a negative count to indicate failure. Store number of columns
915 through new parameter OUTPUT_COUNT; that way, they can never
916 go negative. Change equals_end from int to bool. All uses
918 (struct column_info.valid_len): Now bool, not int. All uses changed.
919 (dired_dump_obstack, get_funky_string, clear_files,
920 extract_dirs_from_files, print_current_files,
921 print_many_per_line, print_horizontal, init_column_info,
922 put_indicator, length_of_file_name_and_frills,
923 print_with_commas): Use size_t, not int, for local variables
925 (decode_switches): Decode sizes using xstrtoul, not xstrtol.
926 Check for TIOCGWINSZ returing negative values (or values greater
928 (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
930 Use xmalloc and xnmalloc, not XMALLOC.
931 (gobble_file): Use xnrealloc, not XREALLOC.
932 (print_color_indicator): Remove now-unnecessary cast to size_t.
934 2003-10-12 Paul Eggert <eggert@twinsun.com>
936 * tests/du/no-x: Change wording of diagnostic to match latest du.c.
937 * tests/sort/sort-tests: Remove from CVS; assume that people
938 brave enough to check coreutils out from CVS can rebuild it.
940 2003-10-12 Jim Meyering <jim@meyering.net>
942 New options: --preserve-root and --no-preserve-root.
943 * src/chmod.c (change_file_mode): Honor new option.
944 (change_file_mode): Strip trailing slashes on directory
945 argument passed to change_dir_mode.
946 (get_root_dev_ino): New function.
947 (main): Initialize global, root_dev_ino.
949 * src/copy.c (copy_internal): Don't #ifdef-out simple uses of
950 S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined
952 * src/chmod.c (change_file_mode): Likewise.
954 2003-10-08 Jim Meyering <jim@meyering.net>
956 * src/csplit.c (main): Remove obsolete FIXME.
958 2003-10-07 Jim Meyering <jim@meyering.net>
960 * Use automake-1.7.8. Regenerate dependent files.
962 2003-09-29 Paul Eggert <eggert@twinsun.com>
966 * doc/coreutils.texi (csplit invocation):
967 The regexp offset need not have a sign; POSIX requires support
970 Be more careful about int widths. For example, remove some
971 arbitrary limits by replacing 'unsigned' with 'size_t',
972 'uintmax_t', etc. Use standard bool rather than a homegrown type.
973 * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
974 * src/csplit.c (FALSE, TRUE, boolean): Remove. All uses changed
975 to <stdbool.h> usage.
976 (struct control): offset is now intmax_t, not int.
977 repeat_forever is now bool, not int.
978 (struct cstring): len is now size_t, not unsigned int.
979 (struct buffer_record): bytes_alloc, bytes_used, num_lines are now
980 size_t, not unsigned. start_line, first_available are now
981 uintmax_t, not unsigned.
982 (hold_count, control_used): Now size_t, not unsigned.
983 (last_line_number, current_line, bytes_written):
984 Now uintmax_t, not unsigned.
985 (save_to_hold_area, red_input, keep_new_line, record_line_starts,
986 create_new_buffer, get_new_buffer, load_buffer, find_line,
987 process_regexp, split_file, new_control_record, extract_regexp,
988 get_format_width, get_format_prec, max_out):
989 size args, locals, and returned values are now size_t, not unsigned
991 (get_first_line_in_buffer, find_line, write_to_file,
992 handle_line_error, process_line_count, regexp_error, process_regexp,
994 File line, byte, and repetition counts are now uintmax_t, not unsigned.
995 (check_for_offset): Don't require a sign before the offset.
996 Use xstrtoimax to do the real work.
997 (extract_regexp): Remove harmful cast of size to unsigned.
998 256 -> 1<<CHAR_BIT, for clarity.
999 (get_format_flags): Return at most 3, to avoid worries about overflow.
1001 (bytes_to_octal_digits): Remove.
1003 (cleanup): Don't check whether output_stream is NULL, since
1004 close_output_file does that for us.
1006 (new_line_control, create_new_buffer): Use "foo *p = xmalloc
1007 (sizeof *p);" instead of the more long-winded alternatives.
1009 (get_new_buffer): Use O(1) algorithm for resizing a buffer
1010 to a much larger size, instead of an O(N) algorithm.
1012 (process_regexp): Use plain NULL rather than casted 0.
1014 (make_filename): Use %u, not %d, to format unsigned file number.
1016 (new_control_record): Use xrealloc exclusively, since it handles
1019 (extract_regexp): Change misspelled word in diagnostic.
1021 (get_format_width): Even if a minimum field width is specified,
1022 allow room for enough octal digits to represent the value of
1023 the maximum representible integer. This fixes a potential
1024 buffer overrun. Calculate this room at compile-time, not
1025 at run-time; this removes the need for bytes_to_octal_digits.
1026 Check for overflow; this removes a FIXME.
1028 (get_format_prec): Don't allow precision to be signed; it's
1029 not ANSI. Check for overflow. Remove hardcoded "11" as
1030 default precision; this fixes a potential buffer overrun
1031 on hosts with wider size_t.
1033 (get_format_conv_type): Change local variable to be of type
1034 unsigned char, not int; this removes a potential subscript
1035 violation on hosts where char is signed.
1037 (max_out): Replace "for (;*p;)" with more-standard "while (*p)".
1038 Allow "%%" in format. Don't overflow when
1039 counting lots of percents.
1041 (usage): Default sprintf format is %02u, not %d.
1043 2003-10-05 Jim Meyering <jim@meyering.net>
1045 * src/chown-core.c (change_file_owner): Remove set-but-not-used local.
1047 * src/du.c (du_files): Mark diagnostic for translation.
1049 2003-10-04 Jim Meyering <jim@meyering.net>
1051 * src/du.c (du_files): Ignore any failure of fts_close.
1052 Give better diagnostics for failed fts_open.
1054 * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition.
1056 Deprecate existing use of -H (aka --si).
1057 * src/du.c (enum) [HUMAN_SI_OPTION]: New member.
1058 [long_options]: Use HUMAN_SI_OPTION, not 'H'.
1059 (main): Warn that the meaning of -H will soon change to be
1062 2003-10-03 Jim Meyering <jim@meyering.net>
1064 * src/du.c: Accept --no-dereference (-P).
1066 2003-10-02 Jim Meyering <jim@meyering.net>
1068 * tests/du/trailing-slash: Adjust for slightly different output.
1070 Rewrite du.c to use fts.
1071 * src/du.c: Include "fts_.h", not ftw.h.
1072 (opt_dereference_arguments, arg_length, suffix_length): Remove globals.
1073 (IS_FTW_DIR_TYPE): Remove definition.
1074 (IS_DIR_TYPE): Define.
1075 (is_symlink_to_dir): Remove now-unnecessary function.
1076 (process_file, du_files): Rewrite to use fts.
1078 * tests/du/inaccessible-cwd: Ensure that even when run from an
1079 inaccessible directory, du can still operate on accessible
1080 directories elsewhere.
1081 * tests/du/Makefile.am (TESTS): Add inaccessible-cwd.
1083 * tests/rm/deep-1: Ensure that du can process a hierarchy
1084 of depth 400 while using no more than 50KB of stack space.
1086 2003-10-01 Akim Demaille <akim@epita.fr>
1088 * announce-gen (print_news_deltas): New function, extracted from main.
1089 (main): Make `news_file' an array.
1090 Use '...=s' => \@var for --news and --url-directory specs.
1091 Before there were a couple of portability problems.
1093 2003-09-28 Jim Meyering <jim@meyering.net>
1095 * Makefile.maint (sc_cast_of_alloca_return_value): New rule.
1096 (syntax-check-rules): Add it.
1098 * src/copy.c: Remove unnecessary cast of alloca, since now it's
1099 guaranteed to be (void *).
1100 * src/cp.c: Likewise.
1101 * src/join.c: Likewise.
1102 * src/ln.c: Likewise.
1103 * src/ls.c: Likewise.
1104 * src/od.c: Likewise.
1105 * src/sys2.h (ASSIGN_STRDUPA): Likewise.
1107 2003-09-27 Jim Meyering <jim@meyering.net>
1109 Don't exhaust virtual memory when processing large inputs.
1110 Fix this by removing csplit's internal free-list management;
1111 instead rely on malloc for that.
1113 * src/csplit.c (free_list): Remove global.
1114 (clear_all_line_control): Remove function.
1115 (get_new_buffer): Always use create_new_buffer to obtain a
1116 new buffer, rather than searching free_list.
1117 (free_buffer): Just call free.
1118 Reported by Nikola Milutinovic.
1120 2003-09-26 Jim Meyering <jim@meyering.net>
1122 * man/rm.x: Also list `chattr' in SEE ALSO section.
1123 Suggestion from Mark Hubbart.
1125 2003-09-25 Jim Meyering <jim@meyering.net>
1127 * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now
1128 that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them.
1130 * Use autoconf-2.57d. Regenerate dependent files.
1132 2003-09-24 Jim Meyering <jim@meyering.net>
1134 Minor efficiency tweak.
1135 * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
1136 (do_link): Likewise.
1138 2003-09-23 Jim Meyering <jim@meyering.net>
1140 * src/paste.c (paste_serial): Save errno after input error,
1141 to report proper errno value.
1142 Based on a patch from Paul Eggert.
1144 * src/tee.c (tee): Adjust fwrite arguments so that the return
1145 value is the number of bytes written.
1147 2003-09-16 Paul Eggert <eggert@twinsun.com>
1149 Don't assume ferror sets errno. Bug reported by Bruno Haible.
1151 * src/comm.c (compare_files): Save errno after input error,
1152 to report proper errno value.
1153 * src/fold.c (fold_file): Likewise.
1154 * src/od.c (check_and_close, skip, read_char, read_block): Likewise.
1155 * src/unexpand.c (unexpand): Likewise.
1157 * src/csplit.c (close_output_file): Don't report bogus errno value
1158 after ferror discovers an output error. We don't know the proper
1159 errno value, since it might have been caused by any of a whole
1160 bunch of calls, and it might have been trashed in the meantime.
1161 Fixing this problem will require much more extensive changes;
1162 in the meantime just say "write error".
1163 * src/od.c (check_and_close, dump, dump_strings): Likewise.
1164 * src/uniq.c (check_file): Likewise.
1166 * src/join.c (get_line): Report error right away if I/O fails,
1167 so that the proper errno value is used.
1168 * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise.
1169 * src/tee.c (tee): Likewise.
1170 * src/uniq.c (check_file): Likewise.
1172 * src/od.c (skip): If a read fails, don't retry it later, so
1173 that we report the proper errno.
1175 * src/tac.c (tac_mem): Don't return a value; nobody uses it.
1177 * src/tee.c (tee): Once a write failure has occurred, don't bother
1178 writing anything more to that stream.
1180 * src/uniq.c (check_file): Check for ferror (stdout) even if
1183 * src/yes.c (UNROLL): Remove.
1184 (main): Exit immediately when write failure is detected.
1185 Simplify code by assigning to argv when argc == 1.
1187 2003-09-21 Paul Eggert <eggert@twinsun.com>
1189 * src/ptx.c: Switch encoding from Latin-1 to UTF-8.
1190 (WRITTEN_BY): Change "Franc,ois" (actually using
1191 c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
1194 2003-09-19 Jim Meyering <jim@meyering.net>
1196 `du -D symlink-to-dir' would mistakenly omit the slash in
1197 lines like this: 24 symlink-to-dir/subdir
1198 * src/du.c (process_file): Fix offset calculation.
1199 Reported by Jeff Sheinberg as Debian bug #211591;
1200 http://bugs.debian.org/205251
1202 * tests/du/deref-args: New file/test for the above.
1203 * tests/du/Makefile.am (TESTS): Add deref-args.
1205 * src/du.c (process_file): Remove useless disjunct.
1207 * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
1209 * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
1210 Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
1211 Mark each WRITTEN_BY string as translatable.
1213 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1214 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1215 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1216 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1217 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1218 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1219 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1220 * who.c, whoami.c, yes.c: Revert yesterday's changes.
1221 Instead, a subsequent change will embed `Written by ' in
1222 each string along with the author names.
1224 * src/true.c: Revert yesterday's changes.
1225 * src/sys2.h: Likewise.
1227 2003-09-18 Jim Meyering <jim@meyering.net>
1229 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1230 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1231 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1232 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1233 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1234 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1235 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1236 * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
1237 comma-separated list of strings and/or update the call to
1238 parse_long_options so that `AUTHORS, NULL' are the last parameters.
1239 * src/true.c (main): Append NULL to version_etc argument list.
1240 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
1242 * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
1243 shadowing the math function name. Also rename loga to log_a.
1245 2003-09-14 Jim Meyering <jim@meyering.net>
1247 * src/factor.c (print_factors): Give a separate diagnostic
1248 for numbers that are too large, but otherwise valid.
1249 Reported by Dániel Varga.
1251 2003-09-10 Jim Meyering <jim@meyering.net>
1253 * Use automake-1.7.7. Regenerate dependent files.
1255 * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
1256 of `fmt -1'. Using the just-built tr is a little cleaner.
1257 Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
1258 * man/Makefile.am (programs, check-x-vs-1): Likewise.
1260 2003-09-09 Jim Meyering <jim@meyering.net>
1262 * src/copy.c: Alphabetize includes.
1263 Remove duplicate inclusion of "same.h".
1265 2003-09-08 Jim Meyering <jim@meyering.net>
1267 * Makefile.maint (GZIP_ENV): Remove --rsyncable.
1268 Didn't give enough of a benefit, mainly because it's not yet
1273 * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
1274 (check-programs-vs-x): Fail if $(programs) is empty.
1276 * src/remove.c: Add a comment.
1278 2003-09-07 Jim Meyering <jim@meyering.net>
1280 * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
1281 Don't define. These symbols are no longer used.
1283 * tests/misc/tty-eof: Write ^D as \cD.
1284 Complete the change of 2003-08-02.
1286 * Makefile.maint (po-check): Use cvsu, so that a temporary source
1287 file in lib/ or src/ doesn't induce an unwarranted failure.
1288 Add a kludge to filter out the sole generated source file that
1289 also has translatable messages: src/false.c.
1291 2003-09-06 Jim Meyering <jim@meyering.net>
1293 * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
1294 (parse_options): Give a diagnostic for (but still accept) the
1295 deprecated --allow-missing option.
1297 2003-09-04 Paul Eggert <eggert@twinsun.com>
1299 Don't ignore -S if input is a pipe. Bug report by Michael McFarland in
1300 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
1302 * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the
1303 size_bound ourselves. if an input file is a pipe and the user
1304 specified a size, use that size instead of trying to guess the
1305 pipe size. This has the beneficial side effect of avoiding the
1306 overhead of default_sort_size in that case. All callers changed.
1307 (sort): Remove static var size; now done by sort_buffer_size.
1309 2003-09-05 Jim Meyering <jim@meyering.net>
1311 * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files.
1313 * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
1314 to start, rather than just .1. Upon failure, print unexpected state.
1316 2003-09-04 Paul Eggert <eggert@twinsun.com>
1318 * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
1319 SAFE_READ_ERROR to tmp->nbytes.
1320 * src/tail.c (pipe_lines, pipe_bytes): Likewise.
1322 * src/head.c (struct linebuffer): Change nbytes and nlines
1323 from unsigned int to size_t. unsigned int is safe (after the
1324 2003-09-03 patch) but size_t is cleaner.
1325 * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
1326 (pipe_bytes): Likewise for local variable 'i', which was 'int'.
1328 Standardize on BUFSIZ as opposed to other macro names and values.
1329 * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ.
1330 * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
1331 stdio.h has always defined it,
1332 and other code already assumes it's defined.
1333 * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
1334 (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
1335 (io_buf): IO_BUF_SIZE -> BUFSIZ.
1337 2003-09-04 Paul Eggert <eggert@twinsun.com>
1339 * src/seq.c (step): Default to 1.
1340 (print_numbers): Allow the output to be empty.
1341 (main): The default step is 1, even if LAST < FIRST;
1342 as per documentation.
1343 * tests/seq/basic (onearg-2): Output should be empty.
1345 2003-09-05 Jim Meyering <jim@meyering.net>
1347 * Makefile.cfg (wget_files): Temporarily disable, until master
1348 versions are restored to ftp.gnu.org.
1350 * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
1352 Make seq's --width (-w) option work properly even when the
1353 endpoint requiring the larger width is negative and smaller than
1355 * src/seq.c (get_width_format): Include `-' in the set of bytes
1356 allowed in a `simple' number (no decimal point, no exponent).
1357 Reported by Patrick Mauritz.
1359 2003-09-02 Paul Eggert <eggert@twinsun.com>
1361 * NEWS: sort -t '\0' now uses a NUL tab.
1362 sort option order no longer matters, unless POSIX requires it.
1363 * src/sort.c (usage): Say "blanks" instead of "whitespace",
1364 Similar fixes for many comments.
1365 (TAB_DEFAULT): New constant, so that we can support NUL as
1366 the field separator.
1367 (tab): Now int, not char. Initialize to TAB_DEFAULT.
1368 (specify_sort_size): If multiple sizes are specified, use the largest.
1369 (begfield, limfield): Support NUL tab char.
1370 (set_ordering): Do not let -i override -d.
1371 (main): Report an error if incompatible -o or -t options are given.
1372 Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
1374 2003-09-05 Jim Meyering <jim@meyering.net>
1376 * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
1378 2003-09-03 Andreas Schwab <schwab@suse.de>
1380 Bug report and patch here:
1381 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
1382 * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
1383 * src/head.c (elide_tail_lines_pipe): Likewise.
1385 2003-09-03 Jim Meyering <jim@meyering.net>
1387 * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
1388 small amount of code from him was first moved to lib/human.c, and was
1389 subsequently rewritten entirely.
1390 * src/df.c (AUTHORS): Likewise.
1392 2003-08-22 Lawrence Teo <lcteo@uncc.edu>
1394 * src/md5sum.c (split_3): Accept the BSD format for generic
1395 message digest modes. Currently works with BSD's MD5 and SHA1
1396 formats since these are the two algorithms presently used in
1397 coreutils. Updated comments to reflect this change.
1398 (bsd_split_3): Updated comments.
1400 * tests/md5sum/basic-1: New test to make sure that
1401 `md5sum --check' doesn't accept the BSD SHA1 format (adapted
1402 from `check-bsd' test in tests/sha1sum/basic-1).
1404 * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
1405 --check exit status and BSD SHA1 format (adapted from tests
1406 in tests/md5sum/basic-1).
1408 2003-08-30 Jim Meyering <jim@meyering.net>
1410 * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
1412 When source and destination arguments refer to the same file, reside
1413 on a partition (e.g. VFAT) on which distinct names may refer to the
1414 same directory entry (often due to variations in case), and when the
1415 link count for the file is 1, mv no longer unlinks the file. Instead,
1416 it gives the expected diagnostic that the source and destination are
1417 the same. WARNING: this is an incomplete fix. If the file happens
1418 to have a link count of 2 or greater, such an erroneous mv command
1419 will still unlink it.
1420 Although that is not possible on vfat or umsdos, it is possible on
1421 other file system types, e.g., ntfs, and hpfs.
1422 * src/copy.c (same_file_ok): Invoke same_name (which might still
1423 return false for names that refer to the same directory entry)
1424 only if the link count is 2 or more.
1425 * tests/mv/vfat: Show how to demonstrate the above problem.
1426 This test is not run.
1427 * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
1429 2003-08-27 Jim Meyering <jim@meyering.net>
1431 * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
1432 who's -l option has been eliciting an unconditional warning about
1433 this impending change since sh-utils-2.0.12 (April 2002).
1435 * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
1436 This would happen for nonempty files not ending with a newline.
1437 Reported by Dan Jacobson.
1438 * tests/misc/paste-no-nl: New file. Test for above-fixed bug.
1439 * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
1441 * src/stat.c (print_it): Avoid buffer overrun that would
1442 occur when the user-specified format string ends with `%'.
1443 Patch by Tommi Kyntola.
1444 * tests/misc/stat-fmt: New file. Test for above-fixed bug.
1445 * tests/misc/Makefile.am (TESTS): Add stat-fmt.
1447 2003-08-26 Jim Meyering <jim@meyering.net>
1449 Apply changes from bison.
1450 * GNUmakefile (SHELL): Define to `sh', if necessary.
1452 * Makefile.maint (WGETFLAGS): Define to `-C off'.
1453 Update all uses of $(WGET).
1455 2003-08-22 Akim Demaille <akim@epita.fr>
1457 * Makefile.cfg (local-checks-to-skip): New.
1458 * Makefile.maint (local-check): Rename as...
1459 (local-checks-available): this.
1462 2003-08-26 Akim Demaille <akim@epita.fr>
1464 * announce-gen (print_changelog_deltas): Neutralize "<#" as
1465 "<\#" to avoid magic from Gnus when posting parts of this script.
1467 2003-08-25 Jim Meyering <jim@meyering.net>
1469 * src/stat.c (main): Warn about use of deprecated `-l' option.
1471 2003-08-22 Jim Meyering <jim@meyering.net>
1473 * src/stat.c (do_stat): For link count at end of line, use %h format,
1474 instead of %-5h. The latter would make stat emit trailing spaces.
1475 Reported by Dan Jacobson.
1477 2003-08-20 Jim Meyering <jim@meyering.net>
1479 * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
1481 2003-08-19 Jim Meyering <jim@meyering.net>
1483 * src/system.h: Include stdlib.h unconditionally,
1484 as we're now assuming that part of hosted C89.
1486 2003-08-18 Jim Meyering <jim@meyering.net>
1488 * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
1489 to avoid warnings from gcc.
1491 2003-08-17 Jim Meyering <jim@meyering.net>
1493 Avoid unnecessary and sometimes time-consuming hostname lookups.
1494 * src/who.c (print_user): Use strchr, not strrchr.
1495 * src/pinky.c (print_entry): Likewise.
1496 Patch by Michael Stone.
1497 This fixes a typo I introduced in who-users.c on 1996-02-23.
1499 * Makefile.maint (makefile-check): Add 0-9 to the range of characters
1500 disallowed between `@...@'.
1502 2003-08-16 Paul Eggert <eggert@twinsun.com>
1504 * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
1505 done by gnulib .m4 files.
1506 (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
1507 * src/sys2.h (strtoull): Remove unused declaration.
1509 2003-08-16 Jim Meyering <jim@meyering.net>
1511 * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
1514 * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
1515 race condition bug. The bug would be triggered when tailing a file
1516 with file pointer not at beginning of file, and where the file was
1517 truncated to have a length of less than the initial offset at just
1518 the right moment (between the two lseek calls in this function).
1520 An invalid initial value for *read_pos would result in
1521 `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
1522 busy-wait rather than sleeping between iterations. The bug manifests
1523 itself only when tailing regular files that are initially nonempty.
1524 * src/tail.c (tail_bytes): Set *read_pos to new file offset after
1526 (tail_lines): Likewise, after lseek calls.
1527 Reported by Nick Estes. See http://bugs.debian.org/205251 for details.
1528 * tests/tail-2/tail-n0f: New file. Test for above fix.
1529 * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
1531 2003-08-15 Jim Meyering <jim@meyering.net>
1533 * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
1534 (sc_sun_os_names): Likewise.
1535 * .x-sc_space_tab, .x-sc_sun_os_names: New files.
1537 * man/help2man: Remove some SPACEs before TAB.
1539 2003-08-14 Paul Eggert <eggert@twinsun.com>
1541 * Makefile.maint (LC_ALL): Set to C.
1542 * man/Makefile.am (ASSORT): New var.
1543 (check-x-vs-1, programs): Use it.
1544 * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
1545 * tests/Makefile.am (ASSORT, all_programs): Likewise.
1547 2003-08-11 Jim Meyering <jim@meyering.net>
1549 fold -s -wN would infloop for N < 8 with TABs in the input.
1550 E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
1551 * src/fold.c (fold_file): Move contents of `else'-block
1552 out of conditional so it's used also for --spaces (-s).
1553 * tests/misc/fold: Test for the above fix.
1554 * tests/misc/Makefile.am (TESTS): Add fold.
1556 2003-08-10 Jim Meyering <jim@meyering.net>
1558 * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
1559 system.h so the types from time.h and sys/time.h are available.
1560 It appears that this is necessary for OpenBSD, NetBSD, and
1561 Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
1563 2003-08-06 Paul Eggert <eggert@twinsun.com>
1565 * NEWS: Add support for setting file timestamps to microsecond
1566 resolution, on hosts that support this.
1567 * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
1568 * src/copy.c (copy_internal):
1569 Set file timestamps with utimens, not utime.
1570 * src/cp.c (re_protect): Likewise.
1571 * src/install.c (change_timestamps): Likewise.
1572 * src/touch.c (newtime, touch, main): Likewise.
1574 2003-08-09 Jim Meyering <jim@meyering.net>
1576 * Makefile.maint (sc_sun_os_names): New rule based on a regexp
1578 (syntax-check-rules): Add it.
1580 * src/tail.c (main): Tweak Solaris OS version number in comment.
1581 * src/wc.c (wc): Likewise
1582 * tests/tail-2/fflush: Likewise.
1584 * src/tail.c: Add new undocumented option, --presume-input-pipe.
1585 (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
1587 2003-08-08 Paul Eggert <eggert@twinsun.com>
1589 Use new gnulib 'extensions' module.
1590 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
1593 2003-08-08 Paul Eggert <eggert@twinsun.com>
1595 * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
1597 2003-08-09 Jim Meyering <jim@meyering.net>
1599 * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
1600 For tests of obsolete behavior, don't presume that unsetting
1601 _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
1603 2003-08-07 Paul Eggert <eggert@twinsun.com>
1605 * doc/coreutils.texi (split invocation):
1606 Add -d or --numeric-suffixes option to 'split'.
1607 From a suggestion by Jesse Kornblum.
1608 * src/split.c (suffix_alphabet): New var.
1609 (longopts, usage, next_file_name, main): Support -d.
1610 (next_file_name, main): Allow -a0, as POSIX requires.
1611 (next_file_name): Don't assume ASCII-like encoding;
1612 'a' through 'z' are not contiguous in EBCDIC.
1614 2003-08-05 Paul Eggert <eggert@twinsun.com>
1616 Merge getline from gnulib.
1617 * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
1618 * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
1619 New files, from gnulib.
1620 * lib/getdelim2.c, lib/getdelim2.h: Remove.
1621 * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
1622 getdelim2.h to getndelim2.c and getndelim2.h.
1623 * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
1624 checking for getdelim.
1625 (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
1626 than rolling our own.
1627 * src/cut.c: Include getndelim2.h rather than getdelim2.h.
1628 (cut_fields): Invoke getndelim2 rather than getdelim2.
1630 2003-08-04 Jim Meyering <jim@meyering.net>
1632 * src/sort.c (main): Use unsigned int instead of int for `nsigs'
1633 and for the indices to iterate through nsigs.
1635 2003-08-02 Paul Eggert <eggert@twinsun.com>
1637 * src/sort.c: Minor code cleanups, mostly to use more accurate
1638 types and to remove unnecessary casts.
1639 (min, max): Remove. All uses changed to MIN and MAX.
1640 (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
1641 keyfield.skipsblanks, struct keyfield.skipeblanks, struct
1642 keyfield.numeric, struct keyfield.general_numeric, struct
1643 keyfield.month, struct keyfield.reverse, reverse, unique,
1644 have_read_stdin): Now bool, not int. All uses changed.
1645 (eolchar): Now char, not int.
1646 (struct keyfield.ignore): Now bool const *, not int *.
1647 (struct keyfield.translate): Now char const *, not char *.
1648 (struct month.name): Likewise.
1649 (blanks, nonprinting, nondictionary): Now bool[], not int[].
1650 (cleanup, inittables, keycompare, check, mergefps, first_same_file,
1651 check, sort, main): Use const * pointers when possible.
1652 (month_cmp): Rewrite to avoid casts.
1653 (inittables): Initialize tables unconditionally, to avoid branches.
1654 (fillbuf): Return bool, not int. All uses changed.
1655 (fillbuf, keycompare, new_key, main):
1656 Use SIZE_MAX rather than (size_t) -1.
1657 (trailing_blanks): Renamed from trim_trailing_blanks.
1658 Return the number of blanks to trim. All uses changed.
1659 (getmonth): Use trailing_blanks rather than open code.
1660 (keycompare): Do not cast char * to unsigned char *; not needed.
1661 CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
1663 (compare, main): Use | rather than || to avoid jumps.
1664 Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
1666 (check, first_same_file, sort, main):
1667 Use bool instead of int local vars when possible.
1668 (check): Merge the old 'checkfp' and 'check' into a single function,
1669 that returns a boolean (true if the file was ordered).
1671 (main): Use int instead of unsigned for iterating through nsigs.
1672 Rename local var "posix_pedantic" to "posixly_correct".
1674 2003-08-02 Jim Meyering <jim@meyering.net>
1676 * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
1677 to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
1679 * src/cut.c (cut_fields): Don't read again after encountering an
1680 initial EOF. E.g., `cut -f2' would do so.
1681 * tests/misc/tty-eof: Add a test for the above fix.
1683 * src/sort.c (sortlines): Add description and references.
1686 * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
1687 the tests in help-version will use the just-built binaries.
1688 Reported by Christian Krackowizer.
1690 2003-07-31 Paul Eggert <eggert@twinsun.com>
1692 * NEWS: Add --rfc-2822 option to GNU date.
1693 * doc/coreutils.texi (Time directives, Options for date, Examples
1695 * src/date.c (long_options, usage, main): Likewise.
1696 * doc/getdate.texi (General date syntax): Likewise.
1697 * doc/coreutils.texi (Options for date): Fix a typo in format:
1698 it's now %d not %_d. Add URLs.
1700 2003-08-01 Jim Meyering <jim@meyering.net>
1702 * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
1703 Otherwise, with at least the /bin/sh from HPUX 10.20,
1704 the trap code would end up converting that to exit 1 and thus an
1705 unexpected test failure. Reported by Christian Krackowizer.
1707 2003-07-31 Paul Eggert <eggert@twinsun.com>
1709 * src/ptx.c: Do not include bumpalloc.h.
1710 (WORD_TABLE): New member alloc.
1711 (ALLOC_NEW_WORD): Remove.
1712 (occurs_alloc): New var.
1713 (digest_word_file, find_occurs_in_text): Check for arithmetic
1714 overflow when computing table size. Use xrealloc rather than
1715 bumpalloc primitives.
1717 2003-07-29 Jim Meyering <jim@meyering.net>
1721 * README: When running tests as root, suggest using
1722 sudo with NON_ROOT_USERNAME=$USER.
1724 * tests/Makefile.am (all_programs): Makefile is in ../src, not
1727 2003-07-28 Jim Meyering <jim@meyering.net>
1729 * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
1731 2003-07-28 Paul Eggert <eggert@twinsun.com>
1733 * lib/stdbool.hin (_Bool): Make it signed char, instead of
1734 an enum type, so that it's guaranteed to promote to int.
1735 * src/sort.c (sortlines_temp): Undo previous change.
1737 2003-07-28 Jim Meyering <jim@meyering.net>
1739 * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
1740 `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
1741 would cause lines[-1 - swap] (with swap = false) to evaluate to
1744 2003-07-27 Jim Meyering <jim@meyering.net>
1746 * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
1747 since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
1749 * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
1750 directories, as required by POSIX. Reported by Karl Berry.
1751 * tests/rm/dir-no-w: New file. Test for the above fix.
1752 * tests/rm/Makefile.am (TESTS): Add dir-no-w.
1754 * tests/mk-script: Emit `$xx', not its expansion.
1756 2003-07-27 Paul Eggert <eggert@twinsun.com>
1758 This change was inspired by a similar proposal by Stepan Kasal.
1759 * src/sort.c (mergelines, sortlines_temp): New functions.
1760 (sortlines): Use them, to reduce the number of times that
1761 we need to copy 'struct line' values. This improved CPU
1762 performance by about 30% on one 18 MB test.
1763 (sort): Don't invoke sortlines unless we have 2 or more lines.
1765 2003-07-26 Stepan Kasal <kasal@ucw.cz>
1767 * src/sort.c (sort): Don't require two `struct line's per text line,
1768 the new sort algorithm requires just 1.5.
1770 2003-07-27 Jim Meyering <jim@meyering.net>
1772 * src/pathchk.c (validate_path): Use %lu, not %ld.
1774 * src/cut.c (is_printable_field): Simplify bit arithmetic.
1776 * src/ls.c (sort_files): Put `volatile' in the right place.
1779 2003-07-26 Jim Meyering <jim@meyering.net>
1781 Use only one bit per field/offset in array, not one `int'.
1782 * src/cut.c (printable_field): Change type to `unsigned char'.
1783 (mark_printable_field, is_printable_field): New functions.
1784 Use them in place of all direct accesses of `printable_field'.
1786 * src/expand.c (parse_tabstops): Detect overflow properly.
1787 * src/cut.c (set_fields): Likewise.
1789 * src/rm.c: Include "dirname.h".
1790 (usage): Use base_name (program_name) in body of --help output.
1792 * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
1793 Idea from Brendan O'Dea, who suggested using
1794 `program_name = basename (argv[0]);' everywhere --
1795 can't do that, but using base_name works just fine here.
1797 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
1799 2003-07-24 Paul Eggert <eggert@twinsun.com>
1801 Fix some POSIX-compliance problems with 'test'. This makes
1802 'test' more compatible with Bash.
1804 * NEWS, doc/coreutils.texi: Document the following.
1805 * src/test.c: Include exitfail.h.
1806 (TEST_FAILURE): New constant, used for exit status if 'test' fails.
1807 (test-syntax_error): Use it.
1808 (binary_operator): Now takes bool arg specifying whether left operand
1809 is -l ARG, so that caller determines this rather than us.
1811 (term): Use posixtest to evaluate parenthesized subexpressions.
1812 (unary_operator, one_argument): Remove support for -t without operand.
1813 (one_argument): Take argument from argv[pos].
1814 (one_argument, two_arguments, three_arguments): Advance pos.
1815 All callers changed.
1816 (three_arguments): Look for binary ops before "!". Then look
1817 for parenthesized one_argument expressions, instead of trusting
1818 expr () to do the right thing.
1819 (posixtest): Now takes number of args. All callers changed.
1820 Treat "( A B )" like "A B".
1821 (main): Set exit_failure to TEST_FAILURE. Don't depend on
1822 POSIXLY_CORRECT, as we now conform to POSIX by default.
1823 (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
1824 * tests/test/Test.pm (test_vector): Add several tests to check
1825 the above. Syntax errors now exit with status 2, not 1.
1826 * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
1828 2003-07-26 Jim Meyering <jim@meyering.net>
1830 * tests/help-version: Adjust for above change in test behavior:
1831 `[' exits with 2, not 1, and test doesn't accept --help or --version.
1833 * Makefile.maint (ME): Don't use trick suggested in Make manual.
1834 It doesn't work for make-3.79.1. Reported by Christian Krackowizer.
1836 * Makefile.maint (sc_system_h_headers): Another syntax check.
1837 (syntax-check-rules): Add it to the list.
1839 * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
1840 so it matches `%ld' format even on 32-bit systems.
1842 * src/fmt.c (flush_paragraph): Cast field width to `int' to
1843 avoid warning on 64-bit systems.
1845 * src/ls.c (sort_files): Make `func' volatile, so it can't be
1846 clobbered by a `longjmp' into this function.
1848 2003-07-25 Jim Meyering <jim@meyering.net>
1850 * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
1853 * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
1854 because it'd evoke spurious failure on 64-bit systems.
1856 2003-07-24 Jim Meyering <jim@meyering.net>
1858 * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
1859 output its current record counts. Reported by Jurriaan.
1861 * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
1862 `wc' with no options. This goes along with the change of 2003-07-20.
1864 2003-07-23 Jim Meyering <jim@meyering.net>
1866 Don't include headers already included by system.h:
1867 * src/tr.c: Don't include errno.h.
1868 * src/true.c: Don't include version-etc.h.
1869 * src/test.c: Don't include limits.h or error.h.
1870 * src/stat.c: Don't include unistd.h or time.h.
1871 * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
1872 * src/pr.c: Don't include time.h.
1873 * src/pathchk.c: Don't include errno.h.
1874 * src/nice.c: Don't include sys/time.h.
1875 * src/ls.c: Don't include stdlib.h.
1877 * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
1878 * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
1879 * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
1880 * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
1881 * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
1882 * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
1883 * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
1884 * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
1885 Don't include closeout.h.
1887 * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
1888 can access the required version of rm.
1889 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
1891 * tests/cut/Test.pm (out-delim3a): New test.
1893 * man/help2man: Update to version 1.33.
1895 * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
1897 * src/dircolors.c: Include xstrndup.h.
1898 (xstrndup): Remove function, now that it's been factored out into
1901 2003-07-22 Paul Eggert <eggert@twinsun.com>
1903 * src/wc.c (wc): Fix typo in computation of file from file_x,
1904 which caused the former to be used uninitialized if file_x was
1907 2003-07-22 Jim Meyering <jim@meyering.net>
1909 * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
1911 * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
1912 help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by
1913 Thomas Luzat. See http://bugs.debian.org/202413 for details.
1915 * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
1917 * src/hostid.c: Don't include <unistd.h>. system.h already does that.
1919 * src/cut.c (set_fields): Mark all selected indices before trying to
1920 determine range endpoints.
1921 * tests/cut/Test.pm: New test for the above fix.
1923 Begin to address this comment: What if someone wants to
1924 extract the 1,000,000-th field of some huge input file?
1925 The first step is to rearrange things so that the values
1926 in the printable_field array are all 0/1 rather than 0/1/2.
1927 * src/cut.c (RANGE_START_SENTINEL): Remove.
1928 Store range-start indices in a hash table, rather than
1929 overloading the `printable_field' array.
1930 (range_start_ht): New global.
1931 (hash_int, hash_compare_ints, is_range_start_index): New functions.
1932 (print_kth): Use is_range_start_index; don't test printable_field.
1933 (set_fields): Detect overflow.
1934 (set_fields): Insert each range-start index into range_start_ht.
1935 (main): Call set_fields only once, and only after
1936 output_delimiter_specified and (if required) range_start_ht have
1939 2003-07-20 Paul Eggert <eggert@twinsun.com>
1941 * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
1942 invoked with a null pointer when there were no file arguments.
1944 2003-07-20 Jim Meyering <jim@meyering.net>
1946 * Makefile.maint (sc_changelog): Add another nit-picky check.
1948 * src/wc.c (write_counts): Add a comment.
1949 (wc): Rename `file' parameter.
1950 Set new local, `file', to be the file name, or (when it's NULL)
1951 _("standard output") so that all uses of `file' use the proper value.
1952 Use STREQ, not strcmp.
1954 2003-07-20 Paul Eggert <eggert@twinsun.com>
1956 wc count field widths now are heuristically adjusted depending
1957 on the input size, if known. If only one count is printed, it
1958 is guaranteed to be printed without leading spaces.
1960 Previously, wc did not align the count fields if
1961 POSIXLY_CORRECT was set, but POSIX did not actually require
1962 this undesirable behavior, so it has been removed.
1964 * NEWS: Document this.
1965 * doc/coreutils.texi (wc invocation): Likewise.
1967 * src/wc.c (number_width): New var.
1968 (posixly_correct): Remove.
1969 (struct fstatus): New struct.
1970 (write_counts): Output fields of width number_width.
1971 Do not worry about POSIXLY_CORRECT.
1972 Use null file, not empty-string file, to denote stdin,
1973 since "" is a valid file name on some hosts.
1974 (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
1976 (wc): Avoid problems if end_pos - current_pos overflows.
1977 Do not print odd message if stdin has a read error.
1978 (get_input_fstatus, compute_number_width): New functions.
1979 (main): Use them to implement the new behavior.
1980 Ignore POSIXLY_CORRECT.
1982 * tests/wc/Test.pm: Adjust to the new output widths.
1984 2003-07-19 Jim Meyering <jim@meyering.net>
1986 * tests/rm/fail-eperm: Don't create temporary directory --
1989 * tests/shred/remove: Don't open-code test for UID != 0.
1990 Use priv-check's require-non-root instead.
1991 Update to use newer framework.
1993 * tests/help-version (expected_failure_status_expr): Record that
1994 expr exits with status of 3 for e.g., a write error.
1996 * tests/priv-check: Use `id -u' to see if we're running as root,
1997 rather than trying go write to an write-protected file.
1998 When running as root, ensure $NON_ROOT_USERNAME is valid.
1999 When running as root with `require-non-root', ensure that `.'
2000 is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
2001 to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test.
2003 * src/printenv.c: Include "exitfail.h".
2004 (main): Set exit_failure rather than calling close_stdout_set_status.
2005 * src/date.c: Likewise.
2006 * src/sort.c: Likewise.
2007 * src/tty.c: Likewise.
2009 2003-07-18 Jim Meyering <jim@meyering.net>
2011 * tests/touch/not-owner: Update to use newer framework.
2013 * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
2014 directory, and remove Perl-coded `you may not run as root' test.
2015 * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
2016 hard-coding something not quite equivalent.
2017 Paul Jarc reported the inconsistent diagnostics.
2019 * src/sort.c (main): Use close_stdout via atexit.
2020 Now `sort --version' and `sort --help' fail, as they should
2021 when their output is redirected to /dev/full.
2023 * src/su.c (usage): Don't call close_stdout here.
2024 (main): Use close_stdout via atexit.
2025 Now `su --version > /dev/full' fails, as it should.
2026 Somehow, the change of 2000-05-07 that purports to fix this
2029 * tests/help-version (--help/--version vs. /dev/full): Special-case
2030 `[' to protect it from expected_failure_status-`eval'.
2032 * src/uniq.c (writeline): Use a SPACE, not a TAB between the
2033 count and the corresponding line, as required by POSIX.
2034 Reported by Clement Wang.
2035 * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
2037 * tests/expr/basic: Add tests for when exit status is 2.
2039 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
2040 Use an anonymous `enum', rather than #define.
2042 2003-07-17 Paul Eggert <eggert@twinsun.com>
2044 * src/expr.c: Include "exitfail.h", "quotearg.h".
2045 (EXPR_INVALID, EXPR_ERROR): New constants.
2046 (nomoreargs, null, toarith, nextarg): Return bool, not int.
2047 (syntax_error): New function, exiting with status 2. Use it
2048 insteading of printing "syntax error" ourselves.
2049 (main): Initialize exit_failure to EXPR_ERROR.
2050 Exit with EXPR_INVALID on syntax error (too few arguments).
2051 (nextarg): Use strcmp, not strcoll; strcoll might return
2052 an undesirable 0, or might fail.
2053 (docolon, eval4, eval3): Exit with status 3 on invalid argument type
2054 or other such error.
2055 (eval2): Report an error if strcoll fails in a string comparison.
2056 * src/sort.c: Include "exitfail.h".
2057 (main): Set exit_failure, not xalloc_exit_failure and
2058 xmemcoll_exit_failure.
2059 * tests/expr/basic: Invalid value exits with status 3, not 2.
2061 2003-07-16 Jim Meyering <jim@meyering.net>
2063 * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
2064 per GNU maintainer guidelines. The next non-beta release will be 5.1.
2066 This script would have caught at least two recent bugs:
2067 those in [ and kill.
2068 * tests/help-version: Revive this script.
2069 It wasn't doing anything useful, since $all_programs wasn't being
2070 defined by the invoking Makefile.am.
2071 Reflect that nohup is no longer a script, so don't exclude it.
2072 Add framework to handle the programs added since it was last run:
2073 kill, stat, unlink, [, link, readlink.
2074 Fix path-related problems deriving from the move of this script
2075 from src/ to its present location.
2076 * tests/Makefile.am (all_programs): Define.
2077 (TESTS_ENVIRONMENT): Use it.
2079 * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
2080 whereby kill would always attempt to operate on argv[0] and fail.
2082 * src/test.c (integer_expected_error): Improve diagnostic -- now,
2083 it also matches the one from bash's builtin test.
2084 (binary_operator): Add \n at end of diagnostic.
2086 * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ...
2087 * tests/priv-check: Move setuidgid-related and
2088 NON_ROOT_USERNAME-checking code to this file.
2090 * README: Update section on testing as `root'.
2091 Suggestion from Paul Jarc.
2093 * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
2094 names of authors that I just found in bash's builtins/test.def.
2096 Running `[' with no arguments would evoke a segfault.
2097 * src/test.c (main) [LBRACKET]: Move initialization of argv to
2098 precede potential use via test_syntax_error.
2100 * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
2101 warning from automake -Wall.
2103 2003-07-15 Jim Meyering <jim@meyering.net>
2107 * Makefile.maint (%.asc): Remove target first, so gpg doesn't
2110 * announce-gen (print_changelog_deltas): Relax tests for matching
2111 version-number line in NEWS.
2112 Change the .sig suffix to .asc here, too.
2114 2003-07-14 Jim Meyering <jim@meyering.net>
2116 * Makefile.maint (%.asc): Renamed from %.sig.
2117 Generate and use ascii-armored signatures.
2118 Use gpg's -o option.
2120 2003-07-13 Jim Meyering <jim@meyering.net>
2122 * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
2125 * Makefile.maint (syntax-check): Move each individual check into
2127 (syntax-check-rules): This is the list of syntax-check targets.
2128 (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
2129 (sc_cast_of_x_alloc_return_value, sc_space_tab):
2130 (sc_error_exit_success, sc_xalloc_h_in_src): New targets.
2132 2003-07-12 Jim Meyering <jim@meyering.net>
2134 * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
2135 traces of the nohup script.
2137 * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
2138 $(OPTIONAL_BIN_ZCRIPTS).
2140 * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
2141 target, not before the `>'.
2143 * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
2144 now that that function no longer calls `error'.
2146 * src/df.c (find_mount_point): Emit a diagnostic for each
2147 failed syscall, rather than relying on caller to do that.
2148 The caller couldn't do a good job, anyhow -- too many different
2149 ways to fail (each with a different referent).
2150 Give a diagnostic upon failed save_cwd, now that that function
2151 no longer calls `error'.
2152 (show_point): Don't diagnose find_mount_point's errors, now that
2153 it handles them itself.
2155 * src/df.c (find_mount_point): Don't let free clobber errno upon
2158 * src/sys2.h: Remove alloca-related block.
2159 * src/system.h: Include <alloca.h> here, instead.
2161 It appears that the `#pragma alloca' included via "system.h" is
2162 adequate, since join.c uses alloca, yet lacked an in-file #pragma.
2163 * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
2164 * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
2166 * src/chown-core.c (change_file_owner): Do not restore any special
2167 permission bits (e.g., set-user-ID, set-group-ID) that are reset
2168 by chown(2) on some systems. Suggestion and insistence :-) from
2171 * tests/input-tty: Also check `test -t 1'.
2172 This is necessary on linux-2.4.21. Otherwise, the stty/basic-1
2173 test would block when run in the background.
2175 2003-07-11 Jim Meyering <jim@meyering.net>
2177 * tests/sample-test: Also fail if cat-to-create-expected-output
2178 fails. Otherwise, if both `exp' and `out' were to end up empty
2179 because of e.g., a full disk, they would mistakenly compare equal.
2181 * src/nohup.c: New file. Rewrite of nohup.sh in C.
2182 This solves a portability problem: on at least Solaris systems,
2183 when nohup.sh used the vendor /bin/sh, it would exit with status
2184 of `1' rather than the required 126 or 127 upon failure to exec
2185 the specified program.
2187 * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
2188 (bin_PROGRAMS): Add nohup.
2189 (EXTRA_DIST): Remove nohup.sh.
2190 (all_programs): Remove use of $(EXTRA_SCRIPTS).
2191 * src/nohup.sh: Remove file.
2192 * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
2194 * tests/misc/nohup: Tests for the above.
2195 * tests/misc/Makefile.am (TESTS): Add nohup.
2197 * src/head.c (diagnose_copy_fd_failure): New function, renamed from
2198 the macro, COPY_FD_DIAGNOSE.
2199 (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
2200 (head_file): Likewise.
2202 * src/date.c: Include "quote.h".
2203 (batch_convert): Use the quote function rather than using literal `...'
2206 * src/setuidgid.c (main): Enclose diagnostic in _(...).
2207 * src/fmt.c (main): Likewise.
2208 * src/mknod.c (main): Likewise.
2209 * src/tac.c (tac_seekable): Likewise.
2210 * src/yes.c (main): Likewise.
2211 * src/od.c (main): Likewise.
2212 * src/install.c (change_attributes): Likewise.
2214 2003-07-10 Jim Meyering <jim@meyering.net>
2216 * src/head.c (usage): Use 1024*1024 in place of 1048576.
2217 * src/tail.c (usage): Likewise.
2219 * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
2220 place of the kludge in this test. Suggestion from Paul Jarc.
2222 * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
2223 * src/setuidgid.c: New program, solely for testing (not installed).
2225 * src/chown-core.c (change_file_owner): Don't leak file descriptors
2226 when dereferencing symlinks.
2228 2003-07-09 Jim Meyering <jim@meyering.net>
2230 * tests/du/slash: New file/test for today's lib/ftw.c fix.
2231 * tests/du/Makefile.am (TESTS): Add slash
2233 * src/tail.c (xlseek): Avoid warning about ``return without value
2234 from function returning non-void''.
2236 2003-07-08 Jim Meyering <jim@meyering.net>
2238 * man/help2man: Update to version 1.29.
2240 * man/help2man: Add END handler to close STDOUT and check for errors.
2242 2003-06-30 Paul Eggert <eggert@twinsun.com>
2244 Add support for a "[" that conforms to the GNU coding standards,
2245 i.e., that does not depend on its name.
2246 * src/lbracket.c: New file.
2248 * man/Makefile.am (programs): Ignore "[", since it doesn't have
2249 a separate man page.
2250 * src/Makefile.am (bin_PROGRAMS): Add "[".
2251 (__SOURCES): New var.
2252 * src/test.c (LBRACKET): Define to 0 if not defined.
2253 (main): Use LBRACKET rather than argv[0].
2255 * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
2256 Reported by Paul Jarc and Dan Jacobson.
2258 * src/test.c (main): Do not recognize --help or --version if
2259 POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
2260 Do not bother testing that margv[margc] is non-null.
2262 2003-07-04 Jim Meyering <jim@meyering.net>
2264 * src/who.c (print_line): Rewrite to use asprintf, in order to be
2265 able to avoid emitting trailing spaces. Reported by Dan Jacobson.
2267 * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
2268 option, and perform the +1600 invocations of head IFF the envvar
2269 RUN_EXPENSIVE_TESTS is set.
2271 2003-07-03 Jim Meyering <jim@meyering.net>
2273 * src/cp.c (do_copy): Give a better diagnostic when failing due
2274 to nonexistent destination directory. Reported by Dmitry Rutsky.
2275 See http://bugs.debian.org/199730 for details.
2277 2003-06-27 Jim Meyering <jim@meyering.net>
2279 split's --verbose option did nothing [broken in 4.5.10 and 5.0]
2280 * src/split.c (longopts): Use `1', not `0' as the value for
2281 for &verbose. Reported by Keith Thompson.
2283 Test for the above fix.
2284 * tests/misc/split-a: Also use --verbose and compare stderr
2285 output with what we'd expect.
2287 2003-06-20 Jim Meyering <jim@meyering.net>
2289 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2290 Use `error_t' (rather than int) as type for local `err'.
2291 From Alfred M. Szmidt.
2293 2003-06-19 Marcus Brinkmann <marcus@gnu.org>
2295 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2296 Fix author preservation code.
2298 2003-06-19 Jim Meyering <jim@meyering.net>
2300 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
2301 (do_link): Don't warn about hard link to symlink.
2303 2003-06-18 Jim Meyering <jim@meyering.net>
2305 * src/cut.c: Include "getdelim2.h", not "getstr.h".
2306 Reflect renaming: getstr -> getdelim2.
2308 * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
2309 readline -> readlinebuffer.
2311 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2313 * src/readlink.c: Include <sys/types.h> before system.h (because
2314 the latter includes <sys/stat.h>). Required on Ultrix 4.3.
2316 2003-06-17 Jim Meyering <jim@meyering.net>
2318 * src/system.h (initialize_main): Define.
2319 Use it in every `main'. Applied via this:
2320 p='initialize_main (&argc, &argv);'
2321 perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \
2322 $(grep -l program_name.=.argv.0 *.c)
2323 test.c uses margc/margv, so I made the change manually for that file.
2324 Based on a patch from Bernard Giroud.
2326 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2328 Fix for build failure on Ultrix 4.3.
2329 * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
2330 Include sys/param.h and sys/mount.h on ultrix.
2332 2003-06-16 Jim Meyering <jim@meyering.net>
2334 * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
2336 * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
2337 them here instead, but with one change: define EISDIR to -1, not 0.
2339 * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
2340 guaranteed to be defined.
2341 * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
2343 * README: Mention the CVS repository.
2344 Encourage addition of test cases.
2346 2003-06-12 Jim Meyering <jim@meyering.net>
2348 * src/touch.c (touch): Call close only if necessary.
2351 * src/wc.c (usage): Correct wording: wc prints counts in the order
2352 `newline, word, byte'. Reported by Keith M. Briggs.
2353 * man/wc.x: Fix it here, too. And change `lines' to `newlines'.
2355 2003-06-10 Jim Meyering <jim@meyering.net>
2357 * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
2359 2003-06-07 Jim Meyering <jim@meyering.net>
2361 * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
2364 2003-06-06 Jim Meyering <jim@meyering.net>
2366 * src/extract-magic (main): Avoid newer 3-arg form of open,
2367 so this script works also with e.g., perl5.005_03.
2368 Patch by John David Anglin.
2370 2003-06-04 Paul Eggert <eggert@twinsun.com>
2372 * src/system.h: Include <stdbool.h> unconditionally.
2374 2003-06-04 Jim Meyering <jim@meyering.net>
2376 * man/Makefile.am (check-programs-vs-x): Rename target
2377 from check-programs-vs-1. Adjust rule to check for the
2378 primary (.x) file, not the generated one (.1).
2380 2003-06-03 Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
2382 * man/kill.x: New file.
2383 * man/Makefile.am (dist_man_MANS): Add kill.1.
2386 2003-06-04 Jim Meyering <jim@meyering.net>
2388 Ensure that the .x file for a new program is never forgotten again.
2389 * man/Makefile.am (programs): Define.
2390 (check-programs-vs-1): New phony target.
2391 (check-local): Depend on it.
2393 2003-06-03 Jim Meyering <jim@meyering.net>
2395 Avoid unnecessary copying of environment.
2396 * src/env.c (main): Rather than clearing the environment and --
2397 unless told to ignore environment -- copying all settings from
2398 the saved, original environment, clear the environment only when
2399 that is requested. Suggested by Jens Elkner.
2401 2003-06-02 Jim Meyering <jim@meyering.net>
2403 * src/system.h: Always include <string.h>, since we assume C89.
2404 Include <limits.h> without checking for HAVE_LIMITS_H.
2406 * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
2407 (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
2409 2003-06-01 Jim Meyering <jim@meyering.net>
2411 Avoid a race condition in `tail -f' described by Ken Raeburn in
2412 http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
2413 * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
2414 (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
2415 (tail_bytes, tail_lines, tail): Likewise.
2416 (tail_file): Use the new `read_pos' value as the size,
2417 rather than stats.st_size from the fstat call.
2419 2003-05-28 Jim Meyering <jim@meyering.net>
2421 * src/extract-magic: Allow expansion of `$file' in the here-
2422 document corresponding to the comment at the top of fs.h.
2424 2003-05-26 Jim Meyering <jim@meyering.net>
2426 * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
2427 <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
2428 Use #if/#elif/... cascade so we get only one set of include files.
2429 Reported by Nelson Beebe.
2431 2003-05-24 Jim Meyering <jim@meyering.net>
2433 * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
2434 * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
2435 accept the BSD format.
2437 2003-03-28 Joe Orton <jorton@redhat.com>
2439 * src/md5sum.c (bsd_split_3): New function.
2440 (split_3): Detect checksums from BSD 'md5' command and handle them
2443 * tests/md5sum/basic-1: New tests for --check exit status, and for
2444 BSD-style checksum files.
2446 2003-05-21 Jim Meyering <jim@meyering.net>
2448 * src/head.c (elide_tail_lines_pipe): Fix a thinko.
2449 This sort of thing is why it'd be *Really Good* to factor
2450 out the common code used here and in tail.c.
2452 2003-05-14 Jim Meyering <jim@meyering.net>
2454 * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
2456 * tests/du/slink: Skip this test if `.' is on an XFS file system.
2458 * tests/du/fd-leak: New file. Test for the bug in du that
2459 was fixed by the 2003-05-12 change to lib/ftw.c.
2460 * tests/du/Makefile.am (TESTS): Add fd-leak.
2462 * src/head.c (AUTHORS): Enclose string in N_(...), now that it
2463 includes a translatable word, `and'.
2465 * src/dd.c (usage): Don't use `,' as the thousands separator
2466 in e.g. 1,000,000 and 1,048,576. Instead, do this:
2467 `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
2468 * src/df.c (usage): Likewise.
2469 * src/du.c (usage): Likewise.
2470 * src/ls.c (usage): Likewise.
2472 * Makefile.maint (syntax-check): Add another check.
2474 2003-05-13 Paul Eggert <eggert@twinsun.com>
2476 Fix uniq to conform to POSIX, which requires that "uniq -d -u"
2477 must output nothing. Problem reported by Josh Hyman.
2479 * src/uniq.c (enum output_mode, mode): Remove, replacing with:
2480 (output_unique, output_first_repeated, output_later_repeated):
2481 New vars. All uses of "mode" changed to use these variables,
2482 which are not mutually exclusive as "mode" was.
2483 (writeline): New arg "match", used to control whether to
2484 obey output_first_repeated or output_later_repeated.
2485 All callers changed.
2486 (check_file, main): Adjust to above changes.
2488 * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
2490 2003-05-14 Jim Meyering <jim@meyering.net>
2492 * tests/rm/rm3: Use tr's \n notation rather than \012.
2493 This package can afford to do that, since its tests are guaranteed use
2494 GNU tr, which has accepted the more modern notation for 10 years.
2495 * tests/rm/rm5: Likewise.
2496 * tests/cp/same-file: Likewise.
2497 * tests/stty/row-col-1: Likewise.
2498 * tests/stty/basic-1: Likewise.
2499 * tests/rm/deep-1: Likewise.
2500 * tests/mv/part-symlink: Likewise.
2501 * tests/mkdir/perm: Likewise.
2502 * tests/misc/nice: Likewise.
2504 2003-05-13 Jim Meyering <jim@meyering.net>
2506 * src/copy.c (struct F_triple) [name]: Remove const attribute.
2507 (triple_free): Don't apply cast to argument of free.
2508 (seen_file): Add cast here instead.
2510 * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
2511 (src_to_dest_free): Don't apply cast to argument of free.
2513 * src/sort.c (zaptemp): Don't apply cast to argument of free.
2514 * src/pr.c (init_fps, init_store_cols): Likewise.
2515 * src/join.c (delseq, freeline): Likewise.
2516 * src/expr.c (OLD): Likewise.
2517 * src/sort.c (sort): Likewise.
2518 * src/head.c (elide_tail_lines_pipe): Likewise.
2520 * src/tail.c: Include "quote.h".
2521 Use quote in diagnostics. Change many error format strings
2522 from just `%s' to e.g., `error reading %s'.
2523 (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
2524 Rewrite newline-counting loop to use memchr.
2526 * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
2527 Now that assert is no longer used, don't include <assert.h>.
2529 2003-05-12 Jim Meyering <jim@meyering.net>
2531 * src/head.c: Include <assert.h>.
2532 (AUTHORS): Add my name.
2533 (elide_tail_lines_pipe): New function.
2535 2003-05-10 Jim Meyering <jim@meyering.net>
2537 * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
2539 * src/readlink.c (main): Set program_name before first use.
2540 Remove that (redundant) first use.
2541 Don't exit successfully just because --verbose was specified.
2542 Pass 0, not EXIT_SUCCESS, as first argument to error; when that
2543 parameter is 0, error does not exit.
2545 * src/uname.c (main): When failing due to too many arguments, also say
2546 that, rather than just "Try `uname --help' for more information.".
2547 * src/comm.c (main): Likewise, but for too few arguments.
2548 * src/logname.c: Include error.h.
2549 (main): Say why we're failing.
2551 * src/uniq.c (main): Don't segfault when argc < optind.
2552 * src/who.c (main): Handle argc < optind.
2553 * src/df.c (main): Likewise.
2554 * src/install.c (main): Likewise.
2555 * src/mv.c (main): Likewise.
2556 * src/pwd.c (main): Likewise.
2557 * src/tty.c (main): Likewise.
2558 * src/chroot.c (main): Likewise.
2559 * src/hostname.c: Likewise.
2560 * src/du.c (main): Likewise.
2561 * src/expand.c (main): Likewise.
2562 * src/env.c (main): Likewise.
2563 * src/unexpand.c (main): Likewise.
2564 * src/printenv.c (main): Likewise.
2565 * src/sync.c (main): Handle argc == 0.
2566 * src/expr.c (main): Likewise.
2567 * src/printf.c (main): Likewise.
2568 * src/basename.c (main): Likewise.
2569 * src/ln.c (main): Test for `missing argument' before computing n_files.
2570 * src/tail.c (main): Test for the case of no arguments before
2573 * src/kill.c (send_signals): Don't check command line arguments here.
2574 (main): Check them here instead. Handle argc < optind.
2576 * src/logname.c (main): Use error, rather than fprintf, for the sake
2579 * src/rm.c (main): Don't overrun array bound if argc is 0.
2581 2003-05-09 Jim Meyering <jim@meyering.net>
2583 * src/sort.c (main): Don't overrun array bound if argc is 0.
2584 That would happen when invoked via: execl ("/usr/bin/sort", NULL);
2585 Reported by Wartan Hachaturow.
2587 2003-05-07 Jim Meyering <jim@meyering.net>
2589 Implement support so that `head --lines=-N' works on seekable files.
2590 * src/head.c (enum Copy_fd_status): Define.
2591 (COPY_FD_DIAGNOSE): New macro.
2592 (elide_tail_lines_seekable): New funtion.
2593 (elide_tail_lines_file): Call it here.
2595 2003-05-06 Jim Meyering <jim@meyering.net>
2597 * src/sys2.h (CHAR_BIT): Remove duplicate definition.
2599 2003-05-04 Jim Meyering <jim@meyering.net>
2601 * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
2602 caused the addition of thousands of small files to the tar archive.
2603 * tests/misc/head-elide-tail: New file. Add them here instead.
2604 * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
2606 2003-05-04 Paul Eggert <eggert@twinsun.com>
2608 * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
2609 (IF_READDIR_NEEDS_REWINDDIR): Remove.
2610 (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
2611 which was a bit weird because it couldn't be emulated by a function.
2613 2003-05-03 Jim Meyering <jim@meyering.net>
2615 Extend head to accept --lines=-N (--bytes=-N) and to print all
2616 but the N lines (bytes) at the end of the file.
2617 * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
2618 Use quote() in diagnostics, rather than literal `' marks.
2619 (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
2621 (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
2622 (head_file): Reorganize so as to call head from only one place.
2623 (main): Likewise, for head_file.
2624 Handle new, undocumented option, --presume-input-pipe.
2625 Handle negative line and byte counts.
2626 * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
2628 * tests/du/8gb: Skip test if the file system of `.' doesn't support
2629 sparse files -- otherwise it'd create a file of size 8GB.
2631 2003-05-02 Jim Meyering <jim@meyering.net>
2633 * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
2634 Instead explain about `-' and standard input.
2635 (main): Give a proper diagnostic for e.g., `fmt -c -72'.
2636 Reported by Keith Thompson.
2637 * tests/fmt/basic: Add test for the above fix.
2639 * src/fmt.c: Include "quote.h".
2640 Use quote() in diagnostics, rather than literal `' marks.
2641 (main): Exit nonzero when unable to open an input file.
2642 * tests/fmt/basic: Add test for the above fix.
2644 * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
2645 specifications like `-72x'.
2646 * tests/fmt/basic: Add test for the above fix.
2648 Work around nasty readdir bug on Darwin6.5.
2649 * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
2650 [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
2651 returned NULL and there has been at least one successful unlink or
2652 rmdir call since the opendir or previous rewinddir, then call
2653 rewinddir and reiterate the loop.
2655 Factor out common code.
2656 * src/remove.c (readdir_ignoring_dotdirs): New function.
2657 (is_empty_dir): Use it here.
2658 (remove_cwd_entries): Use it here.
2660 2003-05-01 Jim Meyering <jim@meyering.net>
2662 * tests/rm/r-3: Create 500 rather than just 300 files.
2663 There's a bug in Darwin6.5's readdir that shows up only with
2665 Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
2669 Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
2670 (dump_remainder): Move two declarations `down' into the scope
2671 where they are used.
2672 (xlseek): Return the resulting offset.
2673 (file_lines): Rename parameter, file_length, to end_pos.
2674 (pipe_lines): Don't coerce safe_read return value to `int'.
2675 Adapt tests accordingly.
2676 (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
2678 Change type of `total_bytes' from `int' to `size_t',
2679 since the former wouldn't always be wide enough.
2680 Don't coerce safe_read return value to `int',
2681 and adapt tests accordingly.
2682 Now that testing for a read error no longer involves
2683 using `tmp', handle that case *after* freeing `tmp'.
2684 (start_bytes): Clean up.
2685 (tail_bytes): Now that `n_bytes' may be larger than
2686 OFF_T_MAX, test for that condition and, if it's true, don't
2687 use lseek optimizations.
2688 (parse_options): Don't fail just because N_UNITS is larger than
2689 the maximum size of a file -- tail may be applied to an input
2690 stream (e.g., a pipe) with more data than that.
2692 * Makefile.maint (syntax-check): Rename from alloc-check.
2693 Also check for SPACE-TAB sequences.
2694 Also check for malloc/calloc/realloc casts.
2696 2003-05-01 Jim Meyering <jim@meyering.net>
2698 * src/tail.c (start_lines): Rewrite to use memchr. Clean up.
2700 2003-04-28 Jim Meyering <jim@meyering.net>
2702 * tests/misc/tty-eof: Send two tokens, not just one, so we don't
2703 make the now-more-picky tsort fail.
2705 2003-04-24 Jim Meyering <jim@meyering.net>
2707 * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
2708 (main): Minor syntactic clean-up.
2710 * src/tsort.c (tsort): Fail if the input contains an odd number of
2711 tokens. Reported by junkio@cox.net.
2713 * tests/tsort/basic-1: Test for the above fix.
2715 2003-04-21 Jim Meyering <jim@meyering.net>
2717 * tests/misc/printf: Add tests for the printf fixes below.
2719 * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
2721 2003-04-20 Paul Eggert <eggert@twinsun.com>
2723 Fix printf POSIX compatibility bug reported by Ben Harris in
2724 <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
2725 * doc/coreutils.texi (printf invocation): It's \NNN in the format,
2726 \0NNN in the %b operand.
2727 * src/printf.c (usage): Likewise.
2728 (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
2729 is desired. All uses changed. Behave like Bash printf if %b
2730 operand uses \NNN where the initial N is not 0.
2732 2003-04-17 Jim Meyering <jim@meyering.net>
2734 * src/stty.c: Remove uses of PROTOTYPE macro.
2736 2003-04-15 Jim Meyering <jim@meyering.net>
2738 * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
2739 each sequence of spaces before a TAB character.
2741 2003-04-13 Jim Meyering <jim@meyering.net>
2743 * src/remove.c (is_empty_dir): Don't closedir (NULL).
2745 2003-04-12 Jim Meyering <jim@meyering.net>
2747 Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
2748 --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
2749 FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
2750 * src/nl.c (main): Fix those problems and remove literal quote marks
2751 (e.g., "`%s'") from format string; instead use "%s" in each format
2752 string and `quote (optarg)' as the corresponding argument.
2753 Also, diagnose all invalid command line options before failing.
2755 * src/nl.c (proc_text): Fix a bug that would make nl output extra
2756 newlines in some cases. Details here: http://bugs.debian.org/177256.
2757 This bug was introduced on 2001-11-10 for textutils-2.0.17.
2758 * tests/misc/nl: Add test for the above-fixed bug.
2760 * tests/misc/readlink: New file. Test the --canonicalize option.
2761 * tests/misc/Makefile.am (TESTS): Add readlink.
2763 2003-04-11 Jim Meyering <jim@meyering.net>
2766 * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
2767 * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
2768 * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
2769 retain alignment) each sequence of spaces before a TAB character.
2771 * src/ls.c: Include <stdlib.h> unconditionally.
2773 * Makefile.maint (xalloc-check): Rename from header-check.
2775 * src/yes.c: Include error.h after system.h, not before.
2778 * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
2779 * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
2780 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
2781 * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
2782 * src/tr.c: * src/unexpand.c, src/users.c:
2783 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
2784 return values and of xrealloc's first argument.
2785 Fix the former with this:
2786 perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
2788 2003-04-10 Jim Meyering <jim@meyering.net>
2790 * src/stty.c (wrapf): Declare with format attribute.
2792 The S_MAGIC_... names shouldn't be maintained in two places (prior
2793 to this change, one would have to keep stat.c and fs.h in sync).
2794 This change makes it so those names and the corresponding
2795 hexadecimal constants all reside in stat.c. fs.h is now generated.
2796 * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
2797 (BUILT_SOURCES): Add fs.h, now that it's generated.
2798 (EXTRA_DIST): Add extract-magic.
2799 * src/extract-magic: New script to extract fs.h definitions from stat.c.
2800 * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
2801 fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
2803 * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
2804 file with nominal length > 4GB fails. Reported by Michael Deutschmann.
2806 * man/unexpand.x: Add `SEE ALSO' reference to expand.
2807 * man/expand.x: Add `SEE ALSO' reference to unexpand.
2808 Suggestion from Dan Jacobson.
2810 2003-04-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
2812 * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
2813 * src/stat.c (human_fstype): Handle Linux's devpts.
2815 2003-04-09 Paul Eggert <eggert@twinsun.com>
2817 * src/split.c (line_bytes_split): Arg is of type size_t, since
2818 that's all that is supported for now.
2819 (main): Check for overflow in obsolescent line count option.
2821 2003-04-09 Jim Meyering <jim@meyering.net>
2823 * tests/misc/split-fail: Add a new test for the above fix.
2825 * src/split.c (bytes_split): Use size_t temporary (rather than
2826 uintmax_t original) in remaining computations. From Paul Eggert.
2828 Handle command line option arguments larger than 2^31.
2829 This allows e.g., splitting into files of size 2GB and larger,
2830 and running split --lines=N with N=2^31 or more.
2831 But for --line-bytes=N, the restriction that N <= SIZE_MAX
2832 remains (for now), due to the way it is implemented.
2834 * src/split.c: Include "inttostr.h".
2835 (bytes_split, lines_split, line_bytes_split, main):
2836 Use uintmax_t, not size_t, for file sizes.
2837 (main): Give a better diagnostic for option arguments == 0.
2838 Use umaxtostr to print file sizes.
2839 Reported by Luke Hassell.
2841 2003-04-08 Jim Meyering <jim@meyering.net>
2843 * src/rm.c (usage): Mention that --directory (-d) works only
2844 on some systems. Suggestion from Samuel Tardieu.
2846 * tests/basename/basic: Run $PERL to see if it is available,
2847 rather than testing its value.
2848 * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
2849 * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
2850 * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
2851 * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
2852 * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
2853 * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
2854 * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
2855 * tests/sum/basic-1, tests/seq/basic: Likewise.
2857 * tests/misc/Makefile.am (TESTS): Add split-fail.
2858 * tests/misc/split-fail: New file.
2860 * src/split.c: Rename local variables: nchars -> n_bytes.
2861 (lines_split): Rename local, nlines -> n_lines.
2862 (main): Rename local variable: s/accum/n_units/.
2863 (main): Use STDIN_FILENO, not literal `0'.
2865 2003-04-07 Jim Meyering <jim@meyering.net>
2867 * src/stat.c: Add #include directives for Ultrix 4.4.
2868 Based on a suggested change from Bert Deknuydt.
2870 2003-04-06 Jim Meyering <jim@meyering.net>
2872 * Makefile.maint (makefile-check): New rule.
2873 (local-check): Add it.
2875 2003-04-05 Jim Meyering <jim@meyering.net>
2877 * Makefile.am (nearly all of them):
2878 Use $(VAR) rather than @VAR@, now that we can rely on automake to
2879 emit a definition for each substituted variable.
2880 * tests/Makefile.am.in: Likewise.
2882 * tests/rm/rm5: Add a comment explaining why this test fails when
2883 using Tru64's broken sed.
2884 * tests/rm/rm3: Likewise.
2886 Make `kill -t' output signal descriptions (not `?') on Tru64.
2887 * src/kill.c (sys_siglist): Also check for __sys_siglist.
2888 Patch by Tony Leneis.
2889 * configure.ac: Also check for declaration of __sys_siglist.
2890 Required for Tru64 4.0D, 4.0F, and 5.1.
2891 Reported by Tony Leneis.
2893 2003-04-04 Jim Meyering <jim@meyering.net>
2895 * src/Makefile.am (PERL): Remove unnecessary definition.
2897 Because of inappropriate (but POSIX-mandated) behavior of rename,
2898 `mv a b' would not remove `a' in some unusual cases. Work around
2899 this by unlinking `a' when necessary.
2901 * src/copy.c (same_file_ok): Add an output parameter.
2902 Set it in the offending case.
2903 (copy_internal): When necessary, unlink SRC_PATH and inform caller.
2904 Reported by Ed Avis.
2905 * tests/mv/hard-4: New test for the above.
2906 * tests/mv/Makefile.am (TESTS): Add hard-4.
2908 Clean up rules for automatically generated sources:
2909 * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
2910 Make each generated file be read-only.
2911 Add each file name to BUILT_SOURCES separately.
2912 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
2914 Put LOCALEDIR macro definition in new file: localedir.h.
2915 * src/Makefile.am (DEFS): Remove definition.
2916 (localedir.h): New rule.
2917 (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
2918 * src/system.h: Include "localedir.h".
2920 2003-04-02 Jim Meyering <jim@meyering.net>
2924 * tests/misc/Makefile.am (TESTS): Add false.
2926 * Makefile.maint (TMPDIR): Make sure it's defined.
2927 (my-distcheck): Build in $(TMPDIR), not `.'.
2929 * src/Makefile.am (false.c): Change all occurrences of
2930 `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
2931 unsuccessfully also with --help. Reported by Paul Jarc,
2932 * tests/misc/false: New test for the above.
2934 2003-03-30 Jim Meyering <jim@meyering.net>
2936 * NEWS: Note the location of older NEWS files.
2938 * src/remove.c (is_empty_dir): Don't let a failing closedir
2939 clobber errno. Spotted by Arnold Robbins.
2941 * src/env.c: Fix typo in comment. From Arnold Robbins.
2943 2003-03-29 Jim Meyering <jim@meyering.net>
2947 * README: Note to expect build problems for stat.c on Ultrix 4.3.
2948 Note that there are some harmless test failures when running
2949 `make check' as root on some systems.
2951 2003-03-28 Jim Meyering <jim@meyering.net>
2953 * tests/stty/row-col-1: Skip this test if stty can't get window size.
2954 This happens when connecting to sparc-solaris5.7 via ssh from within
2955 emacs. Reported by Karl Berry.
2957 * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
2958 Otherwise, on systems (DJGPP) that emulate pipes using files,
2959 this test would never complete, waiting for `yes' to terminate.
2960 * tests/du/slink: As above, use seq, not `yes' to generate link target.
2961 * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
2962 Reported by Rich Dawe.
2964 2003-03-27 Jim Meyering <jim@meyering.net>
2966 * src/id.c: Remove Arnold Robbins' obsolete e-mail address
2967 from `written by...' comment, at his request.
2969 2003-03-24 Paul Eggert <eggert@twinsun.com>
2971 Fix buffer overrun problem reported by TAKAI Kousuke, along
2972 with some other POSIX incompatibilities.
2974 * src/printf.c (print_esc): Do not treat \x specially if
2975 POSIXLY_CORRECT. Avoid buffer overrun if the format ends
2976 in backslash. Treat incomplete escape sequences as strings
2977 of characters, as POSIX requires.
2978 (print_formatted): Allow multiple flags. Avoid buffer overrun
2979 if the format is incomplete.
2981 2003-03-24 Jim Meyering <jim@meyering.net>
2983 * tests/misc/printf: Add tests for the above fixes and changes.
2985 2003-03-26 Jim Meyering <jim@meyering.net>
2987 * src/copy.h (struct cp_options): Add a comment.
2989 2003-03-23 Jim Meyering <jim@meyering.net>
2991 * README: Describe problem with 64-bit mode on HPUX 11.x,
2992 with patch for /usr/include/inttypes.h.
2993 * TODO: Plan to add an autoconf test to work around the bug.
2995 2003-03-22 Jim Meyering <jim@meyering.net>
2997 * src/stat.c: Don't include <sys/sysmacros.h>.
2998 That is already done via system.h. Otherwise, the multiple
2999 inclusion would evoke redefinition warnings from Cray's /bin/cc,
3000 aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28.
3001 (human_fstype): Factor some directives `up', out of this function.
3002 Cast away `const' to avoid error from Cray's /bin/cc.
3004 2003-03-20 Jim Meyering <jim@meyering.net>
3006 * announce-gen (print_changelog_deltas): Ensure that a newline
3007 precedes each row of `*'s.
3009 2003-03-20 Jim Meyering <jim@meyering.net>
3013 * src/seq.c (valid_format): Also accept ` ' and `'' as valid
3014 format flag characters.
3015 Do not require that a field width be specified.
3016 Do not fail when given a field width of `0'.
3017 Reported by Dan Jacobson.
3018 * tests/seq/basic: Add new tests for the above-fixed bug.
3020 * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
3021 (install-root): Likewise.
3022 (install-exec-local): Likewise.
3023 Based on a patch from Richard Dawe.
3025 2003-03-19 Jim Meyering <jim@meyering.net>
3027 * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
3028 because the DJGPP 2.03 port of 'ln -s' doesn't work.
3029 Include $(EXEEXT) in program names.
3030 Since $(LN_S) may degenerate to `cp -p', be careful
3031 to invoke it from the destination directory.
3032 Mostly from Richard Dawe.
3033 * configure.ac: Use AC_PROG_LN_S.
3035 * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the
3036 CDPATH shell variable set could cause this test to fail.
3037 Reported by Karl Berry.
3039 2003-03-18 Jim Meyering <jim@meyering.net>
3041 * src/fmt.c [struct Word] (paren, period, punct, final): Change the
3042 type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
3043 AIX 5.1's xlc could not compile the former.
3044 Patch by Petter Reinholdtsen. Also reported by Mike Jetzer.
3046 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
3048 * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
3049 program names, since automake only adds $(EXEEXT) to programs
3052 2003-03-16 Jim Meyering <jim@meyering.net>
3054 * src/remove.c (rm): Put two local variables in static storage,
3055 so they can't be clobbered by the potential longjmp.
3057 2003-03-15 Jim Meyering <jim@meyering.net>
3059 * Makefile.cfg (gnu_rel_host): Fix code to match the comment
3060 so that a version number with a two-digit component can still count
3061 as an alpha release. Reported by Richard A Downing.
3062 (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
3064 2003-03-14 Jim Meyering <jim@meyering.net>
3066 * src/ansi2knr.c: Remove no-longer-used file.
3067 * src/ansi2knr.1: Likewise.
3069 * Makefile.maint (prev_version_file): Don't use ?= for this particular
3070 assignment, since it causes trouble with old versions of GNU make
3071 (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here.
3072 http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
3073 Patch from Alexandre Duret-Lutz.
3075 * Use patched automake-1.7.3. Regenerate Makefile.in files in
3076 subdirectories so that each includes a definition of ACLOCAL_M4.
3078 * announce-gen (main): Label the compressed source URLs.
3082 * tests/du/slink: Relax the test for the `local'ness of a file system,
3083 so that now it works also for tmpfs.
3085 * tests/du/hard-link: Transform output from first du, so that this
3086 test doesn't fail on file systems like tmpfs that order directory
3087 entries differently.
3089 2003-03-13 Jim Meyering <jim@meyering.net>
3091 * tests/du/8gb: Work around what appears to be an NFS failure that
3092 would make this test fail on some systems.
3094 2003-03-11 Jim Meyering <jim@meyering.net>
3096 * tests/du/basic: Make the test file exactly 4k bytes long.
3098 * src/split.c (longopts): Don't hard-code `2' here.
3099 Instead, just specify `&verbose', and ...
3100 (main): ... remove the `case 2:' block for --verbose.
3102 * tests/du/basic: Make the test file larger than 64 bytes, so that
3103 we don't immediately disqualify file systems (e.g., NetApp) on which
3104 smaller files take up zero disk blocks. Reported by Vin Shelton.
3106 2003-03-10 Jim Meyering <jim@meyering.net>
3108 Don't segfault for a negative field width or precision in format string.
3109 Note that this is just a stopgap fix. The longer term solution may
3110 involve adapting bash's builtins/printf.def.
3112 * src/printf.c: (UNSPECIFIED): Define.
3113 (print_direc): Use the special value, UNSPECIFIED, to indicate
3114 that field_width or precision has not been specified.
3115 (print_formatted): Fail if field_width or precision is the
3116 special value, UNSPECIFIED.
3117 Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
3119 * src/sys2.h (INT_MIN): Define, if necessary.
3120 * tests/misc/printf: Add a test for the above-fixed bug.
3122 2003-03-09 Jim Meyering <jim@meyering.net>
3124 * src/remove.c (AD_stack_pop): Cast sizeof... to int before
3125 changing its sign. This avoids a warning from gcc on 64-bit systems.
3126 Reported by Bob Proulx.
3127 (pop_dir): Reverse order of sign change and cast, to be consistent
3130 2003-03-08 Jim Meyering <jim@meyering.net>
3132 * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
3133 shell variable, but only in the environment. With /bin/sh->bash, the
3134 shell variable is set to `y', and that would cause a spurious warning.
3135 Reported by Bob Proulx.
3137 * tests/Makefile.am (check-root): Remove touch/fifo.
3138 It doesn't appear to have to be run as root.
3140 * tests/rm/fail-2eperm: Rather than simply using the first non-root
3141 user name, make sure that the selected user name has a usable shell.
3142 Reported by Paul Jarc.
3144 Before, when using shred on a device, one had to specify --exact,
3145 or be careful to choose a size that would not be rounded up and
3146 exceed the maximum value; that could result in a failure of
3148 * src/shred.c (do_wipefd): --exact is now the default for non-regular
3149 files. Suggestion from Ben Elliston.
3152 * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
3153 Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
3154 Patch by Bob Proulx.
3156 * src/Makefile.am (check-misc): Check for use of `defined' in
3158 Change to $(srcdir) before running grep.
3160 * src/sleep.c: Remove now-unused #include and #define directives.
3162 * src/du.c (process_file): If a file's size is not being counted
3163 e.g., because it's a hard link to a file we've already counted,
3164 then don't print a line for it.
3166 * tests/du/hard-link: New test for the above-fixed bug.
3167 * tests/du/Makefile.am (TESTS): Add hard-link.
3170 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
3171 and make the two-array approach work.
3173 * tests/du/basic: Correct/add tests for the above fix.
3174 Set LC_ALL, etc., now that we use sort.
3175 Check the block/size of a small file, too.
3176 Correct expected results for simple dir1/dir2/file case.
3177 Add another test of du -S.
3179 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
3181 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
3182 middle-end/9986). As one of GCC's optimizations, it transforms a
3183 fputs_unlocked call to a fputc_unlocked call when the string is
3184 one character long. However, hpux doesn't have fputc_unlocked.
3186 * expr.c (usage): Use putchar, not fputs, to output a single character.
3187 * ls.c (dired_dump_obstack): Likewise.
3188 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
3189 * stat.c (print_it): Likewise.
3191 2003-03-07 Jim Meyering <jim@meyering.net>
3193 * src/cp.c: Remove everything associated with mmap-stack.c.
3194 This reverts the two changes of 2003-02-21.
3195 * src/du.c: Remove everything associated with mmap-stack.c.
3196 This reverts the change of 2003-02-19.
3198 2003-03-06 Jim Meyering <jim@meyering.net>
3200 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
3201 CDPATH shell variable set could cause this test to fail.
3202 Reported by Karl Berry.
3204 2003-03-05 Jim Meyering <jim@meyering.net>
3208 * src/printf.c (print_esc): Remove pointless comparison of unsigned
3209 integer with zero, to avoid a warning from Intel's ecc.
3210 Reported by Nelson Beebe.
3212 * src/du.c (process_file): Sizes must all be of type uintmax_t.
3213 Otherwise, for files or totals that are too big, numbers would
3214 be truncated. Patch mostly by Michael Stone.
3215 Reported by Ingo Saitz as Debian bug #183210.
3217 * tests/du/8gb: New test for the above-fixed bug.
3218 * tests/du/Makefile.am (TESTS): Add 8gb.
3220 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
3221 rather than UTILS_OPEN_MAX - 10.
3223 2003-03-04 Jim Meyering <jim@meyering.net>
3225 * README: Refer new feature discussion to bug-coreutils@gnu.org,
3226 rather than bug-gnu-utils, now that the former is better known.
3227 Suggestion from Göran Uddeborg.
3229 * src/stat.c (usage): Capitalize consistently.
3230 Reported by Göran Uddeborg.
3232 * Makefile.maint (rel-files): Include $(signatures), so that
3233 those files are also copied into $(release_archive_dir).
3235 * src/df.c (find_mount_point): Call error here, now that restore_cwd
3237 * src/remove.c (AD_pop_and_chdir): Likewise.
3239 * tests/Makefile.am (check-root): Add fail-2eperm.
3241 2003-03-03 Jim Meyering <jim@meyering.net>
3243 * src/remove.c (remove_cwd_entries): Include the full filename of
3244 the offending file, not just the basename.
3246 * tests/misc/tty-eof: Set $ME properly.
3248 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
3249 Remove now-unused variables.
3250 (tag-prev-version, prev-cvs-tag): Likewise.
3252 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
3253 accurate diagnostic when failing to remove a file owned by some other
3254 user. Reported by Ivo Timmermans via Michael Stone.
3255 This fixes Debian bug# 178471.
3257 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
3258 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
3259 Based on a report from Ivo Timmermans.
3261 2003-03-02 Jim Meyering <jim@meyering.net>
3263 * src/copy.c (copy_internal) [un_backup]: When recovering from a
3264 failure to create a hard link, do not remove the entry associating
3265 the source dev/ino with the destination file name.
3266 * tests/mv/Makefile.am (TESTS): Add hard-3.
3267 * tests/mv/hard-3: New test, for the above-fixed bug.
3268 Inspired by a report from Iida Yosiaki.
3270 2003-03-01 Jim Meyering <jim@meyering.net>
3272 * src/df.c (print_header): Don't embed spaces in a separate `Type'
3273 header string. Instead, put `Filesystem' and `Type' headers in the
3274 same string, so translators can use horizontal space as needed.
3275 Reported by Jean Charles Delepine.
3277 2003-02-28 Jim Meyering <jim@meyering.net>
3279 * src/copy.c (copy_internal): When link fails because of an
3280 existing destination file, unlink that file and try again.
3281 Reported by Iida Yosiaki.
3283 * tests/mv/Makefile.am (TESTS): Add hard-2.
3284 * tests/mv/hard-2: New test for the above-fixed bug.
3285 Based on a test case from Iida Yosiaki.
3287 2003-02-26 Jim Meyering <jim@meyering.net>
3289 * tests/du/basic: Don't test du's -b option here. Directory byte
3290 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
3291 and IBM AIX 4.2. Reported by Nelson Beebe.
3293 2003-02-25 Jim Meyering <jim@meyering.net>
3295 * Makefile.maint (announcement): Now that ChangeLog entries
3296 are output by announce-gen, don't do it here.
3297 * announce-gen (print_changelog_deltas): New function.
3300 2003-02-22 Jim Meyering <jim@meyering.net>
3302 * announce-gen: New option: --release-type=TYPE
3303 * Makefile.maint (beta, major): New targets. Remove `release'.
3304 Put them all together on a line.
3305 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
3306 invocation of `announcement'.
3307 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
3309 * announce-gen: New option: --news=NEWS_FILE.
3310 Extract NEWS entries here, not via rules in Makefile.maint.
3311 * Makefile.maint (announcement): Now that NEWS entries are
3312 extracted by announce-gen, don't do it here.
3313 (news-r1, news-r2): Remove now-unused definitions.
3315 2003-02-21 Jim Meyering <jim@meyering.net>
3319 Merge in changes from autoconf's version of this file.
3320 * Makefile.maint (www-gnu): Define.
3321 (standards.texi-url_prefix): Use $(www-gnu).
3322 (make-stds.texi-url_prefix): Likewise.
3324 * src/cp.c: Include "mmap-stack.h".
3325 (main): Invoke `run' through a macro that (when possible) runs it
3326 with a large, mmap'd stack.
3328 * src/cp.c (run): New function, preparing for the above.
3329 Exit from this function, not from main
3332 * src/du.c: New option: --apparent-size.
3333 (enum) [APPARENT_SIZE_OPTION]: New member.
3334 (long_options): Add it.
3335 (usage): Describe it.
3337 ['b']: Set apparent_size.
3338 David Eisner reported that the behavior of --bytes had changed.
3339 Paul Eggert proposed the use of a new option, --apparent-size.
3341 * src/du.c (apparent_size): New global.
3342 (print_only_size): Reflect the fact that we're printing byte counts,
3343 not ST_NBLOCKSIZE-byte-block counts.
3344 (print_size): Call print_only_size rather than duplicating its code.
3345 (process_file): Accumulate byte counts, rather than block counts.
3347 * src/du.c (process_file): Always reset size_to_propagate_to_parent
3348 for --separate-dirs (-S).
3350 2003-02-20 Jim Meyering <jim@meyering.net>
3352 * Use automake-1.7.3. Regenerate dependent files.
3354 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
3355 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
3356 (usage) [%B]: Describe it.
3359 * src/du.c (process_file): Reorganize the code to use only
3360 one `sum' array, and change how -S works back to the way it was
3361 before 2003-01-31. Patch by Bruno Haible.
3363 * tests/du/basic: New test.
3364 * tests/du/Makefile.am (TESTS): Add basic.
3366 * tests/envvar-check: Add checks for the following:
3367 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
3369 * tests/Makefile.am: Rename phony target envvar-check to evar-check
3370 so as not to conflict with the distributed file by the same name.
3372 * src/du.c (process_file): Set info->skip before any possible return.
3374 Report correct usage for directories, not 0.
3375 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
3376 _before_ recording the dev/ino of a directory.
3377 Reported by Bruno Haible.
3379 Now, df always displays the device file name corresponding to the
3380 listed mount point under `Filesystem'. Before, for an unmounted
3381 block- or character-special file argument, it would display the
3382 command-line argument instead.
3383 * src/df.c (show_disk): Return a value indicating whether
3384 there was a match. Don't try to find a mount point here.
3385 (show_entry): If show_disk doesn't find a match, call show_point.
3387 2003-02-19 Jim Meyering <jim@meyering.net>
3389 * src/du.c: Include "mmap-stack.h".
3390 (du_files): Add prototype with ATTRIBUTE_NORETURN.
3391 Exit from this function, not from...
3393 Instead, if possible, invoke du_files through a macro that
3394 runs it with a large, mmap'd stack.
3396 * src/join.c (usage): Change wording in --help output:
3397 use FILENUM instead of `SIDE' and say what FILENUM means.
3398 Reported by Bernhard Gabler.
3400 * src/df.c (print_header): Rather than using a hard-coded literal
3401 string of spaces matching the length of the English `...Type' header,
3402 output the right number of spaces to match the selected translation.
3403 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
3405 * src/split.c (bytes_split): Remove unnecessary `else' after break.
3406 (lines_split): Likewise. and correct misleading indentation.
3408 * src/split.c: Include "full-read.h".
3409 (bytes_split, lines_split, line_bytes_split): Use full_read,
3410 not safe_read. The way split was using the latter, a short read
3411 could cause split to terminate before EOF.
3413 * tests/misc/tty-eof: Test all programs that can read stdin,
3414 requiring no arguments and that write to standard output.
3416 * tests/misc/tty-eof: New file. Renamed from ...
3417 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
3418 * tests/misc/Makefile.am (TESTS): Reflect renaming.
3420 2003-02-18 Jim Meyering <jim@meyering.net>
3422 cksum would perform an extra read after encountering EOF
3423 * src/cksum.c (cksum): Exit the loop upon EOF, too.
3424 Patch by Michael Bacarella.
3426 Test for the bug fixed today in cksum, md5sum, and sha1sum.
3427 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
3428 cat, cksum, md5sum, and sha1sum all in the same loop.
3430 2003-02-14 Jim Meyering <jim@meyering.net>
3432 * src/remove.c: Include "euidaccess.h".
3433 Remove declaration of euidaccess.
3435 2003-02-12 Jim Meyering <jim@meyering.net>
3437 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
3438 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
3440 2003-02-10 Jim Meyering <jim@meyering.net>
3442 * src/test.c: Don't include group-member.h.
3443 Include euidaccess.h.
3444 (eaccess): Rewrite function to set the real uid and gid temporarily
3445 to the effective uid and gid, then invoke 'access', and then set the
3446 real uid and gid back. On systems that lack setreuid or setregid,
3447 fall back on the kludges in euidaccess. Before, it would not work
3448 for e.g., files with ACLs, files that were marked immutable,
3449 or on file systems mounted read-only. Nelson Beebe raised the issue.
3450 Paul Eggert suggested the new implementation.
3452 2003-02-09 Jim Meyering <jim@meyering.net>
3454 * src/test.c (test_stat): Remove function. It's job is done (only
3455 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
3457 2003-02-08 Jim Meyering <jim@meyering.net>
3461 * tests/mv/part-symlink: Don't assume that the file owner username
3462 length is less than 9 in ls output: instead, omit that field
3463 altogether. Reported by, and suggested fix from, Ferdinand.
3465 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
3466 * tests/du/Makefile.am (TESTS): Add restore-wd.
3468 * src/rm.c: Correct now-invalid comment about cycle-detection.
3470 2003-02-06 Jim Meyering <jim@meyering.net>
3472 * NEWS: Add entries from old/*/NEWS
3473 from fileutils-4.1 through 4.1.11 and
3474 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
3478 * src/du.c (process_file): Don't return early for excluded files
3479 or for files whose dev/inode we've already seen.
3481 2003-02-05 Jim Meyering <jim@meyering.net>
3483 * tests/du/exclude: New file.
3484 * tests/du/Makefile.am (TESTS): Add exclude.
3486 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
3488 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
3489 Fix memory allocation arithmetic.
3491 2003-02-04 Jim Meyering <jim@meyering.net>
3493 `df /dev/block-or-char-device-file--not-mounted' now reports
3494 the name of the file system on which the file resides, usually `/'.
3495 Before, it would leave the `Mounted on' field blank.
3496 * src/df.c (show_disk): Move function to precede find_mount_point.
3497 (show_disk): Add parameter: STATP.
3498 If we don't find a matching device name, then resort to calling
3499 find_mount_point. Reported by Bob Proulx.
3501 2003-02-03 Andreas Schwab <schwab@suse.de>
3503 * tests/rm/cycle: Require non-root.
3504 * tests/rm/isatty: Likewise.
3506 2003-02-02 Jim Meyering <jim@meyering.net>
3510 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
3512 Ensure that there are no offending uses of `:'.
3513 * Makefile.maint (makefile_path_separator_check): New rule.
3514 (local-check): Add it to the list.
3516 2003-02-01 Jim Meyering <jim@meyering.net>
3518 * src/du.c (MAX_N_DESCRIPTORS): Define.
3520 * src/stat.c (G_fail): New global.
3521 (human_time): Diagnose failed localtime, not failed nstrftime.
3522 (main): Fail if G_fail is set.
3524 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3526 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
3527 hard-coding the path-separator. Also double-quote the new PATH,
3528 to avoid problems when the path-separator is a semi-colon or when
3529 `pwd` contains e.g. a space.
3530 * tests/chgrp/Makefile.am: Likewise.
3531 * tests/chmod/Makefile.am: Likewise.
3532 * tests/chown/Makefile.am: Likewise.
3533 * tests/cp/Makefile.am: Likewise.
3534 * tests/dd/Makefile.am: Likewise.
3535 * tests/dircolors/Makefile.am: Likewise.
3536 * tests/du/Makefile.am: Likewise.
3537 * tests/expr/Makefile.am: Likewise.
3538 * tests/factor/Makefile.am: Likewise.
3539 * tests/fmt/Makefile.am: Likewise.
3540 * tests/install/Makefile.am: Likewise.
3541 * tests/ln/Makefile.am: Likewise.
3542 * tests/ls/Makefile.am: Likewise.
3543 * tests/ls-2/Makefile.am: Likewise.
3544 * tests/md5sum/Makefile.am: Likewise.
3545 * tests/misc/Makefile.am: Likewise.
3546 * tests/mkdir/Makefile.am: Likewise.
3547 * tests/mv/Makefile.am: Likewise.
3548 * tests/od/Makefile.am: Likewise.
3549 * tests/rm/Makefile.am: Likewise.
3550 * tests/rmdir/Makefile.am: Likewise.
3551 * tests/seq/Makefile.am: Likewise.
3552 * tests/sha1sum/Makefile.am: Likewise.
3553 * tests/shred/Makefile.am: Likewise.
3554 * tests/stty/Makefile.am: Likewise.
3555 * tests/sum/Makefile.am: Likewise.
3556 * tests/tail-2/Makefile.am: Likewise.
3557 * tests/touch/Makefile.am: Likewise.
3558 * tests/tsort/Makefile.am: Likewise.
3559 * tests/unexpand/Makefile.am: Likewise.
3561 2003-01-31 Jim Meyering <jim@meyering.net>
3563 * src/stat.c: Include "file-type.h"
3564 (print_human_type): Remove function.
3565 (human_access): Rename from print_human_access. Return a string.
3566 (human_time): Rename from print_human_time. Return a string.
3567 (print_stat): Arrange so that field width and an alignment specifier
3568 are honored for the %A, %F, %x, %y, and %z formats.
3569 [%F]: Use file_type; this gives slightly different file type strings,
3570 e.g., `directory' instead of `Directory' and `regular file' or
3571 `regular empty file' instead of `Regular file'.
3572 Prompted by a report from Richard Dawe that the uses of
3573 S_IFSOCK and S_IFIFO in print_human_time were not portable
3574 to systems using e.g., DJGPP.
3576 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3578 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
3579 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
3581 2003-01-31 Jim Meyering <jim@meyering.net>
3583 * src/du.c (main): Upon processing an invalid option or an invalid
3584 --exclude-from or --max-depth option argument, don't exit right away,
3585 in case there are others. Rather record the failure and exit after
3586 processing other options.
3588 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
3589 tar archive easier to reproduce.
3591 Rewrite to perform directory traversal using nftw.
3593 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
3594 (AUTHORS): Add self.
3595 (opt_one_file_system): Move global into `main'.
3596 (path, xstat, exit_status): Remove declarations.
3597 (arg_length, suffix_length): New globals.
3598 (G_fail): New global, sort of like the old `exit_status'.
3599 (IS_FTW_DIR_TYPE): Define.
3600 (print_only_size): New function.
3601 (process_file): New function.
3602 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
3603 (str_trunc, pop_dir, count_entry): Likewise.
3604 (du_files): Rewrite to use nftw.
3606 2003-01-30 Jim Meyering <jim@meyering.net>
3608 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
3609 symlink-to-directory with -L, even without the trailing slash.
3611 2003-01-27 Jim Meyering <jim@meyering.net>
3613 * src/Makefile.am (check-misc): Check for st_blocks, too.
3615 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
3616 Reported by Richard Dawe.
3618 2003-01-27 Andreas Schwab <schwab@suse.de>
3620 * src/ls.c (quote_name): Add fourth parameter, width, into which to
3621 store the screen columns, and return the number of bytes instead.
3622 (print_dir): Pass NULL as fourth parameter of quote_name.
3623 (print_name_with_quoting): Likewise.
3624 (length_of_file_name_and_frills): Get the width from the fourth
3625 parameter of quote_name instead of return value.
3627 2003-01-27 Jim Meyering <jim@meyering.net>
3629 * src/ls.c (decode_switches): If `dired' is set without
3630 `format == long_format', then silently reset dired. This doesn't
3631 change the behavior of ls (all prior uses of dired were protected
3632 by `&& format == long_format'), and lets us...
3633 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
3634 (PUSH_CURRENT_DIRED_POS): Likewise.
3637 2003-01-22 Jim Meyering <jim@meyering.net>
3639 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
3640 * tests/du/Makefile.am (TESTS): Add no-x.
3642 2003-01-21 Jim Meyering <jim@meyering.net>
3644 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
3645 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
3646 it may still be a directory -- or not (e.g., with FreeBSD on an
3647 NFS-mounted file system), so resort to calling lstat to find out.
3648 Based on a patch by Michael van Elst.
3650 * tests/cp/same-file: Don't assume that the file owner username
3651 length is less than 9 in ls output: instead, omit that field
3652 altogether. Reported by, and suggested fix from, Ferdinand.
3654 2003-01-20 Jim Meyering <jim@meyering.net>
3656 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
3657 large format widths no longer cause strftime to infloop.
3659 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
3661 2003-01-19 Jim Meyering <jim@meyering.net>
3663 * src/readlink.c: Include "canonicalize.h".
3665 2003-01-18 Jim Meyering <jim@meyering.net>
3667 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
3669 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
3670 (long_options): Add option --dereference-command-line-symlink-to-dir.
3671 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
3672 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
3673 -d, -F, -l options is specified.
3674 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
3675 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
3676 Change --dereference-command-line (-H) to dereference *all*
3677 command line arguments, including broken symlinks.
3679 2003-01-15 Paul Eggert <eggert@twinsun.com>
3681 Change ls -H back to the way it was yesterday, since this is
3682 compatible with FreeBSD and the POSIX spec is confusing
3683 and somewhat contradictory.
3685 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
3686 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
3687 (long_options): Change the long option name back.
3688 (usage): Change the usage back.
3689 (gobble_file): When -H is specified, dereference a top-level
3690 arg even if it points to a non-directory.
3692 2003-01-15 Jim Meyering <jim@meyering.net>
3694 * src/ls.c (gobble_file): Fall back on using lstat when required:
3695 when --dereference (-L) is not specified, and
3696 - when operating on a dangling symlink
3697 - when operating on command-line-symlink-to-directories
3698 This fixes numerous problems. Here are examples:
3699 - `ls dangling-symlink' would fail with `no such file...'
3700 Now it prints `dangling-symlink'.
3701 - `ls -i symlink' would mistakenly print the inode of the referent.
3702 Now it prints the inode of the symlink. Likewise for --size (-s).
3703 Based on a patch from Michael Stone.
3704 Reported by Deepak Goel as Debian bug #173793.
3706 Rename ls's --dereference-command-line (-H)
3707 option to --dereference-command-line-symlink-to-dir.
3708 * src/ls.c [enum Dereference_symlink]
3709 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
3710 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
3711 (long_options): Rename the long option.
3712 (usage): Say that --dereference-... changes how ls treats
3713 only symlinks to directories specified on the command line.
3715 2003-01-14 Jim Meyering <jim@meyering.net>
3717 * tests/ls/dangle: New file/test, for the above fix.
3718 * tests/ls/inode: Another new file/test, for the above fix.
3719 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
3721 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
3722 so that ls --color would no longer highlight the names of files with
3723 the execute bit set when not specified on the command line.
3724 Patch by Michael Stone. Reported by Stephen Depooter as
3727 * tests/ls-2/tests (color-exe): New test, for the above fix.
3729 2003-01-13 Jim Meyering <jim@meyering.net>
3731 * tests/shred/exact: Also test for just fixed bug with --zero.
3733 * src/shred.c (long_opts): --zero does not require an argument.
3734 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
3736 2003-01-12 Jim Meyering <jim@meyering.net>
3738 * Makefile.maint (cvs-update): Skip any file with local modifications.
3740 * src/unexpand.c (usage): Document --first-only and mention that
3741 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
3743 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
3745 * src/df.c: Include "canonicalize.h".
3746 Use canonicalize_file_name unconditionally.
3748 2003-01-09 Jim Meyering <jim@meyering.net>
3750 * README: Add readlink.
3752 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3754 * src/df.c: Include "xgetcwd.h".
3755 * src/pwd.c: Likewise.
3757 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3759 * src/shred.c: Remove declaration of xstrdup.
3760 We already get it via xalloc.h which is included via system.h.
3762 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
3764 New program: readlink.
3766 * src/Makefile.am (bin_PROGRAMS): Add readlink.
3767 * src/readlink.c: New file.
3769 * man/readlink.x: New file.
3770 * man/Makefile.am (dist_man_MANS): Add readlink.1.
3771 (readlink.1): New rule.
3773 2003-01-09 Jim Meyering <jim@meyering.net>
3775 When selecting ranges of byte offsets (as opposed to ranges of fields)
3776 and when --output-delimiter=STRING is specified, output STRING between
3777 ranges of selected bytes.
3778 * src/cut.c (RANGE_START_SENTINEL): Define.
3779 (output_delimiter_specified): New global.
3780 (print_kth): Add parameter. Adjust all callers.
3781 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
3782 (cut_bytes): When requested, output STRING between ranges of
3784 (main): Make a diagnostic a little clearer.
3785 Based on a patch from Jan Nieuwenhuizen.
3787 * tests/cut/Test.pm: New tests for the above.
3789 * src/cut.c (set_fields): Make code agree with comment:
3790 Don't merge abutting ranges like 4- and 2-3. This makes no
3791 difference currently, but is required to support an upcoming change.
3793 2003-01-07 Jim Meyering <jim@meyering.net>
3795 * src/cut.c (set_fields): Fix typo in comment.
3797 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
3798 * tests/touch/Makefile.am (TESTS): Add not-owner.
3799 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
3800 Now, this tests only the nonexistent-directory diagnostic.
3801 Suggestion from Michael Stone.
3803 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
3805 2003-01-04 Jim Meyering <jim@meyering.net>
3807 * src/copy.h: Remove use of PARAMS.
3808 * src/remove.h: Likewise.
3809 * src/chown-core.h: Likewise.
3811 rm could be tricked into mistakenly reporting a cycle.
3812 * src/remove.c: [cycle_check_state]: New global.
3813 (remove_cwd_entries): Adapt to new semantics of cycle_check.
3814 (rm): Call cycle_check_init and cycle_check_free for each file.
3815 * tests/rm/cycle (rm): New test, for the above fix.
3816 * tests/rm/Makefile.am (TESTS): Add cycle.
3818 When rm detects a cycle, don't abort the entire command,
3819 but rather just the affected command line argument.
3820 * src/remove.c: Include <setjmp.h>
3821 (struct dirstack_state) [current_arg_jumpbuf]: New member.
3822 (remove_cwd_entries): Call longjmp if we detect a cycle.
3823 (rm): Call setjmp here.
3825 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
3826 Instead, include cycle-check.h and use it.
3828 * src/remove.h (struct dev_ino): Remove declaration.
3830 * src/remove.c (remove_cwd_entries): Fix typos in comment.
3832 Don't include trailing /. in diagnostics about directories.
3833 * src/remove.c (full_filename_): When FILENAME is just `.'
3834 and there is a nonempty directory-name part, don't append `/.'.
3835 * tests/rm/unread2: Remove trailing /. from diagnostic.
3836 * tests/rm/rm2: Likewise.
3838 * src/remove.c (struct dirstack_state): Define.
3839 To be used in place of these file-scoped globals ...
3840 (dir_stack, len_stack, Active_dir): Remove globals.
3841 (ds_init, ds_free): New functions.
3842 (full_filename): Define.
3843 (full_filename_): Rename from full_filename.
3845 Begin to make AD_* functions more generic.
3846 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
3847 (AD_push): Likewise.
3848 (AD_INIT_OTHER_MEMBERS): Define.
3849 (remove_dir): Define the `status' member manually after each
3850 call to AD_push or AD_push_initial.
3852 * src/Makefile.am (check-misc): New rule, to ensure that no more
3853 S_IS* macro definitions sneak into the code.
3854 (check): Depend on check-misc.
3856 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
3857 * src/du.c (count_entry) [S_ISLNK]: Don't define.
3858 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
3860 2003-01-03 Jim Meyering <jim@meyering.net>
3862 * src/true.c: Add copyright.
3863 (AUTHORS): I suppose I've written it.
3865 * src/Makefile.am (false.c): Make the generated file be read-only.
3867 2003-01-04 Jim Meyering <jim@meyering.net>
3869 * src/ls.c: Include "dev-ino.h".
3870 [struct dev_ino]: Remove declaration.
3872 2003-01-02 Jim Meyering <jim@meyering.net>
3874 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
3875 from mv: s/missing file arguments/missing file argument/.
3876 With --target-directory=DIR, cp and mv work with a single file argument.
3877 Reported by Karl Berry.
3879 * tests/rm/isatty: Enable this test.
3881 2002-12-31 Jim Meyering <jim@meyering.net>
3883 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
3884 (AD_push): Likewise.
3885 (AD_INIT_OTHER_MEMBERS): Define.
3886 (remove_dir): Define the `status' member manually after each
3887 call to AD_push or AD_push_initial.
3889 * src/ls.c [struct dev_ino]: Remove definition.
3890 Include "dev-ino.h" instead.
3892 2002-12-28 Jim Meyering <jim@meyering.net>
3894 * tests/du/Makefile.am (TESTS): Add no-deref.
3895 * tests/du/no-deref: New script.
3897 2002-12-23 Jim Meyering <jim@meyering.net>
3899 * src/remove.c (remove_cwd_entries): Fix typo in comment.
3901 2002-12-21 Jim Meyering <jim@meyering.net>
3903 * announce-gen: Generate MML-formatted announcement.
3904 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
3906 2002-12-20 Jim Meyering <jim@meyering.net>
3908 * src/touch.c (touch): Change the wording of a diagnostic so
3909 that it makes sense both when the file exists and when it doesn't.
3910 Suggestion from Michael Stone.
3912 2002-12-18 Jim Meyering <jim@meyering.net>
3914 * src/stty.c (valid_options): Declare to be static.
3916 2002-12-15 Jim Meyering <jim@meyering.net>
3918 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
3920 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
3921 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
3922 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
3923 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
3924 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
3926 * src/remove.c (PARAMS): Remove definition.
3927 * src/sys2.h: Likewise.
3929 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
3930 Include strftime.h instead.
3932 2002-12-14 Jim Meyering <jim@meyering.net>
3934 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
3936 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
3937 This is necessary at least for Irix6.5 when using c89.
3938 Reported by Nelson Beebe.
3940 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
3942 * tests/misc/cat-tty-eof: New test.
3944 * src/mknod.c (usage): Specify how major and minor mode numbers
3945 are interpreted. Report forwarded by Kristin E Thomas.
3946 * src/mknod.c: Remove now-redundant usage-specifying comment.
3948 2002-12-13 Jim Meyering <jim@meyering.net>
3952 * tests/du/trailing-slash: Allow for a directory of size `0'.
3953 That happens at least on file systems of type tmpfs on linux-2.4.18.
3955 * announce-gen: New script to begin replacing the commands
3956 associated with the rule here...
3957 * Makefile.maint (announcement): Invoke announce-gen.
3958 * Makefile.am (EXTRA_DIST): Add announce-gen.
3960 * tests/cp/preserve-2: New file/test, for latest fix.
3961 * tests/cp/Makefile.am (TESTS): Add preserve-2.
3963 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
3965 Fix a bug whereby cp would fail to parse an option like
3966 --preserve=mode,ownership.
3967 * src/cp.c (decode_preserve_arg): Advance `comma' to
3968 point the character following the comma.
3970 2002-12-11 Jim Meyering <jim@meyering.net>
3972 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
3973 in case it's already defined.
3975 2002-12-09 Jim Meyering <jim@meyering.net>
3977 * tests/touch/fail-diag: Don't get a test failure if /no exists.
3978 Instead, evoke a framework failure if /no-$$ exists.
3979 Reported by Michael Stone.
3981 2002-12-08 Jim Meyering <jim@meyering.net>
3983 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
3984 Define to rpl_lstat, so that even on systems like Solaris 5.8,
3985 du honors (per POSIX) the trailing slash on an argument referring
3986 to a symlink-to-directory.
3988 2002-12-06 Jim Meyering <jim@meyering.net>
3990 * Use autoconf-2.57. Regenerate dependent files.
3991 * Use automake-1.7.2. Regenerate dependent files.
3993 * src/ls.c (gobble_file): Also stat the file if it's a
3994 regular file and --indicator-style=classify (aka -F).
3995 Thanks to Ed Santiago for opening my eyes.
3997 * tests/ls/file-type: New file. Test for the above.
3998 A test to contrast ls -F and ls --indicator-style=file-type.
3999 * tests/ls/Makefile.am (TESTS): Add file-type.
4001 2002-12-04 Jim Meyering <jim@meyering.net>
4003 * tests/ls/follow-slink: Make sure the symlink was created.
4004 Richard Dawe reported that `ln -s link link' succeeds, but creates
4005 no file on systems running some version of the DJGPP libc.
4007 2002-12-03 Jim Meyering <jim@meyering.net>
4009 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
4010 since this package no longer panders to K&R compilers.
4012 2002-12-02 Jim Meyering <jim@meyering.net>
4014 * tests/du/slink: Skip this test if `.' is on a non-local file system.
4016 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
4017 something to replace.
4019 2002-12-01 Jim Meyering <jim@meyering.net>
4021 * src/stat.c: Don't include <string.h> or <ctype.h>.
4022 That's already done via system.h.
4023 * src/dircolors.c: Don't include <ctype.h>.
4025 2002-11-30 Jim Meyering <jim@meyering.net>
4027 * ls.c (gobble_file): Remove the block of code that caused
4028 `ls --color -F symlink-to-dir' to list the files in
4029 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
4030 like `ls -F symlink-to-dir') but with the addition of highlighting.
4031 Similarly, `ls --color -dF symlink-to-dir' would print
4032 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
4033 Reported by Jeff Sheinberg as Debian bug #168203.
4034 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
4036 ls is now more efficient: with certain options, it no longer needs
4037 to stat each directory entry on systems with valid dirent.d_type.
4038 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
4039 (main): Make --recursive set format_needs_type, not format_needs_stat.
4040 (gobble_file): Remove a FIXME comment, now that it's fixed.
4042 2002-11-24 Jim Meyering <jim@meyering.net>
4044 * src/du.c (du_files): Don't strip any trailing slash.
4045 Rewrite so that `/' is no longer represented internally as
4047 (count_entry): When appending a file name component,
4048 account for the fact that the current path may end in `/'.
4049 François Pinard reported that `du symlink-to-dir/' was not
4050 equivalent to `du symlink-to-dir/.'. Now it is.
4051 * tests/du/trailing-slash: New file/test, for the above fix.
4052 * tests/du/Makefile.am (TESTS): Add trailing-slash.
4054 2002-11-23 Jim Meyering <jim@meyering.net>
4056 * src/tac.c (output): Declare some local variables to be of type size_t,
4057 rather than `int' to avoid warnings from gcc.
4059 2002-11-21 Paul Eggert <eggert@twinsun.com>
4061 * src/ls.c (decode_switches): Use case-sensitive matching to
4062 decode the QUOTING_STYLE environment variable. This is more
4063 consistent with the documentation, and with --quoting-style.
4065 2002-11-21 Martin Buck <martin.buck@ascom.ch
4067 * src/stty.c (struct speeds): Add support for all baud rates defined
4070 2002-11-19 Jim Meyering <jim@meyering.net>
4072 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
4073 run in a UTF locale. Report and suggested fix by Bruno Haible.
4074 * tests/fmt/basic: Likewise.
4076 2002-11-17 Jim Meyering <jim@meyering.net>
4078 * configure.ac: Update via autoupdate.
4079 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
4081 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
4082 Reported by Hans Ginzel.
4084 2002-11-15 Jim Meyering <jim@meyering.net>
4086 * Makefile.cfg (gnu_rel_host): Define.
4087 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
4088 on whether $(VERSION) looks like a major release number.
4090 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
4091 (release): Rename from `alpha'.
4092 (alpha): Depend on release.
4094 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
4096 2002-11-14 Jim Meyering <jim@meyering.net>
4098 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
4099 (announcement): Use the new variable.
4101 * Makefile.maint: Sync with Bison, i.e.:
4102 (po-check): Scan .l and .y files instead of the
4103 .c and the .h files that they generate. This fixes the bug
4104 reported by Tim Van Holder in:
4105 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
4106 Look for N_ as well as for _. Try to avoid matching #define for
4110 2002-11-12 Jim Meyering <jim@meyering.net>
4112 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
4113 Replace sole use with equivalent `#ifdef S_ISLNK'.
4114 Inconsistency reported by Dmitry V. Levin.
4116 2002-11-11 Jim Meyering <jim@meyering.net>
4118 * src/stat.c (usage): Transform --help items output via s/ - / /,
4119 so that help2man produces properly formatted man pages.
4120 Reported by Herbert Xu as Debian bug #168400.
4122 2002-11-10 Jim Meyering <jim@meyering.net>
4124 * src/ls.c (sighandler): Handle SIGTSTP specially.
4125 Based on suggestions from Solar Designer and Dmitry V. Levin.
4128 * Makefile.cfg (cvs_files): Define. From autoconf.
4129 (local_updates): Likewise.
4131 * src/ls.c (restore_default_color_handler, sigtstp_handler):
4133 (sighandler): New function, based on the one in sort.c.
4134 (main): Use sigaction, if possible; otherwise signal.
4135 Handle these signals:
4136 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
4137 Don't register our handler if the signal is already being ignored.
4139 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
4140 * src/csplit.c (interrupt_handler): Likewise.
4141 * src/sort.c (sighandler): Likewise.
4142 (main): Declare `i' and `nsigs' to be unsigned, not int.
4144 2002-11-09 Jim Meyering <jim@meyering.net>
4146 ls --color: restore terminal text color upon signal.
4147 * src/ls.c: Include "full-write.h" and <signal.h>.
4148 (restore_default_color, restore_default_color_handler): New functions.
4149 (sigtstp_handler, put_indicator_direct): New functions.
4150 (main) [print_with_color]: Register signal handlers.
4151 Patch mostly by Solar Designer and Stanislav Ievlev.
4153 Update from autoconf.
4154 * Makefile.maint (AMTAR): Remove definition.
4155 (update, cvs-update, po-update, do-po-update): New rules.
4156 (wget-update): Update (thus renaming to cvs-update).
4157 (automake_repo): Use anoncvs@sources.redhat.com.
4159 2002-11-06 Jim Meyering <jim@meyering.net>
4161 * tests/misc/Makefile.am (TESTS): Add printf-hex.
4163 * tests/misc/printf: Be careful to test the code in this package,
4164 not the shell built-in function.
4166 * src/printf.c (print_esc): A hexadecimal escape sequence has
4167 at most two hex. digits, not three. Reported by Padraig Brady.
4168 (usage): Update description.
4169 * tests/misc/printf-hex: New file/test, for the above fix.
4171 2002-10-07 Paul Eggert <eggert@twinsun.com>
4173 Add support for locale-specific size indications (e.g.,
4174 thousands-separators) and for explicit size suffixes on output.
4176 * doc/coreutils.texi (Block size): Say that:
4177 This affects display format as well as block size.
4178 Fractional block counts are rounded up.
4179 ls file size blocksize defaults to 1.
4180 A block size spec preceded by ' generates thousands separators.
4181 A suffix without a preceding integer generates suffixes.
4182 (tail invocation): 32k -> 32 KiB.
4183 (What information is listed): ls -h is now equivalent to
4184 ls --block-size=human, and ls -H is now equivalent to
4185 ls --block-size=si. Displayed file size is now always affected by
4188 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
4189 lib/umaxtostr.c: New files, taken from GNU tar.
4191 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
4193 (EXTRA_DIST): Add inttostr.c.
4195 * lib/human.c, lib/human.h: Rewrite to support locale-specific
4196 notations like thousands separators.
4197 Specify what includer of include.h must include beforehand.
4198 (human_group_digits, human_suppress_point_zero, human_autoscale,
4199 human_base_1024, human_SI, human_B): New enum values.
4200 (human_readable): Rename from human_readable_inexact; put the
4201 options before the sizes. All uses changed. The old human_readable
4202 function has been removed; use inttostr.h instead.
4203 (human_options): Renamed from human_block_size, with new signature
4204 that allows block sizes up to UINTMAX_MAX. All callers changed.
4206 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
4207 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
4208 freestanding C89. No need to check for stdlib.h or string.h since
4209 autoconf does this now.
4211 * src/cksum.c (cksum): Use primitives from inttostr.h, not
4212 human.h, to print large numbers simply.
4213 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
4214 * src/dd.c (print_stats, main): Likewise.
4215 * src/df.c (print_header): Likewise.
4216 * src/factor.c (print_factors): Likewise.
4217 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
4218 * src/shred.c (dopass): Likewise.
4219 * src/sort.c (checkfp): Likewise.
4220 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
4221 * src/tail.c (xlseek): Likewise.
4222 * src/wc.c (write_counts, wc): Likewise.
4224 * src/df.c (human_output_opts): New var.
4225 (output_block_size): Now uintmax_t, not int, to handle larger
4226 block sizes. All uses changed.
4227 * src/du.c: Likewise.
4228 * src/ls.c: Likewise.
4230 * src/df.c (print_header): In the header line, prefer SI to human
4231 representation if it's shorter; if neither is shorter, try to
4232 intuit what the user would prefer.
4234 * src/expr.c (inttostr): Remove; use new imaxtostr library
4237 * src/ls.c (file_output_block_size): New var, to distinguish
4238 file sizes from other sizes.
4239 (decode_switches): Set it.
4241 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
4242 (dopass): When printing progress, use floor for what has been done
4243 so far (since we should be conservative there), and ceiling for
4244 what needs to be done (since that's what other programs use).
4246 2002-10-19 Jim Meyering <jim@meyering.net>
4248 * src/pinky.c (print_heading): Align TTY and Name headings.
4249 Reported by Karl Eichwalder.
4251 2002-10-18 Jim Meyering <jim@meyering.net>
4253 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
4254 Remove now-useless cast.
4255 (stdread): Remove function.
4256 (bytes_split): Use size_t instead of int.
4257 Use safe_read, not stdread.
4258 (lines_split): Likewise.
4259 Use memchr rather than a `while' loop.
4260 (line_bytes_split): Use size_t instead of int.
4261 Use safe_read, not stdread.
4262 (main): Add some FIXME comments to remind me to remove casts.
4264 * src/system.h (ST_BLKSIZE): Correct comment describing how to
4265 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
4267 2002-10-17 Jim Meyering <jim@meyering.net>
4269 Fix a problem that could make e.g., `cat' misbehave on systems which
4270 give invalid (unreasonably large) values for stat.st_blksize.
4271 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
4272 Reported by Petter Reinholdtsen.
4274 2002-10-14 Jim Meyering <jim@meyering.net>
4276 Specifying a printf conversion specifer as nl's separator string
4277 could cause nl to segfault.
4278 * src/nl.c (build_print_fmt): Don't include separator string
4279 in the printf format; it might contain `%'.
4280 Use a better bound on the length of the print_fmt buffer.
4281 (print_lineno): Print the separator here instead.
4282 Reported by Doug Coleman.
4284 * tests/misc/nl: New file/tests, including a test for the above.
4285 * tests/misc/Makefile.am (TESTS): Add nl.
4287 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
4288 * tests/misc/Makefile.am (TESTS): Add split-l.
4290 2002-10-13 Jim Meyering <jim@meyering.net>
4294 * src/du.c (usage): Tweak description of --dereference-args/-D.
4296 * src/du.c (count_entry): Also save cwd when dereferencing (via
4297 --dereference-args, -D) a command-line argument.
4298 Reported by Michal Svec. Based on a patch by Andreas Schwab.
4300 * src/Makefile.am (../AUTHORS): New target/rule.
4302 2002-10-12 Jim Meyering <jim@meyering.net>
4304 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
4305 of type size_t, since that's the way it's used and avoids a warning.
4307 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
4308 since that's how it's always used and avoids a new warning from gcc.
4309 (read_input): Adapt to new safe_read ABI.
4311 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
4314 * src/pinky.c (print_long_entry): fread returns size_t.
4315 Declare local `bytes' accordingly, to avoid warning.
4317 tail -c +N would perform an extra read after encountering EOF
4318 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
4319 * src/tail.c (start_bytes): Detect EOF, inform caller.
4320 (tail_bytes): Upon EOF in start_bytes, return immediately.
4321 (file_lines): Reorganize to use memrchr rather than an explicit loop.
4322 Adapt to new safe_read ABI.
4324 2002-10-11 Jim Meyering <jim@meyering.net>
4326 * tests/du/deref: New file/test, for the above fix.
4327 * tests/du/Makefile.am (TESTS): Add deref.
4329 2002-10-10 Jim Meyering <jim@meyering.net>
4331 * tests/ln/Makefile.am (TESTS): Add target-1.
4332 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
4334 2002-10-09 Jim Meyering <jim@meyering.net>
4336 * tests/cp/backup-is-src: Ensure that certain environment variables
4337 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
4339 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
4340 consume 4GB of disk space on systems without support for sparse files.
4341 Fix a logic error that'd make it `cat err' even though dd didn't fail.
4343 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
4344 Patch by steven@magelico.net, forwarded by Michael Stone.
4346 * tests/ls/dired: Ensure that ls produces English messages.
4347 Patch by Alexey Vyskubov, forwarded by Michael Stone.
4349 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
4351 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
4353 2002-10-08 Jim Meyering <jim@meyering.net>
4355 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
4356 Fix syntax in test: use =, not ==.
4357 Reported by Bob Proulx.
4358 Change all the rest like this: grep -lR "testing framework'" .\
4359 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
4361 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
4362 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
4363 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
4364 * src/wc.c (wc): Likewise.
4366 2002-10-07 Paul Eggert <eggert@twinsun.com>
4369 Don't advance the write pointer past the end of the write buffer.
4370 * src/sort.c (begfield, limfield): Likewise.
4372 2002-10-07 Jim Meyering <jim@meyering.net>
4374 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
4375 * src/head.c (head_bytes, head_lines): Likewise.
4377 2002-10-06 Jim Meyering <jim@meyering.net>
4379 * src/dd.c (scanargs): Ensure that specified block sizes (specified
4380 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
4381 (skip, dd_copy): Adapt to new safe_read ABI.
4383 * Makefile.maint (signatures): Define.
4385 (announcement): Depend on $(signatures).
4387 * Makefile.maint (announcement): Output all URLs for detached
4388 signatures, not just the last one from the previous loop.
4390 2002-10-05 Jim Meyering <jim@meyering.net>
4394 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
4395 don't recurse into directory, DIR. Prompted by a report from
4398 * tests/rm/i-no-r: New file/test, for the above fix.
4399 * tests/rm/Makefile.am (TESTS): Add i-no-r.
4401 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
4402 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
4404 2002-10-03 Jim Meyering <jim@meyering.net>
4406 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
4407 * src/df.c (AUTHORS): Likewise.
4408 * src/du.c (AUTHORS): Likewise.
4409 * src/tail.c (AUTHORS): Likewise.
4410 * src/touch.c (AUTHORS): Likewise.
4412 2002-10-02 Jim Meyering <jim@meyering.net>
4414 * Makefile.am (SUBDIRS): Remove `old'.
4415 (EXTRA_DIST): List the files in old/.
4416 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
4417 Suggestion from Akim Demaille.
4419 2002-10-01 Jim Meyering <jim@meyering.net>
4421 * src/sys2.h (SSIZE_MAX): Define.
4423 2002-09-30 Jim Meyering <jim@meyering.net>
4425 * src/csplit.c: Don't include stdlib.h here. It's already included
4428 2002-09-29 Jim Meyering <jim@meyering.net>
4430 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
4431 expression to avoid bogus warning from gcc.
4433 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
4434 (cat): Declare insize and outsize to be of type size_t, not int.
4435 Rearrange pointer/integer expressions to avoid bogus warnings.
4436 (main): Declare insize and outsize to be of type size_t, not int.
4438 * src/tail.c (parse_options): Give a sensible diagnostic for
4439 an invalid byte or line count. Reported by Mikko Tuumanen.
4441 * src/touch.c (main): Split a long line.
4443 * tests/du/Makefile.am (TESTS): Add slink.
4444 * tests/du/slink: New test for system.h change of 2002-08-31.
4446 In move mode, always first try to rename. Before, upon failure to
4447 rename a directory, this code would never attempt to rename any
4448 other file in that directory, but would thenceforth always copy.
4449 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
4450 may fail with EXDEV, yet renaming files within that directory to
4451 a newly-created destination directory succeeds.
4452 * src/copy.c (copy_internal): Remove local, move_mode;
4453 use x->move_mode instead. Based on a patch from Tom Haynes.
4455 2002-09-28 Jim Meyering <jim@meyering.net>
4457 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
4458 Factor out some duplication.
4460 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
4462 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
4464 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
4465 to avoid compiler warnings.
4467 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
4470 Fix things so `mkdir -p' can create very deep directories, e.g.,
4471 mkdir -p $(perl -e 'print "a/" x 40000') now works.
4472 * src/mkdir.c (main): For --parents (-p), call make_path with the
4473 entire directory name, so we don't ever require that file operations
4474 like stat or chmod be performed on the entire command line argument.
4475 * makepath.c (make_path): Restore umask *before* creating the final
4478 2002-09-27 Andreas Schwab <schwab@suse.de>
4480 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
4481 to avoid overflow. Reported by Hans Lermen.
4483 2002-09-26 Jim Meyering <jim@meyering.net>
4485 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
4487 2002-09-25 Jim Meyering <jim@meyering.net>
4489 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
4490 and add a cast, to avoid a warning about `signed and unsigned type in
4491 conditional expression'.
4493 2002-09-22 Jim Meyering <jim@meyering.net>
4495 * src/rmdir.c: Include "dirname.h", for declaration of
4496 strip_trailing_slashes.
4498 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
4499 Now they're defined through system.h.
4501 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
4502 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
4503 since it's already included from sys2.h via system.h.
4505 * Use automake-1.6f. Regenerate dependent files.
4507 * src/Makefile.am (PERL): Remove duplicate definition.
4509 fmt's -s, -t, -c options didn't work properly for long lines.
4510 Since get_line may end up calling put_paragraph (for long lines),
4511 be sure to set global, `other_indent', before it is used there.
4513 * src/fmt.c (set_other_indent): New function, factored out of...
4514 (get_paragraph): ... here. Call it.
4515 (get_line): Call set_other_indent before calling flush_paragraph,
4516 which calls fmt_paragraph, which in turn calls put_paragraph,
4517 which uses other_indent.
4519 * tests/fmt/Makefile.am (TESTS): Add long-line.
4520 * tests/fmt/long-line: New file/test, for the above fix.
4522 2002-09-21 Jim Meyering <jim@meyering.net>
4524 * src/od.c: No longer include deprecated <values.h>.
4525 It was required solely for now-removed reference to BITSPERBYTE.
4526 * src/install.c: Likewise.
4527 Suggestion from Bruno Haible.
4529 2002-09-06 Andreas Schwab <schwab@suse.de>
4531 `rmdir -p dir-specified-with-trailing-slash/' would fail.
4532 * src/rmdir.c (remove_parents): Strip trailing slashes.
4534 2002-09-20 Jim Meyering <jim@meyering.net>
4536 * tests/rmdir/t-slash: New file/test, for the above fix.
4537 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
4539 * Makefile.maint (announcement): Arrange to gpg-sign the message.
4540 Add a URL for each detached signature file.
4542 2002-09-07 Bruno Haible <bruno@clisp.org>
4544 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
4546 2002-09-18 Jim Meyering <jim@meyering.net>
4548 `od -t x8' used the wrong (`l'-prefixed) printf format.
4549 Likewise for the o8 and u8 formats.
4550 * src/od.c (ISPEC_TO_FORMAT): Define macro.
4551 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
4552 Reported by Arun Sharma.
4554 2002-09-17 Jim Meyering <jim@meyering.net>
4556 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
4557 From gettext's intl/loadmsgcat.c.
4559 * tests/od/x8: New file/test, for the above fix.
4560 * tests/od/Makefile.am (TESTS): Add x8.
4562 2002-09-15 Jim Meyering <jim@meyering.net>
4564 * Use autoconf-2.54. Regenerate dependent files.
4566 * src/csplit.c (get_format_width): Add cast to avoid
4567 warning about `signed and unsigned type in conditional expression'.
4569 2002-09-14 Jim Meyering <jim@meyering.net>
4571 * src/who.c (print_user): Change type of local to size_t
4572 to avoid warnings about `comparison between signed and unsigned'.
4573 * src/ptx.c (generate_all_output): Likewise.
4575 * src/dd.c (main, skip): Add casts to avoid warnings about
4576 `comparison between signed and unsigned'.
4578 * src/id.c (print_full_info, print_group_list): Add casts to avoid
4579 warnings about `signed and unsigned type in conditional expression'.
4581 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
4582 to avoid warnings about `comparison between signed and unsigned'.
4583 (split_3): Change parameter names to be readable and add comment.
4584 Clean up the test for whether a line may be ignored.
4586 2002-09-13 Jim Meyering <jim@meyering.net>
4588 * src/printf.c (main): Handle leading command line argument of `--'.
4589 Reported by Raul: DervishD <raul@pleyades.net>
4590 * tests/misc/printf: New file: test for the above.
4591 * tests/misc/Makefile.am (TESTS): Add printf.
4593 * src/date.c (usage): Explain that %S's range of [0..60] is required --
4594 rather than 0..59 -- to accommodate the occasional positive leap second.
4595 Reported by Richard Neill.
4597 2002-09-12 Jim Meyering <jim@meyering.net>
4599 * src/Makefile.am (nanosec_libs): Define.
4600 (sleep_LDADD, tail_LDADD): Use it here.
4602 Factor nanosleep-related code into ../lib/xnanosleep.c.
4603 * src/sleep.c: Include xnanosleep.h.
4604 Factor out fenv.h-related code.
4605 (timespec_subtract): Remove function.
4606 (main): Remove code that deals with computing start and stop times
4607 as well as the loop around nanosleep. Now that's in xnanosleep.c.
4609 Allow S (in --sleep-interval=S) to be a floating point value.
4610 * src/tail.c: Include xnanosleep.h and xstrtod.h.
4611 Move declaration of global variable, sleep_interval, to ...
4613 (usage): Update description of --sleep-interval option.
4614 (tail_forever): New parameter, sleep_interval. Update caller.
4615 Use xnanosleep, rather than sleep.
4616 (parse_options): New parameter, sleep_interval. Update caller.
4617 Use xstrtod, now that we accept floating point values.
4618 Prompted by a patch from Augey Mikus.
4620 2002-09-06 Jim Meyering <jim@meyering.net>
4622 * src/remove.c (prompt): Change comment to give a better note to
4623 translators. From Michael Piefel.
4625 2002-09-02 Jim Meyering <jim@meyering.net>
4627 * README: A good problem report/patch includes diffs against
4628 the most recent test release.
4630 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
4631 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
4633 * src/kill.c (print_table_row): Use an unsigned type for widths
4634 to avoid warning about comparison between signed and unsigned.
4635 (list_signals): Likewise.
4637 * src/od.c (skip): Add a cast to avoid warning about comparison
4638 between signed and unsigned.
4639 * src/install.c (get_ids): Likewise. Also rearrange range-checking
4640 comparisons to make them more readable.
4642 2002-09-01 Jim Meyering <jim@meyering.net>
4646 2002-08-31 Jim Meyering <jim@meyering.net>
4648 Symlinks were always reported as using 0 blocks.
4649 * src/system.h (ST_NBLOCKS): Don't depend on file type.
4650 This reverts the change of 2000-01-30.
4651 Based on a report and patch from Neil Brown via Michael Stone.
4652 This fixes Debian Bug#156358.
4654 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
4655 `exit (1)' to `exit (EXIT_FAILURE)', and
4656 `usage (1)' to `usage (EXIT_FAILURE)'.
4658 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
4659 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
4660 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
4661 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
4662 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
4663 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
4664 error never exits successfully.
4666 2002-08-29 Jim Meyering <jim@meyering.net>
4668 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
4669 when ignoring any return value.
4671 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
4672 failures. On some systems (at least EMC Celerra and Solaris5.8),
4673 this appears to be necessary.
4674 (is_empty_dir): Likewise. Also, always close directory handle.
4675 * src/ls.c (print_dir): Likewise.
4676 (print_dir): Rename local variable: reading -> dirp.
4677 Reported by Mike Coleman.
4679 2002-08-28 Jim Meyering <jim@meyering.net>
4681 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
4682 Give a diagnostic and fail if closedir fails.
4684 2002-08-26 Jim Meyering <jim@meyering.net>
4686 * Makefile.am (THANKS-to-translators): New rule.
4687 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
4688 * THANKStt.in: New file.
4690 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
4692 (main): Register it with atexit.
4693 Close STDOUT_FILENO, to avoid a problem when writing to
4694 /dev/audio on at least Solaris 5.7 and 5.8 systems.
4695 Reported by Shing-Shong Shei.
4697 2002-08-25 Jim Meyering <jim@meyering.net>
4699 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
4700 * src/tac.c (main): Likewise.
4701 * src/tail.c (main): Likewise.
4702 * src/tee.c (main): Likewise.
4703 * src/tr.c (main): Likewise.
4704 * src/wc.c (main): Likewise.
4706 2002-08-20 Jim Meyering <jim@meyering.net>
4708 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
4710 2002-08-10 Paul Eggert <eggert@twinsun.com>
4712 * src/nohup.sh: Don't use "exec --"; it's not portable and
4713 shouldn't be needed.
4715 2002-08-09 Jim Meyering <jim@meyering.net>
4717 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
4718 (usage): Clarify help text for the -COLUMN option.
4719 Patch by Padraig Brady.
4720 * tests/pr/Test.pm [col-last]: New test for the above.
4722 * configure.ac: Start with version 4.5.1, chosen so that it's larger
4723 than the latest version numbers of the component packages.
4725 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
4728 2002-08-08 Jim Meyering <jim@meyering.net>
4730 * src/date.c: Guard inclusion of <langinfo.h> with
4731 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
4732 * src/sort.c: Likewise.
4733 Patch by GOTO Masanori.
4735 2002-08-05 Paul Eggert <eggert@twinsun.com>
4737 Fix some minor time-related bugs with POSIX time arguments.
4738 Some valid time stamps were being rejected (notably -1, and
4739 time stamps before 1900 on 64-bit hosts). And some invalid
4740 time stamps were being accepted, e.g. September 31.
4742 * src/date.c (main): Adjust to posixtime signature change.
4743 * src/touch.c (main): Likewise. Remove unnecessary initialization.
4744 Use localtime, not posixtm, to warn about obsolete "touch".
4746 2002-08-05 Jim Meyering <jim@meyering.net>
4748 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
4750 2002-08-04 Jim Meyering <jim@meyering.net>
4752 * src/Makefile.am (check-README): New target/rule.
4753 (check): Depend on it.
4755 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
4757 2002-08-03 Jim Meyering <jim@meyering.net>
4759 * Makefile.am (SUBDIRS): Add old.
4760 * old/: New directory, containing legacy ChangeLog* and NEWS files
4761 from the fileutils, sh-utils, and textutils packages.
4763 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
4765 2002-08-02 Paul Eggert <eggert@twinsun.com>
4767 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
4769 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
4770 (hard_LC_COLLATE): New var.
4771 (different): Args are now char *, not const char *.
4772 Use xmemcoll instead of memcmp to compare lines, so that
4773 LC_COLLATE has effect. However, use memcmp if it is an
4775 (check_file): Do not include newline in comparison, so that
4776 xmemcoll has a byte to stomp on temporarily.
4777 (main): Set hard_LC_COLLATE.
4779 2002-07-29 Jim Meyering <jim@meyering.net>
4781 * Makefile.am (SUBDIRS): Remove djgpp, for now.
4783 2002-07-20 Jim Meyering <jim@meyering.net>
4785 * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
4786 into EXIT_FAILURE. Otherwise, false --help and false --version
4789 2002-07-08 Jim Meyering <jim@meyering.net>
4791 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
4792 rather than the hard-coded `sh-utils'.
4794 2002-07-01 Jim Meyering <jim@meyering.net>
4796 * configure.ac: Merge the three files from fileutils,
4797 textutils, and sh-utils.
4798 * Makefile.am: Likewise.
4799 * src/Makefile.am: Likewise.