1 2004-02-17 Jim Meyering <jim@meyering.net>
5 `make check' from a build inside a chroot environment would fail
6 * tests/help-version: Specify an argument (`/') for df, in the
7 unusual event that there is no valid entry in /etc/mtab.
8 Likewise for id: add the -u option, so we don't get spurious
9 failures when there are no user or group names.
12 * src/sort.c (usage) [-u]: Add punctuation so that the description in
13 the help2man-generated (line-joined) man page is more readable.
14 Reported by Tim Waugh.
15 [-T]: Add a semicolon, for the same reason.
17 2004-02-15 Jim Meyering <jim@meyering.net>
19 * Makefile.am (dist-hook): Qualify target with $(srcdir)/ prefix.
21 2004-02-11 Jim Meyering <jim@meyering.net>
23 * tests/Makefile.am.in ($(srcdir)/Makefile.am): Use more portable
24 $(srcdir)/../Makefile.am.in, rather than $<.
25 Suggestion from Michael Elizabeth Chastain.
27 2004-02-10 Jim Meyering <jim@meyering.net>
29 * config/install-sh: Make this script executable.
30 * Makefile.am (dist-hook): New target, to ensure that config/install-sh
31 is executable. Otherwise, on systems that lack a suitable install
32 binary, `make install' would fail, because of the way this script
33 is invoked (without `$SHELL ' prefix).
34 Reported by Bob Proulx.
36 2004-02-08 Jim Meyering <jim@meyering.net>
40 * tests/rm/rm5: Avoid triggering a bug in OSF/Tru64's sed
41 that would cause an unwarranted test failure.
42 * tests/rm/rm3: Likewise.
44 2004-02-07 Jim Meyering <jim@meyering.net>
46 Remove xstat function pointer member. The way it was used was not
47 portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
48 inline `stat' and `lstat' functions, thus making the tests of
49 `xstat == lstat' in copy.c always fail.
50 * src/copy.h (struct cp_options) [xstat]: Remove member.
52 * src/copy.c (copy_dir): Set `.dereference' member, not .xstat.
53 (copy_internal): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.
54 Use `x->dereference == DEREF_NEVER' in place of `x->xstat == lstat'.
55 (valid_options): Remove now-obsolete FIXME comments.
57 * src/cp.c (re_protect): Use `XSTAT (x, ...)' in place of
59 (do_copy): Declare/use local xstat rather than x->xstat.
60 (main): Remove code that set x.xstat.
61 * src/mv.c (cp_option_init): Don't initialize xstat member.
62 * src/install.c (cp_option_init): Likewise.
64 * Makefile.cfg (gnu_ftp_host-alpha, etc.): Un-factor .gnu.org suffix,
65 so that emit_upload_commands can use these variables, too.
67 2004-02-06 Jim Meyering <jim@meyering.net>
69 * tests/rm/deep-1: Remove `du' stack space test.
70 Apparently, `ulimit -s N' isn't portable enough.
71 This test will be restored (with a guard against losing ulimit)
72 in its own file later.
74 * tests/rm/deep-1 (deep): Remove progress-style diagnostics,
75 since this test doesn't take long enough to merit them.
76 Run du on $tmp (the containing dir), not $deep, the full path to leaf.
78 * Makefile.maint (signatures): Remove definition.
79 Now, automake's gnupload handles this.
80 (%.sig: %): Remove now-unused rule.
81 (rel-files): Use automake's $(DIST_ARCHIVES), rather than
82 `$(distdir).tar.bz2 $(distdir).tar.gz'.
83 (emit-upload-commands): Adjust to use gnupload.
85 2004-02-05 Jim Meyering <jim@meyering.net>
87 * src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP): Remove definitions.
88 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
89 Now, those are all defined in timespec.h.
92 * src/date.c: Don't include timespec.h, now that system.h does it.
94 2004-02-02 Paul Eggert <eggert@twinsun.com>
96 Don't dump core if localtime returns NULL (possible on
97 hosts with 64-bit time_t and 32-bit int).
98 * src/date.c: Include "inttostr.h".
99 (batch_convert, main):
100 If time conversion fails, exit with nonzero status.
101 (show_date): Return int to report conversion failure.
102 Print the time as an int if localtime fails.
103 * src/uptime.c: Print "??" if the current clock can't
104 be converted by localtime. This won't happen until the year
105 2*31 + 1900, but we don't want to dump core even if the current
106 clock has the wrong value.
108 * src/stat.c: Include "inttostr.h".
109 (human_time): Print the date/time as a number of seconds since the
110 epoch if it can't be converted by localtime. This is better than
111 just saying "invalid", and is consistent with what "ls" does.
112 Don't dump core if the year has more than 48 digits; this isn't
113 possible on any contemporary host, but we might as well do it right.
115 2004-01-31 Paul Eggert <eggert@twinsun.com>
117 * src/stat.c (human_time): Accept time rather than
118 pointer-to-const-time parameter, for clarity. All callers changed.
120 2004-02-02 Jim Meyering <jim@meyering.net>
122 * src/stat.c (do_stat): Remove extra trailing newline from
123 default formats. Reported by Nelson H. F. Beebe.
125 Print actual fractional seconds in time stamps, not just `.00000000'.
126 * src/stat.c (human_time): Add and use new parameter, t_ns.
127 (print_stat): Update callers.
128 * src/ls.c (TIMESPEC_NS): Remove definition.
129 * src/system.h (TIMESPEC_NS): Define here, instead, now that stat.c
130 also uses this macro.
131 Nelson H. F. Beebe noticed that ls --full-time printed nonzero
132 fractional seconds for files on an XFS file system, but that stat's
133 fractional seconds were always zero.
135 2004-01-28 Paul Eggert <eggert@twinsun.com>
137 * src/seq.c (print_numbers): Use 'double' for loop index, not
138 'int', to avoid problems with integer overflow. On almost all
139 machines 'double' works in every case where 'int' works, and
140 it works on other cases besides.
142 2004-01-27 Jim Meyering <jim@meyering.net>
144 * src/seq.c (usage): Mention that if INCREMENT is omitted,
145 it defaults to 1, even when FIRST is larger than LAST.
146 Reword so as not to exclude the possibility that INCREMENT be zero.
148 2004-01-25 Jim Meyering <jim@meyering.net>
152 * Makefile.maint (signatures): Comment out definition.
154 2004-01-23 Jim Meyering <jim@meyering.net>
156 * Makefile.maint (header_regexp): Add exitfail.
158 * man/Makefile.am (EXTRA_DIST): Add help2man.
159 Reported by Nelson H. F. Beebe.
161 * man/Makefile.am (.x.1): Prefix help2man invocation with `$(PERL) --'
162 so it works on systems with Perl installed somewhere other than in
165 * src/paste.c (paste_parallel): Declare local, chr, to be of type
166 `int', not `char', since it must hold EOF. This bug would make
167 paste infloop on some systems. Test failures reported by
168 Nelson H. F. Beebe and Christian Krackowizer.
170 2004-01-22 Jim Meyering <jim@meyering.net>
172 * tests/rmdir/fail-perm: New file. Test for just-fixed rmdir bug.
173 * tests/rmdir/Makefile.am (TESTS): Add fail-perm.
175 * man/help2man: Fix it so using --info-page='coreutils PROG' works.
176 * man/Makefile.am (.x.1): Invoke our own (tweaked) copy of help2man.
177 Use --info-page='coreutils PROG' option.
178 Now, readlink.1 refers the user to `info coreutils readlink'
179 rather than to `info readlink'. Reported by Matt Swift.
181 2004-01-21 Paul Eggert <eggert@twinsun.com>
185 * src/basename.c (usage): Use EXIT_SUCCESS, not 0, for clarity.
186 * src/cat.c, src/chgrp.c, src/chmod.c, src/chown.c, src/chroot.c,
187 * src/cksum.c, src/comm.c, src/cp.c, src/csplit.c, src/cut.c,
188 * src/date.c, src/dd.c, src/df.c, src/dircolors.c, src/dirname.c,
189 * src/du.c, src/echo.c, src/env.c, src/expand.c, src/expr.c,
190 * src/factor.c, src/fmt.c, src/fold.c, src/head.c, src/hostid.c,
191 * src/hostname.c, src/id.c, src/install.c, src/join.c, src/kill.c,
192 * src/link.c, src/ln.c, src/logname.c, src/ls.c, src/md5sum.c,
193 * src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c,
194 * src/nl.c, src/nohup.c, src/od.c, src/paste.c, src/pathchk.c,
195 * src/pinky.c, src/pr.c, src/printenv.c, src/printf.c, src/pwd.c,
196 * src/rm.c, src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c,
197 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c,
198 * src/su.c, src/sum.c, src/sync.c, src/tac.c, src/tail.c, src/tee.c,
199 * src/test.c, src/touch.c, src/tr.c, src/tsort.c, src/tty.c,
200 * src/uname.c, src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c,
201 * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c: Likewise.
203 * src/cat.c (usage): Don't bother normalizing exit status
204 since the arg is already the correct exit status now.
205 * src/cksum.c, src/comm.c, src/csplit.c, src/cut.c,
206 * src/dircolors.c, src/expand.c, src/fmt.c, src/fold.c, src/head.c,
207 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c,
208 * src/pr.c, src/split.c, src/sum.c, src/tac.c, src/tail.c, src/tr.c,
209 * src/tsort.c, unexpand.c, src/src/uniq.c, src/src/wc.c: Likewise.
211 * src/chown.c (main): Removed unused local 'fail'.
213 * src/chroot.c (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE):
216 * src/chroot.c (main): Initialize exit_failure to EXIT_FAIL.
217 * src/env.c, src/nice.c, src/su.c: Likewise.
218 * src/nohup.c (main): Likewise, to NOHUP_FAILURE.
219 * src/setuidgid.c (main): Likewise, to SETUIDGID_FAILURE.
220 * src/expr.c (main): Use initialize_exit_failure rather than
221 setting exit_failure directly; this optimizes away redundant
223 * src/printenv.c, src/sort.c, src/test.c, src/tty.c: Likewise.
225 * src/chroot.c (main): Exit with status 1 rather than 127
226 if chroot itself fails, as per documentation.
228 * src/chroot.c (main): Use EXIT_ENOENT and EXIT_CANNOT_INVOKE
229 rather than roll-your-own symbols or integers.
230 * src/env.c (main): Likewise.
231 * src/nohup.c (main): Likewise.
232 * src/su.c (run_shell): Likewise.
234 * src/cp.c (exit_status): Remove static var....
235 (main): Making it local here instead. Use =, not |=, to set it.
237 * src/cut.c (FATAL_ERROR, main): Exit with status EXIT_FAILURE,
239 * src/date.c (batch_convert, main): Likewise.
240 * src/dd.c (dd_copy): Likewise.
241 * src/pr.c (first_last_page, main, getoptarg): Likewise.
242 * src/tr.c (main): Likewise.
243 * src/date.c (main): Don't assume EXIT_FAILURE == 1, as
244 POSIX doesn't require it.
245 * src/dd.c (write_output, skip, dd_copy): Likewise.
246 * src/df.c (main): Likewise.
247 * src/id.c (main): Likewise.
248 * src/install.c (main): Likewise.
249 * src/ln.c (main): Likewise.
250 * src/ls.c (main): Likewise.
251 * src/mv.c (main): Likewise.
252 * src/shred.c (main): Likewise.
254 * src/env.c (main): Exit with status 1, not 2, on errors detected
256 * src/hostname.c (main): Likewise.
257 * src/nl.c (main): Likewise.
258 * src/stty.c (main): Likewise.
260 * src/expr.c (EXPR_FAILURE): Renamed from EXPR_ERROR, for
261 consistency with the other programs' naming conventions.
264 * src/factor.c (main): Do not report a usage error simply
265 because stdin has bad numbers.
267 * src/id.c (problems): Now a boolean int, not a counter,
268 so that we don't have to worry about int overflow. All uses changed.
269 * src/touch.c (err): Likewise.
271 * src/md5sum.c (main): Use int, not size_t, to store boolean int.
273 * src/mkfifo.c (main): Exit with status 1, not 4, if not implemented.
274 * src/mknod.c: Likewise.
276 * src/nice.c (main): Exit with status EXIT_FAIL, not EXIT_FAILURE,
277 on error; this is in case EXIT_FAILURE is unusual.
278 * src/su.c (main): Likewise.
280 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE): Remove; all uses
281 changed to EXIT_CANNOT_INVOKE.
283 * src/printenv.c (PRINTENV_FAILURE): New constant.
284 (main): Exit with status PRINTENV_FAILURE, not EXIT_FAILURE, on
285 command-line syntax problems.
287 * src/rmdir.c (remove_parents): Don't set 'fail' to a negative number.
288 (main): Avoid integer overflow when seeing whether errors occurred.
290 * src/seq.c (print_numbers): Now returns void, not (zero) int.
292 (main): Remove unused local variable 'errs'. Always exit successfully
295 * src/setuidgid.c (SETUIDGID_FAILURE): Renamed from FAIL_STATUS,
296 for consistency with other programs here. All uses changed.
297 (main): Use 'error' to exit rather than invoking 'exit' here.
299 * src/sort.c: Don't include <assert.h>.
300 (SORT_OUT_OF_ORDER, SORT_FAILURE): Now enums, not macros.
301 (usage): Don't use 'assert'.
302 (main): Remove redundant assignment to exit_failure.
304 * src/system.h (EXIT_FAIL, EXIT_CANNOT_INVOKE, EXIT_ENOENT):
306 (initialize_exit_failure): New inline function.
307 Include exitfail.h here, since we refer to exit_failure.
308 All callers changed to not include exitfail.h.
310 * src/tty.c (TTY_FAILURE, TTY_WRITE_ERROR): New enum values;
311 substitute them for the corresponding integer constants.
313 * tests/help-version (expected_failure_status_date): Remove, as
314 'date' is now normal.
315 (expected_failure_status_nohup): New var.
317 2004-01-21 Jim Meyering <jim@meyering.net>
319 * tests/touch/relative: Remove `command' syntax.
320 Thanks to Nelson H. F. Beebe and Paul Eggert.
322 * tests/touch/relative: Test only year/month/day, not hours/min/sec,
323 so as to avoid problems with systems using TAI clocks.
324 Although it's no longer necessary, set TZ=UTC0 also for the
325 initial touch command. Reported by Paul Jarc here:
326 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/1504
328 2004-01-20 Diego Biurrun <diego@biurrun.de>
330 * src/dircolors.hin: Add .mov to the list of media files.
332 2004-01-19 Paul Eggert <eggert@twinsun.com>
334 * tests/touch/relative: Use TZ=UTC0, not TZ=utc (which isn't
335 portable). Problem reported by Christian Krackowizer. Also, use
336 +0000 rather than +0 to specify a time zone, as the documentation
337 requires four digits.
339 2004-01-19 Jim Meyering <jim@meyering.net>
341 * tests/mv/hard-4: Run envvar-check in case SIMPLE_BACKUP_SUFFIX is set.
342 * tests/mv/backup-is-src: Likewise.
343 Problem reported by Peter Horst
345 2004-01-17 Jim Meyering <jim@meyering.net>
347 * announce-gen (print_changelog_deltas): Use .sig suffix, not .asc.
351 2003-12-15 Paul Eggert <eggert@twinsun.com>
353 * NEWS, doc/coreutils.texi: touch -r and -d can now both be specified,
354 with -r specifying the origin for -d.
355 * src/touch.c (flexible_date): Remove static var.
356 (get_reldate): New function.
357 (main): Use it, to implement this new behavior.
359 2004-01-16 Jim Meyering <jim@meyering.net>
361 * tests/touch/relative: New test for the above.
362 * tests/touch/Makefile.am (TESTS): Add relative.
364 2004-01-13 Jim Meyering <jim@meyering.net>
366 * src/system.h: Include contents of sys2.h.
367 * src/sys2.h: Remove file.
368 * src/Makefile.am (noinst_HEADERS): Remove sys2.h.
370 * Use automake-1.8.2. Regenerate dependent files.
372 * Update to gettext-0.13.1.
373 * configure.ac: Use gettext-0.13.1.
374 * .x-sc_space_tab: Add m4/po.m4 to the list of exceptions.
376 2004-01-12 Jim Meyering <jim@meyering.net>
378 * Makefile.maint (%.sig): Use .sig suffix rather than .asc.
380 * Makefile.maint (po-check): Ensure that cvsu works before using it.
381 Reported by Alexandre Duret-Lutz.
383 * src/tail.c (main): Warn about following stdin only when it's a tty.
385 * configure.ac: Use gl_DEFAULT_POSIX2_VERSION.
387 2004-01-10 Jim Meyering <jim@meyering.net>
389 * tests/misc/stat-fmt: Use backticks, not `$()' notation.
391 2004-01-09 Jim Meyering <jim@meyering.net>
393 * configure.ac: Quote underquoted `jm_DUMMY_1' to avoid new warning.
395 2004-01-08 Jim Meyering <jim@meyering.net>
397 * src/stat.c (human_fstype): Use %lx, not %x format for `unsigned long'.
400 * tests/Makefile.am (TESTS_ENVIRONMENT): Remove `/vg' (prerelease test
401 remnant) from PATH component. That would cause tests in this directory
402 not to run the just-built binaries, but rather whatever happened
403 to be in one's PATH. Reported by Christian Krackowizer.
405 2004-01-04 Jim Meyering <jim@meyering.net>
407 * src/csplit.c (new_control_record): Use x2nrealloc
408 rather than xrealloc.
410 * src/cp.c (re_protect): Use ASSIGN_STRDUPA rather than
412 (make_path_private): Likewise.
414 2004-01-03 Jim Meyering <jim@meyering.net>
416 * src/paste.c: Use `bool' (not int) as the type for a few
418 (collapse_escapes): Rewrite to set globals rather than modifying
420 Use size_t (not int) for all counters and related index variables.
421 (paste_parallel): Remove needless complexity of
422 using xrealloc in the loop; just allocate the buffers up front.
423 Free the two temporary buffers.
424 Move declarations of locals `down' into scope where used.
425 (paste_serial): Remove `register' attributes.
426 (main): Simplify delim-related code.
427 Free `delims', now that it's malloc'd.
429 2004-01-02 Jim Meyering <jim@meyering.net>
431 * src/chroot.c: Include "quote.h".
432 (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): Define.
433 (main): Exit with status of 127, not 1, for too-few-args,
434 chroot failure, or chdir failure.
435 Give a better diagnostic upon execvp failure.
437 * src/du.c (usage): Mention that, with its current meaning,
440 * src/tail.c (main): Warn about following stdin when it's a tty.
441 Fail when following by name but no names are specified.
443 2003-12-30 Jim Meyering <jim@meyering.net>
445 * src/fold.c (main): Use memcpy, not strcpy.
447 * src/copy.c (copy_internal): Use ASSIGN_STRDUPA rather than
450 2003-12-28 Jim Meyering <jim@meyering.net>
452 * src/unexpand.c (n_tabs_allocated): New global.
453 (add_tabstop): Use x2nrealloc rather than xrealloc.
454 * src/expand.c: Likewise.
456 * tests/misc/expand: New file.
457 * tests/misc/Makefile.am (TESTS): Add expand.
459 * src/sort.c (add_temp_dir): Use x2nrealloc rather than xrealloc.
460 (fillbuf): Use x2nrealloc rather than xrealloc.
461 (sort): Use xnmalloc rather than xmalloc.
464 2003-12-27 Jim Meyering <jim@meyering.net>
466 * src/tee.c (tee): Use xnmalloc rather than xmalloc.
468 2003-12-29 Paul Eggert <eggert@twinsun.com>
470 * NEWS: Remove support for join -j1 FIELD, -j2 FIELD, and -o LIST1
471 LIST2 in POSIX 1003.1-2001 hosts, as required by POSIX.
473 * doc/coreutils.texi (join invocation): Remove documentation
474 accordingly. Document that -t makes all separators significant.
476 * src/join.c: Include posixver.h.
477 (obsolete_usage): New var.
478 (longopts): Put obsolete options first.
479 (OBSOLETE_LONG_OPTIONS): New constant.
480 (get_option, add_file_name): New functions.
481 (main): Use them to support new behavior.
482 (usage): Remove documentation for -j1 FIELD and -j2 FIELD.
483 Do not mark -j FIELD as obsolescent; it is longstanding
484 UNIX tradition and is a valid extension to POSIX.
486 * tests/join/Test.pm (tv): Avoid obsolete -o usage.
488 2003-12-28 Paul Eggert <eggert@twinsun.com>
490 * src/join.c (add_field_list): Don't use alloca with unbounded
491 size; just modify the argument, which is no longer const *.
493 Various other minor cleanups, mostly to avoid the need for casts.
495 (extract_field): Renamed from ADD_FIELD, as it's now a function.
497 (struct field.beg): Now char *, not unsigned char const *. All
498 uses changed. It shouldn't be const since xmemcoll writes on its
500 (extract_field): Likewise, for 2nd arg.
501 (keycmp): Remove now-unnecessary cast of xmemcoll args.
503 (is_blank): New function, to avoid need to cast arg to unsigned char.
504 (extract_field): Use it.
506 (xfields): Rewrite pretty much from scratch.
508 (hard_LC_COLLATE): Now bool, not int.
509 (get_line, getseq, add_field_list): Now returns bool, not int.
510 (decode_field_spec, add_field_list): Return true on success (not
511 false), for consistency with the rest of the code. All uses changed.
513 (tab): Now char, not unsigned char. This wasn't 100% necessary
514 but is slightly cleaner.
515 (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler.
517 (empty_filler): Now const *.
519 (make_blank): Remove; wasn't needed. Remove all calls.
520 (main): Don't set uni_blank.nfields; zero is fine.
522 2003-12-27 Jim Meyering <jim@meyering.net>
524 * src/join.c: Include "quote.h".
525 (min, max): Remove definitions.
526 Make a few function parameters and corresponding
527 locals `const'. Use bool for boolean variables.
528 Use size_t (not int) for all counters and related index variables.
529 (prjoin): Remove now-useless assertion.
530 (string_to_join_field): New function.
531 (main): Accept join fields as large as SIZE_MAX.
532 (keycmp): Rename `min' to MIN and max to MAX.
534 2003-12-26 Jim Meyering <jim@meyering.net>
536 fold -s didn't work on e.g., alpha-based systems.
537 * src/fold.c (fold_file): Adjust types (int->size_t) so that using
538 x2nrealloc works properly on systems with differing sizes for int
539 and size_t. Reported by Nelson Beebe.
541 * src/fold.c: Use `bool' (not int) as the type for a few
544 2003-12-23 Paul Eggert <eggert@twinsun.com>
546 * src/ls.c (length_of_file_names_and_frills):
547 Remove forward decl; not needed.
548 (print_file_name_and_frills, length_of_file_name_and_frills):
549 With -m, don't output spaces before inum or size.
550 (print_with_commas): Don't output space just before newline.
552 2003-12-24 Jim Meyering <jim@meyering.net>
554 * tests/ls/Makefile.am (TESTS): Add m-option.
555 * tests/ls/m-option: New file. Test for above fixes.
557 2003-12-20 Jim Meyering <jim@meyering.net>
561 * src/pr.c: Change type of global, buff_allocated, to size_t.
563 * src/join.c [struct seq]: Change types of members count and alloc
564 from `int' to `size_t'.
566 * tests/Makefile.am (root-hint): Tweak wording.
568 * src/du.c: Accept new option (-0, --null) that makes it so each
569 output line is NUL-terminated rather than newline-terminated.
571 * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync.
572 Reported by Volker Paul.
573 * tests/dd/Makefile.am (TESTS): Add unblock-sync.
574 * tests/dd/unblock-sync: New test for the above.
576 2003-12-19 Jim Meyering <jim@meyering.net>
578 * tests/misc/nohup: Double quote back-ticked expression,
579 in case it ends up having an unexpected value.
581 * tests/ls/no-arg: Use ls's -1 option in both runs.
583 * src/du.c (fts_debug): New global.
584 (FTS_CROSS_CHECK, DEBUG_OPT): Define.
585 (main): Make fts use FTS_TIGHT_CYCLE_CHECK.
586 (main) [DU_DEBUG]: Accept -d option.
588 2003-12-18 Jim Meyering <jim@meyering.net>
590 * src/ls.c (format_user): Increment dired_pos via two statements,
591 `dired_pos += width; dired_pos++;' rather than one,
592 `dired_pos += width + 1;' since the latter could conceivably overflow.
593 (format_group): Likewise.
596 * configure.ac: Require automake-1.8.
598 2003-12-12 Jim Meyering <jim@meyering.net>
600 * Use automake-1.8. Regenerate dependent files.
602 2003-12-08 Jim Meyering <jim@meyering.net>
604 * Makefile.maint (news-date-check): New rule.
605 (alpha beta major): Depend on it.
607 2003-12-03 Paul Eggert <eggert@twinsun.com>
609 * NEWS: ls -l (and similar options) now adjust all columns to
610 fit the data. Generalized from a suggestion by Leah Q for file sizes.
611 * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
612 (format_user_width, format_group_width, unsigned_file_size,
613 format_group): New functions.
614 (block_size_width): Renamed from block_size_size.
615 (inode_number_width, nlink_width, owner_width, group_width,
616 author_width, major_device_number_width, minor_device_number_width,
617 file_size_width): New vars.
618 (clear_files): Initialize them.
619 (gobble_file): Set them. Don't ceiling block_size_width to 7.
620 (print_long_file): Use them.
621 (gobble_file): Use a new local variable 'f' to make the code
622 smaller and more consistent with other functions.
623 (format_user): Output to stdout, not to a buffer, so that we
624 don't have to worry about buffer overrun. Update dired_pos.
625 (print_long_file): Don't put owner, group, author into buffer;
626 just print them directly. Don't assume link counts and
627 major and minor numbers fit into unsigned long int.
628 * tests/cp/same-file, tests/mv/part-symlink: Don't assume that
629 'ls' output is fixed-width.
631 2003-12-02 Jim Meyering <jim@meyering.net>
633 * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h.
635 2003-11-27 Jim Meyering <jim@meyering.net>
637 * Use automake-1.7f. Regenerate dependent files.
639 2003-11-24 Paul Eggert <eggert@twinsun.com>
641 Parse floating-point operands and options in the C locale.
642 POSIX requires this for printf, and we might as well be
643 consistent elsewhere (tail, sleep, seq).
645 * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer
646 needed now that we assume C89. Include "c-strtod.h".
647 (xstrtod): Call c_strtod, not strtod.
648 * src/sleep.c: Include "c-strtod.h".
649 (main): Update xstrtod call to include new argument, c_strtod.
650 * src/seq.c (scan_double_arg): Likewise.
651 * src/tail.c (parse_options): Likewise.
653 2003-11-24 Jim Meyering <jim@meyering.net>
655 * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM).
656 Reported by Mark Conty.
658 2003-11-22 Jim Meyering <jim@meyering.net>
660 * Makefile.maint (sc_xalloc_h_in_src): Remove rule. Subsumed by...
661 (sc_system_h_headers): Do this test only if sys2.h exists.
663 2003-11-20 Jim Meyering <jim@meyering.net>
665 * tests/help-version: Ensure that the bug-reporting address is
666 included in the --help output for every program.
667 * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.
669 * src/ptx.c (usage): Output bug-reporting address.
670 Reported by Dan Jacobson.
672 2003-11-19 Jim Meyering <jim@meyering.net>
674 * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted
675 on the join fields. Suggestion from Bruce Robertson.
677 2003-11-18 Jim Meyering <jim@meyering.net>
679 `od -c -w9999999' could segfault
680 * src/od.c (dump): Use xnmalloc/free, not alloca.
682 2003-11-16 Jim Meyering <jim@meyering.net>
684 * Use autoconf-2.59. Regenerate dependent files.
686 * tests/du/hard-link: Minor tweak: use mkdir -p.
688 Fix read-from-free'd-buffer error detected by valgrind.
689 * src/csplit.c (remove_line): Don't return a pointer to data in
690 a freed buffer. Instead, arrange to free the buffer on the
693 * tests/misc/csplit: New test for above fix.
695 2003-11-11 Jim Meyering <jim@meyering.net>
697 * src/ls.c (extract_dirs_from_files): Avoid useless copy operations.
698 This avoids a warning from valgrind about memcpy with overlapping
699 source and destination.
701 * configure.ac: Require automake-1.7.8.
703 2003-11-09 Jim Meyering <jim@meyering.net>
705 * Use automake-1.7.9. Regenerate dependent files.
707 * src/rm.c: Support new options: --preserve-root and --no-preserve-root.
708 * src/chown.c: Likewise.
710 * src/chown-core.c: Include "root-dev-ino.h".
711 (chopt_init): Initialize new member.
712 (change_file_owner): Support rm's new --preserve-root option.
714 * src/remove.c: Include "root-dev-ino.h".
715 (remove_cwd_entries): Remove now-obsolete FIXME comment.
716 (remove_dir): Support rm's new --preserve-root option.
718 * src/chown.c: Include "root-dev-ino.h".
719 Add new options: --preserve-root and --no-preserve-root.
721 * src/chmod.c: Include "root-dev-ino.h".
722 (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
723 ROOT_DEV_INO_WARN macros.
724 (get_root_dev_ino): Remove function definition, now that it's
725 been moved to a separate file.
726 (usage): Describe new options.
728 * src/mv.c (rm_option_init): Initialized new member.
730 * src/remove.h: Include "dev-ino.h".
731 (struct rm_options): Add new member: root_dev_ino.
732 * src/chown-core.h: Include "dev-ino.h".
733 (struct Chown_option): Add new member: root_dev_ino.
735 2003-11-06 Jim Meyering <jim@meyering.net>
737 * src/paste.c (paste_parallel): Use `sizeof *var' rather than
738 hard-coding `sizeof FILE*'.
740 2003-11-05 Dennis Smit <ds@nerds-incorporated.org>
742 * src/wc.c (main): Free `fstatus' so there is no confusion about
743 whether it's leaked or not.
744 * src/who.c (who): Likewise for `utmp_buf'.
746 2003-11-05 Paul Eggert <eggert@twinsun.com>
748 Fix 'cut' problems with size_t overflow and unsigned int.
749 More generally, resize integer variables to fit use more precisely.
750 * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens.
751 (struct range_pair): Make members to be of type size_t, not unsigned.
752 (max_range_endpoint, eol_range_start): Now size_t, not unsigned.
753 (suppress_non_delimited, output_delimiter_specified,
754 have_read_stdin, print_kth, set_fields): Now bool, nt int.
755 (delim): Now unsigned char, not int.
756 (mark_printable_field, is_printable_field, is_range_start_index,
757 set_fields, set_fields, cut_bytes, cut_fields):
758 Use size_t, not unsigned, for field and byte counts.
759 (hash_int): Use uintptr_t, not unsigned, for pointers converted
760 to integers. This squeezes more info out of them.
761 (set_fields, cut_bytes, cut_fields, main):
762 Use bool, not int, for booleans.
763 (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc.
765 2003-11-05 Paul Eggert <eggert@twinsun.com>
767 * man/Makefile.am (check-programs-vs-x):
768 Work even if $(programs) contains '$'.
769 Work even if 'missing=1' in environment.
770 Don't report an error simply because $(programs) outputs nothing.
772 2003-11-05 Jim Meyering <jim@meyering.net>
774 * Use autoconf-2.58. Regenerate dependent files.
776 * src/tr.c (spec_init): Fix typo in last change.
778 * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in
779 call to variadic version_etc function, so that it works even on systems
780 for which sizeof char* != sizeof int.
781 * src/true.c (main): Likewise.
782 * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c:
783 * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c:
784 * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c:
785 * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c:
786 Similarly, cast NULL to `(char *)' in call to variadic function,
787 parse_long_options, so that it works even on systems for which
788 sizeof char* != sizeof int.
789 A similar problem was reported by Harti Brandt in
790 http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html.
792 * src/users.c (users): Free `utmp_buf' explicitly so that people
793 don't mistake this for a real leak.
794 Patch by Dennis Smit <ds@nerds-incorporated.org.
796 2003-11-04 Paul Eggert <eggert@twinsun.com>
798 * README: Document _POSIX2_VERSION.
800 2003-11-04 Jim Meyering <jim@meyering.net>
802 * src/tac.c (memrchr): Remove #if-0'd function.
803 (tac_stdin_to_mem): Clean up #if-0'd code.
805 * src/od.c (decode_format_string): Remove unnecessary casts.
806 Use more maintainable `sizeof *var'.
807 (main): Call decode_format_string rather than decode_one_format,
808 now that `spec' may be NULL.
810 * src/chmod.c (AUTHORS): Add my name.
812 * src/split.c (next_file_name): Use `sizeof *var' rather than
813 hard-coding `sizeof size_t'.
815 * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...).
817 * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc,
818 to avoid potential overflow in pointer arithmetic.
819 (set_fields): Use not `1', but rather `sizeof *printable_field' as
820 second argument to xcalloc.
821 * src/od.c (decode_format_string, dump_strings): Use x2nrealloc
822 rather than xrealloc.
823 * src/date.c (show_date): Likewise.
824 * src/join.c (ADD_FIELD, initseq, getseq): Likewise.
825 * src/pr.c (store_char): Likewise.
826 * src/fold.c (fold_file): Likewise.
828 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
829 type changes (unsigned int -> size_t) in hash.c.
830 * src/cp-hash.c (src_to_dest_hash): Likewise.
831 * src/du.c (entry_hash): Likewise.
832 * src/ls.c (dev_ino_hash): Likewise.
833 * src/cut.c (hash_int): Likewise. Declare function as static.
835 2003-11-03 Jim Meyering <jim@meyering.net>
837 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
838 * tests/misc/fold: Fail the test immediately if we're not running
839 the expected version of fold.
841 2003-11-02 Jim Meyering <jim@meyering.net>
843 * src/tr.c (append_normal_char, append_range, append_char_class)
844 (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var'
845 rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable
847 * src/copy.c (copy_internal): Likewise.
848 * src/join.c (initseq, add_field, make_blank): Likewise.
849 * src/od.c (main): Likewise.
850 * src/cp.c (make_path_private): Likewise.
851 * src/tsort.c (new_item, record_relation): Likewise.
853 * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise.
854 (main): Also remove anachronistic cast of xmalloc return value.
855 * src/ptx.c (alloc_and_compile_regex, main): Likewise.
856 (main): Also remove anachronistic cast of xmalloc return value.
857 * src/sort.c (inittables): Likewise.
858 (sort): Also Split a long line.
860 2003-10-25 Jim Meyering <jim@meyering.net>
862 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
863 type changes (unsigned int -> size_t) in hash.c.
864 * src/cp-hash.c (src_to_dest_hash): Likewise.
865 * src/du.c (entry_hash): Likewise.
866 * src/ls.c (dev_ino_hash): Likewise.
867 * src/cut.c (hash_int): Likewise. Declare function as static.
869 2003-10-21 Jim Meyering <jim@meyering.net>
871 Don't fail when run with VERBOSE=yes.
872 * tests/chgrp/basic: Do `set +x' before starting the subshell
873 from which we invoke chgrp. Otherwise, the output from the
874 VERBOSE=yes-induced `set -x' would result in spurious differences.
875 Reported by Russel Coker via Michael Stone.
877 2003-10-19 Jim Meyering <jim@meyering.net>
879 chmod now uses fts to perform a directory traversal when -R is
880 specified. Before, it operated on full path names, and as such
881 would encounter the PATH_MAX (often 4096) limit.
883 * src/chmod.c: Include "xfts.h".
884 (process_file): Rename from change_file_mode.
885 Adapt to be used with fts.
886 (process_files): New function.
888 2003-10-18 Jim Meyering <jim@meyering.net>
890 * tests/du/deref-args: Ensure that du -D now dereferences all
891 symlinks specified on the command line, not just those that
892 reference directories.
894 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
895 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
896 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
897 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
898 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
899 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
900 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
901 * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
902 of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
903 Update the call to parse_long_options so that `AUTHORS, NULL' are the
905 * src/true.c (main): Append NULL to version_etc argument list.
906 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
908 2003-10-17 Andreas Schwab <schwab@suse.de>
910 * tests/mk-script: Get $srcdir from first parameter instead of
912 (main): Update usage.
914 * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as
915 first argument of mk-script.
916 ($(srcdir)/Makefile.am): Likewise. Prepend $(srcdir) to target.
918 2003-10-17 Jim Meyering <jim@meyering.net>
920 * src/mv.c (usage): Tweak descriptions of -i and -f so that the
921 generated `man' page is more readable. Suggestion from Dan Jacobson.
923 * src/chown-core.c (change_file_owner): Handle the cases in
924 which fts_info indicates an error with the given entry.
926 * src/du.c (main): Simply assign to bit_flags.
927 Don't bother with bit arithmetic.
929 * tests/chmod/no-x: New file.
930 * tests/chgrp/no-x: New file.
931 * tests/chmod/Makefile.am (TESTS): Add no-x.
932 * tests/chgrp/Makefile.am (TESTS): Likewise.
934 * src/du.c: Include "xfts.h".
935 (du_files): Use xfts_open, rather than fts_open.
936 * src/chown-core.c (chown_files): Likewise.
938 2003-10-16 Jim Meyering <jim@meyering.net>
940 * src/chgrp.c (main): Simply assign to bit_flags.
941 Don't bother with bit arithmetic.
942 * src/chown.c (main): Likewise.
943 Rename a couple of local variables.
944 Remove unnecessary casts.
946 * src/tail.c (start_bytes): Rename local, remainder, to avoid
947 gcc's warning about shadowing a global.
949 2003-10-15 Jim Meyering <jim@meyering.net>
951 chown and chgrp now accept POSIX-mandated -H, -L, -P options and
952 use fts to perform a directory traversal when -R is specified.
953 Before, they operated on full path names, and as such would
954 encounter the PATH_MAX (often 4096) limit.
955 They are more efficient. For example, before, chgrp -R would
956 take almost 5 seconds to change about 2000 directories and fail
957 (with `File name too long'), while now it succeeds on a hierarchy
958 of depth 20,000 in 1/10 the time.
960 * src/chown.c: Include "userspec.h" and "fts_.h".
961 (WRITTEN_BY): Add my name.
962 (getpwnam, getgrnam, getgrgid): Remove declarations.
963 (endpwent): Remove definition.
965 (main): Handle new options.
966 Call new function, chown_files rather than change_file_owner.
968 * src/chgrp.c: Include "fts_.h".
969 (WRITTEN_BY): Add my name.
970 (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of
973 (main): Handle new options.
974 Call new function, chown_files rather than change_file_owner.
976 Rewrite to iterate through hierarchies using fts rather than
977 via explicit recursion.
978 * src/chown-core.c: Include "fts_.h"
979 (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
980 on a single file at a time.
981 (chown_files): New function.
982 * src/chown-core.h [enum Dereference_symlink]: Remove declaration.
983 [struct Chown_option] (recurse, force_silent): Change type to `bool'.
984 [struct Chown_option] (dereference): Remove member with ambiguous name.
985 [struct Chown_option] (affect_symlink_referent): New member.
986 (chown_files): New prototype.
988 * tests/chgrp/recurse: Update tests accordingly.
989 * tests/chgrp/posix-H: New tests for the above.
990 * tests/chgrp/Makefile.am (TESTS): Add posix-H.
992 * src/ln.c (usage): Clarify that --directory, -d, -F probably won't
993 work even for superuser. Suggestion from Dan Jacobson.
995 2003-10-14 Paul Eggert <eggert@twinsun.com>
997 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
999 * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h,
1000 lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib.
1001 * src/sort.c (parse_field_count): Handle the case where overflow
1002 and invalid suffix char are both reported.
1004 2003-10-14 Jim Meyering <jim@meyering.net>
1006 * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the
1007 warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
1010 2003-10-13 Paul Eggert <eggert@twinsun.com>
1012 Fix to avoid a denial-of-service attack if the display width is
1013 enormous. Also, clean up the code a bit by removing duplicate code.
1015 * src/ls.c (init_column_info): Remove forward decl; no longer needed.
1016 (calculate_columns): New function, that contains code that used
1017 to be common to print_many_per_line and print_horizontal.
1018 (print_many_per_line, print_horizontal): Use it.
1019 (decode_switches): Set max_idx here, not in calculate_columns.
1020 (print_current_files): Don't call init_column_info; calculate_columns
1022 (init_column_info): Don't allocate a lot more space than is needed
1023 to represent the current set of files. Allocate all the new
1024 size_t cells in one call to xnmalloc, rather than a row at a time.
1026 2003-10-13 Jim Meyering <jim@meyering.net>
1028 * src/ls.c (init_column_info): Add another FIXME comment.
1030 2003-10-13 Paul Eggert <eggert@twinsun.com>
1032 Fix address-arithmetic bug in 'ls', reported by Georgi Guninski.
1033 Remove several arbitrary limits on hosts where int cannot represent
1036 * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent,
1037 nfiles, files_index, tabsize, line_length, struct column_info.line_len,
1038 struct column_info.col_arr[0], max_idx):
1039 Now size_t, not int.
1040 (get_funky_string): Return bool indicating success, instead of
1041 a negative count to indicate failure. Store number of columns
1042 through new parameter OUTPUT_COUNT; that way, they can never
1043 go negative. Change equals_end from int to bool. All uses
1045 (struct column_info.valid_len): Now bool, not int. All uses changed.
1046 (dired_dump_obstack, get_funky_string, clear_files,
1047 extract_dirs_from_files, print_current_files,
1048 print_many_per_line, print_horizontal, init_column_info,
1049 put_indicator, length_of_file_name_and_frills,
1050 print_with_commas): Use size_t, not int, for local variables
1052 (decode_switches): Decode sizes using xstrtoul, not xstrtol.
1053 Check for TIOCGWINSZ returing negative values (or values greater
1055 (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
1057 Use xmalloc and xnmalloc, not XMALLOC.
1058 (gobble_file): Use xnrealloc, not XREALLOC.
1059 (print_color_indicator): Remove now-unnecessary cast to size_t.
1061 2003-10-12 Paul Eggert <eggert@twinsun.com>
1063 * tests/du/no-x: Change wording of diagnostic to match latest du.c.
1064 * tests/sort/sort-tests: Remove from CVS; assume that people
1065 brave enough to check coreutils out from CVS can rebuild it.
1067 2003-10-12 Jim Meyering <jim@meyering.net>
1069 New options: --preserve-root and --no-preserve-root.
1070 * src/chmod.c (change_file_mode): Honor new option.
1071 (change_file_mode): Strip trailing slashes on directory
1072 argument passed to change_dir_mode.
1073 (get_root_dev_ino): New function.
1074 (main): Initialize global, root_dev_ino.
1076 * src/copy.c (copy_internal): Don't #ifdef-out simple uses of
1077 S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined
1079 * src/chmod.c (change_file_mode): Likewise.
1081 2003-10-08 Jim Meyering <jim@meyering.net>
1083 * src/csplit.c (main): Remove obsolete FIXME.
1085 2003-10-07 Jim Meyering <jim@meyering.net>
1087 * Use automake-1.7.8. Regenerate dependent files.
1089 2003-09-29 Paul Eggert <eggert@twinsun.com>
1093 * doc/coreutils.texi (csplit invocation):
1094 The regexp offset need not have a sign; POSIX requires support
1095 for signless offets.
1097 Be more careful about int widths. For example, remove some
1098 arbitrary limits by replacing 'unsigned' with 'size_t',
1099 'uintmax_t', etc. Use standard bool rather than a homegrown type.
1100 * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
1101 * src/csplit.c (FALSE, TRUE, boolean): Remove. All uses changed
1102 to <stdbool.h> usage.
1103 (struct control): offset is now intmax_t, not int.
1104 repeat_forever is now bool, not int.
1105 (struct cstring): len is now size_t, not unsigned int.
1106 (struct buffer_record): bytes_alloc, bytes_used, num_lines are now
1107 size_t, not unsigned. start_line, first_available are now
1108 uintmax_t, not unsigned.
1109 (hold_count, control_used): Now size_t, not unsigned.
1110 (last_line_number, current_line, bytes_written):
1111 Now uintmax_t, not unsigned.
1112 (save_to_hold_area, red_input, keep_new_line, record_line_starts,
1113 create_new_buffer, get_new_buffer, load_buffer, find_line,
1114 process_regexp, split_file, new_control_record, extract_regexp,
1115 get_format_width, get_format_prec, max_out):
1116 size args, locals, and returned values are now size_t, not unsigned
1118 (get_first_line_in_buffer, find_line, write_to_file,
1119 handle_line_error, process_line_count, regexp_error, process_regexp,
1121 File line, byte, and repetition counts are now uintmax_t, not unsigned.
1122 (check_for_offset): Don't require a sign before the offset.
1123 Use xstrtoimax to do the real work.
1124 (extract_regexp): Remove harmful cast of size to unsigned.
1125 256 -> 1<<CHAR_BIT, for clarity.
1126 (get_format_flags): Return at most 3, to avoid worries about overflow.
1128 (bytes_to_octal_digits): Remove.
1130 (cleanup): Don't check whether output_stream is NULL, since
1131 close_output_file does that for us.
1133 (new_line_control, create_new_buffer): Use "foo *p = xmalloc
1134 (sizeof *p);" instead of the more long-winded alternatives.
1136 (get_new_buffer): Use O(1) algorithm for resizing a buffer
1137 to a much larger size, instead of an O(N) algorithm.
1139 (process_regexp): Use plain NULL rather than casted 0.
1141 (make_filename): Use %u, not %d, to format unsigned file number.
1143 (new_control_record): Use xrealloc exclusively, since it handles
1146 (extract_regexp): Change misspelled word in diagnostic.
1148 (get_format_width): Even if a minimum field width is specified,
1149 allow room for enough octal digits to represent the value of
1150 the maximum representible integer. This fixes a potential
1151 buffer overrun. Calculate this room at compile-time, not
1152 at run-time; this removes the need for bytes_to_octal_digits.
1153 Check for overflow; this removes a FIXME.
1155 (get_format_prec): Don't allow precision to be signed; it's
1156 not ANSI. Check for overflow. Remove hardcoded "11" as
1157 default precision; this fixes a potential buffer overrun
1158 on hosts with wider size_t.
1160 (get_format_conv_type): Change local variable to be of type
1161 unsigned char, not int; this removes a potential subscript
1162 violation on hosts where char is signed.
1164 (max_out): Replace "for (;*p;)" with more-standard "while (*p)".
1165 Allow "%%" in format. Don't overflow when
1166 counting lots of percents.
1168 (usage): Default sprintf format is %02u, not %d.
1170 2003-10-05 Jim Meyering <jim@meyering.net>
1172 * src/chown-core.c (change_file_owner): Remove set-but-not-used local.
1174 * src/du.c (du_files): Mark diagnostic for translation.
1176 2003-10-04 Jim Meyering <jim@meyering.net>
1178 * src/du.c (du_files): Ignore any failure of fts_close.
1179 Give better diagnostics for failed fts_open.
1181 * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition.
1183 Deprecate existing use of -H (aka --si).
1184 * src/du.c (enum) [HUMAN_SI_OPTION]: New member.
1185 [long_options]: Use HUMAN_SI_OPTION, not 'H'.
1186 (main): Warn that the meaning of -H will soon change to be
1189 2003-10-03 Jim Meyering <jim@meyering.net>
1191 * src/du.c: Accept --no-dereference (-P).
1193 2003-10-02 Jim Meyering <jim@meyering.net>
1195 * tests/du/trailing-slash: Adjust for slightly different output.
1197 Rewrite du.c to use fts.
1198 * src/du.c: Include "fts_.h", not ftw.h.
1199 (opt_dereference_arguments, arg_length, suffix_length): Remove globals.
1200 (IS_FTW_DIR_TYPE): Remove definition.
1201 (IS_DIR_TYPE): Define.
1202 (is_symlink_to_dir): Remove now-unnecessary function.
1203 (process_file, du_files): Rewrite to use fts.
1205 * tests/du/inaccessible-cwd: Ensure that even when run from an
1206 inaccessible directory, du can still operate on accessible
1207 directories elsewhere.
1208 * tests/du/Makefile.am (TESTS): Add inaccessible-cwd.
1210 * tests/rm/deep-1: Ensure that du can process a hierarchy
1211 of depth 400 while using no more than 50KB of stack space.
1213 2003-10-01 Akim Demaille <akim@epita.fr>
1215 * announce-gen (print_news_deltas): New function, extracted from main.
1216 (main): Make `news_file' an array.
1217 Use '...=s' => \@var for --news and --url-directory specs.
1218 Before there were a couple of portability problems.
1220 2003-09-28 Jim Meyering <jim@meyering.net>
1222 * Makefile.maint (sc_cast_of_alloca_return_value): New rule.
1223 (syntax-check-rules): Add it.
1225 * src/copy.c: Remove unnecessary cast of alloca, since now it's
1226 guaranteed to be (void *).
1227 * src/cp.c: Likewise.
1228 * src/join.c: Likewise.
1229 * src/ln.c: Likewise.
1230 * src/ls.c: Likewise.
1231 * src/od.c: Likewise.
1232 * src/sys2.h (ASSIGN_STRDUPA): Likewise.
1234 2003-09-27 Jim Meyering <jim@meyering.net>
1236 Don't exhaust virtual memory when processing large inputs.
1237 Fix this by removing csplit's internal free-list management;
1238 instead rely on malloc for that.
1240 * src/csplit.c (free_list): Remove global.
1241 (clear_all_line_control): Remove function.
1242 (get_new_buffer): Always use create_new_buffer to obtain a
1243 new buffer, rather than searching free_list.
1244 (free_buffer): Just call free.
1245 Reported by Nikola Milutinovic.
1247 2003-09-26 Jim Meyering <jim@meyering.net>
1249 * man/rm.x: Also list `chattr' in SEE ALSO section.
1250 Suggestion from Mark Hubbart.
1252 2003-09-25 Jim Meyering <jim@meyering.net>
1254 * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now
1255 that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them.
1257 * Use autoconf-2.57d. Regenerate dependent files.
1259 2003-09-24 Jim Meyering <jim@meyering.net>
1261 Minor efficiency tweak.
1262 * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
1263 (do_link): Likewise.
1265 2003-09-23 Jim Meyering <jim@meyering.net>
1267 * src/paste.c (paste_serial): Save errno after input error,
1268 to report proper errno value.
1269 Based on a patch from Paul Eggert.
1271 * src/tee.c (tee): Adjust fwrite arguments so that the return
1272 value is the number of bytes written.
1274 2003-09-16 Paul Eggert <eggert@twinsun.com>
1276 Don't assume ferror sets errno. Bug reported by Bruno Haible.
1278 * src/comm.c (compare_files): Save errno after input error,
1279 to report proper errno value.
1280 * src/fold.c (fold_file): Likewise.
1281 * src/od.c (check_and_close, skip, read_char, read_block): Likewise.
1282 * src/unexpand.c (unexpand): Likewise.
1284 * src/csplit.c (close_output_file): Don't report bogus errno value
1285 after ferror discovers an output error. We don't know the proper
1286 errno value, since it might have been caused by any of a whole
1287 bunch of calls, and it might have been trashed in the meantime.
1288 Fixing this problem will require much more extensive changes;
1289 in the meantime just say "write error".
1290 * src/od.c (check_and_close, dump, dump_strings): Likewise.
1291 * src/uniq.c (check_file): Likewise.
1293 * src/join.c (get_line): Report error right away if I/O fails,
1294 so that the proper errno value is used.
1295 * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise.
1296 * src/tee.c (tee): Likewise.
1297 * src/uniq.c (check_file): Likewise.
1299 * src/od.c (skip): If a read fails, don't retry it later, so
1300 that we report the proper errno.
1302 * src/tac.c (tac_mem): Don't return a value; nobody uses it.
1304 * src/tee.c (tee): Once a write failure has occurred, don't bother
1305 writing anything more to that stream.
1307 * src/uniq.c (check_file): Check for ferror (stdout) even if
1310 * src/yes.c (UNROLL): Remove.
1311 (main): Exit immediately when write failure is detected.
1312 Simplify code by assigning to argv when argc == 1.
1314 2003-09-21 Paul Eggert <eggert@twinsun.com>
1316 * src/ptx.c: Switch encoding from Latin-1 to UTF-8.
1317 (WRITTEN_BY): Change "Franc,ois" (actually using
1318 c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
1321 2003-09-19 Jim Meyering <jim@meyering.net>
1323 `du -D symlink-to-dir' would mistakenly omit the slash in
1324 lines like this: 24 symlink-to-dir/subdir
1325 * src/du.c (process_file): Fix offset calculation.
1326 Reported by Jeff Sheinberg as Debian bug #211591;
1327 http://bugs.debian.org/205251
1329 * tests/du/deref-args: New file/test for the above.
1330 * tests/du/Makefile.am (TESTS): Add deref-args.
1332 * src/du.c (process_file): Remove useless disjunct.
1334 * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
1336 * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
1337 Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
1338 Mark each WRITTEN_BY string as translatable.
1340 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1341 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1342 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1343 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1344 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1345 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1346 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1347 * who.c, whoami.c, yes.c: Revert yesterday's changes.
1348 Instead, a subsequent change will embed `Written by ' in
1349 each string along with the author names.
1351 * src/true.c: Revert yesterday's changes.
1352 * src/sys2.h: Likewise.
1354 2003-09-18 Jim Meyering <jim@meyering.net>
1356 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1357 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1358 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1359 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1360 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1361 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1362 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1363 * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
1364 comma-separated list of strings and/or update the call to
1365 parse_long_options so that `AUTHORS, NULL' are the last parameters.
1366 * src/true.c (main): Append NULL to version_etc argument list.
1367 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
1369 * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
1370 shadowing the math function name. Also rename loga to log_a.
1372 2003-09-14 Jim Meyering <jim@meyering.net>
1374 * src/factor.c (print_factors): Give a separate diagnostic
1375 for numbers that are too large, but otherwise valid.
1376 Reported by Dániel Varga.
1378 2003-09-10 Jim Meyering <jim@meyering.net>
1380 * Use automake-1.7.7. Regenerate dependent files.
1382 * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
1383 of `fmt -1'. Using the just-built tr is a little cleaner.
1384 Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
1385 * man/Makefile.am (programs, check-x-vs-1): Likewise.
1387 2003-09-09 Jim Meyering <jim@meyering.net>
1389 * src/copy.c: Alphabetize includes.
1390 Remove duplicate inclusion of "same.h".
1392 2003-09-08 Jim Meyering <jim@meyering.net>
1394 * Makefile.maint (GZIP_ENV): Remove --rsyncable.
1395 Didn't give enough of a benefit, mainly because it's not yet
1400 * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
1401 (check-programs-vs-x): Fail if $(programs) is empty.
1403 * src/remove.c: Add a comment.
1405 2003-09-07 Jim Meyering <jim@meyering.net>
1407 * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
1408 Don't define. These symbols are no longer used.
1410 * tests/misc/tty-eof: Write ^D as \cD.
1411 Complete the change of 2003-08-02.
1413 * Makefile.maint (po-check): Use cvsu, so that a temporary source
1414 file in lib/ or src/ doesn't induce an unwarranted failure.
1415 Add a kludge to filter out the sole generated source file that
1416 also has translatable messages: src/false.c.
1418 2003-09-06 Jim Meyering <jim@meyering.net>
1420 * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
1421 (parse_options): Give a diagnostic for (but still accept) the
1422 deprecated --allow-missing option.
1424 2003-09-04 Paul Eggert <eggert@twinsun.com>
1426 Don't ignore -S if input is a pipe. Bug report by Michael McFarland in
1427 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
1429 * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the
1430 size_bound ourselves. if an input file is a pipe and the user
1431 specified a size, use that size instead of trying to guess the
1432 pipe size. This has the beneficial side effect of avoiding the
1433 overhead of default_sort_size in that case. All callers changed.
1434 (sort): Remove static var size; now done by sort_buffer_size.
1436 2003-09-05 Jim Meyering <jim@meyering.net>
1438 * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files.
1440 * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
1441 to start, rather than just .1. Upon failure, print unexpected state.
1443 2003-09-04 Paul Eggert <eggert@twinsun.com>
1445 * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
1446 SAFE_READ_ERROR to tmp->nbytes.
1447 * src/tail.c (pipe_lines, pipe_bytes): Likewise.
1449 * src/head.c (struct linebuffer): Change nbytes and nlines
1450 from unsigned int to size_t. unsigned int is safe (after the
1451 2003-09-03 patch) but size_t is cleaner.
1452 * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
1453 (pipe_bytes): Likewise for local variable 'i', which was 'int'.
1455 Standardize on BUFSIZ as opposed to other macro names and values.
1456 * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ.
1457 * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
1458 stdio.h has always defined it,
1459 and other code already assumes it's defined.
1460 * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
1461 (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
1462 (io_buf): IO_BUF_SIZE -> BUFSIZ.
1464 2003-09-04 Paul Eggert <eggert@twinsun.com>
1466 * src/seq.c (step): Default to 1.
1467 (print_numbers): Allow the output to be empty.
1468 (main): The default step is 1, even if LAST < FIRST;
1469 as per documentation.
1470 * tests/seq/basic (onearg-2): Output should be empty.
1472 2003-09-05 Jim Meyering <jim@meyering.net>
1474 * Makefile.cfg (wget_files): Temporarily disable, until master
1475 versions are restored to ftp.gnu.org.
1477 * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
1479 Make seq's --width (-w) option work properly even when the
1480 endpoint requiring the larger width is negative and smaller than
1482 * src/seq.c (get_width_format): Include `-' in the set of bytes
1483 allowed in a `simple' number (no decimal point, no exponent).
1484 Reported by Patrick Mauritz.
1486 2003-09-02 Paul Eggert <eggert@twinsun.com>
1488 * NEWS: sort -t '\0' now uses a NUL tab.
1489 sort option order no longer matters, unless POSIX requires it.
1490 * src/sort.c (usage): Say "blanks" instead of "whitespace",
1491 Similar fixes for many comments.
1492 (TAB_DEFAULT): New constant, so that we can support NUL as
1493 the field separator.
1494 (tab): Now int, not char. Initialize to TAB_DEFAULT.
1495 (specify_sort_size): If multiple sizes are specified, use the largest.
1496 (begfield, limfield): Support NUL tab char.
1497 (set_ordering): Do not let -i override -d.
1498 (main): Report an error if incompatible -o or -t options are given.
1499 Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
1501 2003-09-05 Jim Meyering <jim@meyering.net>
1503 * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
1505 2003-09-03 Andreas Schwab <schwab@suse.de>
1507 Bug report and patch here:
1508 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
1509 * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
1510 * src/head.c (elide_tail_lines_pipe): Likewise.
1512 2003-09-03 Jim Meyering <jim@meyering.net>
1514 * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
1515 small amount of code from him was first moved to lib/human.c, and was
1516 subsequently rewritten entirely.
1517 * src/df.c (AUTHORS): Likewise.
1519 2003-08-22 Lawrence Teo <lcteo@uncc.edu>
1521 * src/md5sum.c (split_3): Accept the BSD format for generic
1522 message digest modes. Currently works with BSD's MD5 and SHA1
1523 formats since these are the two algorithms presently used in
1524 coreutils. Updated comments to reflect this change.
1525 (bsd_split_3): Updated comments.
1527 * tests/md5sum/basic-1: New test to make sure that
1528 `md5sum --check' doesn't accept the BSD SHA1 format (adapted
1529 from `check-bsd' test in tests/sha1sum/basic-1).
1531 * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
1532 --check exit status and BSD SHA1 format (adapted from tests
1533 in tests/md5sum/basic-1).
1535 2003-08-30 Jim Meyering <jim@meyering.net>
1537 * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
1539 When source and destination arguments refer to the same file, reside
1540 on a partition (e.g. VFAT) on which distinct names may refer to the
1541 same directory entry (often due to variations in case), and when the
1542 link count for the file is 1, mv no longer unlinks the file. Instead,
1543 it gives the expected diagnostic that the source and destination are
1544 the same. WARNING: this is an incomplete fix. If the file happens
1545 to have a link count of 2 or greater, such an erroneous mv command
1546 will still unlink it.
1547 Although that is not possible on vfat or umsdos, it is possible on
1548 other file system types, e.g., ntfs, and hpfs.
1549 * src/copy.c (same_file_ok): Invoke same_name (which might still
1550 return false for names that refer to the same directory entry)
1551 only if the link count is 2 or more.
1552 * tests/mv/vfat: Show how to demonstrate the above problem.
1553 This test is not run.
1554 * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
1556 2003-08-27 Jim Meyering <jim@meyering.net>
1558 * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
1559 who's -l option has been eliciting an unconditional warning about
1560 this impending change since sh-utils-2.0.12 (April 2002).
1562 * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
1563 This would happen for nonempty files not ending with a newline.
1564 Reported by Dan Jacobson.
1565 * tests/misc/paste-no-nl: New file. Test for above-fixed bug.
1566 * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
1568 * src/stat.c (print_it): Avoid buffer overrun that would
1569 occur when the user-specified format string ends with `%'.
1570 Patch by Tommi Kyntola.
1571 * tests/misc/stat-fmt: New file. Test for above-fixed bug.
1572 * tests/misc/Makefile.am (TESTS): Add stat-fmt.
1574 2003-08-26 Jim Meyering <jim@meyering.net>
1576 Apply changes from bison.
1577 * GNUmakefile (SHELL): Define to `sh', if necessary.
1579 * Makefile.maint (WGETFLAGS): Define to `-C off'.
1580 Update all uses of $(WGET).
1582 2003-08-22 Akim Demaille <akim@epita.fr>
1584 * Makefile.cfg (local-checks-to-skip): New.
1585 * Makefile.maint (local-check): Rename as...
1586 (local-checks-available): this.
1589 2003-08-26 Akim Demaille <akim@epita.fr>
1591 * announce-gen (print_changelog_deltas): Neutralize "<#" as
1592 "<\#" to avoid magic from Gnus when posting parts of this script.
1594 2003-08-25 Jim Meyering <jim@meyering.net>
1596 * src/stat.c (main): Warn about use of deprecated `-l' option.
1598 2003-08-22 Jim Meyering <jim@meyering.net>
1600 * src/stat.c (do_stat): For link count at end of line, use %h format,
1601 instead of %-5h. The latter would make stat emit trailing spaces.
1602 Reported by Dan Jacobson.
1604 2003-08-20 Jim Meyering <jim@meyering.net>
1606 * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
1608 2003-08-19 Jim Meyering <jim@meyering.net>
1610 * src/system.h: Include stdlib.h unconditionally,
1611 as we're now assuming that part of hosted C89.
1613 2003-08-18 Jim Meyering <jim@meyering.net>
1615 * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
1616 to avoid warnings from gcc.
1618 2003-08-17 Jim Meyering <jim@meyering.net>
1620 Avoid unnecessary and sometimes time-consuming hostname lookups.
1621 * src/who.c (print_user): Use strchr, not strrchr.
1622 * src/pinky.c (print_entry): Likewise.
1623 Patch by Michael Stone.
1624 This fixes a typo I introduced in who-users.c on 1996-02-23.
1626 * Makefile.maint (makefile-check): Add 0-9 to the range of characters
1627 disallowed between `@...@'.
1629 2003-08-16 Paul Eggert <eggert@twinsun.com>
1631 * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
1632 done by gnulib .m4 files.
1633 (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
1634 * src/sys2.h (strtoull): Remove unused declaration.
1636 2003-08-16 Jim Meyering <jim@meyering.net>
1638 * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
1641 * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
1642 race condition bug. The bug would be triggered when tailing a file
1643 with file pointer not at beginning of file, and where the file was
1644 truncated to have a length of less than the initial offset at just
1645 the right moment (between the two lseek calls in this function).
1647 An invalid initial value for *read_pos would result in
1648 `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
1649 busy-wait rather than sleeping between iterations. The bug manifests
1650 itself only when tailing regular files that are initially nonempty.
1651 * src/tail.c (tail_bytes): Set *read_pos to new file offset after
1653 (tail_lines): Likewise, after lseek calls.
1654 Reported by Nick Estes. See http://bugs.debian.org/205251 for details.
1655 * tests/tail-2/tail-n0f: New file. Test for above fix.
1656 * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
1658 2003-08-15 Jim Meyering <jim@meyering.net>
1660 * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
1661 (sc_sun_os_names): Likewise.
1662 * .x-sc_space_tab, .x-sc_sun_os_names: New files.
1664 * man/help2man: Remove some SPACEs before TAB.
1666 2003-08-14 Paul Eggert <eggert@twinsun.com>
1668 * Makefile.maint (LC_ALL): Set to C.
1669 * man/Makefile.am (ASSORT): New var.
1670 (check-x-vs-1, programs): Use it.
1671 * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
1672 * tests/Makefile.am (ASSORT, all_programs): Likewise.
1674 2003-08-11 Jim Meyering <jim@meyering.net>
1676 fold -s -wN would infloop for N < 8 with TABs in the input.
1677 E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
1678 * src/fold.c (fold_file): Move contents of `else'-block
1679 out of conditional so it's used also for --spaces (-s).
1680 * tests/misc/fold: Test for the above fix.
1681 * tests/misc/Makefile.am (TESTS): Add fold.
1683 2003-08-10 Jim Meyering <jim@meyering.net>
1685 * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
1686 system.h so the types from time.h and sys/time.h are available.
1687 It appears that this is necessary for OpenBSD, NetBSD, and
1688 Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
1690 2003-08-06 Paul Eggert <eggert@twinsun.com>
1692 * NEWS: Add support for setting file timestamps to microsecond
1693 resolution, on hosts that support this.
1694 * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
1695 * src/copy.c (copy_internal):
1696 Set file timestamps with utimens, not utime.
1697 * src/cp.c (re_protect): Likewise.
1698 * src/install.c (change_timestamps): Likewise.
1699 * src/touch.c (newtime, touch, main): Likewise.
1701 2003-08-09 Jim Meyering <jim@meyering.net>
1703 * Makefile.maint (sc_sun_os_names): New rule based on a regexp
1705 (syntax-check-rules): Add it.
1707 * src/tail.c (main): Tweak Solaris OS version number in comment.
1708 * src/wc.c (wc): Likewise
1709 * tests/tail-2/fflush: Likewise.
1711 * src/tail.c: Add new undocumented option, --presume-input-pipe.
1712 (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
1714 2003-08-08 Paul Eggert <eggert@twinsun.com>
1716 Use new gnulib 'extensions' module.
1717 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
1720 2003-08-08 Paul Eggert <eggert@twinsun.com>
1722 * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
1724 2003-08-09 Jim Meyering <jim@meyering.net>
1726 * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
1727 For tests of obsolete behavior, don't presume that unsetting
1728 _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
1730 2003-08-07 Paul Eggert <eggert@twinsun.com>
1732 * doc/coreutils.texi (split invocation):
1733 Add -d or --numeric-suffixes option to 'split'.
1734 From a suggestion by Jesse Kornblum.
1735 * src/split.c (suffix_alphabet): New var.
1736 (longopts, usage, next_file_name, main): Support -d.
1737 (next_file_name, main): Allow -a0, as POSIX requires.
1738 (next_file_name): Don't assume ASCII-like encoding;
1739 'a' through 'z' are not contiguous in EBCDIC.
1741 2003-08-05 Paul Eggert <eggert@twinsun.com>
1743 Merge getline from gnulib.
1744 * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
1745 * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
1746 New files, from gnulib.
1747 * lib/getdelim2.c, lib/getdelim2.h: Remove.
1748 * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
1749 getdelim2.h to getndelim2.c and getndelim2.h.
1750 * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
1751 checking for getdelim.
1752 (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
1753 than rolling our own.
1754 * src/cut.c: Include getndelim2.h rather than getdelim2.h.
1755 (cut_fields): Invoke getndelim2 rather than getdelim2.
1757 2003-08-04 Jim Meyering <jim@meyering.net>
1759 * src/sort.c (main): Use unsigned int instead of int for `nsigs'
1760 and for the indices to iterate through nsigs.
1762 2003-08-02 Paul Eggert <eggert@twinsun.com>
1764 * src/sort.c: Minor code cleanups, mostly to use more accurate
1765 types and to remove unnecessary casts.
1766 (min, max): Remove. All uses changed to MIN and MAX.
1767 (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
1768 keyfield.skipsblanks, struct keyfield.skipeblanks, struct
1769 keyfield.numeric, struct keyfield.general_numeric, struct
1770 keyfield.month, struct keyfield.reverse, reverse, unique,
1771 have_read_stdin): Now bool, not int. All uses changed.
1772 (eolchar): Now char, not int.
1773 (struct keyfield.ignore): Now bool const *, not int *.
1774 (struct keyfield.translate): Now char const *, not char *.
1775 (struct month.name): Likewise.
1776 (blanks, nonprinting, nondictionary): Now bool[], not int[].
1777 (cleanup, inittables, keycompare, check, mergefps, first_same_file,
1778 check, sort, main): Use const * pointers when possible.
1779 (month_cmp): Rewrite to avoid casts.
1780 (inittables): Initialize tables unconditionally, to avoid branches.
1781 (fillbuf): Return bool, not int. All uses changed.
1782 (fillbuf, keycompare, new_key, main):
1783 Use SIZE_MAX rather than (size_t) -1.
1784 (trailing_blanks): Renamed from trim_trailing_blanks.
1785 Return the number of blanks to trim. All uses changed.
1786 (getmonth): Use trailing_blanks rather than open code.
1787 (keycompare): Do not cast char * to unsigned char *; not needed.
1788 CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
1790 (compare, main): Use | rather than || to avoid jumps.
1791 Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
1793 (check, first_same_file, sort, main):
1794 Use bool instead of int local vars when possible.
1795 (check): Merge the old 'checkfp' and 'check' into a single function,
1796 that returns a boolean (true if the file was ordered).
1798 (main): Use int instead of unsigned for iterating through nsigs.
1799 Rename local var "posix_pedantic" to "posixly_correct".
1801 2003-08-02 Jim Meyering <jim@meyering.net>
1803 * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
1804 to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
1806 * src/cut.c (cut_fields): Don't read again after encountering an
1807 initial EOF. E.g., `cut -f2' would do so.
1808 * tests/misc/tty-eof: Add a test for the above fix.
1810 * src/sort.c (sortlines): Add description and references.
1813 * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
1814 the tests in help-version will use the just-built binaries.
1815 Reported by Christian Krackowizer.
1817 2003-07-31 Paul Eggert <eggert@twinsun.com>
1819 * NEWS: Add --rfc-2822 option to GNU date.
1820 * doc/coreutils.texi (Time directives, Options for date, Examples
1822 * src/date.c (long_options, usage, main): Likewise.
1823 * doc/getdate.texi (General date syntax): Likewise.
1824 * doc/coreutils.texi (Options for date): Fix a typo in format:
1825 it's now %d not %_d. Add URLs.
1827 2003-08-01 Jim Meyering <jim@meyering.net>
1829 * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
1830 Otherwise, with at least the /bin/sh from HPUX 10.20,
1831 the trap code would end up converting that to exit 1 and thus an
1832 unexpected test failure. Reported by Christian Krackowizer.
1834 2003-07-31 Paul Eggert <eggert@twinsun.com>
1836 * src/ptx.c: Do not include bumpalloc.h.
1837 (WORD_TABLE): New member alloc.
1838 (ALLOC_NEW_WORD): Remove.
1839 (occurs_alloc): New var.
1840 (digest_word_file, find_occurs_in_text): Check for arithmetic
1841 overflow when computing table size. Use xrealloc rather than
1842 bumpalloc primitives.
1844 2003-07-29 Jim Meyering <jim@meyering.net>
1848 * README: When running tests as root, suggest using
1849 sudo with NON_ROOT_USERNAME=$USER.
1851 * tests/Makefile.am (all_programs): Makefile is in ../src, not
1854 2003-07-28 Jim Meyering <jim@meyering.net>
1856 * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
1858 2003-07-28 Paul Eggert <eggert@twinsun.com>
1860 * lib/stdbool.hin (_Bool): Make it signed char, instead of
1861 an enum type, so that it's guaranteed to promote to int.
1862 * src/sort.c (sortlines_temp): Undo previous change.
1864 2003-07-28 Jim Meyering <jim@meyering.net>
1866 * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
1867 `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
1868 would cause lines[-1 - swap] (with swap = false) to evaluate to
1871 2003-07-27 Jim Meyering <jim@meyering.net>
1873 * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
1874 since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
1876 * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
1877 directories, as required by POSIX. Reported by Karl Berry.
1878 * tests/rm/dir-no-w: New file. Test for the above fix.
1879 * tests/rm/Makefile.am (TESTS): Add dir-no-w.
1881 * tests/mk-script: Emit `$xx', not its expansion.
1883 2003-07-27 Paul Eggert <eggert@twinsun.com>
1885 This change was inspired by a similar proposal by Stepan Kasal.
1886 * src/sort.c (mergelines, sortlines_temp): New functions.
1887 (sortlines): Use them, to reduce the number of times that
1888 we need to copy 'struct line' values. This improved CPU
1889 performance by about 30% on one 18 MB test.
1890 (sort): Don't invoke sortlines unless we have 2 or more lines.
1892 2003-07-26 Stepan Kasal <kasal@ucw.cz>
1894 * src/sort.c (sort): Don't require two `struct line's per text line,
1895 the new sort algorithm requires just 1.5.
1897 2003-07-27 Jim Meyering <jim@meyering.net>
1899 * src/pathchk.c (validate_path): Use %lu, not %ld.
1901 * src/cut.c (is_printable_field): Simplify bit arithmetic.
1903 * src/ls.c (sort_files): Put `volatile' in the right place.
1906 2003-07-26 Jim Meyering <jim@meyering.net>
1908 Use only one bit per field/offset in array, not one `int'.
1909 * src/cut.c (printable_field): Change type to `unsigned char'.
1910 (mark_printable_field, is_printable_field): New functions.
1911 Use them in place of all direct accesses of `printable_field'.
1913 * src/expand.c (parse_tabstops): Detect overflow properly.
1914 * src/cut.c (set_fields): Likewise.
1916 * src/rm.c: Include "dirname.h".
1917 (usage): Use base_name (program_name) in body of --help output.
1919 * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
1920 Idea from Brendan O'Dea, who suggested using
1921 `program_name = basename (argv[0]);' everywhere --
1922 can't do that, but using base_name works just fine here.
1924 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
1926 2003-07-24 Paul Eggert <eggert@twinsun.com>
1928 Fix some POSIX-compliance problems with 'test'. This makes
1929 'test' more compatible with Bash.
1931 * NEWS, doc/coreutils.texi: Document the following.
1932 * src/test.c: Include exitfail.h.
1933 (TEST_FAILURE): New constant, used for exit status if 'test' fails.
1934 (test-syntax_error): Use it.
1935 (binary_operator): Now takes bool arg specifying whether left operand
1936 is -l ARG, so that caller determines this rather than us.
1938 (term): Use posixtest to evaluate parenthesized subexpressions.
1939 (unary_operator, one_argument): Remove support for -t without operand.
1940 (one_argument): Take argument from argv[pos].
1941 (one_argument, two_arguments, three_arguments): Advance pos.
1942 All callers changed.
1943 (three_arguments): Look for binary ops before "!". Then look
1944 for parenthesized one_argument expressions, instead of trusting
1945 expr () to do the right thing.
1946 (posixtest): Now takes number of args. All callers changed.
1947 Treat "( A B )" like "A B".
1948 (main): Set exit_failure to TEST_FAILURE. Don't depend on
1949 POSIXLY_CORRECT, as we now conform to POSIX by default.
1950 (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
1951 * tests/test/Test.pm (test_vector): Add several tests to check
1952 the above. Syntax errors now exit with status 2, not 1.
1953 * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
1955 2003-07-26 Jim Meyering <jim@meyering.net>
1957 * tests/help-version: Adjust for above change in test behavior:
1958 `[' exits with 2, not 1, and test doesn't accept --help or --version.
1960 * Makefile.maint (ME): Don't use trick suggested in Make manual.
1961 It doesn't work for make-3.79.1. Reported by Christian Krackowizer.
1963 * Makefile.maint (sc_system_h_headers): Another syntax check.
1964 (syntax-check-rules): Add it to the list.
1966 * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
1967 so it matches `%ld' format even on 32-bit systems.
1969 * src/fmt.c (flush_paragraph): Cast field width to `int' to
1970 avoid warning on 64-bit systems.
1972 * src/ls.c (sort_files): Make `func' volatile, so it can't be
1973 clobbered by a `longjmp' into this function.
1975 2003-07-25 Jim Meyering <jim@meyering.net>
1977 * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
1980 * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
1981 because it'd evoke spurious failure on 64-bit systems.
1983 2003-07-24 Jim Meyering <jim@meyering.net>
1985 * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
1986 output its current record counts. Reported by Jurriaan.
1988 * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
1989 `wc' with no options. This goes along with the change of 2003-07-20.
1991 2003-07-23 Jim Meyering <jim@meyering.net>
1993 Don't include headers already included by system.h:
1994 * src/tr.c: Don't include errno.h.
1995 * src/true.c: Don't include version-etc.h.
1996 * src/test.c: Don't include limits.h or error.h.
1997 * src/stat.c: Don't include unistd.h or time.h.
1998 * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
1999 * src/pr.c: Don't include time.h.
2000 * src/pathchk.c: Don't include errno.h.
2001 * src/nice.c: Don't include sys/time.h.
2002 * src/ls.c: Don't include stdlib.h.
2004 * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
2005 * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
2006 * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
2007 * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
2008 * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
2009 * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
2010 * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
2011 * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
2012 Don't include closeout.h.
2014 * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
2015 can access the required version of rm.
2016 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
2018 * tests/cut/Test.pm (out-delim3a): New test.
2020 * man/help2man: Update to version 1.33.
2022 * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
2024 * src/dircolors.c: Include xstrndup.h.
2025 (xstrndup): Remove function, now that it's been factored out into
2028 2003-07-22 Paul Eggert <eggert@twinsun.com>
2030 * src/wc.c (wc): Fix typo in computation of file from file_x,
2031 which caused the former to be used uninitialized if file_x was
2034 2003-07-22 Jim Meyering <jim@meyering.net>
2036 * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
2038 * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
2039 help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by
2040 Thomas Luzat. See http://bugs.debian.org/202413 for details.
2042 * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
2044 * src/hostid.c: Don't include <unistd.h>. system.h already does that.
2046 * src/cut.c (set_fields): Mark all selected indices before trying to
2047 determine range endpoints.
2048 * tests/cut/Test.pm: New test for the above fix.
2050 Begin to address this comment: What if someone wants to
2051 extract the 1,000,000-th field of some huge input file?
2052 The first step is to rearrange things so that the values
2053 in the printable_field array are all 0/1 rather than 0/1/2.
2054 * src/cut.c (RANGE_START_SENTINEL): Remove.
2055 Store range-start indices in a hash table, rather than
2056 overloading the `printable_field' array.
2057 (range_start_ht): New global.
2058 (hash_int, hash_compare_ints, is_range_start_index): New functions.
2059 (print_kth): Use is_range_start_index; don't test printable_field.
2060 (set_fields): Detect overflow.
2061 (set_fields): Insert each range-start index into range_start_ht.
2062 (main): Call set_fields only once, and only after
2063 output_delimiter_specified and (if required) range_start_ht have
2066 2003-07-20 Paul Eggert <eggert@twinsun.com>
2068 * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
2069 invoked with a null pointer when there were no file arguments.
2071 2003-07-20 Jim Meyering <jim@meyering.net>
2073 * Makefile.maint (sc_changelog): Add another nit-picky check.
2075 * src/wc.c (write_counts): Add a comment.
2076 (wc): Rename `file' parameter.
2077 Set new local, `file', to be the file name, or (when it's NULL)
2078 _("standard output") so that all uses of `file' use the proper value.
2079 Use STREQ, not strcmp.
2081 2003-07-20 Paul Eggert <eggert@twinsun.com>
2083 wc count field widths now are heuristically adjusted depending
2084 on the input size, if known. If only one count is printed, it
2085 is guaranteed to be printed without leading spaces.
2087 Previously, wc did not align the count fields if
2088 POSIXLY_CORRECT was set, but POSIX did not actually require
2089 this undesirable behavior, so it has been removed.
2091 * NEWS: Document this.
2092 * doc/coreutils.texi (wc invocation): Likewise.
2094 * src/wc.c (number_width): New var.
2095 (posixly_correct): Remove.
2096 (struct fstatus): New struct.
2097 (write_counts): Output fields of width number_width.
2098 Do not worry about POSIXLY_CORRECT.
2099 Use null file, not empty-string file, to denote stdin,
2100 since "" is a valid file name on some hosts.
2101 (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
2103 (wc): Avoid problems if end_pos - current_pos overflows.
2104 Do not print odd message if stdin has a read error.
2105 (get_input_fstatus, compute_number_width): New functions.
2106 (main): Use them to implement the new behavior.
2107 Ignore POSIXLY_CORRECT.
2109 * tests/wc/Test.pm: Adjust to the new output widths.
2111 2003-07-19 Jim Meyering <jim@meyering.net>
2113 * tests/rm/fail-eperm: Don't create temporary directory --
2116 * tests/shred/remove: Don't open-code test for UID != 0.
2117 Use priv-check's require-non-root instead.
2118 Update to use newer framework.
2120 * tests/help-version (expected_failure_status_expr): Record that
2121 expr exits with status of 3 for e.g., a write error.
2123 * tests/priv-check: Use `id -u' to see if we're running as root,
2124 rather than trying go write to an write-protected file.
2125 When running as root, ensure $NON_ROOT_USERNAME is valid.
2126 When running as root with `require-non-root', ensure that `.'
2127 is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
2128 to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test.
2130 * src/printenv.c: Include "exitfail.h".
2131 (main): Set exit_failure rather than calling close_stdout_set_status.
2132 * src/date.c: Likewise.
2133 * src/sort.c: Likewise.
2134 * src/tty.c: Likewise.
2136 2003-07-18 Jim Meyering <jim@meyering.net>
2138 * tests/touch/not-owner: Update to use newer framework.
2140 * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
2141 directory, and remove Perl-coded `you may not run as root' test.
2142 * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
2143 hard-coding something not quite equivalent.
2144 Paul Jarc reported the inconsistent diagnostics.
2146 * src/sort.c (main): Use close_stdout via atexit.
2147 Now `sort --version' and `sort --help' fail, as they should
2148 when their output is redirected to /dev/full.
2150 * src/su.c (usage): Don't call close_stdout here.
2151 (main): Use close_stdout via atexit.
2152 Now `su --version > /dev/full' fails, as it should.
2153 Somehow, the change of 2000-05-07 that purports to fix this
2156 * tests/help-version (--help/--version vs. /dev/full): Special-case
2157 `[' to protect it from expected_failure_status-`eval'.
2159 * src/uniq.c (writeline): Use a SPACE, not a TAB between the
2160 count and the corresponding line, as required by POSIX.
2161 Reported by Clement Wang.
2162 * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
2164 * tests/expr/basic: Add tests for when exit status is 2.
2166 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
2167 Use an anonymous `enum', rather than #define.
2169 2003-07-17 Paul Eggert <eggert@twinsun.com>
2171 * src/expr.c: Include "exitfail.h", "quotearg.h".
2172 (EXPR_INVALID, EXPR_ERROR): New constants.
2173 (nomoreargs, null, toarith, nextarg): Return bool, not int.
2174 (syntax_error): New function, exiting with status 2. Use it
2175 insteading of printing "syntax error" ourselves.
2176 (main): Initialize exit_failure to EXPR_ERROR.
2177 Exit with EXPR_INVALID on syntax error (too few arguments).
2178 (nextarg): Use strcmp, not strcoll; strcoll might return
2179 an undesirable 0, or might fail.
2180 (docolon, eval4, eval3): Exit with status 3 on invalid argument type
2181 or other such error.
2182 (eval2): Report an error if strcoll fails in a string comparison.
2183 * src/sort.c: Include "exitfail.h".
2184 (main): Set exit_failure, not xalloc_exit_failure and
2185 xmemcoll_exit_failure.
2186 * tests/expr/basic: Invalid value exits with status 3, not 2.
2188 2003-07-16 Jim Meyering <jim@meyering.net>
2190 * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
2191 per GNU maintainer guidelines. The next non-beta release will be 5.1.
2193 This script would have caught at least two recent bugs:
2194 those in [ and kill.
2195 * tests/help-version: Revive this script.
2196 It wasn't doing anything useful, since $all_programs wasn't being
2197 defined by the invoking Makefile.am.
2198 Reflect that nohup is no longer a script, so don't exclude it.
2199 Add framework to handle the programs added since it was last run:
2200 kill, stat, unlink, [, link, readlink.
2201 Fix path-related problems deriving from the move of this script
2202 from src/ to its present location.
2203 * tests/Makefile.am (all_programs): Define.
2204 (TESTS_ENVIRONMENT): Use it.
2206 * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
2207 whereby kill would always attempt to operate on argv[0] and fail.
2209 * src/test.c (integer_expected_error): Improve diagnostic -- now,
2210 it also matches the one from bash's builtin test.
2211 (binary_operator): Add \n at end of diagnostic.
2213 * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ...
2214 * tests/priv-check: Move setuidgid-related and
2215 NON_ROOT_USERNAME-checking code to this file.
2217 * README: Update section on testing as `root'.
2218 Suggestion from Paul Jarc.
2220 * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
2221 names of authors that I just found in bash's builtins/test.def.
2223 Running `[' with no arguments would evoke a segfault.
2224 * src/test.c (main) [LBRACKET]: Move initialization of argv to
2225 precede potential use via test_syntax_error.
2227 * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
2228 warning from automake -Wall.
2230 2003-07-15 Jim Meyering <jim@meyering.net>
2234 * Makefile.maint (%.asc): Remove target first, so gpg doesn't
2237 * announce-gen (print_changelog_deltas): Relax tests for matching
2238 version-number line in NEWS.
2239 Change the .sig suffix to .asc here, too.
2241 2003-07-14 Jim Meyering <jim@meyering.net>
2243 * Makefile.maint (%.asc): Renamed from %.sig.
2244 Generate and use ascii-armored signatures.
2245 Use gpg's -o option.
2247 2003-07-13 Jim Meyering <jim@meyering.net>
2249 * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
2252 * Makefile.maint (syntax-check): Move each individual check into
2254 (syntax-check-rules): This is the list of syntax-check targets.
2255 (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
2256 (sc_cast_of_x_alloc_return_value, sc_space_tab):
2257 (sc_error_exit_success, sc_xalloc_h_in_src): New targets.
2259 2003-07-12 Jim Meyering <jim@meyering.net>
2261 * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
2262 traces of the nohup script.
2264 * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
2265 $(OPTIONAL_BIN_ZCRIPTS).
2267 * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
2268 target, not before the `>'.
2270 * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
2271 now that that function no longer calls `error'.
2273 * src/df.c (find_mount_point): Emit a diagnostic for each
2274 failed syscall, rather than relying on caller to do that.
2275 The caller couldn't do a good job, anyhow -- too many different
2276 ways to fail (each with a different referent).
2277 Give a diagnostic upon failed save_cwd, now that that function
2278 no longer calls `error'.
2279 (show_point): Don't diagnose find_mount_point's errors, now that
2280 it handles them itself.
2282 * src/df.c (find_mount_point): Don't let free clobber errno upon
2285 * src/sys2.h: Remove alloca-related block.
2286 * src/system.h: Include <alloca.h> here, instead.
2288 It appears that the `#pragma alloca' included via "system.h" is
2289 adequate, since join.c uses alloca, yet lacked an in-file #pragma.
2290 * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
2291 * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
2293 * src/chown-core.c (change_file_owner): Do not restore any special
2294 permission bits (e.g., set-user-ID, set-group-ID) that are reset
2295 by chown(2) on some systems. Suggestion and insistence :-) from
2298 * tests/input-tty: Also check `test -t 1'.
2299 This is necessary on linux-2.4.21. Otherwise, the stty/basic-1
2300 test would block when run in the background.
2302 2003-07-11 Jim Meyering <jim@meyering.net>
2304 * tests/sample-test: Also fail if cat-to-create-expected-output
2305 fails. Otherwise, if both `exp' and `out' were to end up empty
2306 because of e.g., a full disk, they would mistakenly compare equal.
2308 * src/nohup.c: New file. Rewrite of nohup.sh in C.
2309 This solves a portability problem: on at least Solaris systems,
2310 when nohup.sh used the vendor /bin/sh, it would exit with status
2311 of `1' rather than the required 126 or 127 upon failure to exec
2312 the specified program.
2314 * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
2315 (bin_PROGRAMS): Add nohup.
2316 (EXTRA_DIST): Remove nohup.sh.
2317 (all_programs): Remove use of $(EXTRA_SCRIPTS).
2318 * src/nohup.sh: Remove file.
2319 * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
2321 * tests/misc/nohup: Tests for the above.
2322 * tests/misc/Makefile.am (TESTS): Add nohup.
2324 * src/head.c (diagnose_copy_fd_failure): New function, renamed from
2325 the macro, COPY_FD_DIAGNOSE.
2326 (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
2327 (head_file): Likewise.
2329 * src/date.c: Include "quote.h".
2330 (batch_convert): Use the quote function rather than using literal `...'
2333 * src/setuidgid.c (main): Enclose diagnostic in _(...).
2334 * src/fmt.c (main): Likewise.
2335 * src/mknod.c (main): Likewise.
2336 * src/tac.c (tac_seekable): Likewise.
2337 * src/yes.c (main): Likewise.
2338 * src/od.c (main): Likewise.
2339 * src/install.c (change_attributes): Likewise.
2341 2003-07-10 Jim Meyering <jim@meyering.net>
2343 * src/head.c (usage): Use 1024*1024 in place of 1048576.
2344 * src/tail.c (usage): Likewise.
2346 * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
2347 place of the kludge in this test. Suggestion from Paul Jarc.
2349 * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
2350 * src/setuidgid.c: New program, solely for testing (not installed).
2352 * src/chown-core.c (change_file_owner): Don't leak file descriptors
2353 when dereferencing symlinks.
2355 2003-07-09 Jim Meyering <jim@meyering.net>
2357 * tests/du/slash: New file/test for today's lib/ftw.c fix.
2358 * tests/du/Makefile.am (TESTS): Add slash
2360 * src/tail.c (xlseek): Avoid warning about ``return without value
2361 from function returning non-void''.
2363 2003-07-08 Jim Meyering <jim@meyering.net>
2365 * man/help2man: Update to version 1.29.
2367 * man/help2man: Add END handler to close STDOUT and check for errors.
2369 2003-06-30 Paul Eggert <eggert@twinsun.com>
2371 Add support for a "[" that conforms to the GNU coding standards,
2372 i.e., that does not depend on its name.
2373 * src/lbracket.c: New file.
2375 * man/Makefile.am (programs): Ignore "[", since it doesn't have
2376 a separate man page.
2377 * src/Makefile.am (bin_PROGRAMS): Add "[".
2378 (__SOURCES): New var.
2379 * src/test.c (LBRACKET): Define to 0 if not defined.
2380 (main): Use LBRACKET rather than argv[0].
2382 * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
2383 Reported by Paul Jarc and Dan Jacobson.
2385 * src/test.c (main): Do not recognize --help or --version if
2386 POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
2387 Do not bother testing that margv[margc] is non-null.
2389 2003-07-04 Jim Meyering <jim@meyering.net>
2391 * src/who.c (print_line): Rewrite to use asprintf, in order to be
2392 able to avoid emitting trailing spaces. Reported by Dan Jacobson.
2394 * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
2395 option, and perform the +1600 invocations of head IFF the envvar
2396 RUN_EXPENSIVE_TESTS is set.
2398 2003-07-03 Jim Meyering <jim@meyering.net>
2400 * src/cp.c (do_copy): Give a better diagnostic when failing due
2401 to nonexistent destination directory. Reported by Dmitry Rutsky.
2402 See http://bugs.debian.org/199730 for details.
2404 2003-06-27 Jim Meyering <jim@meyering.net>
2406 split's --verbose option did nothing [broken in 4.5.10 and 5.0]
2407 * src/split.c (longopts): Use `1', not `0' as the value for
2408 for &verbose. Reported by Keith Thompson.
2410 Test for the above fix.
2411 * tests/misc/split-a: Also use --verbose and compare stderr
2412 output with what we'd expect.
2414 2003-06-20 Jim Meyering <jim@meyering.net>
2416 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2417 Use `error_t' (rather than int) as type for local `err'.
2418 From Alfred M. Szmidt.
2420 2003-06-19 Marcus Brinkmann <marcus@gnu.org>
2422 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2423 Fix author preservation code.
2425 2003-06-19 Jim Meyering <jim@meyering.net>
2427 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
2428 (do_link): Don't warn about hard link to symlink.
2430 2003-06-18 Jim Meyering <jim@meyering.net>
2432 * src/cut.c: Include "getdelim2.h", not "getstr.h".
2433 Reflect renaming: getstr -> getdelim2.
2435 * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
2436 readline -> readlinebuffer.
2438 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2440 * src/readlink.c: Include <sys/types.h> before system.h (because
2441 the latter includes <sys/stat.h>). Required on Ultrix 4.3.
2443 2003-06-17 Jim Meyering <jim@meyering.net>
2445 * src/system.h (initialize_main): Define.
2446 Use it in every `main'. Applied via this:
2447 p='initialize_main (&argc, &argv);'
2448 perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \
2449 $(grep -l program_name.=.argv.0 *.c)
2450 test.c uses margc/margv, so I made the change manually for that file.
2451 Based on a patch from Bernard Giroud.
2453 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2455 Fix for build failure on Ultrix 4.3.
2456 * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
2457 Include sys/param.h and sys/mount.h on ultrix.
2459 2003-06-16 Jim Meyering <jim@meyering.net>
2461 * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
2463 * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
2464 them here instead, but with one change: define EISDIR to -1, not 0.
2466 * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
2467 guaranteed to be defined.
2468 * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
2470 * README: Mention the CVS repository.
2471 Encourage addition of test cases.
2473 2003-06-12 Jim Meyering <jim@meyering.net>
2475 * src/touch.c (touch): Call close only if necessary.
2478 * src/wc.c (usage): Correct wording: wc prints counts in the order
2479 `newline, word, byte'. Reported by Keith M. Briggs.
2480 * man/wc.x: Fix it here, too. And change `lines' to `newlines'.
2482 2003-06-10 Jim Meyering <jim@meyering.net>
2484 * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
2486 2003-06-07 Jim Meyering <jim@meyering.net>
2488 * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
2491 2003-06-06 Jim Meyering <jim@meyering.net>
2493 * src/extract-magic (main): Avoid newer 3-arg form of open,
2494 so this script works also with e.g., perl5.005_03.
2495 Patch by John David Anglin.
2497 2003-06-04 Paul Eggert <eggert@twinsun.com>
2499 * src/system.h: Include <stdbool.h> unconditionally.
2501 2003-06-04 Jim Meyering <jim@meyering.net>
2503 * man/Makefile.am (check-programs-vs-x): Rename target
2504 from check-programs-vs-1. Adjust rule to check for the
2505 primary (.x) file, not the generated one (.1).
2507 2003-06-03 Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
2509 * man/kill.x: New file.
2510 * man/Makefile.am (dist_man_MANS): Add kill.1.
2513 2003-06-04 Jim Meyering <jim@meyering.net>
2515 Ensure that the .x file for a new program is never forgotten again.
2516 * man/Makefile.am (programs): Define.
2517 (check-programs-vs-1): New phony target.
2518 (check-local): Depend on it.
2520 2003-06-03 Jim Meyering <jim@meyering.net>
2522 Avoid unnecessary copying of environment.
2523 * src/env.c (main): Rather than clearing the environment and --
2524 unless told to ignore environment -- copying all settings from
2525 the saved, original environment, clear the environment only when
2526 that is requested. Suggested by Jens Elkner.
2528 2003-06-02 Jim Meyering <jim@meyering.net>
2530 * src/system.h: Always include <string.h>, since we assume C89.
2531 Include <limits.h> without checking for HAVE_LIMITS_H.
2533 * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
2534 (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
2536 2003-06-01 Jim Meyering <jim@meyering.net>
2538 Avoid a race condition in `tail -f' described by Ken Raeburn in
2539 http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
2540 * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
2541 (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
2542 (tail_bytes, tail_lines, tail): Likewise.
2543 (tail_file): Use the new `read_pos' value as the size,
2544 rather than stats.st_size from the fstat call.
2546 2003-05-28 Jim Meyering <jim@meyering.net>
2548 * src/extract-magic: Allow expansion of `$file' in the here-
2549 document corresponding to the comment at the top of fs.h.
2551 2003-05-26 Jim Meyering <jim@meyering.net>
2553 * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
2554 <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
2555 Use #if/#elif/... cascade so we get only one set of include files.
2556 Reported by Nelson Beebe.
2558 2003-05-24 Jim Meyering <jim@meyering.net>
2560 * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
2561 * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
2562 accept the BSD format.
2564 2003-03-28 Joe Orton <jorton@redhat.com>
2566 * src/md5sum.c (bsd_split_3): New function.
2567 (split_3): Detect checksums from BSD 'md5' command and handle them
2570 * tests/md5sum/basic-1: New tests for --check exit status, and for
2571 BSD-style checksum files.
2573 2003-05-21 Jim Meyering <jim@meyering.net>
2575 * src/head.c (elide_tail_lines_pipe): Fix a thinko.
2576 This sort of thing is why it'd be *Really Good* to factor
2577 out the common code used here and in tail.c.
2579 2003-05-14 Jim Meyering <jim@meyering.net>
2581 * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
2583 * tests/du/slink: Skip this test if `.' is on an XFS file system.
2585 * tests/du/fd-leak: New file. Test for the bug in du that
2586 was fixed by the 2003-05-12 change to lib/ftw.c.
2587 * tests/du/Makefile.am (TESTS): Add fd-leak.
2589 * src/head.c (AUTHORS): Enclose string in N_(...), now that it
2590 includes a translatable word, `and'.
2592 * src/dd.c (usage): Don't use `,' as the thousands separator
2593 in e.g. 1,000,000 and 1,048,576. Instead, do this:
2594 `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
2595 * src/df.c (usage): Likewise.
2596 * src/du.c (usage): Likewise.
2597 * src/ls.c (usage): Likewise.
2599 * Makefile.maint (syntax-check): Add another check.
2601 2003-05-13 Paul Eggert <eggert@twinsun.com>
2603 Fix uniq to conform to POSIX, which requires that "uniq -d -u"
2604 must output nothing. Problem reported by Josh Hyman.
2606 * src/uniq.c (enum output_mode, mode): Remove, replacing with:
2607 (output_unique, output_first_repeated, output_later_repeated):
2608 New vars. All uses of "mode" changed to use these variables,
2609 which are not mutually exclusive as "mode" was.
2610 (writeline): New arg "match", used to control whether to
2611 obey output_first_repeated or output_later_repeated.
2612 All callers changed.
2613 (check_file, main): Adjust to above changes.
2615 * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
2617 2003-05-14 Jim Meyering <jim@meyering.net>
2619 * tests/rm/rm3: Use tr's \n notation rather than \012.
2620 This package can afford to do that, since its tests are guaranteed use
2621 GNU tr, which has accepted the more modern notation for 10 years.
2622 * tests/rm/rm5: Likewise.
2623 * tests/cp/same-file: Likewise.
2624 * tests/stty/row-col-1: Likewise.
2625 * tests/stty/basic-1: Likewise.
2626 * tests/rm/deep-1: Likewise.
2627 * tests/mv/part-symlink: Likewise.
2628 * tests/mkdir/perm: Likewise.
2629 * tests/misc/nice: Likewise.
2631 2003-05-13 Jim Meyering <jim@meyering.net>
2633 * src/copy.c (struct F_triple) [name]: Remove const attribute.
2634 (triple_free): Don't apply cast to argument of free.
2635 (seen_file): Add cast here instead.
2637 * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
2638 (src_to_dest_free): Don't apply cast to argument of free.
2640 * src/sort.c (zaptemp): Don't apply cast to argument of free.
2641 * src/pr.c (init_fps, init_store_cols): Likewise.
2642 * src/join.c (delseq, freeline): Likewise.
2643 * src/expr.c (OLD): Likewise.
2644 * src/sort.c (sort): Likewise.
2645 * src/head.c (elide_tail_lines_pipe): Likewise.
2647 * src/tail.c: Include "quote.h".
2648 Use quote in diagnostics. Change many error format strings
2649 from just `%s' to e.g., `error reading %s'.
2650 (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
2651 Rewrite newline-counting loop to use memchr.
2653 * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
2654 Now that assert is no longer used, don't include <assert.h>.
2656 2003-05-12 Jim Meyering <jim@meyering.net>
2658 * src/head.c: Include <assert.h>.
2659 (AUTHORS): Add my name.
2660 (elide_tail_lines_pipe): New function.
2662 2003-05-10 Jim Meyering <jim@meyering.net>
2664 * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
2666 * src/readlink.c (main): Set program_name before first use.
2667 Remove that (redundant) first use.
2668 Don't exit successfully just because --verbose was specified.
2669 Pass 0, not EXIT_SUCCESS, as first argument to error; when that
2670 parameter is 0, error does not exit.
2672 * src/uname.c (main): When failing due to too many arguments, also say
2673 that, rather than just "Try `uname --help' for more information.".
2674 * src/comm.c (main): Likewise, but for too few arguments.
2675 * src/logname.c: Include error.h.
2676 (main): Say why we're failing.
2678 * src/uniq.c (main): Don't segfault when argc < optind.
2679 * src/who.c (main): Handle argc < optind.
2680 * src/df.c (main): Likewise.
2681 * src/install.c (main): Likewise.
2682 * src/mv.c (main): Likewise.
2683 * src/pwd.c (main): Likewise.
2684 * src/tty.c (main): Likewise.
2685 * src/chroot.c (main): Likewise.
2686 * src/hostname.c: Likewise.
2687 * src/du.c (main): Likewise.
2688 * src/expand.c (main): Likewise.
2689 * src/env.c (main): Likewise.
2690 * src/unexpand.c (main): Likewise.
2691 * src/printenv.c (main): Likewise.
2692 * src/sync.c (main): Handle argc == 0.
2693 * src/expr.c (main): Likewise.
2694 * src/printf.c (main): Likewise.
2695 * src/basename.c (main): Likewise.
2696 * src/ln.c (main): Test for `missing argument' before computing n_files.
2697 * src/tail.c (main): Test for the case of no arguments before
2700 * src/kill.c (send_signals): Don't check command line arguments here.
2701 (main): Check them here instead. Handle argc < optind.
2703 * src/logname.c (main): Use error, rather than fprintf, for the sake
2706 * src/rm.c (main): Don't overrun array bound if argc is 0.
2708 2003-05-09 Jim Meyering <jim@meyering.net>
2710 * src/sort.c (main): Don't overrun array bound if argc is 0.
2711 That would happen when invoked via: execl ("/usr/bin/sort", NULL);
2712 Reported by Wartan Hachaturow.
2714 2003-05-07 Jim Meyering <jim@meyering.net>
2716 Implement support so that `head --lines=-N' works on seekable files.
2717 * src/head.c (enum Copy_fd_status): Define.
2718 (COPY_FD_DIAGNOSE): New macro.
2719 (elide_tail_lines_seekable): New funtion.
2720 (elide_tail_lines_file): Call it here.
2722 2003-05-06 Jim Meyering <jim@meyering.net>
2724 * src/sys2.h (CHAR_BIT): Remove duplicate definition.
2726 2003-05-04 Jim Meyering <jim@meyering.net>
2728 * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
2729 caused the addition of thousands of small files to the tar archive.
2730 * tests/misc/head-elide-tail: New file. Add them here instead.
2731 * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
2733 2003-05-04 Paul Eggert <eggert@twinsun.com>
2735 * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
2736 (IF_READDIR_NEEDS_REWINDDIR): Remove.
2737 (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
2738 which was a bit weird because it couldn't be emulated by a function.
2740 2003-05-03 Jim Meyering <jim@meyering.net>
2742 Extend head to accept --lines=-N (--bytes=-N) and to print all
2743 but the N lines (bytes) at the end of the file.
2744 * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
2745 Use quote() in diagnostics, rather than literal `' marks.
2746 (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
2748 (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
2749 (head_file): Reorganize so as to call head from only one place.
2750 (main): Likewise, for head_file.
2751 Handle new, undocumented option, --presume-input-pipe.
2752 Handle negative line and byte counts.
2753 * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
2755 * tests/du/8gb: Skip test if the file system of `.' doesn't support
2756 sparse files -- otherwise it'd create a file of size 8GB.
2758 2003-05-02 Jim Meyering <jim@meyering.net>
2760 * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
2761 Instead explain about `-' and standard input.
2762 (main): Give a proper diagnostic for e.g., `fmt -c -72'.
2763 Reported by Keith Thompson.
2764 * tests/fmt/basic: Add test for the above fix.
2766 * src/fmt.c: Include "quote.h".
2767 Use quote() in diagnostics, rather than literal `' marks.
2768 (main): Exit nonzero when unable to open an input file.
2769 * tests/fmt/basic: Add test for the above fix.
2771 * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
2772 specifications like `-72x'.
2773 * tests/fmt/basic: Add test for the above fix.
2775 Work around nasty readdir bug on Darwin6.5.
2776 * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
2777 [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
2778 returned NULL and there has been at least one successful unlink or
2779 rmdir call since the opendir or previous rewinddir, then call
2780 rewinddir and reiterate the loop.
2782 Factor out common code.
2783 * src/remove.c (readdir_ignoring_dotdirs): New function.
2784 (is_empty_dir): Use it here.
2785 (remove_cwd_entries): Use it here.
2787 2003-05-01 Jim Meyering <jim@meyering.net>
2789 * tests/rm/r-3: Create 500 rather than just 300 files.
2790 There's a bug in Darwin6.5's readdir that shows up only with
2792 Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
2796 Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
2797 (dump_remainder): Move two declarations `down' into the scope
2798 where they are used.
2799 (xlseek): Return the resulting offset.
2800 (file_lines): Rename parameter, file_length, to end_pos.
2801 (pipe_lines): Don't coerce safe_read return value to `int'.
2802 Adapt tests accordingly.
2803 (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
2805 Change type of `total_bytes' from `int' to `size_t',
2806 since the former wouldn't always be wide enough.
2807 Don't coerce safe_read return value to `int',
2808 and adapt tests accordingly.
2809 Now that testing for a read error no longer involves
2810 using `tmp', handle that case *after* freeing `tmp'.
2811 (start_bytes): Clean up.
2812 (tail_bytes): Now that `n_bytes' may be larger than
2813 OFF_T_MAX, test for that condition and, if it's true, don't
2814 use lseek optimizations.
2815 (parse_options): Don't fail just because N_UNITS is larger than
2816 the maximum size of a file -- tail may be applied to an input
2817 stream (e.g., a pipe) with more data than that.
2819 * Makefile.maint (syntax-check): Rename from alloc-check.
2820 Also check for SPACE-TAB sequences.
2821 Also check for malloc/calloc/realloc casts.
2823 2003-05-01 Jim Meyering <jim@meyering.net>
2825 * src/tail.c (start_lines): Rewrite to use memchr. Clean up.
2827 2003-04-28 Jim Meyering <jim@meyering.net>
2829 * tests/misc/tty-eof: Send two tokens, not just one, so we don't
2830 make the now-more-picky tsort fail.
2832 2003-04-24 Jim Meyering <jim@meyering.net>
2834 * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
2835 (main): Minor syntactic clean-up.
2837 * src/tsort.c (tsort): Fail if the input contains an odd number of
2838 tokens. Reported by junkio@cox.net.
2840 * tests/tsort/basic-1: Test for the above fix.
2842 2003-04-21 Jim Meyering <jim@meyering.net>
2844 * tests/misc/printf: Add tests for the printf fixes below.
2846 * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
2848 2003-04-20 Paul Eggert <eggert@twinsun.com>
2850 Fix printf POSIX compatibility bug reported by Ben Harris in
2851 <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
2852 * doc/coreutils.texi (printf invocation): It's \NNN in the format,
2853 \0NNN in the %b operand.
2854 * src/printf.c (usage): Likewise.
2855 (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
2856 is desired. All uses changed. Behave like Bash printf if %b
2857 operand uses \NNN where the initial N is not 0.
2859 2003-04-17 Jim Meyering <jim@meyering.net>
2861 * src/stty.c: Remove uses of PROTOTYPE macro.
2863 2003-04-15 Jim Meyering <jim@meyering.net>
2865 * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
2866 each sequence of spaces before a TAB character.
2868 2003-04-13 Jim Meyering <jim@meyering.net>
2870 * src/remove.c (is_empty_dir): Don't closedir (NULL).
2872 2003-04-12 Jim Meyering <jim@meyering.net>
2874 Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
2875 --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
2876 FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
2877 * src/nl.c (main): Fix those problems and remove literal quote marks
2878 (e.g., "`%s'") from format string; instead use "%s" in each format
2879 string and `quote (optarg)' as the corresponding argument.
2880 Also, diagnose all invalid command line options before failing.
2882 * src/nl.c (proc_text): Fix a bug that would make nl output extra
2883 newlines in some cases. Details here: http://bugs.debian.org/177256.
2884 This bug was introduced on 2001-11-10 for textutils-2.0.17.
2885 * tests/misc/nl: Add test for the above-fixed bug.
2887 * tests/misc/readlink: New file. Test the --canonicalize option.
2888 * tests/misc/Makefile.am (TESTS): Add readlink.
2890 2003-04-11 Jim Meyering <jim@meyering.net>
2893 * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
2894 * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
2895 * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
2896 retain alignment) each sequence of spaces before a TAB character.
2898 * src/ls.c: Include <stdlib.h> unconditionally.
2900 * Makefile.maint (xalloc-check): Rename from header-check.
2902 * src/yes.c: Include error.h after system.h, not before.
2905 * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
2906 * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
2907 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
2908 * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
2909 * src/tr.c: * src/unexpand.c, src/users.c:
2910 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
2911 return values and of xrealloc's first argument.
2912 Fix the former with this:
2913 perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
2915 2003-04-10 Jim Meyering <jim@meyering.net>
2917 * src/stty.c (wrapf): Declare with format attribute.
2919 The S_MAGIC_... names shouldn't be maintained in two places (prior
2920 to this change, one would have to keep stat.c and fs.h in sync).
2921 This change makes it so those names and the corresponding
2922 hexadecimal constants all reside in stat.c. fs.h is now generated.
2923 * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
2924 (BUILT_SOURCES): Add fs.h, now that it's generated.
2925 (EXTRA_DIST): Add extract-magic.
2926 * src/extract-magic: New script to extract fs.h definitions from stat.c.
2927 * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
2928 fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
2930 * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
2931 file with nominal length > 4GB fails. Reported by Michael Deutschmann.
2933 * man/unexpand.x: Add `SEE ALSO' reference to expand.
2934 * man/expand.x: Add `SEE ALSO' reference to unexpand.
2935 Suggestion from Dan Jacobson.
2937 2003-04-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
2939 * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
2940 * src/stat.c (human_fstype): Handle Linux's devpts.
2942 2003-04-09 Paul Eggert <eggert@twinsun.com>
2944 * src/split.c (line_bytes_split): Arg is of type size_t, since
2945 that's all that is supported for now.
2946 (main): Check for overflow in obsolescent line count option.
2948 2003-04-09 Jim Meyering <jim@meyering.net>
2950 * tests/misc/split-fail: Add a new test for the above fix.
2952 * src/split.c (bytes_split): Use size_t temporary (rather than
2953 uintmax_t original) in remaining computations. From Paul Eggert.
2955 Handle command line option arguments larger than 2^31.
2956 This allows e.g., splitting into files of size 2GB and larger,
2957 and running split --lines=N with N=2^31 or more.
2958 But for --line-bytes=N, the restriction that N <= SIZE_MAX
2959 remains (for now), due to the way it is implemented.
2961 * src/split.c: Include "inttostr.h".
2962 (bytes_split, lines_split, line_bytes_split, main):
2963 Use uintmax_t, not size_t, for file sizes.
2964 (main): Give a better diagnostic for option arguments == 0.
2965 Use umaxtostr to print file sizes.
2966 Reported by Luke Hassell.
2968 2003-04-08 Jim Meyering <jim@meyering.net>
2970 * src/rm.c (usage): Mention that --directory (-d) works only
2971 on some systems. Suggestion from Samuel Tardieu.
2973 * tests/basename/basic: Run $PERL to see if it is available,
2974 rather than testing its value.
2975 * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
2976 * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
2977 * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
2978 * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
2979 * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
2980 * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
2981 * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
2982 * tests/sum/basic-1, tests/seq/basic: Likewise.
2984 * tests/misc/Makefile.am (TESTS): Add split-fail.
2985 * tests/misc/split-fail: New file.
2987 * src/split.c: Rename local variables: nchars -> n_bytes.
2988 (lines_split): Rename local, nlines -> n_lines.
2989 (main): Rename local variable: s/accum/n_units/.
2990 (main): Use STDIN_FILENO, not literal `0'.
2992 2003-04-07 Jim Meyering <jim@meyering.net>
2994 * src/stat.c: Add #include directives for Ultrix 4.4.
2995 Based on a suggested change from Bert Deknuydt.
2997 2003-04-06 Jim Meyering <jim@meyering.net>
2999 * Makefile.maint (makefile-check): New rule.
3000 (local-check): Add it.
3002 2003-04-05 Jim Meyering <jim@meyering.net>
3004 * Makefile.am (nearly all of them):
3005 Use $(VAR) rather than @VAR@, now that we can rely on automake to
3006 emit a definition for each substituted variable.
3007 * tests/Makefile.am.in: Likewise.
3009 * tests/rm/rm5: Add a comment explaining why this test fails when
3010 using Tru64's broken sed.
3011 * tests/rm/rm3: Likewise.
3013 Make `kill -t' output signal descriptions (not `?') on Tru64.
3014 * src/kill.c (sys_siglist): Also check for __sys_siglist.
3015 Patch by Tony Leneis.
3016 * configure.ac: Also check for declaration of __sys_siglist.
3017 Required for Tru64 4.0D, 4.0F, and 5.1.
3018 Reported by Tony Leneis.
3020 2003-04-04 Jim Meyering <jim@meyering.net>
3022 * src/Makefile.am (PERL): Remove unnecessary definition.
3024 Because of inappropriate (but POSIX-mandated) behavior of rename,
3025 `mv a b' would not remove `a' in some unusual cases. Work around
3026 this by unlinking `a' when necessary.
3028 * src/copy.c (same_file_ok): Add an output parameter.
3029 Set it in the offending case.
3030 (copy_internal): When necessary, unlink SRC_PATH and inform caller.
3031 Reported by Ed Avis.
3032 * tests/mv/hard-4: New test for the above.
3033 * tests/mv/Makefile.am (TESTS): Add hard-4.
3035 Clean up rules for automatically generated sources:
3036 * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
3037 Make each generated file be read-only.
3038 Add each file name to BUILT_SOURCES separately.
3039 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
3041 Put LOCALEDIR macro definition in new file: localedir.h.
3042 * src/Makefile.am (DEFS): Remove definition.
3043 (localedir.h): New rule.
3044 (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
3045 * src/system.h: Include "localedir.h".
3047 2003-04-02 Jim Meyering <jim@meyering.net>
3051 * tests/misc/Makefile.am (TESTS): Add false.
3053 * Makefile.maint (TMPDIR): Make sure it's defined.
3054 (my-distcheck): Build in $(TMPDIR), not `.'.
3056 * src/Makefile.am (false.c): Change all occurrences of
3057 `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
3058 unsuccessfully also with --help. Reported by Paul Jarc,
3059 * tests/misc/false: New test for the above.
3061 2003-03-30 Jim Meyering <jim@meyering.net>
3063 * NEWS: Note the location of older NEWS files.
3065 * src/remove.c (is_empty_dir): Don't let a failing closedir
3066 clobber errno. Spotted by Arnold Robbins.
3068 * src/env.c: Fix typo in comment. From Arnold Robbins.
3070 2003-03-29 Jim Meyering <jim@meyering.net>
3074 * README: Note to expect build problems for stat.c on Ultrix 4.3.
3075 Note that there are some harmless test failures when running
3076 `make check' as root on some systems.
3078 2003-03-28 Jim Meyering <jim@meyering.net>
3080 * tests/stty/row-col-1: Skip this test if stty can't get window size.
3081 This happens when connecting to sparc-solaris5.7 via ssh from within
3082 emacs. Reported by Karl Berry.
3084 * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
3085 Otherwise, on systems (DJGPP) that emulate pipes using files,
3086 this test would never complete, waiting for `yes' to terminate.
3087 * tests/du/slink: As above, use seq, not `yes' to generate link target.
3088 * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
3089 Reported by Rich Dawe.
3091 2003-03-27 Jim Meyering <jim@meyering.net>
3093 * src/id.c: Remove Arnold Robbins' obsolete e-mail address
3094 from `written by...' comment, at his request.
3096 2003-03-24 Paul Eggert <eggert@twinsun.com>
3098 Fix buffer overrun problem reported by TAKAI Kousuke, along
3099 with some other POSIX incompatibilities.
3101 * src/printf.c (print_esc): Do not treat \x specially if
3102 POSIXLY_CORRECT. Avoid buffer overrun if the format ends
3103 in backslash. Treat incomplete escape sequences as strings
3104 of characters, as POSIX requires.
3105 (print_formatted): Allow multiple flags. Avoid buffer overrun
3106 if the format is incomplete.
3108 2003-03-24 Jim Meyering <jim@meyering.net>
3110 * tests/misc/printf: Add tests for the above fixes and changes.
3112 2003-03-26 Jim Meyering <jim@meyering.net>
3114 * src/copy.h (struct cp_options): Add a comment.
3116 2003-03-23 Jim Meyering <jim@meyering.net>
3118 * README: Describe problem with 64-bit mode on HPUX 11.x,
3119 with patch for /usr/include/inttypes.h.
3120 * TODO: Plan to add an autoconf test to work around the bug.
3122 2003-03-22 Jim Meyering <jim@meyering.net>
3124 * src/stat.c: Don't include <sys/sysmacros.h>.
3125 That is already done via system.h. Otherwise, the multiple
3126 inclusion would evoke redefinition warnings from Cray's /bin/cc,
3127 aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28.
3128 (human_fstype): Factor some directives `up', out of this function.
3129 Cast away `const' to avoid error from Cray's /bin/cc.
3131 2003-03-20 Jim Meyering <jim@meyering.net>
3133 * announce-gen (print_changelog_deltas): Ensure that a newline
3134 precedes each row of `*'s.
3136 2003-03-20 Jim Meyering <jim@meyering.net>
3140 * src/seq.c (valid_format): Also accept ` ' and `'' as valid
3141 format flag characters.
3142 Do not require that a field width be specified.
3143 Do not fail when given a field width of `0'.
3144 Reported by Dan Jacobson.
3145 * tests/seq/basic: Add new tests for the above-fixed bug.
3147 * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
3148 (install-root): Likewise.
3149 (install-exec-local): Likewise.
3150 Based on a patch from Richard Dawe.
3152 2003-03-19 Jim Meyering <jim@meyering.net>
3154 * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
3155 because the DJGPP 2.03 port of 'ln -s' doesn't work.
3156 Include $(EXEEXT) in program names.
3157 Since $(LN_S) may degenerate to `cp -p', be careful
3158 to invoke it from the destination directory.
3159 Mostly from Richard Dawe.
3160 * configure.ac: Use AC_PROG_LN_S.
3162 * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the
3163 CDPATH shell variable set could cause this test to fail.
3164 Reported by Karl Berry.
3166 2003-03-18 Jim Meyering <jim@meyering.net>
3168 * src/fmt.c [struct Word] (paren, period, punct, final): Change the
3169 type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
3170 AIX 5.1's xlc could not compile the former.
3171 Patch by Petter Reinholdtsen. Also reported by Mike Jetzer.
3173 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
3175 * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
3176 program names, since automake only adds $(EXEEXT) to programs
3179 2003-03-16 Jim Meyering <jim@meyering.net>
3181 * src/remove.c (rm): Put two local variables in static storage,
3182 so they can't be clobbered by the potential longjmp.
3184 2003-03-15 Jim Meyering <jim@meyering.net>
3186 * Makefile.cfg (gnu_rel_host): Fix code to match the comment
3187 so that a version number with a two-digit component can still count
3188 as an alpha release. Reported by Richard A Downing.
3189 (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
3191 2003-03-14 Jim Meyering <jim@meyering.net>
3193 * src/ansi2knr.c: Remove no-longer-used file.
3194 * src/ansi2knr.1: Likewise.
3196 * Makefile.maint (prev_version_file): Don't use ?= for this particular
3197 assignment, since it causes trouble with old versions of GNU make
3198 (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here.
3199 http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
3200 Patch from Alexandre Duret-Lutz.
3202 * Use patched automake-1.7.3. Regenerate Makefile.in files in
3203 subdirectories so that each includes a definition of ACLOCAL_M4.
3205 * announce-gen (main): Label the compressed source URLs.
3209 * tests/du/slink: Relax the test for the `local'ness of a file system,
3210 so that now it works also for tmpfs.
3212 * tests/du/hard-link: Transform output from first du, so that this
3213 test doesn't fail on file systems like tmpfs that order directory
3214 entries differently.
3216 2003-03-13 Jim Meyering <jim@meyering.net>
3218 * tests/du/8gb: Work around what appears to be an NFS failure that
3219 would make this test fail on some systems.
3221 2003-03-11 Jim Meyering <jim@meyering.net>
3223 * tests/du/basic: Make the test file exactly 4k bytes long.
3225 * src/split.c (longopts): Don't hard-code `2' here.
3226 Instead, just specify `&verbose', and ...
3227 (main): ... remove the `case 2:' block for --verbose.
3229 * tests/du/basic: Make the test file larger than 64 bytes, so that
3230 we don't immediately disqualify file systems (e.g., NetApp) on which
3231 smaller files take up zero disk blocks. Reported by Vin Shelton.
3233 2003-03-10 Jim Meyering <jim@meyering.net>
3235 Don't segfault for a negative field width or precision in format string.
3236 Note that this is just a stopgap fix. The longer term solution may
3237 involve adapting bash's builtins/printf.def.
3239 * src/printf.c: (UNSPECIFIED): Define.
3240 (print_direc): Use the special value, UNSPECIFIED, to indicate
3241 that field_width or precision has not been specified.
3242 (print_formatted): Fail if field_width or precision is the
3243 special value, UNSPECIFIED.
3244 Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
3246 * src/sys2.h (INT_MIN): Define, if necessary.
3247 * tests/misc/printf: Add a test for the above-fixed bug.
3249 2003-03-09 Jim Meyering <jim@meyering.net>
3251 * src/remove.c (AD_stack_pop): Cast sizeof... to int before
3252 changing its sign. This avoids a warning from gcc on 64-bit systems.
3253 Reported by Bob Proulx.
3254 (pop_dir): Reverse order of sign change and cast, to be consistent
3257 2003-03-08 Jim Meyering <jim@meyering.net>
3259 * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
3260 shell variable, but only in the environment. With /bin/sh->bash, the
3261 shell variable is set to `y', and that would cause a spurious warning.
3262 Reported by Bob Proulx.
3264 * tests/Makefile.am (check-root): Remove touch/fifo.
3265 It doesn't appear to have to be run as root.
3267 * tests/rm/fail-2eperm: Rather than simply using the first non-root
3268 user name, make sure that the selected user name has a usable shell.
3269 Reported by Paul Jarc.
3271 Before, when using shred on a device, one had to specify --exact,
3272 or be careful to choose a size that would not be rounded up and
3273 exceed the maximum value; that could result in a failure of
3275 * src/shred.c (do_wipefd): --exact is now the default for non-regular
3276 files. Suggestion from Ben Elliston.
3279 * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
3280 Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
3281 Patch by Bob Proulx.
3283 * src/Makefile.am (check-misc): Check for use of `defined' in
3285 Change to $(srcdir) before running grep.
3287 * src/sleep.c: Remove now-unused #include and #define directives.
3289 * src/du.c (process_file): If a file's size is not being counted
3290 e.g., because it's a hard link to a file we've already counted,
3291 then don't print a line for it.
3293 * tests/du/hard-link: New test for the above-fixed bug.
3294 * tests/du/Makefile.am (TESTS): Add hard-link.
3297 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
3298 and make the two-array approach work.
3300 * tests/du/basic: Correct/add tests for the above fix.
3301 Set LC_ALL, etc., now that we use sort.
3302 Check the block/size of a small file, too.
3303 Correct expected results for simple dir1/dir2/file case.
3304 Add another test of du -S.
3306 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
3308 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
3309 middle-end/9986). As one of GCC's optimizations, it transforms a
3310 fputs_unlocked call to a fputc_unlocked call when the string is
3311 one character long. However, hpux doesn't have fputc_unlocked.
3313 * expr.c (usage): Use putchar, not fputs, to output a single character.
3314 * ls.c (dired_dump_obstack): Likewise.
3315 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
3316 * stat.c (print_it): Likewise.
3318 2003-03-07 Jim Meyering <jim@meyering.net>
3320 * src/cp.c: Remove everything associated with mmap-stack.c.
3321 This reverts the two changes of 2003-02-21.
3322 * src/du.c: Remove everything associated with mmap-stack.c.
3323 This reverts the change of 2003-02-19.
3325 2003-03-06 Jim Meyering <jim@meyering.net>
3327 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
3328 CDPATH shell variable set could cause this test to fail.
3329 Reported by Karl Berry.
3331 2003-03-05 Jim Meyering <jim@meyering.net>
3335 * src/printf.c (print_esc): Remove pointless comparison of unsigned
3336 integer with zero, to avoid a warning from Intel's ecc.
3337 Reported by Nelson Beebe.
3339 * src/du.c (process_file): Sizes must all be of type uintmax_t.
3340 Otherwise, for files or totals that are too big, numbers would
3341 be truncated. Patch mostly by Michael Stone.
3342 Reported by Ingo Saitz as Debian bug #183210.
3344 * tests/du/8gb: New test for the above-fixed bug.
3345 * tests/du/Makefile.am (TESTS): Add 8gb.
3347 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
3348 rather than UTILS_OPEN_MAX - 10.
3350 2003-03-04 Jim Meyering <jim@meyering.net>
3352 * README: Refer new feature discussion to bug-coreutils@gnu.org,
3353 rather than bug-gnu-utils, now that the former is better known.
3354 Suggestion from Göran Uddeborg.
3356 * src/stat.c (usage): Capitalize consistently.
3357 Reported by Göran Uddeborg.
3359 * Makefile.maint (rel-files): Include $(signatures), so that
3360 those files are also copied into $(release_archive_dir).
3362 * src/df.c (find_mount_point): Call error here, now that restore_cwd
3364 * src/remove.c (AD_pop_and_chdir): Likewise.
3366 * tests/Makefile.am (check-root): Add fail-2eperm.
3368 2003-03-03 Jim Meyering <jim@meyering.net>
3370 * src/remove.c (remove_cwd_entries): Include the full filename of
3371 the offending file, not just the basename.
3373 * tests/misc/tty-eof: Set $ME properly.
3375 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
3376 Remove now-unused variables.
3377 (tag-prev-version, prev-cvs-tag): Likewise.
3379 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
3380 accurate diagnostic when failing to remove a file owned by some other
3381 user. Reported by Ivo Timmermans via Michael Stone.
3382 This fixes Debian bug# 178471.
3384 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
3385 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
3386 Based on a report from Ivo Timmermans.
3388 2003-03-02 Jim Meyering <jim@meyering.net>
3390 * src/copy.c (copy_internal) [un_backup]: When recovering from a
3391 failure to create a hard link, do not remove the entry associating
3392 the source dev/ino with the destination file name.
3393 * tests/mv/Makefile.am (TESTS): Add hard-3.
3394 * tests/mv/hard-3: New test, for the above-fixed bug.
3395 Inspired by a report from Iida Yosiaki.
3397 2003-03-01 Jim Meyering <jim@meyering.net>
3399 * src/df.c (print_header): Don't embed spaces in a separate `Type'
3400 header string. Instead, put `Filesystem' and `Type' headers in the
3401 same string, so translators can use horizontal space as needed.
3402 Reported by Jean Charles Delepine.
3404 2003-02-28 Jim Meyering <jim@meyering.net>
3406 * src/copy.c (copy_internal): When link fails because of an
3407 existing destination file, unlink that file and try again.
3408 Reported by Iida Yosiaki.
3410 * tests/mv/Makefile.am (TESTS): Add hard-2.
3411 * tests/mv/hard-2: New test for the above-fixed bug.
3412 Based on a test case from Iida Yosiaki.
3414 2003-02-26 Jim Meyering <jim@meyering.net>
3416 * tests/du/basic: Don't test du's -b option here. Directory byte
3417 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
3418 and IBM AIX 4.2. Reported by Nelson Beebe.
3420 2003-02-25 Jim Meyering <jim@meyering.net>
3422 * Makefile.maint (announcement): Now that ChangeLog entries
3423 are output by announce-gen, don't do it here.
3424 * announce-gen (print_changelog_deltas): New function.
3427 2003-02-22 Jim Meyering <jim@meyering.net>
3429 * announce-gen: New option: --release-type=TYPE
3430 * Makefile.maint (beta, major): New targets. Remove `release'.
3431 Put them all together on a line.
3432 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
3433 invocation of `announcement'.
3434 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
3436 * announce-gen: New option: --news=NEWS_FILE.
3437 Extract NEWS entries here, not via rules in Makefile.maint.
3438 * Makefile.maint (announcement): Now that NEWS entries are
3439 extracted by announce-gen, don't do it here.
3440 (news-r1, news-r2): Remove now-unused definitions.
3442 2003-02-21 Jim Meyering <jim@meyering.net>
3446 Merge in changes from autoconf's version of this file.
3447 * Makefile.maint (www-gnu): Define.
3448 (standards.texi-url_prefix): Use $(www-gnu).
3449 (make-stds.texi-url_prefix): Likewise.
3451 * src/cp.c: Include "mmap-stack.h".
3452 (main): Invoke `run' through a macro that (when possible) runs it
3453 with a large, mmap'd stack.
3455 * src/cp.c (run): New function, preparing for the above.
3456 Exit from this function, not from main
3459 * src/du.c: New option: --apparent-size.
3460 (enum) [APPARENT_SIZE_OPTION]: New member.
3461 (long_options): Add it.
3462 (usage): Describe it.
3464 ['b']: Set apparent_size.
3465 David Eisner reported that the behavior of --bytes had changed.
3466 Paul Eggert proposed the use of a new option, --apparent-size.
3468 * src/du.c (apparent_size): New global.
3469 (print_only_size): Reflect the fact that we're printing byte counts,
3470 not ST_NBLOCKSIZE-byte-block counts.
3471 (print_size): Call print_only_size rather than duplicating its code.
3472 (process_file): Accumulate byte counts, rather than block counts.
3474 * src/du.c (process_file): Always reset size_to_propagate_to_parent
3475 for --separate-dirs (-S).
3477 2003-02-20 Jim Meyering <jim@meyering.net>
3479 * Use automake-1.7.3. Regenerate dependent files.
3481 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
3482 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
3483 (usage) [%B]: Describe it.
3486 * src/du.c (process_file): Reorganize the code to use only
3487 one `sum' array, and change how -S works back to the way it was
3488 before 2003-01-31. Patch by Bruno Haible.
3490 * tests/du/basic: New test.
3491 * tests/du/Makefile.am (TESTS): Add basic.
3493 * tests/envvar-check: Add checks for the following:
3494 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
3496 * tests/Makefile.am: Rename phony target envvar-check to evar-check
3497 so as not to conflict with the distributed file by the same name.
3499 * src/du.c (process_file): Set info->skip before any possible return.
3501 Report correct usage for directories, not 0.
3502 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
3503 _before_ recording the dev/ino of a directory.
3504 Reported by Bruno Haible.
3506 Now, df always displays the device file name corresponding to the
3507 listed mount point under `Filesystem'. Before, for an unmounted
3508 block- or character-special file argument, it would display the
3509 command-line argument instead.
3510 * src/df.c (show_disk): Return a value indicating whether
3511 there was a match. Don't try to find a mount point here.
3512 (show_entry): If show_disk doesn't find a match, call show_point.
3514 2003-02-19 Jim Meyering <jim@meyering.net>
3516 * src/du.c: Include "mmap-stack.h".
3517 (du_files): Add prototype with ATTRIBUTE_NORETURN.
3518 Exit from this function, not from...
3520 Instead, if possible, invoke du_files through a macro that
3521 runs it with a large, mmap'd stack.
3523 * src/join.c (usage): Change wording in --help output:
3524 use FILENUM instead of `SIDE' and say what FILENUM means.
3525 Reported by Bernhard Gabler.
3527 * src/df.c (print_header): Rather than using a hard-coded literal
3528 string of spaces matching the length of the English `...Type' header,
3529 output the right number of spaces to match the selected translation.
3530 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
3532 * src/split.c (bytes_split): Remove unnecessary `else' after break.
3533 (lines_split): Likewise. and correct misleading indentation.
3535 * src/split.c: Include "full-read.h".
3536 (bytes_split, lines_split, line_bytes_split): Use full_read,
3537 not safe_read. The way split was using the latter, a short read
3538 could cause split to terminate before EOF.
3540 * tests/misc/tty-eof: Test all programs that can read stdin,
3541 requiring no arguments and that write to standard output.
3543 * tests/misc/tty-eof: New file. Renamed from ...
3544 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
3545 * tests/misc/Makefile.am (TESTS): Reflect renaming.
3547 2003-02-18 Jim Meyering <jim@meyering.net>
3549 cksum would perform an extra read after encountering EOF
3550 * src/cksum.c (cksum): Exit the loop upon EOF, too.
3551 Patch by Michael Bacarella.
3553 Test for the bug fixed today in cksum, md5sum, and sha1sum.
3554 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
3555 cat, cksum, md5sum, and sha1sum all in the same loop.
3557 2003-02-14 Jim Meyering <jim@meyering.net>
3559 * src/remove.c: Include "euidaccess.h".
3560 Remove declaration of euidaccess.
3562 2003-02-12 Jim Meyering <jim@meyering.net>
3564 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
3565 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
3567 2003-02-10 Jim Meyering <jim@meyering.net>
3569 * src/test.c: Don't include group-member.h.
3570 Include euidaccess.h.
3571 (eaccess): Rewrite function to set the real uid and gid temporarily
3572 to the effective uid and gid, then invoke 'access', and then set the
3573 real uid and gid back. On systems that lack setreuid or setregid,
3574 fall back on the kludges in euidaccess. Before, it would not work
3575 for e.g., files with ACLs, files that were marked immutable,
3576 or on file systems mounted read-only. Nelson Beebe raised the issue.
3577 Paul Eggert suggested the new implementation.
3579 2003-02-09 Jim Meyering <jim@meyering.net>
3581 * src/test.c (test_stat): Remove function. It's job is done (only
3582 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
3584 2003-02-08 Jim Meyering <jim@meyering.net>
3588 * tests/mv/part-symlink: Don't assume that the file owner username
3589 length is less than 9 in ls output: instead, omit that field
3590 altogether. Reported by, and suggested fix from, Ferdinand.
3592 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
3593 * tests/du/Makefile.am (TESTS): Add restore-wd.
3595 * src/rm.c: Correct now-invalid comment about cycle-detection.
3597 2003-02-06 Jim Meyering <jim@meyering.net>
3599 * NEWS: Add entries from old/*/NEWS
3600 from fileutils-4.1 through 4.1.11 and
3601 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
3605 * src/du.c (process_file): Don't return early for excluded files
3606 or for files whose dev/inode we've already seen.
3608 2003-02-05 Jim Meyering <jim@meyering.net>
3610 * tests/du/exclude: New file.
3611 * tests/du/Makefile.am (TESTS): Add exclude.
3613 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
3615 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
3616 Fix memory allocation arithmetic.
3618 2003-02-04 Jim Meyering <jim@meyering.net>
3620 `df /dev/block-or-char-device-file--not-mounted' now reports
3621 the name of the file system on which the file resides, usually `/'.
3622 Before, it would leave the `Mounted on' field blank.
3623 * src/df.c (show_disk): Move function to precede find_mount_point.
3624 (show_disk): Add parameter: STATP.
3625 If we don't find a matching device name, then resort to calling
3626 find_mount_point. Reported by Bob Proulx.
3628 2003-02-03 Andreas Schwab <schwab@suse.de>
3630 * tests/rm/cycle: Require non-root.
3631 * tests/rm/isatty: Likewise.
3633 2003-02-02 Jim Meyering <jim@meyering.net>
3637 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
3639 Ensure that there are no offending uses of `:'.
3640 * Makefile.maint (makefile_path_separator_check): New rule.
3641 (local-check): Add it to the list.
3643 2003-02-01 Jim Meyering <jim@meyering.net>
3645 * src/du.c (MAX_N_DESCRIPTORS): Define.
3647 * src/stat.c (G_fail): New global.
3648 (human_time): Diagnose failed localtime, not failed nstrftime.
3649 (main): Fail if G_fail is set.
3651 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3653 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
3654 hard-coding the path-separator. Also double-quote the new PATH,
3655 to avoid problems when the path-separator is a semi-colon or when
3656 `pwd` contains e.g. a space.
3657 * tests/chgrp/Makefile.am: Likewise.
3658 * tests/chmod/Makefile.am: Likewise.
3659 * tests/chown/Makefile.am: Likewise.
3660 * tests/cp/Makefile.am: Likewise.
3661 * tests/dd/Makefile.am: Likewise.
3662 * tests/dircolors/Makefile.am: Likewise.
3663 * tests/du/Makefile.am: Likewise.
3664 * tests/expr/Makefile.am: Likewise.
3665 * tests/factor/Makefile.am: Likewise.
3666 * tests/fmt/Makefile.am: Likewise.
3667 * tests/install/Makefile.am: Likewise.
3668 * tests/ln/Makefile.am: Likewise.
3669 * tests/ls/Makefile.am: Likewise.
3670 * tests/ls-2/Makefile.am: Likewise.
3671 * tests/md5sum/Makefile.am: Likewise.
3672 * tests/misc/Makefile.am: Likewise.
3673 * tests/mkdir/Makefile.am: Likewise.
3674 * tests/mv/Makefile.am: Likewise.
3675 * tests/od/Makefile.am: Likewise.
3676 * tests/rm/Makefile.am: Likewise.
3677 * tests/rmdir/Makefile.am: Likewise.
3678 * tests/seq/Makefile.am: Likewise.
3679 * tests/sha1sum/Makefile.am: Likewise.
3680 * tests/shred/Makefile.am: Likewise.
3681 * tests/stty/Makefile.am: Likewise.
3682 * tests/sum/Makefile.am: Likewise.
3683 * tests/tail-2/Makefile.am: Likewise.
3684 * tests/touch/Makefile.am: Likewise.
3685 * tests/tsort/Makefile.am: Likewise.
3686 * tests/unexpand/Makefile.am: Likewise.
3688 2003-01-31 Jim Meyering <jim@meyering.net>
3690 * src/stat.c: Include "file-type.h"
3691 (print_human_type): Remove function.
3692 (human_access): Rename from print_human_access. Return a string.
3693 (human_time): Rename from print_human_time. Return a string.
3694 (print_stat): Arrange so that field width and an alignment specifier
3695 are honored for the %A, %F, %x, %y, and %z formats.
3696 [%F]: Use file_type; this gives slightly different file type strings,
3697 e.g., `directory' instead of `Directory' and `regular file' or
3698 `regular empty file' instead of `Regular file'.
3699 Prompted by a report from Richard Dawe that the uses of
3700 S_IFSOCK and S_IFIFO in print_human_time were not portable
3701 to systems using e.g., DJGPP.
3703 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3705 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
3706 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
3708 2003-01-31 Jim Meyering <jim@meyering.net>
3710 * src/du.c (main): Upon processing an invalid option or an invalid
3711 --exclude-from or --max-depth option argument, don't exit right away,
3712 in case there are others. Rather record the failure and exit after
3713 processing other options.
3715 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
3716 tar archive easier to reproduce.
3718 Rewrite to perform directory traversal using nftw.
3720 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
3721 (AUTHORS): Add self.
3722 (opt_one_file_system): Move global into `main'.
3723 (path, xstat, exit_status): Remove declarations.
3724 (arg_length, suffix_length): New globals.
3725 (G_fail): New global, sort of like the old `exit_status'.
3726 (IS_FTW_DIR_TYPE): Define.
3727 (print_only_size): New function.
3728 (process_file): New function.
3729 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
3730 (str_trunc, pop_dir, count_entry): Likewise.
3731 (du_files): Rewrite to use nftw.
3733 2003-01-30 Jim Meyering <jim@meyering.net>
3735 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
3736 symlink-to-directory with -L, even without the trailing slash.
3738 2003-01-27 Jim Meyering <jim@meyering.net>
3740 * src/Makefile.am (check-misc): Check for st_blocks, too.
3742 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
3743 Reported by Richard Dawe.
3745 2003-01-27 Andreas Schwab <schwab@suse.de>
3747 * src/ls.c (quote_name): Add fourth parameter, width, into which to
3748 store the screen columns, and return the number of bytes instead.
3749 (print_dir): Pass NULL as fourth parameter of quote_name.
3750 (print_name_with_quoting): Likewise.
3751 (length_of_file_name_and_frills): Get the width from the fourth
3752 parameter of quote_name instead of return value.
3754 2003-01-27 Jim Meyering <jim@meyering.net>
3756 * src/ls.c (decode_switches): If `dired' is set without
3757 `format == long_format', then silently reset dired. This doesn't
3758 change the behavior of ls (all prior uses of dired were protected
3759 by `&& format == long_format'), and lets us...
3760 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
3761 (PUSH_CURRENT_DIRED_POS): Likewise.
3764 2003-01-22 Jim Meyering <jim@meyering.net>
3766 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
3767 * tests/du/Makefile.am (TESTS): Add no-x.
3769 2003-01-21 Jim Meyering <jim@meyering.net>
3771 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
3772 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
3773 it may still be a directory -- or not (e.g., with FreeBSD on an
3774 NFS-mounted file system), so resort to calling lstat to find out.
3775 Based on a patch by Michael van Elst.
3777 * tests/cp/same-file: Don't assume that the file owner username
3778 length is less than 9 in ls output: instead, omit that field
3779 altogether. Reported by, and suggested fix from, Ferdinand.
3781 2003-01-20 Jim Meyering <jim@meyering.net>
3783 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
3784 large format widths no longer cause strftime to infloop.
3786 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
3788 2003-01-19 Jim Meyering <jim@meyering.net>
3790 * src/readlink.c: Include "canonicalize.h".
3792 2003-01-18 Jim Meyering <jim@meyering.net>
3794 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
3796 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
3797 (long_options): Add option --dereference-command-line-symlink-to-dir.
3798 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
3799 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
3800 -d, -F, -l options is specified.
3801 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
3802 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
3803 Change --dereference-command-line (-H) to dereference *all*
3804 command line arguments, including broken symlinks.
3806 2003-01-15 Paul Eggert <eggert@twinsun.com>
3808 Change ls -H back to the way it was yesterday, since this is
3809 compatible with FreeBSD and the POSIX spec is confusing
3810 and somewhat contradictory.
3812 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
3813 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
3814 (long_options): Change the long option name back.
3815 (usage): Change the usage back.
3816 (gobble_file): When -H is specified, dereference a top-level
3817 arg even if it points to a non-directory.
3819 2003-01-15 Jim Meyering <jim@meyering.net>
3821 * src/ls.c (gobble_file): Fall back on using lstat when required:
3822 when --dereference (-L) is not specified, and
3823 - when operating on a dangling symlink
3824 - when operating on command-line-symlink-to-directories
3825 This fixes numerous problems. Here are examples:
3826 - `ls dangling-symlink' would fail with `no such file...'
3827 Now it prints `dangling-symlink'.
3828 - `ls -i symlink' would mistakenly print the inode of the referent.
3829 Now it prints the inode of the symlink. Likewise for --size (-s).
3830 Based on a patch from Michael Stone.
3831 Reported by Deepak Goel as Debian bug #173793.
3833 Rename ls's --dereference-command-line (-H)
3834 option to --dereference-command-line-symlink-to-dir.
3835 * src/ls.c [enum Dereference_symlink]
3836 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
3837 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
3838 (long_options): Rename the long option.
3839 (usage): Say that --dereference-... changes how ls treats
3840 only symlinks to directories specified on the command line.
3842 2003-01-14 Jim Meyering <jim@meyering.net>
3844 * tests/ls/dangle: New file/test, for the above fix.
3845 * tests/ls/inode: Another new file/test, for the above fix.
3846 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
3848 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
3849 so that ls --color would no longer highlight the names of files with
3850 the execute bit set when not specified on the command line.
3851 Patch by Michael Stone. Reported by Stephen Depooter as
3854 * tests/ls-2/tests (color-exe): New test, for the above fix.
3856 2003-01-13 Jim Meyering <jim@meyering.net>
3858 * tests/shred/exact: Also test for just fixed bug with --zero.
3860 * src/shred.c (long_opts): --zero does not require an argument.
3861 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
3863 2003-01-12 Jim Meyering <jim@meyering.net>
3865 * Makefile.maint (cvs-update): Skip any file with local modifications.
3867 * src/unexpand.c (usage): Document --first-only and mention that
3868 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
3870 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
3872 * src/df.c: Include "canonicalize.h".
3873 Use canonicalize_file_name unconditionally.
3875 2003-01-09 Jim Meyering <jim@meyering.net>
3877 * README: Add readlink.
3879 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3881 * src/df.c: Include "xgetcwd.h".
3882 * src/pwd.c: Likewise.
3884 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3886 * src/shred.c: Remove declaration of xstrdup.
3887 We already get it via xalloc.h which is included via system.h.
3889 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
3891 New program: readlink.
3893 * src/Makefile.am (bin_PROGRAMS): Add readlink.
3894 * src/readlink.c: New file.
3896 * man/readlink.x: New file.
3897 * man/Makefile.am (dist_man_MANS): Add readlink.1.
3898 (readlink.1): New rule.
3900 2003-01-09 Jim Meyering <jim@meyering.net>
3902 When selecting ranges of byte offsets (as opposed to ranges of fields)
3903 and when --output-delimiter=STRING is specified, output STRING between
3904 ranges of selected bytes.
3905 * src/cut.c (RANGE_START_SENTINEL): Define.
3906 (output_delimiter_specified): New global.
3907 (print_kth): Add parameter. Adjust all callers.
3908 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
3909 (cut_bytes): When requested, output STRING between ranges of
3911 (main): Make a diagnostic a little clearer.
3912 Based on a patch from Jan Nieuwenhuizen.
3914 * tests/cut/Test.pm: New tests for the above.
3916 * src/cut.c (set_fields): Make code agree with comment:
3917 Don't merge abutting ranges like 4- and 2-3. This makes no
3918 difference currently, but is required to support an upcoming change.
3920 2003-01-07 Jim Meyering <jim@meyering.net>
3922 * src/cut.c (set_fields): Fix typo in comment.
3924 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
3925 * tests/touch/Makefile.am (TESTS): Add not-owner.
3926 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
3927 Now, this tests only the nonexistent-directory diagnostic.
3928 Suggestion from Michael Stone.
3930 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
3932 2003-01-04 Jim Meyering <jim@meyering.net>
3934 * src/copy.h: Remove use of PARAMS.
3935 * src/remove.h: Likewise.
3936 * src/chown-core.h: Likewise.
3938 rm could be tricked into mistakenly reporting a cycle.
3939 * src/remove.c: [cycle_check_state]: New global.
3940 (remove_cwd_entries): Adapt to new semantics of cycle_check.
3941 (rm): Call cycle_check_init and cycle_check_free for each file.
3942 * tests/rm/cycle (rm): New test, for the above fix.
3943 * tests/rm/Makefile.am (TESTS): Add cycle.
3945 When rm detects a cycle, don't abort the entire command,
3946 but rather just the affected command line argument.
3947 * src/remove.c: Include <setjmp.h>
3948 (struct dirstack_state) [current_arg_jumpbuf]: New member.
3949 (remove_cwd_entries): Call longjmp if we detect a cycle.
3950 (rm): Call setjmp here.
3952 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
3953 Instead, include cycle-check.h and use it.
3955 * src/remove.h (struct dev_ino): Remove declaration.
3957 * src/remove.c (remove_cwd_entries): Fix typos in comment.
3959 Don't include trailing /. in diagnostics about directories.
3960 * src/remove.c (full_filename_): When FILENAME is just `.'
3961 and there is a nonempty directory-name part, don't append `/.'.
3962 * tests/rm/unread2: Remove trailing /. from diagnostic.
3963 * tests/rm/rm2: Likewise.
3965 * src/remove.c (struct dirstack_state): Define.
3966 To be used in place of these file-scoped globals ...
3967 (dir_stack, len_stack, Active_dir): Remove globals.
3968 (ds_init, ds_free): New functions.
3969 (full_filename): Define.
3970 (full_filename_): Rename from full_filename.
3972 Begin to make AD_* functions more generic.
3973 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
3974 (AD_push): Likewise.
3975 (AD_INIT_OTHER_MEMBERS): Define.
3976 (remove_dir): Define the `status' member manually after each
3977 call to AD_push or AD_push_initial.
3979 * src/Makefile.am (check-misc): New rule, to ensure that no more
3980 S_IS* macro definitions sneak into the code.
3981 (check): Depend on check-misc.
3983 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
3984 * src/du.c (count_entry) [S_ISLNK]: Don't define.
3985 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
3987 2003-01-03 Jim Meyering <jim@meyering.net>
3989 * src/true.c: Add copyright.
3990 (AUTHORS): I suppose I've written it.
3992 * src/Makefile.am (false.c): Make the generated file be read-only.
3994 2003-01-04 Jim Meyering <jim@meyering.net>
3996 * src/ls.c: Include "dev-ino.h".
3997 [struct dev_ino]: Remove declaration.
3999 2003-01-02 Jim Meyering <jim@meyering.net>
4001 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
4002 from mv: s/missing file arguments/missing file argument/.
4003 With --target-directory=DIR, cp and mv work with a single file argument.
4004 Reported by Karl Berry.
4006 * tests/rm/isatty: Enable this test.
4008 2002-12-31 Jim Meyering <jim@meyering.net>
4010 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
4011 (AD_push): Likewise.
4012 (AD_INIT_OTHER_MEMBERS): Define.
4013 (remove_dir): Define the `status' member manually after each
4014 call to AD_push or AD_push_initial.
4016 * src/ls.c [struct dev_ino]: Remove definition.
4017 Include "dev-ino.h" instead.
4019 2002-12-28 Jim Meyering <jim@meyering.net>
4021 * tests/du/Makefile.am (TESTS): Add no-deref.
4022 * tests/du/no-deref: New script.
4024 2002-12-23 Jim Meyering <jim@meyering.net>
4026 * src/remove.c (remove_cwd_entries): Fix typo in comment.
4028 2002-12-21 Jim Meyering <jim@meyering.net>
4030 * announce-gen: Generate MML-formatted announcement.
4031 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
4033 2002-12-20 Jim Meyering <jim@meyering.net>
4035 * src/touch.c (touch): Change the wording of a diagnostic so
4036 that it makes sense both when the file exists and when it doesn't.
4037 Suggestion from Michael Stone.
4039 2002-12-18 Jim Meyering <jim@meyering.net>
4041 * src/stty.c (valid_options): Declare to be static.
4043 2002-12-15 Jim Meyering <jim@meyering.net>
4045 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
4047 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
4048 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
4049 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
4050 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
4051 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
4053 * src/remove.c (PARAMS): Remove definition.
4054 * src/sys2.h: Likewise.
4056 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
4057 Include strftime.h instead.
4059 2002-12-14 Jim Meyering <jim@meyering.net>
4061 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
4063 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
4064 This is necessary at least for Irix6.5 when using c89.
4065 Reported by Nelson Beebe.
4067 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
4069 * tests/misc/cat-tty-eof: New test.
4071 * src/mknod.c (usage): Specify how major and minor mode numbers
4072 are interpreted. Report forwarded by Kristin E Thomas.
4073 * src/mknod.c: Remove now-redundant usage-specifying comment.
4075 2002-12-13 Jim Meyering <jim@meyering.net>
4079 * tests/du/trailing-slash: Allow for a directory of size `0'.
4080 That happens at least on file systems of type tmpfs on linux-2.4.18.
4082 * announce-gen: New script to begin replacing the commands
4083 associated with the rule here...
4084 * Makefile.maint (announcement): Invoke announce-gen.
4085 * Makefile.am (EXTRA_DIST): Add announce-gen.
4087 * tests/cp/preserve-2: New file/test, for latest fix.
4088 * tests/cp/Makefile.am (TESTS): Add preserve-2.
4090 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
4092 Fix a bug whereby cp would fail to parse an option like
4093 --preserve=mode,ownership.
4094 * src/cp.c (decode_preserve_arg): Advance `comma' to
4095 point the character following the comma.
4097 2002-12-11 Jim Meyering <jim@meyering.net>
4099 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
4100 in case it's already defined.
4102 2002-12-09 Jim Meyering <jim@meyering.net>
4104 * tests/touch/fail-diag: Don't get a test failure if /no exists.
4105 Instead, evoke a framework failure if /no-$$ exists.
4106 Reported by Michael Stone.
4108 2002-12-08 Jim Meyering <jim@meyering.net>
4110 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
4111 Define to rpl_lstat, so that even on systems like Solaris 5.8,
4112 du honors (per POSIX) the trailing slash on an argument referring
4113 to a symlink-to-directory.
4115 2002-12-06 Jim Meyering <jim@meyering.net>
4117 * Use autoconf-2.57. Regenerate dependent files.
4118 * Use automake-1.7.2. Regenerate dependent files.
4120 * src/ls.c (gobble_file): Also stat the file if it's a
4121 regular file and --indicator-style=classify (aka -F).
4122 Thanks to Ed Santiago for opening my eyes.
4124 * tests/ls/file-type: New file. Test for the above.
4125 A test to contrast ls -F and ls --indicator-style=file-type.
4126 * tests/ls/Makefile.am (TESTS): Add file-type.
4128 2002-12-04 Jim Meyering <jim@meyering.net>
4130 * tests/ls/follow-slink: Make sure the symlink was created.
4131 Richard Dawe reported that `ln -s link link' succeeds, but creates
4132 no file on systems running some version of the DJGPP libc.
4134 2002-12-03 Jim Meyering <jim@meyering.net>
4136 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
4137 since this package no longer panders to K&R compilers.
4139 2002-12-02 Jim Meyering <jim@meyering.net>
4141 * tests/du/slink: Skip this test if `.' is on a non-local file system.
4143 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
4144 something to replace.
4146 2002-12-01 Jim Meyering <jim@meyering.net>
4148 * src/stat.c: Don't include <string.h> or <ctype.h>.
4149 That's already done via system.h.
4150 * src/dircolors.c: Don't include <ctype.h>.
4152 2002-11-30 Jim Meyering <jim@meyering.net>
4154 * ls.c (gobble_file): Remove the block of code that caused
4155 `ls --color -F symlink-to-dir' to list the files in
4156 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
4157 like `ls -F symlink-to-dir') but with the addition of highlighting.
4158 Similarly, `ls --color -dF symlink-to-dir' would print
4159 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
4160 Reported by Jeff Sheinberg as Debian bug #168203.
4161 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
4163 ls is now more efficient: with certain options, it no longer needs
4164 to stat each directory entry on systems with valid dirent.d_type.
4165 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
4166 (main): Make --recursive set format_needs_type, not format_needs_stat.
4167 (gobble_file): Remove a FIXME comment, now that it's fixed.
4169 2002-11-24 Jim Meyering <jim@meyering.net>
4171 * src/du.c (du_files): Don't strip any trailing slash.
4172 Rewrite so that `/' is no longer represented internally as
4174 (count_entry): When appending a file name component,
4175 account for the fact that the current path may end in `/'.
4176 François Pinard reported that `du symlink-to-dir/' was not
4177 equivalent to `du symlink-to-dir/.'. Now it is.
4178 * tests/du/trailing-slash: New file/test, for the above fix.
4179 * tests/du/Makefile.am (TESTS): Add trailing-slash.
4181 2002-11-23 Jim Meyering <jim@meyering.net>
4183 * src/tac.c (output): Declare some local variables to be of type size_t,
4184 rather than `int' to avoid warnings from gcc.
4186 2002-11-21 Paul Eggert <eggert@twinsun.com>
4188 * src/ls.c (decode_switches): Use case-sensitive matching to
4189 decode the QUOTING_STYLE environment variable. This is more
4190 consistent with the documentation, and with --quoting-style.
4192 2002-11-21 Martin Buck <martin.buck@ascom.ch
4194 * src/stty.c (struct speeds): Add support for all baud rates defined
4197 2002-11-19 Jim Meyering <jim@meyering.net>
4199 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
4200 run in a UTF locale. Report and suggested fix by Bruno Haible.
4201 * tests/fmt/basic: Likewise.
4203 2002-11-17 Jim Meyering <jim@meyering.net>
4205 * configure.ac: Update via autoupdate.
4206 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
4208 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
4209 Reported by Hans Ginzel.
4211 2002-11-15 Jim Meyering <jim@meyering.net>
4213 * Makefile.cfg (gnu_rel_host): Define.
4214 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
4215 on whether $(VERSION) looks like a major release number.
4217 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
4218 (release): Rename from `alpha'.
4219 (alpha): Depend on release.
4221 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
4223 2002-11-14 Jim Meyering <jim@meyering.net>
4225 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
4226 (announcement): Use the new variable.
4228 * Makefile.maint: Sync with Bison, i.e.:
4229 (po-check): Scan .l and .y files instead of the
4230 .c and the .h files that they generate. This fixes the bug
4231 reported by Tim Van Holder in:
4232 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
4233 Look for N_ as well as for _. Try to avoid matching #define for
4237 2002-11-12 Jim Meyering <jim@meyering.net>
4239 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
4240 Replace sole use with equivalent `#ifdef S_ISLNK'.
4241 Inconsistency reported by Dmitry V. Levin.
4243 2002-11-11 Jim Meyering <jim@meyering.net>
4245 * src/stat.c (usage): Transform --help items output via s/ - / /,
4246 so that help2man produces properly formatted man pages.
4247 Reported by Herbert Xu as Debian bug #168400.
4249 2002-11-10 Jim Meyering <jim@meyering.net>
4251 * src/ls.c (sighandler): Handle SIGTSTP specially.
4252 Based on suggestions from Solar Designer and Dmitry V. Levin.
4255 * Makefile.cfg (cvs_files): Define. From autoconf.
4256 (local_updates): Likewise.
4258 * src/ls.c (restore_default_color_handler, sigtstp_handler):
4260 (sighandler): New function, based on the one in sort.c.
4261 (main): Use sigaction, if possible; otherwise signal.
4262 Handle these signals:
4263 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
4264 Don't register our handler if the signal is already being ignored.
4266 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
4267 * src/csplit.c (interrupt_handler): Likewise.
4268 * src/sort.c (sighandler): Likewise.
4269 (main): Declare `i' and `nsigs' to be unsigned, not int.
4271 2002-11-09 Jim Meyering <jim@meyering.net>
4273 ls --color: restore terminal text color upon signal.
4274 * src/ls.c: Include "full-write.h" and <signal.h>.
4275 (restore_default_color, restore_default_color_handler): New functions.
4276 (sigtstp_handler, put_indicator_direct): New functions.
4277 (main) [print_with_color]: Register signal handlers.
4278 Patch mostly by Solar Designer and Stanislav Ievlev.
4280 Update from autoconf.
4281 * Makefile.maint (AMTAR): Remove definition.
4282 (update, cvs-update, po-update, do-po-update): New rules.
4283 (wget-update): Update (thus renaming to cvs-update).
4284 (automake_repo): Use anoncvs@sources.redhat.com.
4286 2002-11-06 Jim Meyering <jim@meyering.net>
4288 * tests/misc/Makefile.am (TESTS): Add printf-hex.
4290 * tests/misc/printf: Be careful to test the code in this package,
4291 not the shell built-in function.
4293 * src/printf.c (print_esc): A hexadecimal escape sequence has
4294 at most two hex. digits, not three. Reported by Padraig Brady.
4295 (usage): Update description.
4296 * tests/misc/printf-hex: New file/test, for the above fix.
4298 2002-10-07 Paul Eggert <eggert@twinsun.com>
4300 Add support for locale-specific size indications (e.g.,
4301 thousands-separators) and for explicit size suffixes on output.
4303 * doc/coreutils.texi (Block size): Say that:
4304 This affects display format as well as block size.
4305 Fractional block counts are rounded up.
4306 ls file size blocksize defaults to 1.
4307 A block size spec preceded by ' generates thousands separators.
4308 A suffix without a preceding integer generates suffixes.
4309 (tail invocation): 32k -> 32 KiB.
4310 (What information is listed): ls -h is now equivalent to
4311 ls --block-size=human, and ls -H is now equivalent to
4312 ls --block-size=si. Displayed file size is now always affected by
4315 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
4316 lib/umaxtostr.c: New files, taken from GNU tar.
4318 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
4320 (EXTRA_DIST): Add inttostr.c.
4322 * lib/human.c, lib/human.h: Rewrite to support locale-specific
4323 notations like thousands separators.
4324 Specify what includer of include.h must include beforehand.
4325 (human_group_digits, human_suppress_point_zero, human_autoscale,
4326 human_base_1024, human_SI, human_B): New enum values.
4327 (human_readable): Rename from human_readable_inexact; put the
4328 options before the sizes. All uses changed. The old human_readable
4329 function has been removed; use inttostr.h instead.
4330 (human_options): Renamed from human_block_size, with new signature
4331 that allows block sizes up to UINTMAX_MAX. All callers changed.
4333 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
4334 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
4335 freestanding C89. No need to check for stdlib.h or string.h since
4336 autoconf does this now.
4338 * src/cksum.c (cksum): Use primitives from inttostr.h, not
4339 human.h, to print large numbers simply.
4340 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
4341 * src/dd.c (print_stats, main): Likewise.
4342 * src/df.c (print_header): Likewise.
4343 * src/factor.c (print_factors): Likewise.
4344 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
4345 * src/shred.c (dopass): Likewise.
4346 * src/sort.c (checkfp): Likewise.
4347 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
4348 * src/tail.c (xlseek): Likewise.
4349 * src/wc.c (write_counts, wc): Likewise.
4351 * src/df.c (human_output_opts): New var.
4352 (output_block_size): Now uintmax_t, not int, to handle larger
4353 block sizes. All uses changed.
4354 * src/du.c: Likewise.
4355 * src/ls.c: Likewise.
4357 * src/df.c (print_header): In the header line, prefer SI to human
4358 representation if it's shorter; if neither is shorter, try to
4359 intuit what the user would prefer.
4361 * src/expr.c (inttostr): Remove; use new imaxtostr library
4364 * src/ls.c (file_output_block_size): New var, to distinguish
4365 file sizes from other sizes.
4366 (decode_switches): Set it.
4368 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
4369 (dopass): When printing progress, use floor for what has been done
4370 so far (since we should be conservative there), and ceiling for
4371 what needs to be done (since that's what other programs use).
4373 2002-10-19 Jim Meyering <jim@meyering.net>
4375 * src/pinky.c (print_heading): Align TTY and Name headings.
4376 Reported by Karl Eichwalder.
4378 2002-10-18 Jim Meyering <jim@meyering.net>
4380 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
4381 Remove now-useless cast.
4382 (stdread): Remove function.
4383 (bytes_split): Use size_t instead of int.
4384 Use safe_read, not stdread.
4385 (lines_split): Likewise.
4386 Use memchr rather than a `while' loop.
4387 (line_bytes_split): Use size_t instead of int.
4388 Use safe_read, not stdread.
4389 (main): Add some FIXME comments to remind me to remove casts.
4391 * src/system.h (ST_BLKSIZE): Correct comment describing how to
4392 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
4394 2002-10-17 Jim Meyering <jim@meyering.net>
4396 Fix a problem that could make e.g., `cat' misbehave on systems which
4397 give invalid (unreasonably large) values for stat.st_blksize.
4398 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
4399 Reported by Petter Reinholdtsen.
4401 2002-10-14 Jim Meyering <jim@meyering.net>
4403 Specifying a printf conversion specifer as nl's separator string
4404 could cause nl to segfault.
4405 * src/nl.c (build_print_fmt): Don't include separator string
4406 in the printf format; it might contain `%'.
4407 Use a better bound on the length of the print_fmt buffer.
4408 (print_lineno): Print the separator here instead.
4409 Reported by Doug Coleman.
4411 * tests/misc/nl: New file/tests, including a test for the above.
4412 * tests/misc/Makefile.am (TESTS): Add nl.
4414 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
4415 * tests/misc/Makefile.am (TESTS): Add split-l.
4417 2002-10-13 Jim Meyering <jim@meyering.net>
4421 * src/du.c (usage): Tweak description of --dereference-args/-D.
4423 * src/du.c (count_entry): Also save cwd when dereferencing (via
4424 --dereference-args, -D) a command-line argument.
4425 Reported by Michal Svec. Based on a patch by Andreas Schwab.
4427 * src/Makefile.am (../AUTHORS): New target/rule.
4429 2002-10-12 Jim Meyering <jim@meyering.net>
4431 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
4432 of type size_t, since that's the way it's used and avoids a warning.
4434 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
4435 since that's how it's always used and avoids a new warning from gcc.
4436 (read_input): Adapt to new safe_read ABI.
4438 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
4441 * src/pinky.c (print_long_entry): fread returns size_t.
4442 Declare local `bytes' accordingly, to avoid warning.
4444 tail -c +N would perform an extra read after encountering EOF
4445 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
4446 * src/tail.c (start_bytes): Detect EOF, inform caller.
4447 (tail_bytes): Upon EOF in start_bytes, return immediately.
4448 (file_lines): Reorganize to use memrchr rather than an explicit loop.
4449 Adapt to new safe_read ABI.
4451 2002-10-11 Jim Meyering <jim@meyering.net>
4453 * tests/du/deref: New file/test, for the above fix.
4454 * tests/du/Makefile.am (TESTS): Add deref.
4456 2002-10-10 Jim Meyering <jim@meyering.net>
4458 * tests/ln/Makefile.am (TESTS): Add target-1.
4459 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
4461 2002-10-09 Jim Meyering <jim@meyering.net>
4463 * tests/cp/backup-is-src: Ensure that certain environment variables
4464 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
4466 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
4467 consume 4GB of disk space on systems without support for sparse files.
4468 Fix a logic error that'd make it `cat err' even though dd didn't fail.
4470 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
4471 Patch by steven@magelico.net, forwarded by Michael Stone.
4473 * tests/ls/dired: Ensure that ls produces English messages.
4474 Patch by Alexey Vyskubov, forwarded by Michael Stone.
4476 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
4478 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
4480 2002-10-08 Jim Meyering <jim@meyering.net>
4482 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
4483 Fix syntax in test: use =, not ==.
4484 Reported by Bob Proulx.
4485 Change all the rest like this: grep -lR "testing framework'" .\
4486 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
4488 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
4489 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
4490 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
4491 * src/wc.c (wc): Likewise.
4493 2002-10-07 Paul Eggert <eggert@twinsun.com>
4496 Don't advance the write pointer past the end of the write buffer.
4497 * src/sort.c (begfield, limfield): Likewise.
4499 2002-10-07 Jim Meyering <jim@meyering.net>
4501 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
4502 * src/head.c (head_bytes, head_lines): Likewise.
4504 2002-10-06 Jim Meyering <jim@meyering.net>
4506 * src/dd.c (scanargs): Ensure that specified block sizes (specified
4507 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
4508 (skip, dd_copy): Adapt to new safe_read ABI.
4510 * Makefile.maint (signatures): Define.
4512 (announcement): Depend on $(signatures).
4514 * Makefile.maint (announcement): Output all URLs for detached
4515 signatures, not just the last one from the previous loop.
4517 2002-10-05 Jim Meyering <jim@meyering.net>
4521 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
4522 don't recurse into directory, DIR. Prompted by a report from
4525 * tests/rm/i-no-r: New file/test, for the above fix.
4526 * tests/rm/Makefile.am (TESTS): Add i-no-r.
4528 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
4529 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
4531 2002-10-03 Jim Meyering <jim@meyering.net>
4533 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
4534 * src/df.c (AUTHORS): Likewise.
4535 * src/du.c (AUTHORS): Likewise.
4536 * src/tail.c (AUTHORS): Likewise.
4537 * src/touch.c (AUTHORS): Likewise.
4539 2002-10-02 Jim Meyering <jim@meyering.net>
4541 * Makefile.am (SUBDIRS): Remove `old'.
4542 (EXTRA_DIST): List the files in old/.
4543 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
4544 Suggestion from Akim Demaille.
4546 2002-10-01 Jim Meyering <jim@meyering.net>
4548 * src/sys2.h (SSIZE_MAX): Define.
4550 2002-09-30 Jim Meyering <jim@meyering.net>
4552 * src/csplit.c: Don't include stdlib.h here. It's already included
4555 2002-09-29 Jim Meyering <jim@meyering.net>
4557 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
4558 expression to avoid bogus warning from gcc.
4560 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
4561 (cat): Declare insize and outsize to be of type size_t, not int.
4562 Rearrange pointer/integer expressions to avoid bogus warnings.
4563 (main): Declare insize and outsize to be of type size_t, not int.
4565 * src/tail.c (parse_options): Give a sensible diagnostic for
4566 an invalid byte or line count. Reported by Mikko Tuumanen.
4568 * src/touch.c (main): Split a long line.
4570 * tests/du/Makefile.am (TESTS): Add slink.
4571 * tests/du/slink: New test for system.h change of 2002-08-31.
4573 In move mode, always first try to rename. Before, upon failure to
4574 rename a directory, this code would never attempt to rename any
4575 other file in that directory, but would thenceforth always copy.
4576 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
4577 may fail with EXDEV, yet renaming files within that directory to
4578 a newly-created destination directory succeeds.
4579 * src/copy.c (copy_internal): Remove local, move_mode;
4580 use x->move_mode instead. Based on a patch from Tom Haynes.
4582 2002-09-28 Jim Meyering <jim@meyering.net>
4584 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
4585 Factor out some duplication.
4587 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
4589 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
4591 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
4592 to avoid compiler warnings.
4594 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
4597 Fix things so `mkdir -p' can create very deep directories, e.g.,
4598 mkdir -p $(perl -e 'print "a/" x 40000') now works.
4599 * src/mkdir.c (main): For --parents (-p), call make_path with the
4600 entire directory name, so we don't ever require that file operations
4601 like stat or chmod be performed on the entire command line argument.
4602 * makepath.c (make_path): Restore umask *before* creating the final
4605 2002-09-27 Andreas Schwab <schwab@suse.de>
4607 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
4608 to avoid overflow. Reported by Hans Lermen.
4610 2002-09-26 Jim Meyering <jim@meyering.net>
4612 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
4614 2002-09-25 Jim Meyering <jim@meyering.net>
4616 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
4617 and add a cast, to avoid a warning about `signed and unsigned type in
4618 conditional expression'.
4620 2002-09-22 Jim Meyering <jim@meyering.net>
4622 * src/rmdir.c: Include "dirname.h", for declaration of
4623 strip_trailing_slashes.
4625 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
4626 Now they're defined through system.h.
4628 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
4629 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
4630 since it's already included from sys2.h via system.h.
4632 * Use automake-1.6f. Regenerate dependent files.
4634 * src/Makefile.am (PERL): Remove duplicate definition.
4636 fmt's -s, -t, -c options didn't work properly for long lines.
4637 Since get_line may end up calling put_paragraph (for long lines),
4638 be sure to set global, `other_indent', before it is used there.
4640 * src/fmt.c (set_other_indent): New function, factored out of...
4641 (get_paragraph): ... here. Call it.
4642 (get_line): Call set_other_indent before calling flush_paragraph,
4643 which calls fmt_paragraph, which in turn calls put_paragraph,
4644 which uses other_indent.
4646 * tests/fmt/Makefile.am (TESTS): Add long-line.
4647 * tests/fmt/long-line: New file/test, for the above fix.
4649 2002-09-21 Jim Meyering <jim@meyering.net>
4651 * src/od.c: No longer include deprecated <values.h>.
4652 It was required solely for now-removed reference to BITSPERBYTE.
4653 * src/install.c: Likewise.
4654 Suggestion from Bruno Haible.
4656 2002-09-06 Andreas Schwab <schwab@suse.de>
4658 `rmdir -p dir-specified-with-trailing-slash/' would fail.
4659 * src/rmdir.c (remove_parents): Strip trailing slashes.
4661 2002-09-20 Jim Meyering <jim@meyering.net>
4663 * tests/rmdir/t-slash: New file/test, for the above fix.
4664 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
4666 * Makefile.maint (announcement): Arrange to gpg-sign the message.
4667 Add a URL for each detached signature file.
4669 2002-09-07 Bruno Haible <bruno@clisp.org>
4671 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
4673 2002-09-18 Jim Meyering <jim@meyering.net>
4675 `od -t x8' used the wrong (`l'-prefixed) printf format.
4676 Likewise for the o8 and u8 formats.
4677 * src/od.c (ISPEC_TO_FORMAT): Define macro.
4678 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
4679 Reported by Arun Sharma.
4681 2002-09-17 Jim Meyering <jim@meyering.net>
4683 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
4684 From gettext's intl/loadmsgcat.c.
4686 * tests/od/x8: New file/test, for the above fix.
4687 * tests/od/Makefile.am (TESTS): Add x8.
4689 2002-09-15 Jim Meyering <jim@meyering.net>
4691 * Use autoconf-2.54. Regenerate dependent files.
4693 * src/csplit.c (get_format_width): Add cast to avoid
4694 warning about `signed and unsigned type in conditional expression'.
4696 2002-09-14 Jim Meyering <jim@meyering.net>
4698 * src/who.c (print_user): Change type of local to size_t
4699 to avoid warnings about `comparison between signed and unsigned'.
4700 * src/ptx.c (generate_all_output): Likewise.
4702 * src/dd.c (main, skip): Add casts to avoid warnings about
4703 `comparison between signed and unsigned'.
4705 * src/id.c (print_full_info, print_group_list): Add casts to avoid
4706 warnings about `signed and unsigned type in conditional expression'.
4708 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
4709 to avoid warnings about `comparison between signed and unsigned'.
4710 (split_3): Change parameter names to be readable and add comment.
4711 Clean up the test for whether a line may be ignored.
4713 2002-09-13 Jim Meyering <jim@meyering.net>
4715 * src/printf.c (main): Handle leading command line argument of `--'.
4716 Reported by Raul: DervishD <raul@pleyades.net>
4717 * tests/misc/printf: New file: test for the above.
4718 * tests/misc/Makefile.am (TESTS): Add printf.
4720 * src/date.c (usage): Explain that %S's range of [0..60] is required --
4721 rather than 0..59 -- to accommodate the occasional positive leap second.
4722 Reported by Richard Neill.
4724 2002-09-12 Jim Meyering <jim@meyering.net>
4726 * src/Makefile.am (nanosec_libs): Define.
4727 (sleep_LDADD, tail_LDADD): Use it here.
4729 Factor nanosleep-related code into ../lib/xnanosleep.c.
4730 * src/sleep.c: Include xnanosleep.h.
4731 Factor out fenv.h-related code.
4732 (timespec_subtract): Remove function.
4733 (main): Remove code that deals with computing start and stop times
4734 as well as the loop around nanosleep. Now that's in xnanosleep.c.
4736 Allow S (in --sleep-interval=S) to be a floating point value.
4737 * src/tail.c: Include xnanosleep.h and xstrtod.h.
4738 Move declaration of global variable, sleep_interval, to ...
4740 (usage): Update description of --sleep-interval option.
4741 (tail_forever): New parameter, sleep_interval. Update caller.
4742 Use xnanosleep, rather than sleep.
4743 (parse_options): New parameter, sleep_interval. Update caller.
4744 Use xstrtod, now that we accept floating point values.
4745 Prompted by a patch from Augey Mikus.
4747 2002-09-06 Jim Meyering <jim@meyering.net>
4749 * src/remove.c (prompt): Change comment to give a better note to
4750 translators. From Michael Piefel.
4752 2002-09-02 Jim Meyering <jim@meyering.net>
4754 * README: A good problem report/patch includes diffs against
4755 the most recent test release.
4757 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
4758 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
4760 * src/kill.c (print_table_row): Use an unsigned type for widths
4761 to avoid warning about comparison between signed and unsigned.
4762 (list_signals): Likewise.
4764 * src/od.c (skip): Add a cast to avoid warning about comparison
4765 between signed and unsigned.
4766 * src/install.c (get_ids): Likewise. Also rearrange range-checking
4767 comparisons to make them more readable.
4769 2002-09-01 Jim Meyering <jim@meyering.net>
4773 2002-08-31 Jim Meyering <jim@meyering.net>
4775 Symlinks were always reported as using 0 blocks.
4776 * src/system.h (ST_NBLOCKS): Don't depend on file type.
4777 This reverts the change of 2000-01-30.
4778 Based on a report and patch from Neil Brown via Michael Stone.
4779 This fixes Debian Bug#156358.
4781 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
4782 `exit (1)' to `exit (EXIT_FAILURE)', and
4783 `usage (1)' to `usage (EXIT_FAILURE)'.
4785 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
4786 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
4787 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
4788 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
4789 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
4790 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
4791 error never exits successfully.
4793 2002-08-29 Jim Meyering <jim@meyering.net>
4795 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
4796 when ignoring any return value.
4798 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
4799 failures. On some systems (at least EMC Celerra and Solaris5.8),
4800 this appears to be necessary.
4801 (is_empty_dir): Likewise. Also, always close directory handle.
4802 * src/ls.c (print_dir): Likewise.
4803 (print_dir): Rename local variable: reading -> dirp.
4804 Reported by Mike Coleman.
4806 2002-08-28 Jim Meyering <jim@meyering.net>
4808 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
4809 Give a diagnostic and fail if closedir fails.
4811 2002-08-26 Jim Meyering <jim@meyering.net>
4813 * Makefile.am (THANKS-to-translators): New rule.
4814 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
4815 * THANKStt.in: New file.
4817 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
4819 (main): Register it with atexit.
4820 Close STDOUT_FILENO, to avoid a problem when writing to
4821 /dev/audio on at least Solaris 5.7 and 5.8 systems.
4822 Reported by Shing-Shong Shei.
4824 2002-08-25 Jim Meyering <jim@meyering.net>
4826 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
4827 * src/tac.c (main): Likewise.
4828 * src/tail.c (main): Likewise.
4829 * src/tee.c (main): Likewise.
4830 * src/tr.c (main): Likewise.
4831 * src/wc.c (main): Likewise.
4833 2002-08-20 Jim Meyering <jim@meyering.net>
4835 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
4837 2002-08-10 Paul Eggert <eggert@twinsun.com>
4839 * src/nohup.sh: Don't use "exec --"; it's not portable and
4840 shouldn't be needed.
4842 2002-08-09 Jim Meyering <jim@meyering.net>
4844 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
4845 (usage): Clarify help text for the -COLUMN option.
4846 Patch by Padraig Brady.
4847 * tests/pr/Test.pm [col-last]: New test for the above.
4849 * configure.ac: Start with version 4.5.1, chosen so that it's larger
4850 than the latest version numbers of the component packages.
4852 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
4855 2002-08-08 Jim Meyering <jim@meyering.net>
4857 * src/date.c: Guard inclusion of <langinfo.h> with
4858 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
4859 * src/sort.c: Likewise.
4860 Patch by GOTO Masanori.
4862 2002-08-05 Paul Eggert <eggert@twinsun.com>
4864 Fix some minor time-related bugs with POSIX time arguments.
4865 Some valid time stamps were being rejected (notably -1, and
4866 time stamps before 1900 on 64-bit hosts). And some invalid
4867 time stamps were being accepted, e.g. September 31.
4869 * src/date.c (main): Adjust to posixtime signature change.
4870 * src/touch.c (main): Likewise. Remove unnecessary initialization.
4871 Use localtime, not posixtm, to warn about obsolete "touch".
4873 2002-08-05 Jim Meyering <jim@meyering.net>
4875 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
4877 2002-08-04 Jim Meyering <jim@meyering.net>
4879 * src/Makefile.am (check-README): New target/rule.
4880 (check): Depend on it.
4882 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
4884 2002-08-03 Jim Meyering <jim@meyering.net>
4886 * Makefile.am (SUBDIRS): Add old.
4887 * old/: New directory, containing legacy ChangeLog* and NEWS files
4888 from the fileutils, sh-utils, and textutils packages.
4890 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
4892 2002-08-02 Paul Eggert <eggert@twinsun.com>
4894 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
4896 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
4897 (hard_LC_COLLATE): New var.
4898 (different): Args are now char *, not const char *.
4899 Use xmemcoll instead of memcmp to compare lines, so that
4900 LC_COLLATE has effect. However, use memcmp if it is an
4902 (check_file): Do not include newline in comparison, so that
4903 xmemcoll has a byte to stomp on temporarily.
4904 (main): Set hard_LC_COLLATE.
4906 2002-07-29 Jim Meyering <jim@meyering.net>
4908 * Makefile.am (SUBDIRS): Remove djgpp, for now.
4910 2002-07-20 Jim Meyering <jim@meyering.net>
4912 * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
4913 into EXIT_FAILURE. Otherwise, false --help and false --version
4916 2002-07-08 Jim Meyering <jim@meyering.net>
4918 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
4919 rather than the hard-coded `sh-utils'.
4921 2002-07-01 Jim Meyering <jim@meyering.net>
4923 * configure.ac: Merge the three files from fileutils,
4924 textutils, and sh-utils.
4925 * Makefile.am: Likewise.
4926 * src/Makefile.am: Likewise.