1 2004-02-21 Jim Meyering <jim@meyering.net>
3 * src/comm.c (usage): Tell what comm does when there are no options.
4 Reword in terms of FILE1 and FILE2 rather than `left file' and
5 `right file'. Suggestion from Dan Jacobson.
7 2004-02-17 Jim Meyering <jim@meyering.net>
11 `make check' from a build inside a chroot environment would fail
12 * tests/help-version: Specify an argument (`/') for df, in the
13 unusual event that there is no valid entry in /etc/mtab.
14 Likewise for id: add the -u option, so we don't get spurious
15 failures when there are no user or group names.
18 * src/sort.c (usage) [-u]: Add punctuation so that the description in
19 the help2man-generated (line-joined) man page is more readable.
20 Reported by Tim Waugh.
21 [-T]: Add a semicolon, for the same reason.
23 2004-02-15 Jim Meyering <jim@meyering.net>
25 * Makefile.am (dist-hook): Qualify target with $(srcdir)/ prefix.
27 2004-02-11 Jim Meyering <jim@meyering.net>
29 * tests/Makefile.am.in ($(srcdir)/Makefile.am): Use more portable
30 $(srcdir)/../Makefile.am.in, rather than $<.
31 Suggestion from Michael Elizabeth Chastain.
33 2004-02-10 Jim Meyering <jim@meyering.net>
35 * config/install-sh: Make this script executable.
36 * Makefile.am (dist-hook): New target, to ensure that config/install-sh
37 is executable. Otherwise, on systems that lack a suitable install
38 binary, `make install' would fail, because of the way this script
39 is invoked (without `$SHELL ' prefix).
40 Reported by Bob Proulx.
42 2004-02-08 Jim Meyering <jim@meyering.net>
46 * tests/rm/rm5: Avoid triggering a bug in OSF/Tru64's sed
47 that would cause an unwarranted test failure.
48 * tests/rm/rm3: Likewise.
50 2004-02-07 Jim Meyering <jim@meyering.net>
52 Remove xstat function pointer member. The way it was used was not
53 portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
54 inline `stat' and `lstat' functions, thus making the tests of
55 `xstat == lstat' in copy.c always fail.
56 * src/copy.h (struct cp_options) [xstat]: Remove member.
58 * src/copy.c (copy_dir): Set `.dereference' member, not .xstat.
59 (copy_internal): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.
60 Use `x->dereference == DEREF_NEVER' in place of `x->xstat == lstat'.
61 (valid_options): Remove now-obsolete FIXME comments.
63 * src/cp.c (re_protect): Use `XSTAT (x, ...)' in place of
65 (do_copy): Declare/use local xstat rather than x->xstat.
66 (main): Remove code that set x.xstat.
67 * src/mv.c (cp_option_init): Don't initialize xstat member.
68 * src/install.c (cp_option_init): Likewise.
70 * Makefile.cfg (gnu_ftp_host-alpha, etc.): Un-factor .gnu.org suffix,
71 so that emit_upload_commands can use these variables, too.
73 2004-02-06 Jim Meyering <jim@meyering.net>
75 * tests/rm/deep-1: Remove `du' stack space test.
76 Apparently, `ulimit -s N' isn't portable enough.
77 This test will be restored (with a guard against losing ulimit)
78 in its own file later.
80 * tests/rm/deep-1 (deep): Remove progress-style diagnostics,
81 since this test doesn't take long enough to merit them.
82 Run du on $tmp (the containing dir), not $deep, the full path to leaf.
84 * Makefile.maint (signatures): Remove definition.
85 Now, automake's gnupload handles this.
86 (%.sig: %): Remove now-unused rule.
87 (rel-files): Use automake's $(DIST_ARCHIVES), rather than
88 `$(distdir).tar.bz2 $(distdir).tar.gz'.
89 (emit-upload-commands): Adjust to use gnupload.
91 2004-02-05 Jim Meyering <jim@meyering.net>
93 * src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP): Remove definitions.
94 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
95 Now, those are all defined in timespec.h.
98 * src/date.c: Don't include timespec.h, now that system.h does it.
100 2004-02-02 Paul Eggert <eggert@twinsun.com>
102 Don't dump core if localtime returns NULL (possible on
103 hosts with 64-bit time_t and 32-bit int).
104 * src/date.c: Include "inttostr.h".
105 (batch_convert, main):
106 If time conversion fails, exit with nonzero status.
107 (show_date): Return int to report conversion failure.
108 Print the time as an int if localtime fails.
109 * src/uptime.c: Print "??" if the current clock can't
110 be converted by localtime. This won't happen until the year
111 2*31 + 1900, but we don't want to dump core even if the current
112 clock has the wrong value.
114 * src/stat.c: Include "inttostr.h".
115 (human_time): Print the date/time as a number of seconds since the
116 epoch if it can't be converted by localtime. This is better than
117 just saying "invalid", and is consistent with what "ls" does.
118 Don't dump core if the year has more than 48 digits; this isn't
119 possible on any contemporary host, but we might as well do it right.
121 2004-01-31 Paul Eggert <eggert@twinsun.com>
123 * src/stat.c (human_time): Accept time rather than
124 pointer-to-const-time parameter, for clarity. All callers changed.
126 2004-02-02 Jim Meyering <jim@meyering.net>
128 * src/stat.c (do_stat): Remove extra trailing newline from
129 default formats. Reported by Nelson H. F. Beebe.
131 Print actual fractional seconds in time stamps, not just `.00000000'.
132 * src/stat.c (human_time): Add and use new parameter, t_ns.
133 (print_stat): Update callers.
134 * src/ls.c (TIMESPEC_NS): Remove definition.
135 * src/system.h (TIMESPEC_NS): Define here, instead, now that stat.c
136 also uses this macro.
137 Nelson H. F. Beebe noticed that ls --full-time printed nonzero
138 fractional seconds for files on an XFS file system, but that stat's
139 fractional seconds were always zero.
141 2004-01-28 Paul Eggert <eggert@twinsun.com>
143 * src/seq.c (print_numbers): Use 'double' for loop index, not
144 'int', to avoid problems with integer overflow. On almost all
145 machines 'double' works in every case where 'int' works, and
146 it works on other cases besides.
148 2004-01-27 Jim Meyering <jim@meyering.net>
150 * src/seq.c (usage): Mention that if INCREMENT is omitted,
151 it defaults to 1, even when FIRST is larger than LAST.
152 Reword so as not to exclude the possibility that INCREMENT be zero.
154 2004-01-25 Jim Meyering <jim@meyering.net>
158 * Makefile.maint (signatures): Comment out definition.
160 2004-01-23 Jim Meyering <jim@meyering.net>
162 * Makefile.maint (header_regexp): Add exitfail.
164 * man/Makefile.am (EXTRA_DIST): Add help2man.
165 Reported by Nelson H. F. Beebe.
167 * man/Makefile.am (.x.1): Prefix help2man invocation with `$(PERL) --'
168 so it works on systems with Perl installed somewhere other than in
171 * src/paste.c (paste_parallel): Declare local, chr, to be of type
172 `int', not `char', since it must hold EOF. This bug would make
173 paste infloop on some systems. Test failures reported by
174 Nelson H. F. Beebe and Christian Krackowizer.
176 2004-01-22 Jim Meyering <jim@meyering.net>
178 * tests/rmdir/fail-perm: New file. Test for just-fixed rmdir bug.
179 * tests/rmdir/Makefile.am (TESTS): Add fail-perm.
181 * man/help2man: Fix it so using --info-page='coreutils PROG' works.
182 * man/Makefile.am (.x.1): Invoke our own (tweaked) copy of help2man.
183 Use --info-page='coreutils PROG' option.
184 Now, readlink.1 refers the user to `info coreutils readlink'
185 rather than to `info readlink'. Reported by Matt Swift.
187 2004-01-21 Paul Eggert <eggert@twinsun.com>
191 * src/basename.c (usage): Use EXIT_SUCCESS, not 0, for clarity.
192 * src/cat.c, src/chgrp.c, src/chmod.c, src/chown.c, src/chroot.c,
193 * src/cksum.c, src/comm.c, src/cp.c, src/csplit.c, src/cut.c,
194 * src/date.c, src/dd.c, src/df.c, src/dircolors.c, src/dirname.c,
195 * src/du.c, src/echo.c, src/env.c, src/expand.c, src/expr.c,
196 * src/factor.c, src/fmt.c, src/fold.c, src/head.c, src/hostid.c,
197 * src/hostname.c, src/id.c, src/install.c, src/join.c, src/kill.c,
198 * src/link.c, src/ln.c, src/logname.c, src/ls.c, src/md5sum.c,
199 * src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c,
200 * src/nl.c, src/nohup.c, src/od.c, src/paste.c, src/pathchk.c,
201 * src/pinky.c, src/pr.c, src/printenv.c, src/printf.c, src/pwd.c,
202 * src/rm.c, src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c,
203 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c,
204 * src/su.c, src/sum.c, src/sync.c, src/tac.c, src/tail.c, src/tee.c,
205 * src/test.c, src/touch.c, src/tr.c, src/tsort.c, src/tty.c,
206 * src/uname.c, src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c,
207 * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c: Likewise.
209 * src/cat.c (usage): Don't bother normalizing exit status
210 since the arg is already the correct exit status now.
211 * src/cksum.c, src/comm.c, src/csplit.c, src/cut.c,
212 * src/dircolors.c, src/expand.c, src/fmt.c, src/fold.c, src/head.c,
213 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c,
214 * src/pr.c, src/split.c, src/sum.c, src/tac.c, src/tail.c, src/tr.c,
215 * src/tsort.c, unexpand.c, src/src/uniq.c, src/src/wc.c: Likewise.
217 * src/chown.c (main): Removed unused local 'fail'.
219 * src/chroot.c (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE):
222 * src/chroot.c (main): Initialize exit_failure to EXIT_FAIL.
223 * src/env.c, src/nice.c, src/su.c: Likewise.
224 * src/nohup.c (main): Likewise, to NOHUP_FAILURE.
225 * src/setuidgid.c (main): Likewise, to SETUIDGID_FAILURE.
226 * src/expr.c (main): Use initialize_exit_failure rather than
227 setting exit_failure directly; this optimizes away redundant
229 * src/printenv.c, src/sort.c, src/test.c, src/tty.c: Likewise.
231 * src/chroot.c (main): Exit with status 1 rather than 127
232 if chroot itself fails, as per documentation.
234 * src/chroot.c (main): Use EXIT_ENOENT and EXIT_CANNOT_INVOKE
235 rather than roll-your-own symbols or integers.
236 * src/env.c (main): Likewise.
237 * src/nohup.c (main): Likewise.
238 * src/su.c (run_shell): Likewise.
240 * src/cp.c (exit_status): Remove static var....
241 (main): Making it local here instead. Use =, not |=, to set it.
243 * src/cut.c (FATAL_ERROR, main): Exit with status EXIT_FAILURE,
245 * src/date.c (batch_convert, main): Likewise.
246 * src/dd.c (dd_copy): Likewise.
247 * src/pr.c (first_last_page, main, getoptarg): Likewise.
248 * src/tr.c (main): Likewise.
249 * src/date.c (main): Don't assume EXIT_FAILURE == 1, as
250 POSIX doesn't require it.
251 * src/dd.c (write_output, skip, dd_copy): Likewise.
252 * src/df.c (main): Likewise.
253 * src/id.c (main): Likewise.
254 * src/install.c (main): Likewise.
255 * src/ln.c (main): Likewise.
256 * src/ls.c (main): Likewise.
257 * src/mv.c (main): Likewise.
258 * src/shred.c (main): Likewise.
260 * src/env.c (main): Exit with status 1, not 2, on errors detected
262 * src/hostname.c (main): Likewise.
263 * src/nl.c (main): Likewise.
264 * src/stty.c (main): Likewise.
266 * src/expr.c (EXPR_FAILURE): Renamed from EXPR_ERROR, for
267 consistency with the other programs' naming conventions.
270 * src/factor.c (main): Do not report a usage error simply
271 because stdin has bad numbers.
273 * src/id.c (problems): Now a boolean int, not a counter,
274 so that we don't have to worry about int overflow. All uses changed.
275 * src/touch.c (err): Likewise.
277 * src/md5sum.c (main): Use int, not size_t, to store boolean int.
279 * src/mkfifo.c (main): Exit with status 1, not 4, if not implemented.
280 * src/mknod.c: Likewise.
282 * src/nice.c (main): Exit with status EXIT_FAIL, not EXIT_FAILURE,
283 on error; this is in case EXIT_FAILURE is unusual.
284 * src/su.c (main): Likewise.
286 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE): Remove; all uses
287 changed to EXIT_CANNOT_INVOKE.
289 * src/printenv.c (PRINTENV_FAILURE): New constant.
290 (main): Exit with status PRINTENV_FAILURE, not EXIT_FAILURE, on
291 command-line syntax problems.
293 * src/rmdir.c (remove_parents): Don't set 'fail' to a negative number.
294 (main): Avoid integer overflow when seeing whether errors occurred.
296 * src/seq.c (print_numbers): Now returns void, not (zero) int.
298 (main): Remove unused local variable 'errs'. Always exit successfully
301 * src/setuidgid.c (SETUIDGID_FAILURE): Renamed from FAIL_STATUS,
302 for consistency with other programs here. All uses changed.
303 (main): Use 'error' to exit rather than invoking 'exit' here.
305 * src/sort.c: Don't include <assert.h>.
306 (SORT_OUT_OF_ORDER, SORT_FAILURE): Now enums, not macros.
307 (usage): Don't use 'assert'.
308 (main): Remove redundant assignment to exit_failure.
310 * src/system.h (EXIT_FAIL, EXIT_CANNOT_INVOKE, EXIT_ENOENT):
312 (initialize_exit_failure): New inline function.
313 Include exitfail.h here, since we refer to exit_failure.
314 All callers changed to not include exitfail.h.
316 * src/tty.c (TTY_FAILURE, TTY_WRITE_ERROR): New enum values;
317 substitute them for the corresponding integer constants.
319 * tests/help-version (expected_failure_status_date): Remove, as
320 'date' is now normal.
321 (expected_failure_status_nohup): New var.
323 2004-01-21 Jim Meyering <jim@meyering.net>
325 * tests/touch/relative: Remove `command' syntax.
326 Thanks to Nelson H. F. Beebe and Paul Eggert.
328 * tests/touch/relative: Test only year/month/day, not hours/min/sec,
329 so as to avoid problems with systems using TAI clocks.
330 Although it's no longer necessary, set TZ=UTC0 also for the
331 initial touch command. Reported by Paul Jarc here:
332 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/1504
334 2004-01-20 Diego Biurrun <diego@biurrun.de>
336 * src/dircolors.hin: Add .mov to the list of media files.
338 2004-01-19 Paul Eggert <eggert@twinsun.com>
340 * tests/touch/relative: Use TZ=UTC0, not TZ=utc (which isn't
341 portable). Problem reported by Christian Krackowizer. Also, use
342 +0000 rather than +0 to specify a time zone, as the documentation
343 requires four digits.
345 2004-01-19 Jim Meyering <jim@meyering.net>
347 * tests/mv/hard-4: Run envvar-check in case SIMPLE_BACKUP_SUFFIX is set.
348 * tests/mv/backup-is-src: Likewise.
349 Problem reported by Peter Horst
351 2004-01-17 Jim Meyering <jim@meyering.net>
353 * announce-gen (print_changelog_deltas): Use .sig suffix, not .asc.
357 2003-12-15 Paul Eggert <eggert@twinsun.com>
359 * NEWS, doc/coreutils.texi: touch -r and -d can now both be specified,
360 with -r specifying the origin for -d.
361 * src/touch.c (flexible_date): Remove static var.
362 (get_reldate): New function.
363 (main): Use it, to implement this new behavior.
365 2004-01-16 Jim Meyering <jim@meyering.net>
367 * tests/touch/relative: New test for the above.
368 * tests/touch/Makefile.am (TESTS): Add relative.
370 2004-01-13 Jim Meyering <jim@meyering.net>
372 * src/system.h: Include contents of sys2.h.
373 * src/sys2.h: Remove file.
374 * src/Makefile.am (noinst_HEADERS): Remove sys2.h.
376 * Use automake-1.8.2. Regenerate dependent files.
378 * Update to gettext-0.13.1.
379 * configure.ac: Use gettext-0.13.1.
380 * .x-sc_space_tab: Add m4/po.m4 to the list of exceptions.
382 2004-01-12 Jim Meyering <jim@meyering.net>
384 * Makefile.maint (%.sig): Use .sig suffix rather than .asc.
386 * Makefile.maint (po-check): Ensure that cvsu works before using it.
387 Reported by Alexandre Duret-Lutz.
389 * src/tail.c (main): Warn about following stdin only when it's a tty.
391 * configure.ac: Use gl_DEFAULT_POSIX2_VERSION.
393 2004-01-10 Jim Meyering <jim@meyering.net>
395 * tests/misc/stat-fmt: Use backticks, not `$()' notation.
397 2004-01-09 Jim Meyering <jim@meyering.net>
399 * configure.ac: Quote underquoted `jm_DUMMY_1' to avoid new warning.
401 2004-01-08 Jim Meyering <jim@meyering.net>
403 * src/stat.c (human_fstype): Use %lx, not %x format for `unsigned long'.
406 * tests/Makefile.am (TESTS_ENVIRONMENT): Remove `/vg' (prerelease test
407 remnant) from PATH component. That would cause tests in this directory
408 not to run the just-built binaries, but rather whatever happened
409 to be in one's PATH. Reported by Christian Krackowizer.
411 2004-01-04 Jim Meyering <jim@meyering.net>
413 * src/csplit.c (new_control_record): Use x2nrealloc
414 rather than xrealloc.
416 * src/cp.c (re_protect): Use ASSIGN_STRDUPA rather than
418 (make_path_private): Likewise.
420 2004-01-03 Jim Meyering <jim@meyering.net>
422 * src/paste.c: Use `bool' (not int) as the type for a few
424 (collapse_escapes): Rewrite to set globals rather than modifying
426 Use size_t (not int) for all counters and related index variables.
427 (paste_parallel): Remove needless complexity of
428 using xrealloc in the loop; just allocate the buffers up front.
429 Free the two temporary buffers.
430 Move declarations of locals `down' into scope where used.
431 (paste_serial): Remove `register' attributes.
432 (main): Simplify delim-related code.
433 Free `delims', now that it's malloc'd.
435 2004-01-02 Jim Meyering <jim@meyering.net>
437 * src/chroot.c: Include "quote.h".
438 (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): Define.
439 (main): Exit with status of 127, not 1, for too-few-args,
440 chroot failure, or chdir failure.
441 Give a better diagnostic upon execvp failure.
443 * src/du.c (usage): Mention that, with its current meaning,
446 * src/tail.c (main): Warn about following stdin when it's a tty.
447 Fail when following by name but no names are specified.
449 2003-12-30 Jim Meyering <jim@meyering.net>
451 * src/fold.c (main): Use memcpy, not strcpy.
453 * src/copy.c (copy_internal): Use ASSIGN_STRDUPA rather than
456 2003-12-28 Jim Meyering <jim@meyering.net>
458 * src/unexpand.c (n_tabs_allocated): New global.
459 (add_tabstop): Use x2nrealloc rather than xrealloc.
460 * src/expand.c: Likewise.
462 * tests/misc/expand: New file.
463 * tests/misc/Makefile.am (TESTS): Add expand.
465 * src/sort.c (add_temp_dir): Use x2nrealloc rather than xrealloc.
466 (fillbuf): Use x2nrealloc rather than xrealloc.
467 (sort): Use xnmalloc rather than xmalloc.
470 2003-12-27 Jim Meyering <jim@meyering.net>
472 * src/tee.c (tee): Use xnmalloc rather than xmalloc.
474 2003-12-29 Paul Eggert <eggert@twinsun.com>
476 * NEWS: Remove support for join -j1 FIELD, -j2 FIELD, and -o LIST1
477 LIST2 in POSIX 1003.1-2001 hosts, as required by POSIX.
479 * doc/coreutils.texi (join invocation): Remove documentation
480 accordingly. Document that -t makes all separators significant.
482 * src/join.c: Include posixver.h.
483 (obsolete_usage): New var.
484 (longopts): Put obsolete options first.
485 (OBSOLETE_LONG_OPTIONS): New constant.
486 (get_option, add_file_name): New functions.
487 (main): Use them to support new behavior.
488 (usage): Remove documentation for -j1 FIELD and -j2 FIELD.
489 Do not mark -j FIELD as obsolescent; it is longstanding
490 UNIX tradition and is a valid extension to POSIX.
492 * tests/join/Test.pm (tv): Avoid obsolete -o usage.
494 2003-12-28 Paul Eggert <eggert@twinsun.com>
496 * src/join.c (add_field_list): Don't use alloca with unbounded
497 size; just modify the argument, which is no longer const *.
499 Various other minor cleanups, mostly to avoid the need for casts.
501 (extract_field): Renamed from ADD_FIELD, as it's now a function.
503 (struct field.beg): Now char *, not unsigned char const *. All
504 uses changed. It shouldn't be const since xmemcoll writes on its
506 (extract_field): Likewise, for 2nd arg.
507 (keycmp): Remove now-unnecessary cast of xmemcoll args.
509 (is_blank): New function, to avoid need to cast arg to unsigned char.
510 (extract_field): Use it.
512 (xfields): Rewrite pretty much from scratch.
514 (hard_LC_COLLATE): Now bool, not int.
515 (get_line, getseq, add_field_list): Now returns bool, not int.
516 (decode_field_spec, add_field_list): Return true on success (not
517 false), for consistency with the rest of the code. All uses changed.
519 (tab): Now char, not unsigned char. This wasn't 100% necessary
520 but is slightly cleaner.
521 (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler.
523 (empty_filler): Now const *.
525 (make_blank): Remove; wasn't needed. Remove all calls.
526 (main): Don't set uni_blank.nfields; zero is fine.
528 2003-12-27 Jim Meyering <jim@meyering.net>
530 * src/join.c: Include "quote.h".
531 (min, max): Remove definitions.
532 Make a few function parameters and corresponding
533 locals `const'. Use bool for boolean variables.
534 Use size_t (not int) for all counters and related index variables.
535 (prjoin): Remove now-useless assertion.
536 (string_to_join_field): New function.
537 (main): Accept join fields as large as SIZE_MAX.
538 (keycmp): Rename `min' to MIN and max to MAX.
540 2003-12-26 Jim Meyering <jim@meyering.net>
542 fold -s didn't work on e.g., alpha-based systems.
543 * src/fold.c (fold_file): Adjust types (int->size_t) so that using
544 x2nrealloc works properly on systems with differing sizes for int
545 and size_t. Reported by Nelson Beebe.
547 * src/fold.c: Use `bool' (not int) as the type for a few
550 2003-12-23 Paul Eggert <eggert@twinsun.com>
552 * src/ls.c (length_of_file_names_and_frills):
553 Remove forward decl; not needed.
554 (print_file_name_and_frills, length_of_file_name_and_frills):
555 With -m, don't output spaces before inum or size.
556 (print_with_commas): Don't output space just before newline.
558 2003-12-24 Jim Meyering <jim@meyering.net>
560 * tests/ls/Makefile.am (TESTS): Add m-option.
561 * tests/ls/m-option: New file. Test for above fixes.
563 2003-12-20 Jim Meyering <jim@meyering.net>
567 * src/pr.c: Change type of global, buff_allocated, to size_t.
569 * src/join.c [struct seq]: Change types of members count and alloc
570 from `int' to `size_t'.
572 * tests/Makefile.am (root-hint): Tweak wording.
574 * src/du.c: Accept new option (-0, --null) that makes it so each
575 output line is NUL-terminated rather than newline-terminated.
577 * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync.
578 Reported by Volker Paul.
579 * tests/dd/Makefile.am (TESTS): Add unblock-sync.
580 * tests/dd/unblock-sync: New test for the above.
582 2003-12-19 Jim Meyering <jim@meyering.net>
584 * tests/misc/nohup: Double quote back-ticked expression,
585 in case it ends up having an unexpected value.
587 * tests/ls/no-arg: Use ls's -1 option in both runs.
589 * src/du.c (fts_debug): New global.
590 (FTS_CROSS_CHECK, DEBUG_OPT): Define.
591 (main): Make fts use FTS_TIGHT_CYCLE_CHECK.
592 (main) [DU_DEBUG]: Accept -d option.
594 2003-12-18 Jim Meyering <jim@meyering.net>
596 * src/ls.c (format_user): Increment dired_pos via two statements,
597 `dired_pos += width; dired_pos++;' rather than one,
598 `dired_pos += width + 1;' since the latter could conceivably overflow.
599 (format_group): Likewise.
602 * configure.ac: Require automake-1.8.
604 2003-12-12 Jim Meyering <jim@meyering.net>
606 * Use automake-1.8. Regenerate dependent files.
608 2003-12-08 Jim Meyering <jim@meyering.net>
610 * Makefile.maint (news-date-check): New rule.
611 (alpha beta major): Depend on it.
613 2003-12-03 Paul Eggert <eggert@twinsun.com>
615 * NEWS: ls -l (and similar options) now adjust all columns to
616 fit the data. Generalized from a suggestion by Leah Q for file sizes.
617 * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
618 (format_user_width, format_group_width, unsigned_file_size,
619 format_group): New functions.
620 (block_size_width): Renamed from block_size_size.
621 (inode_number_width, nlink_width, owner_width, group_width,
622 author_width, major_device_number_width, minor_device_number_width,
623 file_size_width): New vars.
624 (clear_files): Initialize them.
625 (gobble_file): Set them. Don't ceiling block_size_width to 7.
626 (print_long_file): Use them.
627 (gobble_file): Use a new local variable 'f' to make the code
628 smaller and more consistent with other functions.
629 (format_user): Output to stdout, not to a buffer, so that we
630 don't have to worry about buffer overrun. Update dired_pos.
631 (print_long_file): Don't put owner, group, author into buffer;
632 just print them directly. Don't assume link counts and
633 major and minor numbers fit into unsigned long int.
634 * tests/cp/same-file, tests/mv/part-symlink: Don't assume that
635 'ls' output is fixed-width.
637 2003-12-02 Jim Meyering <jim@meyering.net>
639 * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h.
641 2003-11-27 Jim Meyering <jim@meyering.net>
643 * Use automake-1.7f. Regenerate dependent files.
645 2003-11-24 Paul Eggert <eggert@twinsun.com>
647 Parse floating-point operands and options in the C locale.
648 POSIX requires this for printf, and we might as well be
649 consistent elsewhere (tail, sleep, seq).
651 * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer
652 needed now that we assume C89. Include "c-strtod.h".
653 (xstrtod): Call c_strtod, not strtod.
654 * src/sleep.c: Include "c-strtod.h".
655 (main): Update xstrtod call to include new argument, c_strtod.
656 * src/seq.c (scan_double_arg): Likewise.
657 * src/tail.c (parse_options): Likewise.
659 2003-11-24 Jim Meyering <jim@meyering.net>
661 * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM).
662 Reported by Mark Conty.
664 2003-11-22 Jim Meyering <jim@meyering.net>
666 * Makefile.maint (sc_xalloc_h_in_src): Remove rule. Subsumed by...
667 (sc_system_h_headers): Do this test only if sys2.h exists.
669 2003-11-20 Jim Meyering <jim@meyering.net>
671 * tests/help-version: Ensure that the bug-reporting address is
672 included in the --help output for every program.
673 * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.
675 * src/ptx.c (usage): Output bug-reporting address.
676 Reported by Dan Jacobson.
678 2003-11-19 Jim Meyering <jim@meyering.net>
680 * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted
681 on the join fields. Suggestion from Bruce Robertson.
683 2003-11-18 Jim Meyering <jim@meyering.net>
685 `od -c -w9999999' could segfault
686 * src/od.c (dump): Use xnmalloc/free, not alloca.
688 2003-11-16 Jim Meyering <jim@meyering.net>
690 * Use autoconf-2.59. Regenerate dependent files.
692 * tests/du/hard-link: Minor tweak: use mkdir -p.
694 Fix read-from-free'd-buffer error detected by valgrind.
695 * src/csplit.c (remove_line): Don't return a pointer to data in
696 a freed buffer. Instead, arrange to free the buffer on the
699 * tests/misc/csplit: New test for above fix.
701 2003-11-11 Jim Meyering <jim@meyering.net>
703 * src/ls.c (extract_dirs_from_files): Avoid useless copy operations.
704 This avoids a warning from valgrind about memcpy with overlapping
705 source and destination.
707 * configure.ac: Require automake-1.7.8.
709 2003-11-09 Jim Meyering <jim@meyering.net>
711 * Use automake-1.7.9. Regenerate dependent files.
713 * src/rm.c: Support new options: --preserve-root and --no-preserve-root.
714 * src/chown.c: Likewise.
716 * src/chown-core.c: Include "root-dev-ino.h".
717 (chopt_init): Initialize new member.
718 (change_file_owner): Support rm's new --preserve-root option.
720 * src/remove.c: Include "root-dev-ino.h".
721 (remove_cwd_entries): Remove now-obsolete FIXME comment.
722 (remove_dir): Support rm's new --preserve-root option.
724 * src/chown.c: Include "root-dev-ino.h".
725 Add new options: --preserve-root and --no-preserve-root.
727 * src/chmod.c: Include "root-dev-ino.h".
728 (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
729 ROOT_DEV_INO_WARN macros.
730 (get_root_dev_ino): Remove function definition, now that it's
731 been moved to a separate file.
732 (usage): Describe new options.
734 * src/mv.c (rm_option_init): Initialized new member.
736 * src/remove.h: Include "dev-ino.h".
737 (struct rm_options): Add new member: root_dev_ino.
738 * src/chown-core.h: Include "dev-ino.h".
739 (struct Chown_option): Add new member: root_dev_ino.
741 2003-11-06 Jim Meyering <jim@meyering.net>
743 * src/paste.c (paste_parallel): Use `sizeof *var' rather than
744 hard-coding `sizeof FILE*'.
746 2003-11-05 Dennis Smit <ds@nerds-incorporated.org>
748 * src/wc.c (main): Free `fstatus' so there is no confusion about
749 whether it's leaked or not.
750 * src/who.c (who): Likewise for `utmp_buf'.
752 2003-11-05 Paul Eggert <eggert@twinsun.com>
754 Fix 'cut' problems with size_t overflow and unsigned int.
755 More generally, resize integer variables to fit use more precisely.
756 * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens.
757 (struct range_pair): Make members to be of type size_t, not unsigned.
758 (max_range_endpoint, eol_range_start): Now size_t, not unsigned.
759 (suppress_non_delimited, output_delimiter_specified,
760 have_read_stdin, print_kth, set_fields): Now bool, nt int.
761 (delim): Now unsigned char, not int.
762 (mark_printable_field, is_printable_field, is_range_start_index,
763 set_fields, set_fields, cut_bytes, cut_fields):
764 Use size_t, not unsigned, for field and byte counts.
765 (hash_int): Use uintptr_t, not unsigned, for pointers converted
766 to integers. This squeezes more info out of them.
767 (set_fields, cut_bytes, cut_fields, main):
768 Use bool, not int, for booleans.
769 (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc.
771 2003-11-05 Paul Eggert <eggert@twinsun.com>
773 * man/Makefile.am (check-programs-vs-x):
774 Work even if $(programs) contains '$'.
775 Work even if 'missing=1' in environment.
776 Don't report an error simply because $(programs) outputs nothing.
778 2003-11-05 Jim Meyering <jim@meyering.net>
780 * Use autoconf-2.58. Regenerate dependent files.
782 * src/tr.c (spec_init): Fix typo in last change.
784 * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in
785 call to variadic version_etc function, so that it works even on systems
786 for which sizeof char* != sizeof int.
787 * src/true.c (main): Likewise.
788 * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c:
789 * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c:
790 * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c:
791 * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c:
792 Similarly, cast NULL to `(char *)' in call to variadic function,
793 parse_long_options, so that it works even on systems for which
794 sizeof char* != sizeof int.
795 A similar problem was reported by Harti Brandt in
796 http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html.
798 * src/users.c (users): Free `utmp_buf' explicitly so that people
799 don't mistake this for a real leak.
800 Patch by Dennis Smit <ds@nerds-incorporated.org.
802 2003-11-04 Paul Eggert <eggert@twinsun.com>
804 * README: Document _POSIX2_VERSION.
806 2003-11-04 Jim Meyering <jim@meyering.net>
808 * src/tac.c (memrchr): Remove #if-0'd function.
809 (tac_stdin_to_mem): Clean up #if-0'd code.
811 * src/od.c (decode_format_string): Remove unnecessary casts.
812 Use more maintainable `sizeof *var'.
813 (main): Call decode_format_string rather than decode_one_format,
814 now that `spec' may be NULL.
816 * src/chmod.c (AUTHORS): Add my name.
818 * src/split.c (next_file_name): Use `sizeof *var' rather than
819 hard-coding `sizeof size_t'.
821 * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...).
823 * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc,
824 to avoid potential overflow in pointer arithmetic.
825 (set_fields): Use not `1', but rather `sizeof *printable_field' as
826 second argument to xcalloc.
827 * src/od.c (decode_format_string, dump_strings): Use x2nrealloc
828 rather than xrealloc.
829 * src/date.c (show_date): Likewise.
830 * src/join.c (ADD_FIELD, initseq, getseq): Likewise.
831 * src/pr.c (store_char): Likewise.
832 * src/fold.c (fold_file): Likewise.
834 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
835 type changes (unsigned int -> size_t) in hash.c.
836 * src/cp-hash.c (src_to_dest_hash): Likewise.
837 * src/du.c (entry_hash): Likewise.
838 * src/ls.c (dev_ino_hash): Likewise.
839 * src/cut.c (hash_int): Likewise. Declare function as static.
841 2003-11-03 Jim Meyering <jim@meyering.net>
843 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
844 * tests/misc/fold: Fail the test immediately if we're not running
845 the expected version of fold.
847 2003-11-02 Jim Meyering <jim@meyering.net>
849 * src/tr.c (append_normal_char, append_range, append_char_class)
850 (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var'
851 rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable
853 * src/copy.c (copy_internal): Likewise.
854 * src/join.c (initseq, add_field, make_blank): Likewise.
855 * src/od.c (main): Likewise.
856 * src/cp.c (make_path_private): Likewise.
857 * src/tsort.c (new_item, record_relation): Likewise.
859 * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise.
860 (main): Also remove anachronistic cast of xmalloc return value.
861 * src/ptx.c (alloc_and_compile_regex, main): Likewise.
862 (main): Also remove anachronistic cast of xmalloc return value.
863 * src/sort.c (inittables): Likewise.
864 (sort): Also Split a long line.
866 2003-10-25 Jim Meyering <jim@meyering.net>
868 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
869 type changes (unsigned int -> size_t) in hash.c.
870 * src/cp-hash.c (src_to_dest_hash): Likewise.
871 * src/du.c (entry_hash): Likewise.
872 * src/ls.c (dev_ino_hash): Likewise.
873 * src/cut.c (hash_int): Likewise. Declare function as static.
875 2003-10-21 Jim Meyering <jim@meyering.net>
877 Don't fail when run with VERBOSE=yes.
878 * tests/chgrp/basic: Do `set +x' before starting the subshell
879 from which we invoke chgrp. Otherwise, the output from the
880 VERBOSE=yes-induced `set -x' would result in spurious differences.
881 Reported by Russel Coker via Michael Stone.
883 2003-10-19 Jim Meyering <jim@meyering.net>
885 chmod now uses fts to perform a directory traversal when -R is
886 specified. Before, it operated on full path names, and as such
887 would encounter the PATH_MAX (often 4096) limit.
889 * src/chmod.c: Include "xfts.h".
890 (process_file): Rename from change_file_mode.
891 Adapt to be used with fts.
892 (process_files): New function.
894 2003-10-18 Jim Meyering <jim@meyering.net>
896 * tests/du/deref-args: Ensure that du -D now dereferences all
897 symlinks specified on the command line, not just those that
898 reference directories.
900 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
901 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
902 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
903 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
904 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
905 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
906 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
907 * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
908 of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
909 Update the call to parse_long_options so that `AUTHORS, NULL' are the
911 * src/true.c (main): Append NULL to version_etc argument list.
912 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
914 2003-10-17 Andreas Schwab <schwab@suse.de>
916 * tests/mk-script: Get $srcdir from first parameter instead of
918 (main): Update usage.
920 * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as
921 first argument of mk-script.
922 ($(srcdir)/Makefile.am): Likewise. Prepend $(srcdir) to target.
924 2003-10-17 Jim Meyering <jim@meyering.net>
926 * src/mv.c (usage): Tweak descriptions of -i and -f so that the
927 generated `man' page is more readable. Suggestion from Dan Jacobson.
929 * src/chown-core.c (change_file_owner): Handle the cases in
930 which fts_info indicates an error with the given entry.
932 * src/du.c (main): Simply assign to bit_flags.
933 Don't bother with bit arithmetic.
935 * tests/chmod/no-x: New file.
936 * tests/chgrp/no-x: New file.
937 * tests/chmod/Makefile.am (TESTS): Add no-x.
938 * tests/chgrp/Makefile.am (TESTS): Likewise.
940 * src/du.c: Include "xfts.h".
941 (du_files): Use xfts_open, rather than fts_open.
942 * src/chown-core.c (chown_files): Likewise.
944 2003-10-16 Jim Meyering <jim@meyering.net>
946 * src/chgrp.c (main): Simply assign to bit_flags.
947 Don't bother with bit arithmetic.
948 * src/chown.c (main): Likewise.
949 Rename a couple of local variables.
950 Remove unnecessary casts.
952 * src/tail.c (start_bytes): Rename local, remainder, to avoid
953 gcc's warning about shadowing a global.
955 2003-10-15 Jim Meyering <jim@meyering.net>
957 chown and chgrp now accept POSIX-mandated -H, -L, -P options and
958 use fts to perform a directory traversal when -R is specified.
959 Before, they operated on full path names, and as such would
960 encounter the PATH_MAX (often 4096) limit.
961 They are more efficient. For example, before, chgrp -R would
962 take almost 5 seconds to change about 2000 directories and fail
963 (with `File name too long'), while now it succeeds on a hierarchy
964 of depth 20,000 in 1/10 the time.
966 * src/chown.c: Include "userspec.h" and "fts_.h".
967 (WRITTEN_BY): Add my name.
968 (getpwnam, getgrnam, getgrgid): Remove declarations.
969 (endpwent): Remove definition.
971 (main): Handle new options.
972 Call new function, chown_files rather than change_file_owner.
974 * src/chgrp.c: Include "fts_.h".
975 (WRITTEN_BY): Add my name.
976 (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of
979 (main): Handle new options.
980 Call new function, chown_files rather than change_file_owner.
982 Rewrite to iterate through hierarchies using fts rather than
983 via explicit recursion.
984 * src/chown-core.c: Include "fts_.h"
985 (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
986 on a single file at a time.
987 (chown_files): New function.
988 * src/chown-core.h [enum Dereference_symlink]: Remove declaration.
989 [struct Chown_option] (recurse, force_silent): Change type to `bool'.
990 [struct Chown_option] (dereference): Remove member with ambiguous name.
991 [struct Chown_option] (affect_symlink_referent): New member.
992 (chown_files): New prototype.
994 * tests/chgrp/recurse: Update tests accordingly.
995 * tests/chgrp/posix-H: New tests for the above.
996 * tests/chgrp/Makefile.am (TESTS): Add posix-H.
998 * src/ln.c (usage): Clarify that --directory, -d, -F probably won't
999 work even for superuser. Suggestion from Dan Jacobson.
1001 2003-10-14 Paul Eggert <eggert@twinsun.com>
1003 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
1005 * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h,
1006 lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib.
1007 * src/sort.c (parse_field_count): Handle the case where overflow
1008 and invalid suffix char are both reported.
1010 2003-10-14 Jim Meyering <jim@meyering.net>
1012 * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the
1013 warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
1016 2003-10-13 Paul Eggert <eggert@twinsun.com>
1018 Fix to avoid a denial-of-service attack if the display width is
1019 enormous. Also, clean up the code a bit by removing duplicate code.
1021 * src/ls.c (init_column_info): Remove forward decl; no longer needed.
1022 (calculate_columns): New function, that contains code that used
1023 to be common to print_many_per_line and print_horizontal.
1024 (print_many_per_line, print_horizontal): Use it.
1025 (decode_switches): Set max_idx here, not in calculate_columns.
1026 (print_current_files): Don't call init_column_info; calculate_columns
1028 (init_column_info): Don't allocate a lot more space than is needed
1029 to represent the current set of files. Allocate all the new
1030 size_t cells in one call to xnmalloc, rather than a row at a time.
1032 2003-10-13 Jim Meyering <jim@meyering.net>
1034 * src/ls.c (init_column_info): Add another FIXME comment.
1036 2003-10-13 Paul Eggert <eggert@twinsun.com>
1038 Fix address-arithmetic bug in 'ls', reported by Georgi Guninski.
1039 Remove several arbitrary limits on hosts where int cannot represent
1042 * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent,
1043 nfiles, files_index, tabsize, line_length, struct column_info.line_len,
1044 struct column_info.col_arr[0], max_idx):
1045 Now size_t, not int.
1046 (get_funky_string): Return bool indicating success, instead of
1047 a negative count to indicate failure. Store number of columns
1048 through new parameter OUTPUT_COUNT; that way, they can never
1049 go negative. Change equals_end from int to bool. All uses
1051 (struct column_info.valid_len): Now bool, not int. All uses changed.
1052 (dired_dump_obstack, get_funky_string, clear_files,
1053 extract_dirs_from_files, print_current_files,
1054 print_many_per_line, print_horizontal, init_column_info,
1055 put_indicator, length_of_file_name_and_frills,
1056 print_with_commas): Use size_t, not int, for local variables
1058 (decode_switches): Decode sizes using xstrtoul, not xstrtol.
1059 Check for TIOCGWINSZ returing negative values (or values greater
1061 (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
1063 Use xmalloc and xnmalloc, not XMALLOC.
1064 (gobble_file): Use xnrealloc, not XREALLOC.
1065 (print_color_indicator): Remove now-unnecessary cast to size_t.
1067 2003-10-12 Paul Eggert <eggert@twinsun.com>
1069 * tests/du/no-x: Change wording of diagnostic to match latest du.c.
1070 * tests/sort/sort-tests: Remove from CVS; assume that people
1071 brave enough to check coreutils out from CVS can rebuild it.
1073 2003-10-12 Jim Meyering <jim@meyering.net>
1075 New options: --preserve-root and --no-preserve-root.
1076 * src/chmod.c (change_file_mode): Honor new option.
1077 (change_file_mode): Strip trailing slashes on directory
1078 argument passed to change_dir_mode.
1079 (get_root_dev_ino): New function.
1080 (main): Initialize global, root_dev_ino.
1082 * src/copy.c (copy_internal): Don't #ifdef-out simple uses of
1083 S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined
1085 * src/chmod.c (change_file_mode): Likewise.
1087 2003-10-08 Jim Meyering <jim@meyering.net>
1089 * src/csplit.c (main): Remove obsolete FIXME.
1091 2003-10-07 Jim Meyering <jim@meyering.net>
1093 * Use automake-1.7.8. Regenerate dependent files.
1095 2003-09-29 Paul Eggert <eggert@twinsun.com>
1099 * doc/coreutils.texi (csplit invocation):
1100 The regexp offset need not have a sign; POSIX requires support
1101 for signless offets.
1103 Be more careful about int widths. For example, remove some
1104 arbitrary limits by replacing 'unsigned' with 'size_t',
1105 'uintmax_t', etc. Use standard bool rather than a homegrown type.
1106 * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
1107 * src/csplit.c (FALSE, TRUE, boolean): Remove. All uses changed
1108 to <stdbool.h> usage.
1109 (struct control): offset is now intmax_t, not int.
1110 repeat_forever is now bool, not int.
1111 (struct cstring): len is now size_t, not unsigned int.
1112 (struct buffer_record): bytes_alloc, bytes_used, num_lines are now
1113 size_t, not unsigned. start_line, first_available are now
1114 uintmax_t, not unsigned.
1115 (hold_count, control_used): Now size_t, not unsigned.
1116 (last_line_number, current_line, bytes_written):
1117 Now uintmax_t, not unsigned.
1118 (save_to_hold_area, red_input, keep_new_line, record_line_starts,
1119 create_new_buffer, get_new_buffer, load_buffer, find_line,
1120 process_regexp, split_file, new_control_record, extract_regexp,
1121 get_format_width, get_format_prec, max_out):
1122 size args, locals, and returned values are now size_t, not unsigned
1124 (get_first_line_in_buffer, find_line, write_to_file,
1125 handle_line_error, process_line_count, regexp_error, process_regexp,
1127 File line, byte, and repetition counts are now uintmax_t, not unsigned.
1128 (check_for_offset): Don't require a sign before the offset.
1129 Use xstrtoimax to do the real work.
1130 (extract_regexp): Remove harmful cast of size to unsigned.
1131 256 -> 1<<CHAR_BIT, for clarity.
1132 (get_format_flags): Return at most 3, to avoid worries about overflow.
1134 (bytes_to_octal_digits): Remove.
1136 (cleanup): Don't check whether output_stream is NULL, since
1137 close_output_file does that for us.
1139 (new_line_control, create_new_buffer): Use "foo *p = xmalloc
1140 (sizeof *p);" instead of the more long-winded alternatives.
1142 (get_new_buffer): Use O(1) algorithm for resizing a buffer
1143 to a much larger size, instead of an O(N) algorithm.
1145 (process_regexp): Use plain NULL rather than casted 0.
1147 (make_filename): Use %u, not %d, to format unsigned file number.
1149 (new_control_record): Use xrealloc exclusively, since it handles
1152 (extract_regexp): Change misspelled word in diagnostic.
1154 (get_format_width): Even if a minimum field width is specified,
1155 allow room for enough octal digits to represent the value of
1156 the maximum representible integer. This fixes a potential
1157 buffer overrun. Calculate this room at compile-time, not
1158 at run-time; this removes the need for bytes_to_octal_digits.
1159 Check for overflow; this removes a FIXME.
1161 (get_format_prec): Don't allow precision to be signed; it's
1162 not ANSI. Check for overflow. Remove hardcoded "11" as
1163 default precision; this fixes a potential buffer overrun
1164 on hosts with wider size_t.
1166 (get_format_conv_type): Change local variable to be of type
1167 unsigned char, not int; this removes a potential subscript
1168 violation on hosts where char is signed.
1170 (max_out): Replace "for (;*p;)" with more-standard "while (*p)".
1171 Allow "%%" in format. Don't overflow when
1172 counting lots of percents.
1174 (usage): Default sprintf format is %02u, not %d.
1176 2003-10-05 Jim Meyering <jim@meyering.net>
1178 * src/chown-core.c (change_file_owner): Remove set-but-not-used local.
1180 * src/du.c (du_files): Mark diagnostic for translation.
1182 2003-10-04 Jim Meyering <jim@meyering.net>
1184 * src/du.c (du_files): Ignore any failure of fts_close.
1185 Give better diagnostics for failed fts_open.
1187 * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition.
1189 Deprecate existing use of -H (aka --si).
1190 * src/du.c (enum) [HUMAN_SI_OPTION]: New member.
1191 [long_options]: Use HUMAN_SI_OPTION, not 'H'.
1192 (main): Warn that the meaning of -H will soon change to be
1195 2003-10-03 Jim Meyering <jim@meyering.net>
1197 * src/du.c: Accept --no-dereference (-P).
1199 2003-10-02 Jim Meyering <jim@meyering.net>
1201 * tests/du/trailing-slash: Adjust for slightly different output.
1203 Rewrite du.c to use fts.
1204 * src/du.c: Include "fts_.h", not ftw.h.
1205 (opt_dereference_arguments, arg_length, suffix_length): Remove globals.
1206 (IS_FTW_DIR_TYPE): Remove definition.
1207 (IS_DIR_TYPE): Define.
1208 (is_symlink_to_dir): Remove now-unnecessary function.
1209 (process_file, du_files): Rewrite to use fts.
1211 * tests/du/inaccessible-cwd: Ensure that even when run from an
1212 inaccessible directory, du can still operate on accessible
1213 directories elsewhere.
1214 * tests/du/Makefile.am (TESTS): Add inaccessible-cwd.
1216 * tests/rm/deep-1: Ensure that du can process a hierarchy
1217 of depth 400 while using no more than 50KB of stack space.
1219 2003-10-01 Akim Demaille <akim@epita.fr>
1221 * announce-gen (print_news_deltas): New function, extracted from main.
1222 (main): Make `news_file' an array.
1223 Use '...=s' => \@var for --news and --url-directory specs.
1224 Before there were a couple of portability problems.
1226 2003-09-28 Jim Meyering <jim@meyering.net>
1228 * Makefile.maint (sc_cast_of_alloca_return_value): New rule.
1229 (syntax-check-rules): Add it.
1231 * src/copy.c: Remove unnecessary cast of alloca, since now it's
1232 guaranteed to be (void *).
1233 * src/cp.c: Likewise.
1234 * src/join.c: Likewise.
1235 * src/ln.c: Likewise.
1236 * src/ls.c: Likewise.
1237 * src/od.c: Likewise.
1238 * src/sys2.h (ASSIGN_STRDUPA): Likewise.
1240 2003-09-27 Jim Meyering <jim@meyering.net>
1242 Don't exhaust virtual memory when processing large inputs.
1243 Fix this by removing csplit's internal free-list management;
1244 instead rely on malloc for that.
1246 * src/csplit.c (free_list): Remove global.
1247 (clear_all_line_control): Remove function.
1248 (get_new_buffer): Always use create_new_buffer to obtain a
1249 new buffer, rather than searching free_list.
1250 (free_buffer): Just call free.
1251 Reported by Nikola Milutinovic.
1253 2003-09-26 Jim Meyering <jim@meyering.net>
1255 * man/rm.x: Also list `chattr' in SEE ALSO section.
1256 Suggestion from Mark Hubbart.
1258 2003-09-25 Jim Meyering <jim@meyering.net>
1260 * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now
1261 that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them.
1263 * Use autoconf-2.57d. Regenerate dependent files.
1265 2003-09-24 Jim Meyering <jim@meyering.net>
1267 Minor efficiency tweak.
1268 * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
1269 (do_link): Likewise.
1271 2003-09-23 Jim Meyering <jim@meyering.net>
1273 * src/paste.c (paste_serial): Save errno after input error,
1274 to report proper errno value.
1275 Based on a patch from Paul Eggert.
1277 * src/tee.c (tee): Adjust fwrite arguments so that the return
1278 value is the number of bytes written.
1280 2003-09-16 Paul Eggert <eggert@twinsun.com>
1282 Don't assume ferror sets errno. Bug reported by Bruno Haible.
1284 * src/comm.c (compare_files): Save errno after input error,
1285 to report proper errno value.
1286 * src/fold.c (fold_file): Likewise.
1287 * src/od.c (check_and_close, skip, read_char, read_block): Likewise.
1288 * src/unexpand.c (unexpand): Likewise.
1290 * src/csplit.c (close_output_file): Don't report bogus errno value
1291 after ferror discovers an output error. We don't know the proper
1292 errno value, since it might have been caused by any of a whole
1293 bunch of calls, and it might have been trashed in the meantime.
1294 Fixing this problem will require much more extensive changes;
1295 in the meantime just say "write error".
1296 * src/od.c (check_and_close, dump, dump_strings): Likewise.
1297 * src/uniq.c (check_file): Likewise.
1299 * src/join.c (get_line): Report error right away if I/O fails,
1300 so that the proper errno value is used.
1301 * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise.
1302 * src/tee.c (tee): Likewise.
1303 * src/uniq.c (check_file): Likewise.
1305 * src/od.c (skip): If a read fails, don't retry it later, so
1306 that we report the proper errno.
1308 * src/tac.c (tac_mem): Don't return a value; nobody uses it.
1310 * src/tee.c (tee): Once a write failure has occurred, don't bother
1311 writing anything more to that stream.
1313 * src/uniq.c (check_file): Check for ferror (stdout) even if
1316 * src/yes.c (UNROLL): Remove.
1317 (main): Exit immediately when write failure is detected.
1318 Simplify code by assigning to argv when argc == 1.
1320 2003-09-21 Paul Eggert <eggert@twinsun.com>
1322 * src/ptx.c: Switch encoding from Latin-1 to UTF-8.
1323 (WRITTEN_BY): Change "Franc,ois" (actually using
1324 c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
1327 2003-09-19 Jim Meyering <jim@meyering.net>
1329 `du -D symlink-to-dir' would mistakenly omit the slash in
1330 lines like this: 24 symlink-to-dir/subdir
1331 * src/du.c (process_file): Fix offset calculation.
1332 Reported by Jeff Sheinberg as Debian bug #211591;
1333 http://bugs.debian.org/205251
1335 * tests/du/deref-args: New file/test for the above.
1336 * tests/du/Makefile.am (TESTS): Add deref-args.
1338 * src/du.c (process_file): Remove useless disjunct.
1340 * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
1342 * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
1343 Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
1344 Mark each WRITTEN_BY string as translatable.
1346 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1347 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1348 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1349 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1350 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1351 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1352 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1353 * who.c, whoami.c, yes.c: Revert yesterday's changes.
1354 Instead, a subsequent change will embed `Written by ' in
1355 each string along with the author names.
1357 * src/true.c: Revert yesterday's changes.
1358 * src/sys2.h: Likewise.
1360 2003-09-18 Jim Meyering <jim@meyering.net>
1362 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1363 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1364 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1365 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1366 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1367 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1368 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1369 * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
1370 comma-separated list of strings and/or update the call to
1371 parse_long_options so that `AUTHORS, NULL' are the last parameters.
1372 * src/true.c (main): Append NULL to version_etc argument list.
1373 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
1375 * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
1376 shadowing the math function name. Also rename loga to log_a.
1378 2003-09-14 Jim Meyering <jim@meyering.net>
1380 * src/factor.c (print_factors): Give a separate diagnostic
1381 for numbers that are too large, but otherwise valid.
1382 Reported by Dániel Varga.
1384 2003-09-10 Jim Meyering <jim@meyering.net>
1386 * Use automake-1.7.7. Regenerate dependent files.
1388 * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
1389 of `fmt -1'. Using the just-built tr is a little cleaner.
1390 Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
1391 * man/Makefile.am (programs, check-x-vs-1): Likewise.
1393 2003-09-09 Jim Meyering <jim@meyering.net>
1395 * src/copy.c: Alphabetize includes.
1396 Remove duplicate inclusion of "same.h".
1398 2003-09-08 Jim Meyering <jim@meyering.net>
1400 * Makefile.maint (GZIP_ENV): Remove --rsyncable.
1401 Didn't give enough of a benefit, mainly because it's not yet
1406 * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
1407 (check-programs-vs-x): Fail if $(programs) is empty.
1409 * src/remove.c: Add a comment.
1411 2003-09-07 Jim Meyering <jim@meyering.net>
1413 * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
1414 Don't define. These symbols are no longer used.
1416 * tests/misc/tty-eof: Write ^D as \cD.
1417 Complete the change of 2003-08-02.
1419 * Makefile.maint (po-check): Use cvsu, so that a temporary source
1420 file in lib/ or src/ doesn't induce an unwarranted failure.
1421 Add a kludge to filter out the sole generated source file that
1422 also has translatable messages: src/false.c.
1424 2003-09-06 Jim Meyering <jim@meyering.net>
1426 * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
1427 (parse_options): Give a diagnostic for (but still accept) the
1428 deprecated --allow-missing option.
1430 2003-09-04 Paul Eggert <eggert@twinsun.com>
1432 Don't ignore -S if input is a pipe. Bug report by Michael McFarland in
1433 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
1435 * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the
1436 size_bound ourselves. if an input file is a pipe and the user
1437 specified a size, use that size instead of trying to guess the
1438 pipe size. This has the beneficial side effect of avoiding the
1439 overhead of default_sort_size in that case. All callers changed.
1440 (sort): Remove static var size; now done by sort_buffer_size.
1442 2003-09-05 Jim Meyering <jim@meyering.net>
1444 * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files.
1446 * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
1447 to start, rather than just .1. Upon failure, print unexpected state.
1449 2003-09-04 Paul Eggert <eggert@twinsun.com>
1451 * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
1452 SAFE_READ_ERROR to tmp->nbytes.
1453 * src/tail.c (pipe_lines, pipe_bytes): Likewise.
1455 * src/head.c (struct linebuffer): Change nbytes and nlines
1456 from unsigned int to size_t. unsigned int is safe (after the
1457 2003-09-03 patch) but size_t is cleaner.
1458 * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
1459 (pipe_bytes): Likewise for local variable 'i', which was 'int'.
1461 Standardize on BUFSIZ as opposed to other macro names and values.
1462 * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ.
1463 * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
1464 stdio.h has always defined it,
1465 and other code already assumes it's defined.
1466 * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
1467 (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
1468 (io_buf): IO_BUF_SIZE -> BUFSIZ.
1470 2003-09-04 Paul Eggert <eggert@twinsun.com>
1472 * src/seq.c (step): Default to 1.
1473 (print_numbers): Allow the output to be empty.
1474 (main): The default step is 1, even if LAST < FIRST;
1475 as per documentation.
1476 * tests/seq/basic (onearg-2): Output should be empty.
1478 2003-09-05 Jim Meyering <jim@meyering.net>
1480 * Makefile.cfg (wget_files): Temporarily disable, until master
1481 versions are restored to ftp.gnu.org.
1483 * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
1485 Make seq's --width (-w) option work properly even when the
1486 endpoint requiring the larger width is negative and smaller than
1488 * src/seq.c (get_width_format): Include `-' in the set of bytes
1489 allowed in a `simple' number (no decimal point, no exponent).
1490 Reported by Patrick Mauritz.
1492 2003-09-02 Paul Eggert <eggert@twinsun.com>
1494 * NEWS: sort -t '\0' now uses a NUL tab.
1495 sort option order no longer matters, unless POSIX requires it.
1496 * src/sort.c (usage): Say "blanks" instead of "whitespace",
1497 Similar fixes for many comments.
1498 (TAB_DEFAULT): New constant, so that we can support NUL as
1499 the field separator.
1500 (tab): Now int, not char. Initialize to TAB_DEFAULT.
1501 (specify_sort_size): If multiple sizes are specified, use the largest.
1502 (begfield, limfield): Support NUL tab char.
1503 (set_ordering): Do not let -i override -d.
1504 (main): Report an error if incompatible -o or -t options are given.
1505 Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
1507 2003-09-05 Jim Meyering <jim@meyering.net>
1509 * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
1511 2003-09-03 Andreas Schwab <schwab@suse.de>
1513 Bug report and patch here:
1514 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
1515 * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
1516 * src/head.c (elide_tail_lines_pipe): Likewise.
1518 2003-09-03 Jim Meyering <jim@meyering.net>
1520 * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
1521 small amount of code from him was first moved to lib/human.c, and was
1522 subsequently rewritten entirely.
1523 * src/df.c (AUTHORS): Likewise.
1525 2003-08-22 Lawrence Teo <lcteo@uncc.edu>
1527 * src/md5sum.c (split_3): Accept the BSD format for generic
1528 message digest modes. Currently works with BSD's MD5 and SHA1
1529 formats since these are the two algorithms presently used in
1530 coreutils. Updated comments to reflect this change.
1531 (bsd_split_3): Updated comments.
1533 * tests/md5sum/basic-1: New test to make sure that
1534 `md5sum --check' doesn't accept the BSD SHA1 format (adapted
1535 from `check-bsd' test in tests/sha1sum/basic-1).
1537 * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
1538 --check exit status and BSD SHA1 format (adapted from tests
1539 in tests/md5sum/basic-1).
1541 2003-08-30 Jim Meyering <jim@meyering.net>
1543 * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
1545 When source and destination arguments refer to the same file, reside
1546 on a partition (e.g. VFAT) on which distinct names may refer to the
1547 same directory entry (often due to variations in case), and when the
1548 link count for the file is 1, mv no longer unlinks the file. Instead,
1549 it gives the expected diagnostic that the source and destination are
1550 the same. WARNING: this is an incomplete fix. If the file happens
1551 to have a link count of 2 or greater, such an erroneous mv command
1552 will still unlink it.
1553 Although that is not possible on vfat or umsdos, it is possible on
1554 other file system types, e.g., ntfs, and hpfs.
1555 * src/copy.c (same_file_ok): Invoke same_name (which might still
1556 return false for names that refer to the same directory entry)
1557 only if the link count is 2 or more.
1558 * tests/mv/vfat: Show how to demonstrate the above problem.
1559 This test is not run.
1560 * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
1562 2003-08-27 Jim Meyering <jim@meyering.net>
1564 * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
1565 who's -l option has been eliciting an unconditional warning about
1566 this impending change since sh-utils-2.0.12 (April 2002).
1568 * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
1569 This would happen for nonempty files not ending with a newline.
1570 Reported by Dan Jacobson.
1571 * tests/misc/paste-no-nl: New file. Test for above-fixed bug.
1572 * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
1574 * src/stat.c (print_it): Avoid buffer overrun that would
1575 occur when the user-specified format string ends with `%'.
1576 Patch by Tommi Kyntola.
1577 * tests/misc/stat-fmt: New file. Test for above-fixed bug.
1578 * tests/misc/Makefile.am (TESTS): Add stat-fmt.
1580 2003-08-26 Jim Meyering <jim@meyering.net>
1582 Apply changes from bison.
1583 * GNUmakefile (SHELL): Define to `sh', if necessary.
1585 * Makefile.maint (WGETFLAGS): Define to `-C off'.
1586 Update all uses of $(WGET).
1588 2003-08-22 Akim Demaille <akim@epita.fr>
1590 * Makefile.cfg (local-checks-to-skip): New.
1591 * Makefile.maint (local-check): Rename as...
1592 (local-checks-available): this.
1595 2003-08-26 Akim Demaille <akim@epita.fr>
1597 * announce-gen (print_changelog_deltas): Neutralize "<#" as
1598 "<\#" to avoid magic from Gnus when posting parts of this script.
1600 2003-08-25 Jim Meyering <jim@meyering.net>
1602 * src/stat.c (main): Warn about use of deprecated `-l' option.
1604 2003-08-22 Jim Meyering <jim@meyering.net>
1606 * src/stat.c (do_stat): For link count at end of line, use %h format,
1607 instead of %-5h. The latter would make stat emit trailing spaces.
1608 Reported by Dan Jacobson.
1610 2003-08-20 Jim Meyering <jim@meyering.net>
1612 * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
1614 2003-08-19 Jim Meyering <jim@meyering.net>
1616 * src/system.h: Include stdlib.h unconditionally,
1617 as we're now assuming that part of hosted C89.
1619 2003-08-18 Jim Meyering <jim@meyering.net>
1621 * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
1622 to avoid warnings from gcc.
1624 2003-08-17 Jim Meyering <jim@meyering.net>
1626 Avoid unnecessary and sometimes time-consuming hostname lookups.
1627 * src/who.c (print_user): Use strchr, not strrchr.
1628 * src/pinky.c (print_entry): Likewise.
1629 Patch by Michael Stone.
1630 This fixes a typo I introduced in who-users.c on 1996-02-23.
1632 * Makefile.maint (makefile-check): Add 0-9 to the range of characters
1633 disallowed between `@...@'.
1635 2003-08-16 Paul Eggert <eggert@twinsun.com>
1637 * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
1638 done by gnulib .m4 files.
1639 (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
1640 * src/sys2.h (strtoull): Remove unused declaration.
1642 2003-08-16 Jim Meyering <jim@meyering.net>
1644 * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
1647 * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
1648 race condition bug. The bug would be triggered when tailing a file
1649 with file pointer not at beginning of file, and where the file was
1650 truncated to have a length of less than the initial offset at just
1651 the right moment (between the two lseek calls in this function).
1653 An invalid initial value for *read_pos would result in
1654 `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
1655 busy-wait rather than sleeping between iterations. The bug manifests
1656 itself only when tailing regular files that are initially nonempty.
1657 * src/tail.c (tail_bytes): Set *read_pos to new file offset after
1659 (tail_lines): Likewise, after lseek calls.
1660 Reported by Nick Estes. See http://bugs.debian.org/205251 for details.
1661 * tests/tail-2/tail-n0f: New file. Test for above fix.
1662 * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
1664 2003-08-15 Jim Meyering <jim@meyering.net>
1666 * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
1667 (sc_sun_os_names): Likewise.
1668 * .x-sc_space_tab, .x-sc_sun_os_names: New files.
1670 * man/help2man: Remove some SPACEs before TAB.
1672 2003-08-14 Paul Eggert <eggert@twinsun.com>
1674 * Makefile.maint (LC_ALL): Set to C.
1675 * man/Makefile.am (ASSORT): New var.
1676 (check-x-vs-1, programs): Use it.
1677 * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
1678 * tests/Makefile.am (ASSORT, all_programs): Likewise.
1680 2003-08-11 Jim Meyering <jim@meyering.net>
1682 fold -s -wN would infloop for N < 8 with TABs in the input.
1683 E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
1684 * src/fold.c (fold_file): Move contents of `else'-block
1685 out of conditional so it's used also for --spaces (-s).
1686 * tests/misc/fold: Test for the above fix.
1687 * tests/misc/Makefile.am (TESTS): Add fold.
1689 2003-08-10 Jim Meyering <jim@meyering.net>
1691 * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
1692 system.h so the types from time.h and sys/time.h are available.
1693 It appears that this is necessary for OpenBSD, NetBSD, and
1694 Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
1696 2003-08-06 Paul Eggert <eggert@twinsun.com>
1698 * NEWS: Add support for setting file timestamps to microsecond
1699 resolution, on hosts that support this.
1700 * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
1701 * src/copy.c (copy_internal):
1702 Set file timestamps with utimens, not utime.
1703 * src/cp.c (re_protect): Likewise.
1704 * src/install.c (change_timestamps): Likewise.
1705 * src/touch.c (newtime, touch, main): Likewise.
1707 2003-08-09 Jim Meyering <jim@meyering.net>
1709 * Makefile.maint (sc_sun_os_names): New rule based on a regexp
1711 (syntax-check-rules): Add it.
1713 * src/tail.c (main): Tweak Solaris OS version number in comment.
1714 * src/wc.c (wc): Likewise
1715 * tests/tail-2/fflush: Likewise.
1717 * src/tail.c: Add new undocumented option, --presume-input-pipe.
1718 (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
1720 2003-08-08 Paul Eggert <eggert@twinsun.com>
1722 Use new gnulib 'extensions' module.
1723 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
1726 2003-08-08 Paul Eggert <eggert@twinsun.com>
1728 * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
1730 2003-08-09 Jim Meyering <jim@meyering.net>
1732 * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
1733 For tests of obsolete behavior, don't presume that unsetting
1734 _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
1736 2003-08-07 Paul Eggert <eggert@twinsun.com>
1738 * doc/coreutils.texi (split invocation):
1739 Add -d or --numeric-suffixes option to 'split'.
1740 From a suggestion by Jesse Kornblum.
1741 * src/split.c (suffix_alphabet): New var.
1742 (longopts, usage, next_file_name, main): Support -d.
1743 (next_file_name, main): Allow -a0, as POSIX requires.
1744 (next_file_name): Don't assume ASCII-like encoding;
1745 'a' through 'z' are not contiguous in EBCDIC.
1747 2003-08-05 Paul Eggert <eggert@twinsun.com>
1749 Merge getline from gnulib.
1750 * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
1751 * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
1752 New files, from gnulib.
1753 * lib/getdelim2.c, lib/getdelim2.h: Remove.
1754 * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
1755 getdelim2.h to getndelim2.c and getndelim2.h.
1756 * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
1757 checking for getdelim.
1758 (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
1759 than rolling our own.
1760 * src/cut.c: Include getndelim2.h rather than getdelim2.h.
1761 (cut_fields): Invoke getndelim2 rather than getdelim2.
1763 2003-08-04 Jim Meyering <jim@meyering.net>
1765 * src/sort.c (main): Use unsigned int instead of int for `nsigs'
1766 and for the indices to iterate through nsigs.
1768 2003-08-02 Paul Eggert <eggert@twinsun.com>
1770 * src/sort.c: Minor code cleanups, mostly to use more accurate
1771 types and to remove unnecessary casts.
1772 (min, max): Remove. All uses changed to MIN and MAX.
1773 (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
1774 keyfield.skipsblanks, struct keyfield.skipeblanks, struct
1775 keyfield.numeric, struct keyfield.general_numeric, struct
1776 keyfield.month, struct keyfield.reverse, reverse, unique,
1777 have_read_stdin): Now bool, not int. All uses changed.
1778 (eolchar): Now char, not int.
1779 (struct keyfield.ignore): Now bool const *, not int *.
1780 (struct keyfield.translate): Now char const *, not char *.
1781 (struct month.name): Likewise.
1782 (blanks, nonprinting, nondictionary): Now bool[], not int[].
1783 (cleanup, inittables, keycompare, check, mergefps, first_same_file,
1784 check, sort, main): Use const * pointers when possible.
1785 (month_cmp): Rewrite to avoid casts.
1786 (inittables): Initialize tables unconditionally, to avoid branches.
1787 (fillbuf): Return bool, not int. All uses changed.
1788 (fillbuf, keycompare, new_key, main):
1789 Use SIZE_MAX rather than (size_t) -1.
1790 (trailing_blanks): Renamed from trim_trailing_blanks.
1791 Return the number of blanks to trim. All uses changed.
1792 (getmonth): Use trailing_blanks rather than open code.
1793 (keycompare): Do not cast char * to unsigned char *; not needed.
1794 CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
1796 (compare, main): Use | rather than || to avoid jumps.
1797 Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
1799 (check, first_same_file, sort, main):
1800 Use bool instead of int local vars when possible.
1801 (check): Merge the old 'checkfp' and 'check' into a single function,
1802 that returns a boolean (true if the file was ordered).
1804 (main): Use int instead of unsigned for iterating through nsigs.
1805 Rename local var "posix_pedantic" to "posixly_correct".
1807 2003-08-02 Jim Meyering <jim@meyering.net>
1809 * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
1810 to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
1812 * src/cut.c (cut_fields): Don't read again after encountering an
1813 initial EOF. E.g., `cut -f2' would do so.
1814 * tests/misc/tty-eof: Add a test for the above fix.
1816 * src/sort.c (sortlines): Add description and references.
1819 * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
1820 the tests in help-version will use the just-built binaries.
1821 Reported by Christian Krackowizer.
1823 2003-07-31 Paul Eggert <eggert@twinsun.com>
1825 * NEWS: Add --rfc-2822 option to GNU date.
1826 * doc/coreutils.texi (Time directives, Options for date, Examples
1828 * src/date.c (long_options, usage, main): Likewise.
1829 * doc/getdate.texi (General date syntax): Likewise.
1830 * doc/coreutils.texi (Options for date): Fix a typo in format:
1831 it's now %d not %_d. Add URLs.
1833 2003-08-01 Jim Meyering <jim@meyering.net>
1835 * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
1836 Otherwise, with at least the /bin/sh from HPUX 10.20,
1837 the trap code would end up converting that to exit 1 and thus an
1838 unexpected test failure. Reported by Christian Krackowizer.
1840 2003-07-31 Paul Eggert <eggert@twinsun.com>
1842 * src/ptx.c: Do not include bumpalloc.h.
1843 (WORD_TABLE): New member alloc.
1844 (ALLOC_NEW_WORD): Remove.
1845 (occurs_alloc): New var.
1846 (digest_word_file, find_occurs_in_text): Check for arithmetic
1847 overflow when computing table size. Use xrealloc rather than
1848 bumpalloc primitives.
1850 2003-07-29 Jim Meyering <jim@meyering.net>
1854 * README: When running tests as root, suggest using
1855 sudo with NON_ROOT_USERNAME=$USER.
1857 * tests/Makefile.am (all_programs): Makefile is in ../src, not
1860 2003-07-28 Jim Meyering <jim@meyering.net>
1862 * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
1864 2003-07-28 Paul Eggert <eggert@twinsun.com>
1866 * lib/stdbool.hin (_Bool): Make it signed char, instead of
1867 an enum type, so that it's guaranteed to promote to int.
1868 * src/sort.c (sortlines_temp): Undo previous change.
1870 2003-07-28 Jim Meyering <jim@meyering.net>
1872 * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
1873 `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
1874 would cause lines[-1 - swap] (with swap = false) to evaluate to
1877 2003-07-27 Jim Meyering <jim@meyering.net>
1879 * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
1880 since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
1882 * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
1883 directories, as required by POSIX. Reported by Karl Berry.
1884 * tests/rm/dir-no-w: New file. Test for the above fix.
1885 * tests/rm/Makefile.am (TESTS): Add dir-no-w.
1887 * tests/mk-script: Emit `$xx', not its expansion.
1889 2003-07-27 Paul Eggert <eggert@twinsun.com>
1891 This change was inspired by a similar proposal by Stepan Kasal.
1892 * src/sort.c (mergelines, sortlines_temp): New functions.
1893 (sortlines): Use them, to reduce the number of times that
1894 we need to copy 'struct line' values. This improved CPU
1895 performance by about 30% on one 18 MB test.
1896 (sort): Don't invoke sortlines unless we have 2 or more lines.
1898 2003-07-26 Stepan Kasal <kasal@ucw.cz>
1900 * src/sort.c (sort): Don't require two `struct line's per text line,
1901 the new sort algorithm requires just 1.5.
1903 2003-07-27 Jim Meyering <jim@meyering.net>
1905 * src/pathchk.c (validate_path): Use %lu, not %ld.
1907 * src/cut.c (is_printable_field): Simplify bit arithmetic.
1909 * src/ls.c (sort_files): Put `volatile' in the right place.
1912 2003-07-26 Jim Meyering <jim@meyering.net>
1914 Use only one bit per field/offset in array, not one `int'.
1915 * src/cut.c (printable_field): Change type to `unsigned char'.
1916 (mark_printable_field, is_printable_field): New functions.
1917 Use them in place of all direct accesses of `printable_field'.
1919 * src/expand.c (parse_tabstops): Detect overflow properly.
1920 * src/cut.c (set_fields): Likewise.
1922 * src/rm.c: Include "dirname.h".
1923 (usage): Use base_name (program_name) in body of --help output.
1925 * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
1926 Idea from Brendan O'Dea, who suggested using
1927 `program_name = basename (argv[0]);' everywhere --
1928 can't do that, but using base_name works just fine here.
1930 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
1932 2003-07-24 Paul Eggert <eggert@twinsun.com>
1934 Fix some POSIX-compliance problems with 'test'. This makes
1935 'test' more compatible with Bash.
1937 * NEWS, doc/coreutils.texi: Document the following.
1938 * src/test.c: Include exitfail.h.
1939 (TEST_FAILURE): New constant, used for exit status if 'test' fails.
1940 (test-syntax_error): Use it.
1941 (binary_operator): Now takes bool arg specifying whether left operand
1942 is -l ARG, so that caller determines this rather than us.
1944 (term): Use posixtest to evaluate parenthesized subexpressions.
1945 (unary_operator, one_argument): Remove support for -t without operand.
1946 (one_argument): Take argument from argv[pos].
1947 (one_argument, two_arguments, three_arguments): Advance pos.
1948 All callers changed.
1949 (three_arguments): Look for binary ops before "!". Then look
1950 for parenthesized one_argument expressions, instead of trusting
1951 expr () to do the right thing.
1952 (posixtest): Now takes number of args. All callers changed.
1953 Treat "( A B )" like "A B".
1954 (main): Set exit_failure to TEST_FAILURE. Don't depend on
1955 POSIXLY_CORRECT, as we now conform to POSIX by default.
1956 (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
1957 * tests/test/Test.pm (test_vector): Add several tests to check
1958 the above. Syntax errors now exit with status 2, not 1.
1959 * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
1961 2003-07-26 Jim Meyering <jim@meyering.net>
1963 * tests/help-version: Adjust for above change in test behavior:
1964 `[' exits with 2, not 1, and test doesn't accept --help or --version.
1966 * Makefile.maint (ME): Don't use trick suggested in Make manual.
1967 It doesn't work for make-3.79.1. Reported by Christian Krackowizer.
1969 * Makefile.maint (sc_system_h_headers): Another syntax check.
1970 (syntax-check-rules): Add it to the list.
1972 * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
1973 so it matches `%ld' format even on 32-bit systems.
1975 * src/fmt.c (flush_paragraph): Cast field width to `int' to
1976 avoid warning on 64-bit systems.
1978 * src/ls.c (sort_files): Make `func' volatile, so it can't be
1979 clobbered by a `longjmp' into this function.
1981 2003-07-25 Jim Meyering <jim@meyering.net>
1983 * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
1986 * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
1987 because it'd evoke spurious failure on 64-bit systems.
1989 2003-07-24 Jim Meyering <jim@meyering.net>
1991 * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
1992 output its current record counts. Reported by Jurriaan.
1994 * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
1995 `wc' with no options. This goes along with the change of 2003-07-20.
1997 2003-07-23 Jim Meyering <jim@meyering.net>
1999 Don't include headers already included by system.h:
2000 * src/tr.c: Don't include errno.h.
2001 * src/true.c: Don't include version-etc.h.
2002 * src/test.c: Don't include limits.h or error.h.
2003 * src/stat.c: Don't include unistd.h or time.h.
2004 * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
2005 * src/pr.c: Don't include time.h.
2006 * src/pathchk.c: Don't include errno.h.
2007 * src/nice.c: Don't include sys/time.h.
2008 * src/ls.c: Don't include stdlib.h.
2010 * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
2011 * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
2012 * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
2013 * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
2014 * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
2015 * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
2016 * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
2017 * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
2018 Don't include closeout.h.
2020 * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
2021 can access the required version of rm.
2022 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
2024 * tests/cut/Test.pm (out-delim3a): New test.
2026 * man/help2man: Update to version 1.33.
2028 * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
2030 * src/dircolors.c: Include xstrndup.h.
2031 (xstrndup): Remove function, now that it's been factored out into
2034 2003-07-22 Paul Eggert <eggert@twinsun.com>
2036 * src/wc.c (wc): Fix typo in computation of file from file_x,
2037 which caused the former to be used uninitialized if file_x was
2040 2003-07-22 Jim Meyering <jim@meyering.net>
2042 * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
2044 * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
2045 help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by
2046 Thomas Luzat. See http://bugs.debian.org/202413 for details.
2048 * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
2050 * src/hostid.c: Don't include <unistd.h>. system.h already does that.
2052 * src/cut.c (set_fields): Mark all selected indices before trying to
2053 determine range endpoints.
2054 * tests/cut/Test.pm: New test for the above fix.
2056 Begin to address this comment: What if someone wants to
2057 extract the 1,000,000-th field of some huge input file?
2058 The first step is to rearrange things so that the values
2059 in the printable_field array are all 0/1 rather than 0/1/2.
2060 * src/cut.c (RANGE_START_SENTINEL): Remove.
2061 Store range-start indices in a hash table, rather than
2062 overloading the `printable_field' array.
2063 (range_start_ht): New global.
2064 (hash_int, hash_compare_ints, is_range_start_index): New functions.
2065 (print_kth): Use is_range_start_index; don't test printable_field.
2066 (set_fields): Detect overflow.
2067 (set_fields): Insert each range-start index into range_start_ht.
2068 (main): Call set_fields only once, and only after
2069 output_delimiter_specified and (if required) range_start_ht have
2072 2003-07-20 Paul Eggert <eggert@twinsun.com>
2074 * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
2075 invoked with a null pointer when there were no file arguments.
2077 2003-07-20 Jim Meyering <jim@meyering.net>
2079 * Makefile.maint (sc_changelog): Add another nit-picky check.
2081 * src/wc.c (write_counts): Add a comment.
2082 (wc): Rename `file' parameter.
2083 Set new local, `file', to be the file name, or (when it's NULL)
2084 _("standard output") so that all uses of `file' use the proper value.
2085 Use STREQ, not strcmp.
2087 2003-07-20 Paul Eggert <eggert@twinsun.com>
2089 wc count field widths now are heuristically adjusted depending
2090 on the input size, if known. If only one count is printed, it
2091 is guaranteed to be printed without leading spaces.
2093 Previously, wc did not align the count fields if
2094 POSIXLY_CORRECT was set, but POSIX did not actually require
2095 this undesirable behavior, so it has been removed.
2097 * NEWS: Document this.
2098 * doc/coreutils.texi (wc invocation): Likewise.
2100 * src/wc.c (number_width): New var.
2101 (posixly_correct): Remove.
2102 (struct fstatus): New struct.
2103 (write_counts): Output fields of width number_width.
2104 Do not worry about POSIXLY_CORRECT.
2105 Use null file, not empty-string file, to denote stdin,
2106 since "" is a valid file name on some hosts.
2107 (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
2109 (wc): Avoid problems if end_pos - current_pos overflows.
2110 Do not print odd message if stdin has a read error.
2111 (get_input_fstatus, compute_number_width): New functions.
2112 (main): Use them to implement the new behavior.
2113 Ignore POSIXLY_CORRECT.
2115 * tests/wc/Test.pm: Adjust to the new output widths.
2117 2003-07-19 Jim Meyering <jim@meyering.net>
2119 * tests/rm/fail-eperm: Don't create temporary directory --
2122 * tests/shred/remove: Don't open-code test for UID != 0.
2123 Use priv-check's require-non-root instead.
2124 Update to use newer framework.
2126 * tests/help-version (expected_failure_status_expr): Record that
2127 expr exits with status of 3 for e.g., a write error.
2129 * tests/priv-check: Use `id -u' to see if we're running as root,
2130 rather than trying go write to an write-protected file.
2131 When running as root, ensure $NON_ROOT_USERNAME is valid.
2132 When running as root with `require-non-root', ensure that `.'
2133 is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
2134 to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test.
2136 * src/printenv.c: Include "exitfail.h".
2137 (main): Set exit_failure rather than calling close_stdout_set_status.
2138 * src/date.c: Likewise.
2139 * src/sort.c: Likewise.
2140 * src/tty.c: Likewise.
2142 2003-07-18 Jim Meyering <jim@meyering.net>
2144 * tests/touch/not-owner: Update to use newer framework.
2146 * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
2147 directory, and remove Perl-coded `you may not run as root' test.
2148 * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
2149 hard-coding something not quite equivalent.
2150 Paul Jarc reported the inconsistent diagnostics.
2152 * src/sort.c (main): Use close_stdout via atexit.
2153 Now `sort --version' and `sort --help' fail, as they should
2154 when their output is redirected to /dev/full.
2156 * src/su.c (usage): Don't call close_stdout here.
2157 (main): Use close_stdout via atexit.
2158 Now `su --version > /dev/full' fails, as it should.
2159 Somehow, the change of 2000-05-07 that purports to fix this
2162 * tests/help-version (--help/--version vs. /dev/full): Special-case
2163 `[' to protect it from expected_failure_status-`eval'.
2165 * src/uniq.c (writeline): Use a SPACE, not a TAB between the
2166 count and the corresponding line, as required by POSIX.
2167 Reported by Clement Wang.
2168 * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
2170 * tests/expr/basic: Add tests for when exit status is 2.
2172 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
2173 Use an anonymous `enum', rather than #define.
2175 2003-07-17 Paul Eggert <eggert@twinsun.com>
2177 * src/expr.c: Include "exitfail.h", "quotearg.h".
2178 (EXPR_INVALID, EXPR_ERROR): New constants.
2179 (nomoreargs, null, toarith, nextarg): Return bool, not int.
2180 (syntax_error): New function, exiting with status 2. Use it
2181 insteading of printing "syntax error" ourselves.
2182 (main): Initialize exit_failure to EXPR_ERROR.
2183 Exit with EXPR_INVALID on syntax error (too few arguments).
2184 (nextarg): Use strcmp, not strcoll; strcoll might return
2185 an undesirable 0, or might fail.
2186 (docolon, eval4, eval3): Exit with status 3 on invalid argument type
2187 or other such error.
2188 (eval2): Report an error if strcoll fails in a string comparison.
2189 * src/sort.c: Include "exitfail.h".
2190 (main): Set exit_failure, not xalloc_exit_failure and
2191 xmemcoll_exit_failure.
2192 * tests/expr/basic: Invalid value exits with status 3, not 2.
2194 2003-07-16 Jim Meyering <jim@meyering.net>
2196 * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
2197 per GNU maintainer guidelines. The next non-beta release will be 5.1.
2199 This script would have caught at least two recent bugs:
2200 those in [ and kill.
2201 * tests/help-version: Revive this script.
2202 It wasn't doing anything useful, since $all_programs wasn't being
2203 defined by the invoking Makefile.am.
2204 Reflect that nohup is no longer a script, so don't exclude it.
2205 Add framework to handle the programs added since it was last run:
2206 kill, stat, unlink, [, link, readlink.
2207 Fix path-related problems deriving from the move of this script
2208 from src/ to its present location.
2209 * tests/Makefile.am (all_programs): Define.
2210 (TESTS_ENVIRONMENT): Use it.
2212 * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
2213 whereby kill would always attempt to operate on argv[0] and fail.
2215 * src/test.c (integer_expected_error): Improve diagnostic -- now,
2216 it also matches the one from bash's builtin test.
2217 (binary_operator): Add \n at end of diagnostic.
2219 * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ...
2220 * tests/priv-check: Move setuidgid-related and
2221 NON_ROOT_USERNAME-checking code to this file.
2223 * README: Update section on testing as `root'.
2224 Suggestion from Paul Jarc.
2226 * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
2227 names of authors that I just found in bash's builtins/test.def.
2229 Running `[' with no arguments would evoke a segfault.
2230 * src/test.c (main) [LBRACKET]: Move initialization of argv to
2231 precede potential use via test_syntax_error.
2233 * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
2234 warning from automake -Wall.
2236 2003-07-15 Jim Meyering <jim@meyering.net>
2240 * Makefile.maint (%.asc): Remove target first, so gpg doesn't
2243 * announce-gen (print_changelog_deltas): Relax tests for matching
2244 version-number line in NEWS.
2245 Change the .sig suffix to .asc here, too.
2247 2003-07-14 Jim Meyering <jim@meyering.net>
2249 * Makefile.maint (%.asc): Renamed from %.sig.
2250 Generate and use ascii-armored signatures.
2251 Use gpg's -o option.
2253 2003-07-13 Jim Meyering <jim@meyering.net>
2255 * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
2258 * Makefile.maint (syntax-check): Move each individual check into
2260 (syntax-check-rules): This is the list of syntax-check targets.
2261 (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
2262 (sc_cast_of_x_alloc_return_value, sc_space_tab):
2263 (sc_error_exit_success, sc_xalloc_h_in_src): New targets.
2265 2003-07-12 Jim Meyering <jim@meyering.net>
2267 * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
2268 traces of the nohup script.
2270 * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
2271 $(OPTIONAL_BIN_ZCRIPTS).
2273 * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
2274 target, not before the `>'.
2276 * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
2277 now that that function no longer calls `error'.
2279 * src/df.c (find_mount_point): Emit a diagnostic for each
2280 failed syscall, rather than relying on caller to do that.
2281 The caller couldn't do a good job, anyhow -- too many different
2282 ways to fail (each with a different referent).
2283 Give a diagnostic upon failed save_cwd, now that that function
2284 no longer calls `error'.
2285 (show_point): Don't diagnose find_mount_point's errors, now that
2286 it handles them itself.
2288 * src/df.c (find_mount_point): Don't let free clobber errno upon
2291 * src/sys2.h: Remove alloca-related block.
2292 * src/system.h: Include <alloca.h> here, instead.
2294 It appears that the `#pragma alloca' included via "system.h" is
2295 adequate, since join.c uses alloca, yet lacked an in-file #pragma.
2296 * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
2297 * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
2299 * src/chown-core.c (change_file_owner): Do not restore any special
2300 permission bits (e.g., set-user-ID, set-group-ID) that are reset
2301 by chown(2) on some systems. Suggestion and insistence :-) from
2304 * tests/input-tty: Also check `test -t 1'.
2305 This is necessary on linux-2.4.21. Otherwise, the stty/basic-1
2306 test would block when run in the background.
2308 2003-07-11 Jim Meyering <jim@meyering.net>
2310 * tests/sample-test: Also fail if cat-to-create-expected-output
2311 fails. Otherwise, if both `exp' and `out' were to end up empty
2312 because of e.g., a full disk, they would mistakenly compare equal.
2314 * src/nohup.c: New file. Rewrite of nohup.sh in C.
2315 This solves a portability problem: on at least Solaris systems,
2316 when nohup.sh used the vendor /bin/sh, it would exit with status
2317 of `1' rather than the required 126 or 127 upon failure to exec
2318 the specified program.
2320 * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
2321 (bin_PROGRAMS): Add nohup.
2322 (EXTRA_DIST): Remove nohup.sh.
2323 (all_programs): Remove use of $(EXTRA_SCRIPTS).
2324 * src/nohup.sh: Remove file.
2325 * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
2327 * tests/misc/nohup: Tests for the above.
2328 * tests/misc/Makefile.am (TESTS): Add nohup.
2330 * src/head.c (diagnose_copy_fd_failure): New function, renamed from
2331 the macro, COPY_FD_DIAGNOSE.
2332 (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
2333 (head_file): Likewise.
2335 * src/date.c: Include "quote.h".
2336 (batch_convert): Use the quote function rather than using literal `...'
2339 * src/setuidgid.c (main): Enclose diagnostic in _(...).
2340 * src/fmt.c (main): Likewise.
2341 * src/mknod.c (main): Likewise.
2342 * src/tac.c (tac_seekable): Likewise.
2343 * src/yes.c (main): Likewise.
2344 * src/od.c (main): Likewise.
2345 * src/install.c (change_attributes): Likewise.
2347 2003-07-10 Jim Meyering <jim@meyering.net>
2349 * src/head.c (usage): Use 1024*1024 in place of 1048576.
2350 * src/tail.c (usage): Likewise.
2352 * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
2353 place of the kludge in this test. Suggestion from Paul Jarc.
2355 * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
2356 * src/setuidgid.c: New program, solely for testing (not installed).
2358 * src/chown-core.c (change_file_owner): Don't leak file descriptors
2359 when dereferencing symlinks.
2361 2003-07-09 Jim Meyering <jim@meyering.net>
2363 * tests/du/slash: New file/test for today's lib/ftw.c fix.
2364 * tests/du/Makefile.am (TESTS): Add slash
2366 * src/tail.c (xlseek): Avoid warning about ``return without value
2367 from function returning non-void''.
2369 2003-07-08 Jim Meyering <jim@meyering.net>
2371 * man/help2man: Update to version 1.29.
2373 * man/help2man: Add END handler to close STDOUT and check for errors.
2375 2003-06-30 Paul Eggert <eggert@twinsun.com>
2377 Add support for a "[" that conforms to the GNU coding standards,
2378 i.e., that does not depend on its name.
2379 * src/lbracket.c: New file.
2381 * man/Makefile.am (programs): Ignore "[", since it doesn't have
2382 a separate man page.
2383 * src/Makefile.am (bin_PROGRAMS): Add "[".
2384 (__SOURCES): New var.
2385 * src/test.c (LBRACKET): Define to 0 if not defined.
2386 (main): Use LBRACKET rather than argv[0].
2388 * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
2389 Reported by Paul Jarc and Dan Jacobson.
2391 * src/test.c (main): Do not recognize --help or --version if
2392 POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
2393 Do not bother testing that margv[margc] is non-null.
2395 2003-07-04 Jim Meyering <jim@meyering.net>
2397 * src/who.c (print_line): Rewrite to use asprintf, in order to be
2398 able to avoid emitting trailing spaces. Reported by Dan Jacobson.
2400 * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
2401 option, and perform the +1600 invocations of head IFF the envvar
2402 RUN_EXPENSIVE_TESTS is set.
2404 2003-07-03 Jim Meyering <jim@meyering.net>
2406 * src/cp.c (do_copy): Give a better diagnostic when failing due
2407 to nonexistent destination directory. Reported by Dmitry Rutsky.
2408 See http://bugs.debian.org/199730 for details.
2410 2003-06-27 Jim Meyering <jim@meyering.net>
2412 split's --verbose option did nothing [broken in 4.5.10 and 5.0]
2413 * src/split.c (longopts): Use `1', not `0' as the value for
2414 for &verbose. Reported by Keith Thompson.
2416 Test for the above fix.
2417 * tests/misc/split-a: Also use --verbose and compare stderr
2418 output with what we'd expect.
2420 2003-06-20 Jim Meyering <jim@meyering.net>
2422 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2423 Use `error_t' (rather than int) as type for local `err'.
2424 From Alfred M. Szmidt.
2426 2003-06-19 Marcus Brinkmann <marcus@gnu.org>
2428 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2429 Fix author preservation code.
2431 2003-06-19 Jim Meyering <jim@meyering.net>
2433 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
2434 (do_link): Don't warn about hard link to symlink.
2436 2003-06-18 Jim Meyering <jim@meyering.net>
2438 * src/cut.c: Include "getdelim2.h", not "getstr.h".
2439 Reflect renaming: getstr -> getdelim2.
2441 * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
2442 readline -> readlinebuffer.
2444 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2446 * src/readlink.c: Include <sys/types.h> before system.h (because
2447 the latter includes <sys/stat.h>). Required on Ultrix 4.3.
2449 2003-06-17 Jim Meyering <jim@meyering.net>
2451 * src/system.h (initialize_main): Define.
2452 Use it in every `main'. Applied via this:
2453 p='initialize_main (&argc, &argv);'
2454 perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \
2455 $(grep -l program_name.=.argv.0 *.c)
2456 test.c uses margc/margv, so I made the change manually for that file.
2457 Based on a patch from Bernard Giroud.
2459 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2461 Fix for build failure on Ultrix 4.3.
2462 * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
2463 Include sys/param.h and sys/mount.h on ultrix.
2465 2003-06-16 Jim Meyering <jim@meyering.net>
2467 * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
2469 * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
2470 them here instead, but with one change: define EISDIR to -1, not 0.
2472 * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
2473 guaranteed to be defined.
2474 * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
2476 * README: Mention the CVS repository.
2477 Encourage addition of test cases.
2479 2003-06-12 Jim Meyering <jim@meyering.net>
2481 * src/touch.c (touch): Call close only if necessary.
2484 * src/wc.c (usage): Correct wording: wc prints counts in the order
2485 `newline, word, byte'. Reported by Keith M. Briggs.
2486 * man/wc.x: Fix it here, too. And change `lines' to `newlines'.
2488 2003-06-10 Jim Meyering <jim@meyering.net>
2490 * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
2492 2003-06-07 Jim Meyering <jim@meyering.net>
2494 * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
2497 2003-06-06 Jim Meyering <jim@meyering.net>
2499 * src/extract-magic (main): Avoid newer 3-arg form of open,
2500 so this script works also with e.g., perl5.005_03.
2501 Patch by John David Anglin.
2503 2003-06-04 Paul Eggert <eggert@twinsun.com>
2505 * src/system.h: Include <stdbool.h> unconditionally.
2507 2003-06-04 Jim Meyering <jim@meyering.net>
2509 * man/Makefile.am (check-programs-vs-x): Rename target
2510 from check-programs-vs-1. Adjust rule to check for the
2511 primary (.x) file, not the generated one (.1).
2513 2003-06-03 Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
2515 * man/kill.x: New file.
2516 * man/Makefile.am (dist_man_MANS): Add kill.1.
2519 2003-06-04 Jim Meyering <jim@meyering.net>
2521 Ensure that the .x file for a new program is never forgotten again.
2522 * man/Makefile.am (programs): Define.
2523 (check-programs-vs-1): New phony target.
2524 (check-local): Depend on it.
2526 2003-06-03 Jim Meyering <jim@meyering.net>
2528 Avoid unnecessary copying of environment.
2529 * src/env.c (main): Rather than clearing the environment and --
2530 unless told to ignore environment -- copying all settings from
2531 the saved, original environment, clear the environment only when
2532 that is requested. Suggested by Jens Elkner.
2534 2003-06-02 Jim Meyering <jim@meyering.net>
2536 * src/system.h: Always include <string.h>, since we assume C89.
2537 Include <limits.h> without checking for HAVE_LIMITS_H.
2539 * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
2540 (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
2542 2003-06-01 Jim Meyering <jim@meyering.net>
2544 Avoid a race condition in `tail -f' described by Ken Raeburn in
2545 http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
2546 * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
2547 (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
2548 (tail_bytes, tail_lines, tail): Likewise.
2549 (tail_file): Use the new `read_pos' value as the size,
2550 rather than stats.st_size from the fstat call.
2552 2003-05-28 Jim Meyering <jim@meyering.net>
2554 * src/extract-magic: Allow expansion of `$file' in the here-
2555 document corresponding to the comment at the top of fs.h.
2557 2003-05-26 Jim Meyering <jim@meyering.net>
2559 * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
2560 <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
2561 Use #if/#elif/... cascade so we get only one set of include files.
2562 Reported by Nelson Beebe.
2564 2003-05-24 Jim Meyering <jim@meyering.net>
2566 * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
2567 * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
2568 accept the BSD format.
2570 2003-03-28 Joe Orton <jorton@redhat.com>
2572 * src/md5sum.c (bsd_split_3): New function.
2573 (split_3): Detect checksums from BSD 'md5' command and handle them
2576 * tests/md5sum/basic-1: New tests for --check exit status, and for
2577 BSD-style checksum files.
2579 2003-05-21 Jim Meyering <jim@meyering.net>
2581 * src/head.c (elide_tail_lines_pipe): Fix a thinko.
2582 This sort of thing is why it'd be *Really Good* to factor
2583 out the common code used here and in tail.c.
2585 2003-05-14 Jim Meyering <jim@meyering.net>
2587 * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
2589 * tests/du/slink: Skip this test if `.' is on an XFS file system.
2591 * tests/du/fd-leak: New file. Test for the bug in du that
2592 was fixed by the 2003-05-12 change to lib/ftw.c.
2593 * tests/du/Makefile.am (TESTS): Add fd-leak.
2595 * src/head.c (AUTHORS): Enclose string in N_(...), now that it
2596 includes a translatable word, `and'.
2598 * src/dd.c (usage): Don't use `,' as the thousands separator
2599 in e.g. 1,000,000 and 1,048,576. Instead, do this:
2600 `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
2601 * src/df.c (usage): Likewise.
2602 * src/du.c (usage): Likewise.
2603 * src/ls.c (usage): Likewise.
2605 * Makefile.maint (syntax-check): Add another check.
2607 2003-05-13 Paul Eggert <eggert@twinsun.com>
2609 Fix uniq to conform to POSIX, which requires that "uniq -d -u"
2610 must output nothing. Problem reported by Josh Hyman.
2612 * src/uniq.c (enum output_mode, mode): Remove, replacing with:
2613 (output_unique, output_first_repeated, output_later_repeated):
2614 New vars. All uses of "mode" changed to use these variables,
2615 which are not mutually exclusive as "mode" was.
2616 (writeline): New arg "match", used to control whether to
2617 obey output_first_repeated or output_later_repeated.
2618 All callers changed.
2619 (check_file, main): Adjust to above changes.
2621 * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
2623 2003-05-14 Jim Meyering <jim@meyering.net>
2625 * tests/rm/rm3: Use tr's \n notation rather than \012.
2626 This package can afford to do that, since its tests are guaranteed use
2627 GNU tr, which has accepted the more modern notation for 10 years.
2628 * tests/rm/rm5: Likewise.
2629 * tests/cp/same-file: Likewise.
2630 * tests/stty/row-col-1: Likewise.
2631 * tests/stty/basic-1: Likewise.
2632 * tests/rm/deep-1: Likewise.
2633 * tests/mv/part-symlink: Likewise.
2634 * tests/mkdir/perm: Likewise.
2635 * tests/misc/nice: Likewise.
2637 2003-05-13 Jim Meyering <jim@meyering.net>
2639 * src/copy.c (struct F_triple) [name]: Remove const attribute.
2640 (triple_free): Don't apply cast to argument of free.
2641 (seen_file): Add cast here instead.
2643 * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
2644 (src_to_dest_free): Don't apply cast to argument of free.
2646 * src/sort.c (zaptemp): Don't apply cast to argument of free.
2647 * src/pr.c (init_fps, init_store_cols): Likewise.
2648 * src/join.c (delseq, freeline): Likewise.
2649 * src/expr.c (OLD): Likewise.
2650 * src/sort.c (sort): Likewise.
2651 * src/head.c (elide_tail_lines_pipe): Likewise.
2653 * src/tail.c: Include "quote.h".
2654 Use quote in diagnostics. Change many error format strings
2655 from just `%s' to e.g., `error reading %s'.
2656 (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
2657 Rewrite newline-counting loop to use memchr.
2659 * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
2660 Now that assert is no longer used, don't include <assert.h>.
2662 2003-05-12 Jim Meyering <jim@meyering.net>
2664 * src/head.c: Include <assert.h>.
2665 (AUTHORS): Add my name.
2666 (elide_tail_lines_pipe): New function.
2668 2003-05-10 Jim Meyering <jim@meyering.net>
2670 * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
2672 * src/readlink.c (main): Set program_name before first use.
2673 Remove that (redundant) first use.
2674 Don't exit successfully just because --verbose was specified.
2675 Pass 0, not EXIT_SUCCESS, as first argument to error; when that
2676 parameter is 0, error does not exit.
2678 * src/uname.c (main): When failing due to too many arguments, also say
2679 that, rather than just "Try `uname --help' for more information.".
2680 * src/comm.c (main): Likewise, but for too few arguments.
2681 * src/logname.c: Include error.h.
2682 (main): Say why we're failing.
2684 * src/uniq.c (main): Don't segfault when argc < optind.
2685 * src/who.c (main): Handle argc < optind.
2686 * src/df.c (main): Likewise.
2687 * src/install.c (main): Likewise.
2688 * src/mv.c (main): Likewise.
2689 * src/pwd.c (main): Likewise.
2690 * src/tty.c (main): Likewise.
2691 * src/chroot.c (main): Likewise.
2692 * src/hostname.c: Likewise.
2693 * src/du.c (main): Likewise.
2694 * src/expand.c (main): Likewise.
2695 * src/env.c (main): Likewise.
2696 * src/unexpand.c (main): Likewise.
2697 * src/printenv.c (main): Likewise.
2698 * src/sync.c (main): Handle argc == 0.
2699 * src/expr.c (main): Likewise.
2700 * src/printf.c (main): Likewise.
2701 * src/basename.c (main): Likewise.
2702 * src/ln.c (main): Test for `missing argument' before computing n_files.
2703 * src/tail.c (main): Test for the case of no arguments before
2706 * src/kill.c (send_signals): Don't check command line arguments here.
2707 (main): Check them here instead. Handle argc < optind.
2709 * src/logname.c (main): Use error, rather than fprintf, for the sake
2712 * src/rm.c (main): Don't overrun array bound if argc is 0.
2714 2003-05-09 Jim Meyering <jim@meyering.net>
2716 * src/sort.c (main): Don't overrun array bound if argc is 0.
2717 That would happen when invoked via: execl ("/usr/bin/sort", NULL);
2718 Reported by Wartan Hachaturow.
2720 2003-05-07 Jim Meyering <jim@meyering.net>
2722 Implement support so that `head --lines=-N' works on seekable files.
2723 * src/head.c (enum Copy_fd_status): Define.
2724 (COPY_FD_DIAGNOSE): New macro.
2725 (elide_tail_lines_seekable): New funtion.
2726 (elide_tail_lines_file): Call it here.
2728 2003-05-06 Jim Meyering <jim@meyering.net>
2730 * src/sys2.h (CHAR_BIT): Remove duplicate definition.
2732 2003-05-04 Jim Meyering <jim@meyering.net>
2734 * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
2735 caused the addition of thousands of small files to the tar archive.
2736 * tests/misc/head-elide-tail: New file. Add them here instead.
2737 * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
2739 2003-05-04 Paul Eggert <eggert@twinsun.com>
2741 * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
2742 (IF_READDIR_NEEDS_REWINDDIR): Remove.
2743 (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
2744 which was a bit weird because it couldn't be emulated by a function.
2746 2003-05-03 Jim Meyering <jim@meyering.net>
2748 Extend head to accept --lines=-N (--bytes=-N) and to print all
2749 but the N lines (bytes) at the end of the file.
2750 * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
2751 Use quote() in diagnostics, rather than literal `' marks.
2752 (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
2754 (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
2755 (head_file): Reorganize so as to call head from only one place.
2756 (main): Likewise, for head_file.
2757 Handle new, undocumented option, --presume-input-pipe.
2758 Handle negative line and byte counts.
2759 * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
2761 * tests/du/8gb: Skip test if the file system of `.' doesn't support
2762 sparse files -- otherwise it'd create a file of size 8GB.
2764 2003-05-02 Jim Meyering <jim@meyering.net>
2766 * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
2767 Instead explain about `-' and standard input.
2768 (main): Give a proper diagnostic for e.g., `fmt -c -72'.
2769 Reported by Keith Thompson.
2770 * tests/fmt/basic: Add test for the above fix.
2772 * src/fmt.c: Include "quote.h".
2773 Use quote() in diagnostics, rather than literal `' marks.
2774 (main): Exit nonzero when unable to open an input file.
2775 * tests/fmt/basic: Add test for the above fix.
2777 * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
2778 specifications like `-72x'.
2779 * tests/fmt/basic: Add test for the above fix.
2781 Work around nasty readdir bug on Darwin6.5.
2782 * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
2783 [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
2784 returned NULL and there has been at least one successful unlink or
2785 rmdir call since the opendir or previous rewinddir, then call
2786 rewinddir and reiterate the loop.
2788 Factor out common code.
2789 * src/remove.c (readdir_ignoring_dotdirs): New function.
2790 (is_empty_dir): Use it here.
2791 (remove_cwd_entries): Use it here.
2793 2003-05-01 Jim Meyering <jim@meyering.net>
2795 * tests/rm/r-3: Create 500 rather than just 300 files.
2796 There's a bug in Darwin6.5's readdir that shows up only with
2798 Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
2802 Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
2803 (dump_remainder): Move two declarations `down' into the scope
2804 where they are used.
2805 (xlseek): Return the resulting offset.
2806 (file_lines): Rename parameter, file_length, to end_pos.
2807 (pipe_lines): Don't coerce safe_read return value to `int'.
2808 Adapt tests accordingly.
2809 (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
2811 Change type of `total_bytes' from `int' to `size_t',
2812 since the former wouldn't always be wide enough.
2813 Don't coerce safe_read return value to `int',
2814 and adapt tests accordingly.
2815 Now that testing for a read error no longer involves
2816 using `tmp', handle that case *after* freeing `tmp'.
2817 (start_bytes): Clean up.
2818 (tail_bytes): Now that `n_bytes' may be larger than
2819 OFF_T_MAX, test for that condition and, if it's true, don't
2820 use lseek optimizations.
2821 (parse_options): Don't fail just because N_UNITS is larger than
2822 the maximum size of a file -- tail may be applied to an input
2823 stream (e.g., a pipe) with more data than that.
2825 * Makefile.maint (syntax-check): Rename from alloc-check.
2826 Also check for SPACE-TAB sequences.
2827 Also check for malloc/calloc/realloc casts.
2829 2003-05-01 Jim Meyering <jim@meyering.net>
2831 * src/tail.c (start_lines): Rewrite to use memchr. Clean up.
2833 2003-04-28 Jim Meyering <jim@meyering.net>
2835 * tests/misc/tty-eof: Send two tokens, not just one, so we don't
2836 make the now-more-picky tsort fail.
2838 2003-04-24 Jim Meyering <jim@meyering.net>
2840 * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
2841 (main): Minor syntactic clean-up.
2843 * src/tsort.c (tsort): Fail if the input contains an odd number of
2844 tokens. Reported by junkio@cox.net.
2846 * tests/tsort/basic-1: Test for the above fix.
2848 2003-04-21 Jim Meyering <jim@meyering.net>
2850 * tests/misc/printf: Add tests for the printf fixes below.
2852 * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
2854 2003-04-20 Paul Eggert <eggert@twinsun.com>
2856 Fix printf POSIX compatibility bug reported by Ben Harris in
2857 <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
2858 * doc/coreutils.texi (printf invocation): It's \NNN in the format,
2859 \0NNN in the %b operand.
2860 * src/printf.c (usage): Likewise.
2861 (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
2862 is desired. All uses changed. Behave like Bash printf if %b
2863 operand uses \NNN where the initial N is not 0.
2865 2003-04-17 Jim Meyering <jim@meyering.net>
2867 * src/stty.c: Remove uses of PROTOTYPE macro.
2869 2003-04-15 Jim Meyering <jim@meyering.net>
2871 * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
2872 each sequence of spaces before a TAB character.
2874 2003-04-13 Jim Meyering <jim@meyering.net>
2876 * src/remove.c (is_empty_dir): Don't closedir (NULL).
2878 2003-04-12 Jim Meyering <jim@meyering.net>
2880 Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
2881 --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
2882 FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
2883 * src/nl.c (main): Fix those problems and remove literal quote marks
2884 (e.g., "`%s'") from format string; instead use "%s" in each format
2885 string and `quote (optarg)' as the corresponding argument.
2886 Also, diagnose all invalid command line options before failing.
2888 * src/nl.c (proc_text): Fix a bug that would make nl output extra
2889 newlines in some cases. Details here: http://bugs.debian.org/177256.
2890 This bug was introduced on 2001-11-10 for textutils-2.0.17.
2891 * tests/misc/nl: Add test for the above-fixed bug.
2893 * tests/misc/readlink: New file. Test the --canonicalize option.
2894 * tests/misc/Makefile.am (TESTS): Add readlink.
2896 2003-04-11 Jim Meyering <jim@meyering.net>
2899 * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
2900 * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
2901 * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
2902 retain alignment) each sequence of spaces before a TAB character.
2904 * src/ls.c: Include <stdlib.h> unconditionally.
2906 * Makefile.maint (xalloc-check): Rename from header-check.
2908 * src/yes.c: Include error.h after system.h, not before.
2911 * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
2912 * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
2913 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
2914 * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
2915 * src/tr.c: * src/unexpand.c, src/users.c:
2916 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
2917 return values and of xrealloc's first argument.
2918 Fix the former with this:
2919 perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
2921 2003-04-10 Jim Meyering <jim@meyering.net>
2923 * src/stty.c (wrapf): Declare with format attribute.
2925 The S_MAGIC_... names shouldn't be maintained in two places (prior
2926 to this change, one would have to keep stat.c and fs.h in sync).
2927 This change makes it so those names and the corresponding
2928 hexadecimal constants all reside in stat.c. fs.h is now generated.
2929 * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
2930 (BUILT_SOURCES): Add fs.h, now that it's generated.
2931 (EXTRA_DIST): Add extract-magic.
2932 * src/extract-magic: New script to extract fs.h definitions from stat.c.
2933 * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
2934 fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
2936 * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
2937 file with nominal length > 4GB fails. Reported by Michael Deutschmann.
2939 * man/unexpand.x: Add `SEE ALSO' reference to expand.
2940 * man/expand.x: Add `SEE ALSO' reference to unexpand.
2941 Suggestion from Dan Jacobson.
2943 2003-04-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
2945 * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
2946 * src/stat.c (human_fstype): Handle Linux's devpts.
2948 2003-04-09 Paul Eggert <eggert@twinsun.com>
2950 * src/split.c (line_bytes_split): Arg is of type size_t, since
2951 that's all that is supported for now.
2952 (main): Check for overflow in obsolescent line count option.
2954 2003-04-09 Jim Meyering <jim@meyering.net>
2956 * tests/misc/split-fail: Add a new test for the above fix.
2958 * src/split.c (bytes_split): Use size_t temporary (rather than
2959 uintmax_t original) in remaining computations. From Paul Eggert.
2961 Handle command line option arguments larger than 2^31.
2962 This allows e.g., splitting into files of size 2GB and larger,
2963 and running split --lines=N with N=2^31 or more.
2964 But for --line-bytes=N, the restriction that N <= SIZE_MAX
2965 remains (for now), due to the way it is implemented.
2967 * src/split.c: Include "inttostr.h".
2968 (bytes_split, lines_split, line_bytes_split, main):
2969 Use uintmax_t, not size_t, for file sizes.
2970 (main): Give a better diagnostic for option arguments == 0.
2971 Use umaxtostr to print file sizes.
2972 Reported by Luke Hassell.
2974 2003-04-08 Jim Meyering <jim@meyering.net>
2976 * src/rm.c (usage): Mention that --directory (-d) works only
2977 on some systems. Suggestion from Samuel Tardieu.
2979 * tests/basename/basic: Run $PERL to see if it is available,
2980 rather than testing its value.
2981 * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
2982 * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
2983 * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
2984 * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
2985 * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
2986 * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
2987 * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
2988 * tests/sum/basic-1, tests/seq/basic: Likewise.
2990 * tests/misc/Makefile.am (TESTS): Add split-fail.
2991 * tests/misc/split-fail: New file.
2993 * src/split.c: Rename local variables: nchars -> n_bytes.
2994 (lines_split): Rename local, nlines -> n_lines.
2995 (main): Rename local variable: s/accum/n_units/.
2996 (main): Use STDIN_FILENO, not literal `0'.
2998 2003-04-07 Jim Meyering <jim@meyering.net>
3000 * src/stat.c: Add #include directives for Ultrix 4.4.
3001 Based on a suggested change from Bert Deknuydt.
3003 2003-04-06 Jim Meyering <jim@meyering.net>
3005 * Makefile.maint (makefile-check): New rule.
3006 (local-check): Add it.
3008 2003-04-05 Jim Meyering <jim@meyering.net>
3010 * Makefile.am (nearly all of them):
3011 Use $(VAR) rather than @VAR@, now that we can rely on automake to
3012 emit a definition for each substituted variable.
3013 * tests/Makefile.am.in: Likewise.
3015 * tests/rm/rm5: Add a comment explaining why this test fails when
3016 using Tru64's broken sed.
3017 * tests/rm/rm3: Likewise.
3019 Make `kill -t' output signal descriptions (not `?') on Tru64.
3020 * src/kill.c (sys_siglist): Also check for __sys_siglist.
3021 Patch by Tony Leneis.
3022 * configure.ac: Also check for declaration of __sys_siglist.
3023 Required for Tru64 4.0D, 4.0F, and 5.1.
3024 Reported by Tony Leneis.
3026 2003-04-04 Jim Meyering <jim@meyering.net>
3028 * src/Makefile.am (PERL): Remove unnecessary definition.
3030 Because of inappropriate (but POSIX-mandated) behavior of rename,
3031 `mv a b' would not remove `a' in some unusual cases. Work around
3032 this by unlinking `a' when necessary.
3034 * src/copy.c (same_file_ok): Add an output parameter.
3035 Set it in the offending case.
3036 (copy_internal): When necessary, unlink SRC_PATH and inform caller.
3037 Reported by Ed Avis.
3038 * tests/mv/hard-4: New test for the above.
3039 * tests/mv/Makefile.am (TESTS): Add hard-4.
3041 Clean up rules for automatically generated sources:
3042 * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
3043 Make each generated file be read-only.
3044 Add each file name to BUILT_SOURCES separately.
3045 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
3047 Put LOCALEDIR macro definition in new file: localedir.h.
3048 * src/Makefile.am (DEFS): Remove definition.
3049 (localedir.h): New rule.
3050 (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
3051 * src/system.h: Include "localedir.h".
3053 2003-04-02 Jim Meyering <jim@meyering.net>
3057 * tests/misc/Makefile.am (TESTS): Add false.
3059 * Makefile.maint (TMPDIR): Make sure it's defined.
3060 (my-distcheck): Build in $(TMPDIR), not `.'.
3062 * src/Makefile.am (false.c): Change all occurrences of
3063 `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
3064 unsuccessfully also with --help. Reported by Paul Jarc,
3065 * tests/misc/false: New test for the above.
3067 2003-03-30 Jim Meyering <jim@meyering.net>
3069 * NEWS: Note the location of older NEWS files.
3071 * src/remove.c (is_empty_dir): Don't let a failing closedir
3072 clobber errno. Spotted by Arnold Robbins.
3074 * src/env.c: Fix typo in comment. From Arnold Robbins.
3076 2003-03-29 Jim Meyering <jim@meyering.net>
3080 * README: Note to expect build problems for stat.c on Ultrix 4.3.
3081 Note that there are some harmless test failures when running
3082 `make check' as root on some systems.
3084 2003-03-28 Jim Meyering <jim@meyering.net>
3086 * tests/stty/row-col-1: Skip this test if stty can't get window size.
3087 This happens when connecting to sparc-solaris5.7 via ssh from within
3088 emacs. Reported by Karl Berry.
3090 * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
3091 Otherwise, on systems (DJGPP) that emulate pipes using files,
3092 this test would never complete, waiting for `yes' to terminate.
3093 * tests/du/slink: As above, use seq, not `yes' to generate link target.
3094 * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
3095 Reported by Rich Dawe.
3097 2003-03-27 Jim Meyering <jim@meyering.net>
3099 * src/id.c: Remove Arnold Robbins' obsolete e-mail address
3100 from `written by...' comment, at his request.
3102 2003-03-24 Paul Eggert <eggert@twinsun.com>
3104 Fix buffer overrun problem reported by TAKAI Kousuke, along
3105 with some other POSIX incompatibilities.
3107 * src/printf.c (print_esc): Do not treat \x specially if
3108 POSIXLY_CORRECT. Avoid buffer overrun if the format ends
3109 in backslash. Treat incomplete escape sequences as strings
3110 of characters, as POSIX requires.
3111 (print_formatted): Allow multiple flags. Avoid buffer overrun
3112 if the format is incomplete.
3114 2003-03-24 Jim Meyering <jim@meyering.net>
3116 * tests/misc/printf: Add tests for the above fixes and changes.
3118 2003-03-26 Jim Meyering <jim@meyering.net>
3120 * src/copy.h (struct cp_options): Add a comment.
3122 2003-03-23 Jim Meyering <jim@meyering.net>
3124 * README: Describe problem with 64-bit mode on HPUX 11.x,
3125 with patch for /usr/include/inttypes.h.
3126 * TODO: Plan to add an autoconf test to work around the bug.
3128 2003-03-22 Jim Meyering <jim@meyering.net>
3130 * src/stat.c: Don't include <sys/sysmacros.h>.
3131 That is already done via system.h. Otherwise, the multiple
3132 inclusion would evoke redefinition warnings from Cray's /bin/cc,
3133 aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28.
3134 (human_fstype): Factor some directives `up', out of this function.
3135 Cast away `const' to avoid error from Cray's /bin/cc.
3137 2003-03-20 Jim Meyering <jim@meyering.net>
3139 * announce-gen (print_changelog_deltas): Ensure that a newline
3140 precedes each row of `*'s.
3142 2003-03-20 Jim Meyering <jim@meyering.net>
3146 * src/seq.c (valid_format): Also accept ` ' and `'' as valid
3147 format flag characters.
3148 Do not require that a field width be specified.
3149 Do not fail when given a field width of `0'.
3150 Reported by Dan Jacobson.
3151 * tests/seq/basic: Add new tests for the above-fixed bug.
3153 * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
3154 (install-root): Likewise.
3155 (install-exec-local): Likewise.
3156 Based on a patch from Richard Dawe.
3158 2003-03-19 Jim Meyering <jim@meyering.net>
3160 * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
3161 because the DJGPP 2.03 port of 'ln -s' doesn't work.
3162 Include $(EXEEXT) in program names.
3163 Since $(LN_S) may degenerate to `cp -p', be careful
3164 to invoke it from the destination directory.
3165 Mostly from Richard Dawe.
3166 * configure.ac: Use AC_PROG_LN_S.
3168 * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the
3169 CDPATH shell variable set could cause this test to fail.
3170 Reported by Karl Berry.
3172 2003-03-18 Jim Meyering <jim@meyering.net>
3174 * src/fmt.c [struct Word] (paren, period, punct, final): Change the
3175 type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
3176 AIX 5.1's xlc could not compile the former.
3177 Patch by Petter Reinholdtsen. Also reported by Mike Jetzer.
3179 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
3181 * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
3182 program names, since automake only adds $(EXEEXT) to programs
3185 2003-03-16 Jim Meyering <jim@meyering.net>
3187 * src/remove.c (rm): Put two local variables in static storage,
3188 so they can't be clobbered by the potential longjmp.
3190 2003-03-15 Jim Meyering <jim@meyering.net>
3192 * Makefile.cfg (gnu_rel_host): Fix code to match the comment
3193 so that a version number with a two-digit component can still count
3194 as an alpha release. Reported by Richard A Downing.
3195 (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
3197 2003-03-14 Jim Meyering <jim@meyering.net>
3199 * src/ansi2knr.c: Remove no-longer-used file.
3200 * src/ansi2knr.1: Likewise.
3202 * Makefile.maint (prev_version_file): Don't use ?= for this particular
3203 assignment, since it causes trouble with old versions of GNU make
3204 (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here.
3205 http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
3206 Patch from Alexandre Duret-Lutz.
3208 * Use patched automake-1.7.3. Regenerate Makefile.in files in
3209 subdirectories so that each includes a definition of ACLOCAL_M4.
3211 * announce-gen (main): Label the compressed source URLs.
3215 * tests/du/slink: Relax the test for the `local'ness of a file system,
3216 so that now it works also for tmpfs.
3218 * tests/du/hard-link: Transform output from first du, so that this
3219 test doesn't fail on file systems like tmpfs that order directory
3220 entries differently.
3222 2003-03-13 Jim Meyering <jim@meyering.net>
3224 * tests/du/8gb: Work around what appears to be an NFS failure that
3225 would make this test fail on some systems.
3227 2003-03-11 Jim Meyering <jim@meyering.net>
3229 * tests/du/basic: Make the test file exactly 4k bytes long.
3231 * src/split.c (longopts): Don't hard-code `2' here.
3232 Instead, just specify `&verbose', and ...
3233 (main): ... remove the `case 2:' block for --verbose.
3235 * tests/du/basic: Make the test file larger than 64 bytes, so that
3236 we don't immediately disqualify file systems (e.g., NetApp) on which
3237 smaller files take up zero disk blocks. Reported by Vin Shelton.
3239 2003-03-10 Jim Meyering <jim@meyering.net>
3241 Don't segfault for a negative field width or precision in format string.
3242 Note that this is just a stopgap fix. The longer term solution may
3243 involve adapting bash's builtins/printf.def.
3245 * src/printf.c: (UNSPECIFIED): Define.
3246 (print_direc): Use the special value, UNSPECIFIED, to indicate
3247 that field_width or precision has not been specified.
3248 (print_formatted): Fail if field_width or precision is the
3249 special value, UNSPECIFIED.
3250 Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
3252 * src/sys2.h (INT_MIN): Define, if necessary.
3253 * tests/misc/printf: Add a test for the above-fixed bug.
3255 2003-03-09 Jim Meyering <jim@meyering.net>
3257 * src/remove.c (AD_stack_pop): Cast sizeof... to int before
3258 changing its sign. This avoids a warning from gcc on 64-bit systems.
3259 Reported by Bob Proulx.
3260 (pop_dir): Reverse order of sign change and cast, to be consistent
3263 2003-03-08 Jim Meyering <jim@meyering.net>
3265 * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
3266 shell variable, but only in the environment. With /bin/sh->bash, the
3267 shell variable is set to `y', and that would cause a spurious warning.
3268 Reported by Bob Proulx.
3270 * tests/Makefile.am (check-root): Remove touch/fifo.
3271 It doesn't appear to have to be run as root.
3273 * tests/rm/fail-2eperm: Rather than simply using the first non-root
3274 user name, make sure that the selected user name has a usable shell.
3275 Reported by Paul Jarc.
3277 Before, when using shred on a device, one had to specify --exact,
3278 or be careful to choose a size that would not be rounded up and
3279 exceed the maximum value; that could result in a failure of
3281 * src/shred.c (do_wipefd): --exact is now the default for non-regular
3282 files. Suggestion from Ben Elliston.
3285 * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
3286 Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
3287 Patch by Bob Proulx.
3289 * src/Makefile.am (check-misc): Check for use of `defined' in
3291 Change to $(srcdir) before running grep.
3293 * src/sleep.c: Remove now-unused #include and #define directives.
3295 * src/du.c (process_file): If a file's size is not being counted
3296 e.g., because it's a hard link to a file we've already counted,
3297 then don't print a line for it.
3299 * tests/du/hard-link: New test for the above-fixed bug.
3300 * tests/du/Makefile.am (TESTS): Add hard-link.
3303 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
3304 and make the two-array approach work.
3306 * tests/du/basic: Correct/add tests for the above fix.
3307 Set LC_ALL, etc., now that we use sort.
3308 Check the block/size of a small file, too.
3309 Correct expected results for simple dir1/dir2/file case.
3310 Add another test of du -S.
3312 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
3314 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
3315 middle-end/9986). As one of GCC's optimizations, it transforms a
3316 fputs_unlocked call to a fputc_unlocked call when the string is
3317 one character long. However, hpux doesn't have fputc_unlocked.
3319 * expr.c (usage): Use putchar, not fputs, to output a single character.
3320 * ls.c (dired_dump_obstack): Likewise.
3321 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
3322 * stat.c (print_it): Likewise.
3324 2003-03-07 Jim Meyering <jim@meyering.net>
3326 * src/cp.c: Remove everything associated with mmap-stack.c.
3327 This reverts the two changes of 2003-02-21.
3328 * src/du.c: Remove everything associated with mmap-stack.c.
3329 This reverts the change of 2003-02-19.
3331 2003-03-06 Jim Meyering <jim@meyering.net>
3333 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
3334 CDPATH shell variable set could cause this test to fail.
3335 Reported by Karl Berry.
3337 2003-03-05 Jim Meyering <jim@meyering.net>
3341 * src/printf.c (print_esc): Remove pointless comparison of unsigned
3342 integer with zero, to avoid a warning from Intel's ecc.
3343 Reported by Nelson Beebe.
3345 * src/du.c (process_file): Sizes must all be of type uintmax_t.
3346 Otherwise, for files or totals that are too big, numbers would
3347 be truncated. Patch mostly by Michael Stone.
3348 Reported by Ingo Saitz as Debian bug #183210.
3350 * tests/du/8gb: New test for the above-fixed bug.
3351 * tests/du/Makefile.am (TESTS): Add 8gb.
3353 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
3354 rather than UTILS_OPEN_MAX - 10.
3356 2003-03-04 Jim Meyering <jim@meyering.net>
3358 * README: Refer new feature discussion to bug-coreutils@gnu.org,
3359 rather than bug-gnu-utils, now that the former is better known.
3360 Suggestion from Göran Uddeborg.
3362 * src/stat.c (usage): Capitalize consistently.
3363 Reported by Göran Uddeborg.
3365 * Makefile.maint (rel-files): Include $(signatures), so that
3366 those files are also copied into $(release_archive_dir).
3368 * src/df.c (find_mount_point): Call error here, now that restore_cwd
3370 * src/remove.c (AD_pop_and_chdir): Likewise.
3372 * tests/Makefile.am (check-root): Add fail-2eperm.
3374 2003-03-03 Jim Meyering <jim@meyering.net>
3376 * src/remove.c (remove_cwd_entries): Include the full filename of
3377 the offending file, not just the basename.
3379 * tests/misc/tty-eof: Set $ME properly.
3381 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
3382 Remove now-unused variables.
3383 (tag-prev-version, prev-cvs-tag): Likewise.
3385 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
3386 accurate diagnostic when failing to remove a file owned by some other
3387 user. Reported by Ivo Timmermans via Michael Stone.
3388 This fixes Debian bug# 178471.
3390 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
3391 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
3392 Based on a report from Ivo Timmermans.
3394 2003-03-02 Jim Meyering <jim@meyering.net>
3396 * src/copy.c (copy_internal) [un_backup]: When recovering from a
3397 failure to create a hard link, do not remove the entry associating
3398 the source dev/ino with the destination file name.
3399 * tests/mv/Makefile.am (TESTS): Add hard-3.
3400 * tests/mv/hard-3: New test, for the above-fixed bug.
3401 Inspired by a report from Iida Yosiaki.
3403 2003-03-01 Jim Meyering <jim@meyering.net>
3405 * src/df.c (print_header): Don't embed spaces in a separate `Type'
3406 header string. Instead, put `Filesystem' and `Type' headers in the
3407 same string, so translators can use horizontal space as needed.
3408 Reported by Jean Charles Delepine.
3410 2003-02-28 Jim Meyering <jim@meyering.net>
3412 * src/copy.c (copy_internal): When link fails because of an
3413 existing destination file, unlink that file and try again.
3414 Reported by Iida Yosiaki.
3416 * tests/mv/Makefile.am (TESTS): Add hard-2.
3417 * tests/mv/hard-2: New test for the above-fixed bug.
3418 Based on a test case from Iida Yosiaki.
3420 2003-02-26 Jim Meyering <jim@meyering.net>
3422 * tests/du/basic: Don't test du's -b option here. Directory byte
3423 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
3424 and IBM AIX 4.2. Reported by Nelson Beebe.
3426 2003-02-25 Jim Meyering <jim@meyering.net>
3428 * Makefile.maint (announcement): Now that ChangeLog entries
3429 are output by announce-gen, don't do it here.
3430 * announce-gen (print_changelog_deltas): New function.
3433 2003-02-22 Jim Meyering <jim@meyering.net>
3435 * announce-gen: New option: --release-type=TYPE
3436 * Makefile.maint (beta, major): New targets. Remove `release'.
3437 Put them all together on a line.
3438 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
3439 invocation of `announcement'.
3440 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
3442 * announce-gen: New option: --news=NEWS_FILE.
3443 Extract NEWS entries here, not via rules in Makefile.maint.
3444 * Makefile.maint (announcement): Now that NEWS entries are
3445 extracted by announce-gen, don't do it here.
3446 (news-r1, news-r2): Remove now-unused definitions.
3448 2003-02-21 Jim Meyering <jim@meyering.net>
3452 Merge in changes from autoconf's version of this file.
3453 * Makefile.maint (www-gnu): Define.
3454 (standards.texi-url_prefix): Use $(www-gnu).
3455 (make-stds.texi-url_prefix): Likewise.
3457 * src/cp.c: Include "mmap-stack.h".
3458 (main): Invoke `run' through a macro that (when possible) runs it
3459 with a large, mmap'd stack.
3461 * src/cp.c (run): New function, preparing for the above.
3462 Exit from this function, not from main
3465 * src/du.c: New option: --apparent-size.
3466 (enum) [APPARENT_SIZE_OPTION]: New member.
3467 (long_options): Add it.
3468 (usage): Describe it.
3470 ['b']: Set apparent_size.
3471 David Eisner reported that the behavior of --bytes had changed.
3472 Paul Eggert proposed the use of a new option, --apparent-size.
3474 * src/du.c (apparent_size): New global.
3475 (print_only_size): Reflect the fact that we're printing byte counts,
3476 not ST_NBLOCKSIZE-byte-block counts.
3477 (print_size): Call print_only_size rather than duplicating its code.
3478 (process_file): Accumulate byte counts, rather than block counts.
3480 * src/du.c (process_file): Always reset size_to_propagate_to_parent
3481 for --separate-dirs (-S).
3483 2003-02-20 Jim Meyering <jim@meyering.net>
3485 * Use automake-1.7.3. Regenerate dependent files.
3487 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
3488 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
3489 (usage) [%B]: Describe it.
3492 * src/du.c (process_file): Reorganize the code to use only
3493 one `sum' array, and change how -S works back to the way it was
3494 before 2003-01-31. Patch by Bruno Haible.
3496 * tests/du/basic: New test.
3497 * tests/du/Makefile.am (TESTS): Add basic.
3499 * tests/envvar-check: Add checks for the following:
3500 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
3502 * tests/Makefile.am: Rename phony target envvar-check to evar-check
3503 so as not to conflict with the distributed file by the same name.
3505 * src/du.c (process_file): Set info->skip before any possible return.
3507 Report correct usage for directories, not 0.
3508 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
3509 _before_ recording the dev/ino of a directory.
3510 Reported by Bruno Haible.
3512 Now, df always displays the device file name corresponding to the
3513 listed mount point under `Filesystem'. Before, for an unmounted
3514 block- or character-special file argument, it would display the
3515 command-line argument instead.
3516 * src/df.c (show_disk): Return a value indicating whether
3517 there was a match. Don't try to find a mount point here.
3518 (show_entry): If show_disk doesn't find a match, call show_point.
3520 2003-02-19 Jim Meyering <jim@meyering.net>
3522 * src/du.c: Include "mmap-stack.h".
3523 (du_files): Add prototype with ATTRIBUTE_NORETURN.
3524 Exit from this function, not from...
3526 Instead, if possible, invoke du_files through a macro that
3527 runs it with a large, mmap'd stack.
3529 * src/join.c (usage): Change wording in --help output:
3530 use FILENUM instead of `SIDE' and say what FILENUM means.
3531 Reported by Bernhard Gabler.
3533 * src/df.c (print_header): Rather than using a hard-coded literal
3534 string of spaces matching the length of the English `...Type' header,
3535 output the right number of spaces to match the selected translation.
3536 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
3538 * src/split.c (bytes_split): Remove unnecessary `else' after break.
3539 (lines_split): Likewise. and correct misleading indentation.
3541 * src/split.c: Include "full-read.h".
3542 (bytes_split, lines_split, line_bytes_split): Use full_read,
3543 not safe_read. The way split was using the latter, a short read
3544 could cause split to terminate before EOF.
3546 * tests/misc/tty-eof: Test all programs that can read stdin,
3547 requiring no arguments and that write to standard output.
3549 * tests/misc/tty-eof: New file. Renamed from ...
3550 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
3551 * tests/misc/Makefile.am (TESTS): Reflect renaming.
3553 2003-02-18 Jim Meyering <jim@meyering.net>
3555 cksum would perform an extra read after encountering EOF
3556 * src/cksum.c (cksum): Exit the loop upon EOF, too.
3557 Patch by Michael Bacarella.
3559 Test for the bug fixed today in cksum, md5sum, and sha1sum.
3560 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
3561 cat, cksum, md5sum, and sha1sum all in the same loop.
3563 2003-02-14 Jim Meyering <jim@meyering.net>
3565 * src/remove.c: Include "euidaccess.h".
3566 Remove declaration of euidaccess.
3568 2003-02-12 Jim Meyering <jim@meyering.net>
3570 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
3571 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
3573 2003-02-10 Jim Meyering <jim@meyering.net>
3575 * src/test.c: Don't include group-member.h.
3576 Include euidaccess.h.
3577 (eaccess): Rewrite function to set the real uid and gid temporarily
3578 to the effective uid and gid, then invoke 'access', and then set the
3579 real uid and gid back. On systems that lack setreuid or setregid,
3580 fall back on the kludges in euidaccess. Before, it would not work
3581 for e.g., files with ACLs, files that were marked immutable,
3582 or on file systems mounted read-only. Nelson Beebe raised the issue.
3583 Paul Eggert suggested the new implementation.
3585 2003-02-09 Jim Meyering <jim@meyering.net>
3587 * src/test.c (test_stat): Remove function. It's job is done (only
3588 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
3590 2003-02-08 Jim Meyering <jim@meyering.net>
3594 * tests/mv/part-symlink: Don't assume that the file owner username
3595 length is less than 9 in ls output: instead, omit that field
3596 altogether. Reported by, and suggested fix from, Ferdinand.
3598 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
3599 * tests/du/Makefile.am (TESTS): Add restore-wd.
3601 * src/rm.c: Correct now-invalid comment about cycle-detection.
3603 2003-02-06 Jim Meyering <jim@meyering.net>
3605 * NEWS: Add entries from old/*/NEWS
3606 from fileutils-4.1 through 4.1.11 and
3607 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
3611 * src/du.c (process_file): Don't return early for excluded files
3612 or for files whose dev/inode we've already seen.
3614 2003-02-05 Jim Meyering <jim@meyering.net>
3616 * tests/du/exclude: New file.
3617 * tests/du/Makefile.am (TESTS): Add exclude.
3619 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
3621 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
3622 Fix memory allocation arithmetic.
3624 2003-02-04 Jim Meyering <jim@meyering.net>
3626 `df /dev/block-or-char-device-file--not-mounted' now reports
3627 the name of the file system on which the file resides, usually `/'.
3628 Before, it would leave the `Mounted on' field blank.
3629 * src/df.c (show_disk): Move function to precede find_mount_point.
3630 (show_disk): Add parameter: STATP.
3631 If we don't find a matching device name, then resort to calling
3632 find_mount_point. Reported by Bob Proulx.
3634 2003-02-03 Andreas Schwab <schwab@suse.de>
3636 * tests/rm/cycle: Require non-root.
3637 * tests/rm/isatty: Likewise.
3639 2003-02-02 Jim Meyering <jim@meyering.net>
3643 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
3645 Ensure that there are no offending uses of `:'.
3646 * Makefile.maint (makefile_path_separator_check): New rule.
3647 (local-check): Add it to the list.
3649 2003-02-01 Jim Meyering <jim@meyering.net>
3651 * src/du.c (MAX_N_DESCRIPTORS): Define.
3653 * src/stat.c (G_fail): New global.
3654 (human_time): Diagnose failed localtime, not failed nstrftime.
3655 (main): Fail if G_fail is set.
3657 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3659 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
3660 hard-coding the path-separator. Also double-quote the new PATH,
3661 to avoid problems when the path-separator is a semi-colon or when
3662 `pwd` contains e.g. a space.
3663 * tests/chgrp/Makefile.am: Likewise.
3664 * tests/chmod/Makefile.am: Likewise.
3665 * tests/chown/Makefile.am: Likewise.
3666 * tests/cp/Makefile.am: Likewise.
3667 * tests/dd/Makefile.am: Likewise.
3668 * tests/dircolors/Makefile.am: Likewise.
3669 * tests/du/Makefile.am: Likewise.
3670 * tests/expr/Makefile.am: Likewise.
3671 * tests/factor/Makefile.am: Likewise.
3672 * tests/fmt/Makefile.am: Likewise.
3673 * tests/install/Makefile.am: Likewise.
3674 * tests/ln/Makefile.am: Likewise.
3675 * tests/ls/Makefile.am: Likewise.
3676 * tests/ls-2/Makefile.am: Likewise.
3677 * tests/md5sum/Makefile.am: Likewise.
3678 * tests/misc/Makefile.am: Likewise.
3679 * tests/mkdir/Makefile.am: Likewise.
3680 * tests/mv/Makefile.am: Likewise.
3681 * tests/od/Makefile.am: Likewise.
3682 * tests/rm/Makefile.am: Likewise.
3683 * tests/rmdir/Makefile.am: Likewise.
3684 * tests/seq/Makefile.am: Likewise.
3685 * tests/sha1sum/Makefile.am: Likewise.
3686 * tests/shred/Makefile.am: Likewise.
3687 * tests/stty/Makefile.am: Likewise.
3688 * tests/sum/Makefile.am: Likewise.
3689 * tests/tail-2/Makefile.am: Likewise.
3690 * tests/touch/Makefile.am: Likewise.
3691 * tests/tsort/Makefile.am: Likewise.
3692 * tests/unexpand/Makefile.am: Likewise.
3694 2003-01-31 Jim Meyering <jim@meyering.net>
3696 * src/stat.c: Include "file-type.h"
3697 (print_human_type): Remove function.
3698 (human_access): Rename from print_human_access. Return a string.
3699 (human_time): Rename from print_human_time. Return a string.
3700 (print_stat): Arrange so that field width and an alignment specifier
3701 are honored for the %A, %F, %x, %y, and %z formats.
3702 [%F]: Use file_type; this gives slightly different file type strings,
3703 e.g., `directory' instead of `Directory' and `regular file' or
3704 `regular empty file' instead of `Regular file'.
3705 Prompted by a report from Richard Dawe that the uses of
3706 S_IFSOCK and S_IFIFO in print_human_time were not portable
3707 to systems using e.g., DJGPP.
3709 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3711 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
3712 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
3714 2003-01-31 Jim Meyering <jim@meyering.net>
3716 * src/du.c (main): Upon processing an invalid option or an invalid
3717 --exclude-from or --max-depth option argument, don't exit right away,
3718 in case there are others. Rather record the failure and exit after
3719 processing other options.
3721 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
3722 tar archive easier to reproduce.
3724 Rewrite to perform directory traversal using nftw.
3726 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
3727 (AUTHORS): Add self.
3728 (opt_one_file_system): Move global into `main'.
3729 (path, xstat, exit_status): Remove declarations.
3730 (arg_length, suffix_length): New globals.
3731 (G_fail): New global, sort of like the old `exit_status'.
3732 (IS_FTW_DIR_TYPE): Define.
3733 (print_only_size): New function.
3734 (process_file): New function.
3735 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
3736 (str_trunc, pop_dir, count_entry): Likewise.
3737 (du_files): Rewrite to use nftw.
3739 2003-01-30 Jim Meyering <jim@meyering.net>
3741 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
3742 symlink-to-directory with -L, even without the trailing slash.
3744 2003-01-27 Jim Meyering <jim@meyering.net>
3746 * src/Makefile.am (check-misc): Check for st_blocks, too.
3748 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
3749 Reported by Richard Dawe.
3751 2003-01-27 Andreas Schwab <schwab@suse.de>
3753 * src/ls.c (quote_name): Add fourth parameter, width, into which to
3754 store the screen columns, and return the number of bytes instead.
3755 (print_dir): Pass NULL as fourth parameter of quote_name.
3756 (print_name_with_quoting): Likewise.
3757 (length_of_file_name_and_frills): Get the width from the fourth
3758 parameter of quote_name instead of return value.
3760 2003-01-27 Jim Meyering <jim@meyering.net>
3762 * src/ls.c (decode_switches): If `dired' is set without
3763 `format == long_format', then silently reset dired. This doesn't
3764 change the behavior of ls (all prior uses of dired were protected
3765 by `&& format == long_format'), and lets us...
3766 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
3767 (PUSH_CURRENT_DIRED_POS): Likewise.
3770 2003-01-22 Jim Meyering <jim@meyering.net>
3772 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
3773 * tests/du/Makefile.am (TESTS): Add no-x.
3775 2003-01-21 Jim Meyering <jim@meyering.net>
3777 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
3778 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
3779 it may still be a directory -- or not (e.g., with FreeBSD on an
3780 NFS-mounted file system), so resort to calling lstat to find out.
3781 Based on a patch by Michael van Elst.
3783 * tests/cp/same-file: Don't assume that the file owner username
3784 length is less than 9 in ls output: instead, omit that field
3785 altogether. Reported by, and suggested fix from, Ferdinand.
3787 2003-01-20 Jim Meyering <jim@meyering.net>
3789 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
3790 large format widths no longer cause strftime to infloop.
3792 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
3794 2003-01-19 Jim Meyering <jim@meyering.net>
3796 * src/readlink.c: Include "canonicalize.h".
3798 2003-01-18 Jim Meyering <jim@meyering.net>
3800 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
3802 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
3803 (long_options): Add option --dereference-command-line-symlink-to-dir.
3804 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
3805 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
3806 -d, -F, -l options is specified.
3807 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
3808 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
3809 Change --dereference-command-line (-H) to dereference *all*
3810 command line arguments, including broken symlinks.
3812 2003-01-15 Paul Eggert <eggert@twinsun.com>
3814 Change ls -H back to the way it was yesterday, since this is
3815 compatible with FreeBSD and the POSIX spec is confusing
3816 and somewhat contradictory.
3818 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
3819 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
3820 (long_options): Change the long option name back.
3821 (usage): Change the usage back.
3822 (gobble_file): When -H is specified, dereference a top-level
3823 arg even if it points to a non-directory.
3825 2003-01-15 Jim Meyering <jim@meyering.net>
3827 * src/ls.c (gobble_file): Fall back on using lstat when required:
3828 when --dereference (-L) is not specified, and
3829 - when operating on a dangling symlink
3830 - when operating on command-line-symlink-to-directories
3831 This fixes numerous problems. Here are examples:
3832 - `ls dangling-symlink' would fail with `no such file...'
3833 Now it prints `dangling-symlink'.
3834 - `ls -i symlink' would mistakenly print the inode of the referent.
3835 Now it prints the inode of the symlink. Likewise for --size (-s).
3836 Based on a patch from Michael Stone.
3837 Reported by Deepak Goel as Debian bug #173793.
3839 Rename ls's --dereference-command-line (-H)
3840 option to --dereference-command-line-symlink-to-dir.
3841 * src/ls.c [enum Dereference_symlink]
3842 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
3843 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
3844 (long_options): Rename the long option.
3845 (usage): Say that --dereference-... changes how ls treats
3846 only symlinks to directories specified on the command line.
3848 2003-01-14 Jim Meyering <jim@meyering.net>
3850 * tests/ls/dangle: New file/test, for the above fix.
3851 * tests/ls/inode: Another new file/test, for the above fix.
3852 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
3854 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
3855 so that ls --color would no longer highlight the names of files with
3856 the execute bit set when not specified on the command line.
3857 Patch by Michael Stone. Reported by Stephen Depooter as
3860 * tests/ls-2/tests (color-exe): New test, for the above fix.
3862 2003-01-13 Jim Meyering <jim@meyering.net>
3864 * tests/shred/exact: Also test for just fixed bug with --zero.
3866 * src/shred.c (long_opts): --zero does not require an argument.
3867 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
3869 2003-01-12 Jim Meyering <jim@meyering.net>
3871 * Makefile.maint (cvs-update): Skip any file with local modifications.
3873 * src/unexpand.c (usage): Document --first-only and mention that
3874 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
3876 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
3878 * src/df.c: Include "canonicalize.h".
3879 Use canonicalize_file_name unconditionally.
3881 2003-01-09 Jim Meyering <jim@meyering.net>
3883 * README: Add readlink.
3885 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3887 * src/df.c: Include "xgetcwd.h".
3888 * src/pwd.c: Likewise.
3890 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3892 * src/shred.c: Remove declaration of xstrdup.
3893 We already get it via xalloc.h which is included via system.h.
3895 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
3897 New program: readlink.
3899 * src/Makefile.am (bin_PROGRAMS): Add readlink.
3900 * src/readlink.c: New file.
3902 * man/readlink.x: New file.
3903 * man/Makefile.am (dist_man_MANS): Add readlink.1.
3904 (readlink.1): New rule.
3906 2003-01-09 Jim Meyering <jim@meyering.net>
3908 When selecting ranges of byte offsets (as opposed to ranges of fields)
3909 and when --output-delimiter=STRING is specified, output STRING between
3910 ranges of selected bytes.
3911 * src/cut.c (RANGE_START_SENTINEL): Define.
3912 (output_delimiter_specified): New global.
3913 (print_kth): Add parameter. Adjust all callers.
3914 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
3915 (cut_bytes): When requested, output STRING between ranges of
3917 (main): Make a diagnostic a little clearer.
3918 Based on a patch from Jan Nieuwenhuizen.
3920 * tests/cut/Test.pm: New tests for the above.
3922 * src/cut.c (set_fields): Make code agree with comment:
3923 Don't merge abutting ranges like 4- and 2-3. This makes no
3924 difference currently, but is required to support an upcoming change.
3926 2003-01-07 Jim Meyering <jim@meyering.net>
3928 * src/cut.c (set_fields): Fix typo in comment.
3930 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
3931 * tests/touch/Makefile.am (TESTS): Add not-owner.
3932 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
3933 Now, this tests only the nonexistent-directory diagnostic.
3934 Suggestion from Michael Stone.
3936 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
3938 2003-01-04 Jim Meyering <jim@meyering.net>
3940 * src/copy.h: Remove use of PARAMS.
3941 * src/remove.h: Likewise.
3942 * src/chown-core.h: Likewise.
3944 rm could be tricked into mistakenly reporting a cycle.
3945 * src/remove.c: [cycle_check_state]: New global.
3946 (remove_cwd_entries): Adapt to new semantics of cycle_check.
3947 (rm): Call cycle_check_init and cycle_check_free for each file.
3948 * tests/rm/cycle (rm): New test, for the above fix.
3949 * tests/rm/Makefile.am (TESTS): Add cycle.
3951 When rm detects a cycle, don't abort the entire command,
3952 but rather just the affected command line argument.
3953 * src/remove.c: Include <setjmp.h>
3954 (struct dirstack_state) [current_arg_jumpbuf]: New member.
3955 (remove_cwd_entries): Call longjmp if we detect a cycle.
3956 (rm): Call setjmp here.
3958 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
3959 Instead, include cycle-check.h and use it.
3961 * src/remove.h (struct dev_ino): Remove declaration.
3963 * src/remove.c (remove_cwd_entries): Fix typos in comment.
3965 Don't include trailing /. in diagnostics about directories.
3966 * src/remove.c (full_filename_): When FILENAME is just `.'
3967 and there is a nonempty directory-name part, don't append `/.'.
3968 * tests/rm/unread2: Remove trailing /. from diagnostic.
3969 * tests/rm/rm2: Likewise.
3971 * src/remove.c (struct dirstack_state): Define.
3972 To be used in place of these file-scoped globals ...
3973 (dir_stack, len_stack, Active_dir): Remove globals.
3974 (ds_init, ds_free): New functions.
3975 (full_filename): Define.
3976 (full_filename_): Rename from full_filename.
3978 Begin to make AD_* functions more generic.
3979 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
3980 (AD_push): Likewise.
3981 (AD_INIT_OTHER_MEMBERS): Define.
3982 (remove_dir): Define the `status' member manually after each
3983 call to AD_push or AD_push_initial.
3985 * src/Makefile.am (check-misc): New rule, to ensure that no more
3986 S_IS* macro definitions sneak into the code.
3987 (check): Depend on check-misc.
3989 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
3990 * src/du.c (count_entry) [S_ISLNK]: Don't define.
3991 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
3993 2003-01-03 Jim Meyering <jim@meyering.net>
3995 * src/true.c: Add copyright.
3996 (AUTHORS): I suppose I've written it.
3998 * src/Makefile.am (false.c): Make the generated file be read-only.
4000 2003-01-04 Jim Meyering <jim@meyering.net>
4002 * src/ls.c: Include "dev-ino.h".
4003 [struct dev_ino]: Remove declaration.
4005 2003-01-02 Jim Meyering <jim@meyering.net>
4007 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
4008 from mv: s/missing file arguments/missing file argument/.
4009 With --target-directory=DIR, cp and mv work with a single file argument.
4010 Reported by Karl Berry.
4012 * tests/rm/isatty: Enable this test.
4014 2002-12-31 Jim Meyering <jim@meyering.net>
4016 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
4017 (AD_push): Likewise.
4018 (AD_INIT_OTHER_MEMBERS): Define.
4019 (remove_dir): Define the `status' member manually after each
4020 call to AD_push or AD_push_initial.
4022 * src/ls.c [struct dev_ino]: Remove definition.
4023 Include "dev-ino.h" instead.
4025 2002-12-28 Jim Meyering <jim@meyering.net>
4027 * tests/du/Makefile.am (TESTS): Add no-deref.
4028 * tests/du/no-deref: New script.
4030 2002-12-23 Jim Meyering <jim@meyering.net>
4032 * src/remove.c (remove_cwd_entries): Fix typo in comment.
4034 2002-12-21 Jim Meyering <jim@meyering.net>
4036 * announce-gen: Generate MML-formatted announcement.
4037 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
4039 2002-12-20 Jim Meyering <jim@meyering.net>
4041 * src/touch.c (touch): Change the wording of a diagnostic so
4042 that it makes sense both when the file exists and when it doesn't.
4043 Suggestion from Michael Stone.
4045 2002-12-18 Jim Meyering <jim@meyering.net>
4047 * src/stty.c (valid_options): Declare to be static.
4049 2002-12-15 Jim Meyering <jim@meyering.net>
4051 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
4053 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
4054 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
4055 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
4056 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
4057 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
4059 * src/remove.c (PARAMS): Remove definition.
4060 * src/sys2.h: Likewise.
4062 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
4063 Include strftime.h instead.
4065 2002-12-14 Jim Meyering <jim@meyering.net>
4067 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
4069 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
4070 This is necessary at least for Irix6.5 when using c89.
4071 Reported by Nelson Beebe.
4073 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
4075 * tests/misc/cat-tty-eof: New test.
4077 * src/mknod.c (usage): Specify how major and minor mode numbers
4078 are interpreted. Report forwarded by Kristin E Thomas.
4079 * src/mknod.c: Remove now-redundant usage-specifying comment.
4081 2002-12-13 Jim Meyering <jim@meyering.net>
4085 * tests/du/trailing-slash: Allow for a directory of size `0'.
4086 That happens at least on file systems of type tmpfs on linux-2.4.18.
4088 * announce-gen: New script to begin replacing the commands
4089 associated with the rule here...
4090 * Makefile.maint (announcement): Invoke announce-gen.
4091 * Makefile.am (EXTRA_DIST): Add announce-gen.
4093 * tests/cp/preserve-2: New file/test, for latest fix.
4094 * tests/cp/Makefile.am (TESTS): Add preserve-2.
4096 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
4098 Fix a bug whereby cp would fail to parse an option like
4099 --preserve=mode,ownership.
4100 * src/cp.c (decode_preserve_arg): Advance `comma' to
4101 point the character following the comma.
4103 2002-12-11 Jim Meyering <jim@meyering.net>
4105 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
4106 in case it's already defined.
4108 2002-12-09 Jim Meyering <jim@meyering.net>
4110 * tests/touch/fail-diag: Don't get a test failure if /no exists.
4111 Instead, evoke a framework failure if /no-$$ exists.
4112 Reported by Michael Stone.
4114 2002-12-08 Jim Meyering <jim@meyering.net>
4116 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
4117 Define to rpl_lstat, so that even on systems like Solaris 5.8,
4118 du honors (per POSIX) the trailing slash on an argument referring
4119 to a symlink-to-directory.
4121 2002-12-06 Jim Meyering <jim@meyering.net>
4123 * Use autoconf-2.57. Regenerate dependent files.
4124 * Use automake-1.7.2. Regenerate dependent files.
4126 * src/ls.c (gobble_file): Also stat the file if it's a
4127 regular file and --indicator-style=classify (aka -F).
4128 Thanks to Ed Santiago for opening my eyes.
4130 * tests/ls/file-type: New file. Test for the above.
4131 A test to contrast ls -F and ls --indicator-style=file-type.
4132 * tests/ls/Makefile.am (TESTS): Add file-type.
4134 2002-12-04 Jim Meyering <jim@meyering.net>
4136 * tests/ls/follow-slink: Make sure the symlink was created.
4137 Richard Dawe reported that `ln -s link link' succeeds, but creates
4138 no file on systems running some version of the DJGPP libc.
4140 2002-12-03 Jim Meyering <jim@meyering.net>
4142 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
4143 since this package no longer panders to K&R compilers.
4145 2002-12-02 Jim Meyering <jim@meyering.net>
4147 * tests/du/slink: Skip this test if `.' is on a non-local file system.
4149 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
4150 something to replace.
4152 2002-12-01 Jim Meyering <jim@meyering.net>
4154 * src/stat.c: Don't include <string.h> or <ctype.h>.
4155 That's already done via system.h.
4156 * src/dircolors.c: Don't include <ctype.h>.
4158 2002-11-30 Jim Meyering <jim@meyering.net>
4160 * ls.c (gobble_file): Remove the block of code that caused
4161 `ls --color -F symlink-to-dir' to list the files in
4162 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
4163 like `ls -F symlink-to-dir') but with the addition of highlighting.
4164 Similarly, `ls --color -dF symlink-to-dir' would print
4165 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
4166 Reported by Jeff Sheinberg as Debian bug #168203.
4167 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
4169 ls is now more efficient: with certain options, it no longer needs
4170 to stat each directory entry on systems with valid dirent.d_type.
4171 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
4172 (main): Make --recursive set format_needs_type, not format_needs_stat.
4173 (gobble_file): Remove a FIXME comment, now that it's fixed.
4175 2002-11-24 Jim Meyering <jim@meyering.net>
4177 * src/du.c (du_files): Don't strip any trailing slash.
4178 Rewrite so that `/' is no longer represented internally as
4180 (count_entry): When appending a file name component,
4181 account for the fact that the current path may end in `/'.
4182 François Pinard reported that `du symlink-to-dir/' was not
4183 equivalent to `du symlink-to-dir/.'. Now it is.
4184 * tests/du/trailing-slash: New file/test, for the above fix.
4185 * tests/du/Makefile.am (TESTS): Add trailing-slash.
4187 2002-11-23 Jim Meyering <jim@meyering.net>
4189 * src/tac.c (output): Declare some local variables to be of type size_t,
4190 rather than `int' to avoid warnings from gcc.
4192 2002-11-21 Paul Eggert <eggert@twinsun.com>
4194 * src/ls.c (decode_switches): Use case-sensitive matching to
4195 decode the QUOTING_STYLE environment variable. This is more
4196 consistent with the documentation, and with --quoting-style.
4198 2002-11-21 Martin Buck <martin.buck@ascom.ch
4200 * src/stty.c (struct speeds): Add support for all baud rates defined
4203 2002-11-19 Jim Meyering <jim@meyering.net>
4205 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
4206 run in a UTF locale. Report and suggested fix by Bruno Haible.
4207 * tests/fmt/basic: Likewise.
4209 2002-11-17 Jim Meyering <jim@meyering.net>
4211 * configure.ac: Update via autoupdate.
4212 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
4214 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
4215 Reported by Hans Ginzel.
4217 2002-11-15 Jim Meyering <jim@meyering.net>
4219 * Makefile.cfg (gnu_rel_host): Define.
4220 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
4221 on whether $(VERSION) looks like a major release number.
4223 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
4224 (release): Rename from `alpha'.
4225 (alpha): Depend on release.
4227 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
4229 2002-11-14 Jim Meyering <jim@meyering.net>
4231 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
4232 (announcement): Use the new variable.
4234 * Makefile.maint: Sync with Bison, i.e.:
4235 (po-check): Scan .l and .y files instead of the
4236 .c and the .h files that they generate. This fixes the bug
4237 reported by Tim Van Holder in:
4238 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
4239 Look for N_ as well as for _. Try to avoid matching #define for
4243 2002-11-12 Jim Meyering <jim@meyering.net>
4245 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
4246 Replace sole use with equivalent `#ifdef S_ISLNK'.
4247 Inconsistency reported by Dmitry V. Levin.
4249 2002-11-11 Jim Meyering <jim@meyering.net>
4251 * src/stat.c (usage): Transform --help items output via s/ - / /,
4252 so that help2man produces properly formatted man pages.
4253 Reported by Herbert Xu as Debian bug #168400.
4255 2002-11-10 Jim Meyering <jim@meyering.net>
4257 * src/ls.c (sighandler): Handle SIGTSTP specially.
4258 Based on suggestions from Solar Designer and Dmitry V. Levin.
4261 * Makefile.cfg (cvs_files): Define. From autoconf.
4262 (local_updates): Likewise.
4264 * src/ls.c (restore_default_color_handler, sigtstp_handler):
4266 (sighandler): New function, based on the one in sort.c.
4267 (main): Use sigaction, if possible; otherwise signal.
4268 Handle these signals:
4269 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
4270 Don't register our handler if the signal is already being ignored.
4272 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
4273 * src/csplit.c (interrupt_handler): Likewise.
4274 * src/sort.c (sighandler): Likewise.
4275 (main): Declare `i' and `nsigs' to be unsigned, not int.
4277 2002-11-09 Jim Meyering <jim@meyering.net>
4279 ls --color: restore terminal text color upon signal.
4280 * src/ls.c: Include "full-write.h" and <signal.h>.
4281 (restore_default_color, restore_default_color_handler): New functions.
4282 (sigtstp_handler, put_indicator_direct): New functions.
4283 (main) [print_with_color]: Register signal handlers.
4284 Patch mostly by Solar Designer and Stanislav Ievlev.
4286 Update from autoconf.
4287 * Makefile.maint (AMTAR): Remove definition.
4288 (update, cvs-update, po-update, do-po-update): New rules.
4289 (wget-update): Update (thus renaming to cvs-update).
4290 (automake_repo): Use anoncvs@sources.redhat.com.
4292 2002-11-06 Jim Meyering <jim@meyering.net>
4294 * tests/misc/Makefile.am (TESTS): Add printf-hex.
4296 * tests/misc/printf: Be careful to test the code in this package,
4297 not the shell built-in function.
4299 * src/printf.c (print_esc): A hexadecimal escape sequence has
4300 at most two hex. digits, not three. Reported by Padraig Brady.
4301 (usage): Update description.
4302 * tests/misc/printf-hex: New file/test, for the above fix.
4304 2002-10-07 Paul Eggert <eggert@twinsun.com>
4306 Add support for locale-specific size indications (e.g.,
4307 thousands-separators) and for explicit size suffixes on output.
4309 * doc/coreutils.texi (Block size): Say that:
4310 This affects display format as well as block size.
4311 Fractional block counts are rounded up.
4312 ls file size blocksize defaults to 1.
4313 A block size spec preceded by ' generates thousands separators.
4314 A suffix without a preceding integer generates suffixes.
4315 (tail invocation): 32k -> 32 KiB.
4316 (What information is listed): ls -h is now equivalent to
4317 ls --block-size=human, and ls -H is now equivalent to
4318 ls --block-size=si. Displayed file size is now always affected by
4321 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
4322 lib/umaxtostr.c: New files, taken from GNU tar.
4324 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
4326 (EXTRA_DIST): Add inttostr.c.
4328 * lib/human.c, lib/human.h: Rewrite to support locale-specific
4329 notations like thousands separators.
4330 Specify what includer of include.h must include beforehand.
4331 (human_group_digits, human_suppress_point_zero, human_autoscale,
4332 human_base_1024, human_SI, human_B): New enum values.
4333 (human_readable): Rename from human_readable_inexact; put the
4334 options before the sizes. All uses changed. The old human_readable
4335 function has been removed; use inttostr.h instead.
4336 (human_options): Renamed from human_block_size, with new signature
4337 that allows block sizes up to UINTMAX_MAX. All callers changed.
4339 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
4340 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
4341 freestanding C89. No need to check for stdlib.h or string.h since
4342 autoconf does this now.
4344 * src/cksum.c (cksum): Use primitives from inttostr.h, not
4345 human.h, to print large numbers simply.
4346 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
4347 * src/dd.c (print_stats, main): Likewise.
4348 * src/df.c (print_header): Likewise.
4349 * src/factor.c (print_factors): Likewise.
4350 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
4351 * src/shred.c (dopass): Likewise.
4352 * src/sort.c (checkfp): Likewise.
4353 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
4354 * src/tail.c (xlseek): Likewise.
4355 * src/wc.c (write_counts, wc): Likewise.
4357 * src/df.c (human_output_opts): New var.
4358 (output_block_size): Now uintmax_t, not int, to handle larger
4359 block sizes. All uses changed.
4360 * src/du.c: Likewise.
4361 * src/ls.c: Likewise.
4363 * src/df.c (print_header): In the header line, prefer SI to human
4364 representation if it's shorter; if neither is shorter, try to
4365 intuit what the user would prefer.
4367 * src/expr.c (inttostr): Remove; use new imaxtostr library
4370 * src/ls.c (file_output_block_size): New var, to distinguish
4371 file sizes from other sizes.
4372 (decode_switches): Set it.
4374 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
4375 (dopass): When printing progress, use floor for what has been done
4376 so far (since we should be conservative there), and ceiling for
4377 what needs to be done (since that's what other programs use).
4379 2002-10-19 Jim Meyering <jim@meyering.net>
4381 * src/pinky.c (print_heading): Align TTY and Name headings.
4382 Reported by Karl Eichwalder.
4384 2002-10-18 Jim Meyering <jim@meyering.net>
4386 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
4387 Remove now-useless cast.
4388 (stdread): Remove function.
4389 (bytes_split): Use size_t instead of int.
4390 Use safe_read, not stdread.
4391 (lines_split): Likewise.
4392 Use memchr rather than a `while' loop.
4393 (line_bytes_split): Use size_t instead of int.
4394 Use safe_read, not stdread.
4395 (main): Add some FIXME comments to remind me to remove casts.
4397 * src/system.h (ST_BLKSIZE): Correct comment describing how to
4398 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
4400 2002-10-17 Jim Meyering <jim@meyering.net>
4402 Fix a problem that could make e.g., `cat' misbehave on systems which
4403 give invalid (unreasonably large) values for stat.st_blksize.
4404 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
4405 Reported by Petter Reinholdtsen.
4407 2002-10-14 Jim Meyering <jim@meyering.net>
4409 Specifying a printf conversion specifer as nl's separator string
4410 could cause nl to segfault.
4411 * src/nl.c (build_print_fmt): Don't include separator string
4412 in the printf format; it might contain `%'.
4413 Use a better bound on the length of the print_fmt buffer.
4414 (print_lineno): Print the separator here instead.
4415 Reported by Doug Coleman.
4417 * tests/misc/nl: New file/tests, including a test for the above.
4418 * tests/misc/Makefile.am (TESTS): Add nl.
4420 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
4421 * tests/misc/Makefile.am (TESTS): Add split-l.
4423 2002-10-13 Jim Meyering <jim@meyering.net>
4427 * src/du.c (usage): Tweak description of --dereference-args/-D.
4429 * src/du.c (count_entry): Also save cwd when dereferencing (via
4430 --dereference-args, -D) a command-line argument.
4431 Reported by Michal Svec. Based on a patch by Andreas Schwab.
4433 * src/Makefile.am (../AUTHORS): New target/rule.
4435 2002-10-12 Jim Meyering <jim@meyering.net>
4437 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
4438 of type size_t, since that's the way it's used and avoids a warning.
4440 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
4441 since that's how it's always used and avoids a new warning from gcc.
4442 (read_input): Adapt to new safe_read ABI.
4444 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
4447 * src/pinky.c (print_long_entry): fread returns size_t.
4448 Declare local `bytes' accordingly, to avoid warning.
4450 tail -c +N would perform an extra read after encountering EOF
4451 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
4452 * src/tail.c (start_bytes): Detect EOF, inform caller.
4453 (tail_bytes): Upon EOF in start_bytes, return immediately.
4454 (file_lines): Reorganize to use memrchr rather than an explicit loop.
4455 Adapt to new safe_read ABI.
4457 2002-10-11 Jim Meyering <jim@meyering.net>
4459 * tests/du/deref: New file/test, for the above fix.
4460 * tests/du/Makefile.am (TESTS): Add deref.
4462 2002-10-10 Jim Meyering <jim@meyering.net>
4464 * tests/ln/Makefile.am (TESTS): Add target-1.
4465 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
4467 2002-10-09 Jim Meyering <jim@meyering.net>
4469 * tests/cp/backup-is-src: Ensure that certain environment variables
4470 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
4472 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
4473 consume 4GB of disk space on systems without support for sparse files.
4474 Fix a logic error that'd make it `cat err' even though dd didn't fail.
4476 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
4477 Patch by steven@magelico.net, forwarded by Michael Stone.
4479 * tests/ls/dired: Ensure that ls produces English messages.
4480 Patch by Alexey Vyskubov, forwarded by Michael Stone.
4482 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
4484 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
4486 2002-10-08 Jim Meyering <jim@meyering.net>
4488 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
4489 Fix syntax in test: use =, not ==.
4490 Reported by Bob Proulx.
4491 Change all the rest like this: grep -lR "testing framework'" .\
4492 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
4494 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
4495 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
4496 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
4497 * src/wc.c (wc): Likewise.
4499 2002-10-07 Paul Eggert <eggert@twinsun.com>
4502 Don't advance the write pointer past the end of the write buffer.
4503 * src/sort.c (begfield, limfield): Likewise.
4505 2002-10-07 Jim Meyering <jim@meyering.net>
4507 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
4508 * src/head.c (head_bytes, head_lines): Likewise.
4510 2002-10-06 Jim Meyering <jim@meyering.net>
4512 * src/dd.c (scanargs): Ensure that specified block sizes (specified
4513 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
4514 (skip, dd_copy): Adapt to new safe_read ABI.
4516 * Makefile.maint (signatures): Define.
4518 (announcement): Depend on $(signatures).
4520 * Makefile.maint (announcement): Output all URLs for detached
4521 signatures, not just the last one from the previous loop.
4523 2002-10-05 Jim Meyering <jim@meyering.net>
4527 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
4528 don't recurse into directory, DIR. Prompted by a report from
4531 * tests/rm/i-no-r: New file/test, for the above fix.
4532 * tests/rm/Makefile.am (TESTS): Add i-no-r.
4534 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
4535 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
4537 2002-10-03 Jim Meyering <jim@meyering.net>
4539 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
4540 * src/df.c (AUTHORS): Likewise.
4541 * src/du.c (AUTHORS): Likewise.
4542 * src/tail.c (AUTHORS): Likewise.
4543 * src/touch.c (AUTHORS): Likewise.
4545 2002-10-02 Jim Meyering <jim@meyering.net>
4547 * Makefile.am (SUBDIRS): Remove `old'.
4548 (EXTRA_DIST): List the files in old/.
4549 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
4550 Suggestion from Akim Demaille.
4552 2002-10-01 Jim Meyering <jim@meyering.net>
4554 * src/sys2.h (SSIZE_MAX): Define.
4556 2002-09-30 Jim Meyering <jim@meyering.net>
4558 * src/csplit.c: Don't include stdlib.h here. It's already included
4561 2002-09-29 Jim Meyering <jim@meyering.net>
4563 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
4564 expression to avoid bogus warning from gcc.
4566 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
4567 (cat): Declare insize and outsize to be of type size_t, not int.
4568 Rearrange pointer/integer expressions to avoid bogus warnings.
4569 (main): Declare insize and outsize to be of type size_t, not int.
4571 * src/tail.c (parse_options): Give a sensible diagnostic for
4572 an invalid byte or line count. Reported by Mikko Tuumanen.
4574 * src/touch.c (main): Split a long line.
4576 * tests/du/Makefile.am (TESTS): Add slink.
4577 * tests/du/slink: New test for system.h change of 2002-08-31.
4579 In move mode, always first try to rename. Before, upon failure to
4580 rename a directory, this code would never attempt to rename any
4581 other file in that directory, but would thenceforth always copy.
4582 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
4583 may fail with EXDEV, yet renaming files within that directory to
4584 a newly-created destination directory succeeds.
4585 * src/copy.c (copy_internal): Remove local, move_mode;
4586 use x->move_mode instead. Based on a patch from Tom Haynes.
4588 2002-09-28 Jim Meyering <jim@meyering.net>
4590 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
4591 Factor out some duplication.
4593 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
4595 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
4597 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
4598 to avoid compiler warnings.
4600 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
4603 Fix things so `mkdir -p' can create very deep directories, e.g.,
4604 mkdir -p $(perl -e 'print "a/" x 40000') now works.
4605 * src/mkdir.c (main): For --parents (-p), call make_path with the
4606 entire directory name, so we don't ever require that file operations
4607 like stat or chmod be performed on the entire command line argument.
4608 * makepath.c (make_path): Restore umask *before* creating the final
4611 2002-09-27 Andreas Schwab <schwab@suse.de>
4613 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
4614 to avoid overflow. Reported by Hans Lermen.
4616 2002-09-26 Jim Meyering <jim@meyering.net>
4618 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
4620 2002-09-25 Jim Meyering <jim@meyering.net>
4622 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
4623 and add a cast, to avoid a warning about `signed and unsigned type in
4624 conditional expression'.
4626 2002-09-22 Jim Meyering <jim@meyering.net>
4628 * src/rmdir.c: Include "dirname.h", for declaration of
4629 strip_trailing_slashes.
4631 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
4632 Now they're defined through system.h.
4634 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
4635 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
4636 since it's already included from sys2.h via system.h.
4638 * Use automake-1.6f. Regenerate dependent files.
4640 * src/Makefile.am (PERL): Remove duplicate definition.
4642 fmt's -s, -t, -c options didn't work properly for long lines.
4643 Since get_line may end up calling put_paragraph (for long lines),
4644 be sure to set global, `other_indent', before it is used there.
4646 * src/fmt.c (set_other_indent): New function, factored out of...
4647 (get_paragraph): ... here. Call it.
4648 (get_line): Call set_other_indent before calling flush_paragraph,
4649 which calls fmt_paragraph, which in turn calls put_paragraph,
4650 which uses other_indent.
4652 * tests/fmt/Makefile.am (TESTS): Add long-line.
4653 * tests/fmt/long-line: New file/test, for the above fix.
4655 2002-09-21 Jim Meyering <jim@meyering.net>
4657 * src/od.c: No longer include deprecated <values.h>.
4658 It was required solely for now-removed reference to BITSPERBYTE.
4659 * src/install.c: Likewise.
4660 Suggestion from Bruno Haible.
4662 2002-09-06 Andreas Schwab <schwab@suse.de>
4664 `rmdir -p dir-specified-with-trailing-slash/' would fail.
4665 * src/rmdir.c (remove_parents): Strip trailing slashes.
4667 2002-09-20 Jim Meyering <jim@meyering.net>
4669 * tests/rmdir/t-slash: New file/test, for the above fix.
4670 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
4672 * Makefile.maint (announcement): Arrange to gpg-sign the message.
4673 Add a URL for each detached signature file.
4675 2002-09-07 Bruno Haible <bruno@clisp.org>
4677 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
4679 2002-09-18 Jim Meyering <jim@meyering.net>
4681 `od -t x8' used the wrong (`l'-prefixed) printf format.
4682 Likewise for the o8 and u8 formats.
4683 * src/od.c (ISPEC_TO_FORMAT): Define macro.
4684 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
4685 Reported by Arun Sharma.
4687 2002-09-17 Jim Meyering <jim@meyering.net>
4689 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
4690 From gettext's intl/loadmsgcat.c.
4692 * tests/od/x8: New file/test, for the above fix.
4693 * tests/od/Makefile.am (TESTS): Add x8.
4695 2002-09-15 Jim Meyering <jim@meyering.net>
4697 * Use autoconf-2.54. Regenerate dependent files.
4699 * src/csplit.c (get_format_width): Add cast to avoid
4700 warning about `signed and unsigned type in conditional expression'.
4702 2002-09-14 Jim Meyering <jim@meyering.net>
4704 * src/who.c (print_user): Change type of local to size_t
4705 to avoid warnings about `comparison between signed and unsigned'.
4706 * src/ptx.c (generate_all_output): Likewise.
4708 * src/dd.c (main, skip): Add casts to avoid warnings about
4709 `comparison between signed and unsigned'.
4711 * src/id.c (print_full_info, print_group_list): Add casts to avoid
4712 warnings about `signed and unsigned type in conditional expression'.
4714 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
4715 to avoid warnings about `comparison between signed and unsigned'.
4716 (split_3): Change parameter names to be readable and add comment.
4717 Clean up the test for whether a line may be ignored.
4719 2002-09-13 Jim Meyering <jim@meyering.net>
4721 * src/printf.c (main): Handle leading command line argument of `--'.
4722 Reported by Raul: DervishD <raul@pleyades.net>
4723 * tests/misc/printf: New file: test for the above.
4724 * tests/misc/Makefile.am (TESTS): Add printf.
4726 * src/date.c (usage): Explain that %S's range of [0..60] is required --
4727 rather than 0..59 -- to accommodate the occasional positive leap second.
4728 Reported by Richard Neill.
4730 2002-09-12 Jim Meyering <jim@meyering.net>
4732 * src/Makefile.am (nanosec_libs): Define.
4733 (sleep_LDADD, tail_LDADD): Use it here.
4735 Factor nanosleep-related code into ../lib/xnanosleep.c.
4736 * src/sleep.c: Include xnanosleep.h.
4737 Factor out fenv.h-related code.
4738 (timespec_subtract): Remove function.
4739 (main): Remove code that deals with computing start and stop times
4740 as well as the loop around nanosleep. Now that's in xnanosleep.c.
4742 Allow S (in --sleep-interval=S) to be a floating point value.
4743 * src/tail.c: Include xnanosleep.h and xstrtod.h.
4744 Move declaration of global variable, sleep_interval, to ...
4746 (usage): Update description of --sleep-interval option.
4747 (tail_forever): New parameter, sleep_interval. Update caller.
4748 Use xnanosleep, rather than sleep.
4749 (parse_options): New parameter, sleep_interval. Update caller.
4750 Use xstrtod, now that we accept floating point values.
4751 Prompted by a patch from Augey Mikus.
4753 2002-09-06 Jim Meyering <jim@meyering.net>
4755 * src/remove.c (prompt): Change comment to give a better note to
4756 translators. From Michael Piefel.
4758 2002-09-02 Jim Meyering <jim@meyering.net>
4760 * README: A good problem report/patch includes diffs against
4761 the most recent test release.
4763 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
4764 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
4766 * src/kill.c (print_table_row): Use an unsigned type for widths
4767 to avoid warning about comparison between signed and unsigned.
4768 (list_signals): Likewise.
4770 * src/od.c (skip): Add a cast to avoid warning about comparison
4771 between signed and unsigned.
4772 * src/install.c (get_ids): Likewise. Also rearrange range-checking
4773 comparisons to make them more readable.
4775 2002-09-01 Jim Meyering <jim@meyering.net>
4779 2002-08-31 Jim Meyering <jim@meyering.net>
4781 Symlinks were always reported as using 0 blocks.
4782 * src/system.h (ST_NBLOCKS): Don't depend on file type.
4783 This reverts the change of 2000-01-30.
4784 Based on a report and patch from Neil Brown via Michael Stone.
4785 This fixes Debian Bug#156358.
4787 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
4788 `exit (1)' to `exit (EXIT_FAILURE)', and
4789 `usage (1)' to `usage (EXIT_FAILURE)'.
4791 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
4792 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
4793 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
4794 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
4795 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
4796 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
4797 error never exits successfully.
4799 2002-08-29 Jim Meyering <jim@meyering.net>
4801 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
4802 when ignoring any return value.
4804 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
4805 failures. On some systems (at least EMC Celerra and Solaris5.8),
4806 this appears to be necessary.
4807 (is_empty_dir): Likewise. Also, always close directory handle.
4808 * src/ls.c (print_dir): Likewise.
4809 (print_dir): Rename local variable: reading -> dirp.
4810 Reported by Mike Coleman.
4812 2002-08-28 Jim Meyering <jim@meyering.net>
4814 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
4815 Give a diagnostic and fail if closedir fails.
4817 2002-08-26 Jim Meyering <jim@meyering.net>
4819 * Makefile.am (THANKS-to-translators): New rule.
4820 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
4821 * THANKStt.in: New file.
4823 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
4825 (main): Register it with atexit.
4826 Close STDOUT_FILENO, to avoid a problem when writing to
4827 /dev/audio on at least Solaris 5.7 and 5.8 systems.
4828 Reported by Shing-Shong Shei.
4830 2002-08-25 Jim Meyering <jim@meyering.net>
4832 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
4833 * src/tac.c (main): Likewise.
4834 * src/tail.c (main): Likewise.
4835 * src/tee.c (main): Likewise.
4836 * src/tr.c (main): Likewise.
4837 * src/wc.c (main): Likewise.
4839 2002-08-20 Jim Meyering <jim@meyering.net>
4841 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
4843 2002-08-10 Paul Eggert <eggert@twinsun.com>
4845 * src/nohup.sh: Don't use "exec --"; it's not portable and
4846 shouldn't be needed.
4848 2002-08-09 Jim Meyering <jim@meyering.net>
4850 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
4851 (usage): Clarify help text for the -COLUMN option.
4852 Patch by Padraig Brady.
4853 * tests/pr/Test.pm [col-last]: New test for the above.
4855 * configure.ac: Start with version 4.5.1, chosen so that it's larger
4856 than the latest version numbers of the component packages.
4858 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
4861 2002-08-08 Jim Meyering <jim@meyering.net>
4863 * src/date.c: Guard inclusion of <langinfo.h> with
4864 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
4865 * src/sort.c: Likewise.
4866 Patch by GOTO Masanori.
4868 2002-08-05 Paul Eggert <eggert@twinsun.com>
4870 Fix some minor time-related bugs with POSIX time arguments.
4871 Some valid time stamps were being rejected (notably -1, and
4872 time stamps before 1900 on 64-bit hosts). And some invalid
4873 time stamps were being accepted, e.g. September 31.
4875 * src/date.c (main): Adjust to posixtime signature change.
4876 * src/touch.c (main): Likewise. Remove unnecessary initialization.
4877 Use localtime, not posixtm, to warn about obsolete "touch".
4879 2002-08-05 Jim Meyering <jim@meyering.net>
4881 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
4883 2002-08-04 Jim Meyering <jim@meyering.net>
4885 * src/Makefile.am (check-README): New target/rule.
4886 (check): Depend on it.
4888 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
4890 2002-08-03 Jim Meyering <jim@meyering.net>
4892 * Makefile.am (SUBDIRS): Add old.
4893 * old/: New directory, containing legacy ChangeLog* and NEWS files
4894 from the fileutils, sh-utils, and textutils packages.
4896 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
4898 2002-08-02 Paul Eggert <eggert@twinsun.com>
4900 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
4902 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
4903 (hard_LC_COLLATE): New var.
4904 (different): Args are now char *, not const char *.
4905 Use xmemcoll instead of memcmp to compare lines, so that
4906 LC_COLLATE has effect. However, use memcmp if it is an
4908 (check_file): Do not include newline in comparison, so that
4909 xmemcoll has a byte to stomp on temporarily.
4910 (main): Set hard_LC_COLLATE.
4912 2002-07-29 Jim Meyering <jim@meyering.net>
4914 * Makefile.am (SUBDIRS): Remove djgpp, for now.
4916 2002-07-20 Jim Meyering <jim@meyering.net>
4918 * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
4919 into EXIT_FAILURE. Otherwise, false --help and false --version
4922 2002-07-08 Jim Meyering <jim@meyering.net>
4924 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
4925 rather than the hard-coded `sh-utils'.
4927 2002-07-01 Jim Meyering <jim@meyering.net>
4929 * configure.ac: Merge the three files from fileutils,
4930 textutils, and sh-utils.
4931 * Makefile.am: Likewise.
4932 * src/Makefile.am: Likewise.