1 2004-02-21 Jim Meyering <jim@meyering.net>
5 * src/comm.c (usage): Tell what comm does when there are no options.
6 Reword in terms of FILE1 and FILE2 rather than `left file' and
7 `right file'. Suggestion from Dan Jacobson.
9 2004-02-15 Paul Eggert <eggert@twinsun.com>
11 Fix some POSIX-conformance bugs in expr.
13 * NEWS: document the following changes to src/expr.c.
14 * doc/coreutils.texi (expr invocation): Likewise.
15 Document what forms integers may take, and say "integer"
16 consistently instead of "number". Warn about operands
17 that "expr" can misinterpret, and how to work around the
19 * src/expr.c (eval, eval7, eval6, eval5, eval4, eval3, eval2, eval1):
20 Accept a bool argument specifying whether to evaluate the
21 expression. This is to allow short-circuit evaluation. All
23 (null): Report that a string is zero even if it has
24 a form like "-0" or "00".
25 (eval1, eval): Use short-circuit evaluation for | and &.
26 (eval): Return 0 if both arguments are null or zero, instead
27 of returning the first argument.
28 * tests/expr/basic: Add some tests for the above.
30 2004-02-17 Jim Meyering <jim@meyering.net>
34 `make check' from a build inside a chroot environment would fail
35 * tests/help-version: Specify an argument (`/') for df, in the
36 unusual event that there is no valid entry in /etc/mtab.
37 Likewise for id: add the -u option, so we don't get spurious
38 failures when there are no user or group names.
41 * src/sort.c (usage) [-u]: Add punctuation so that the description in
42 the help2man-generated (line-joined) man page is more readable.
43 Reported by Tim Waugh.
44 [-T]: Add a semicolon, for the same reason.
46 2004-02-15 Jim Meyering <jim@meyering.net>
48 * Makefile.am (dist-hook): Qualify target with $(srcdir)/ prefix.
50 2004-02-11 Jim Meyering <jim@meyering.net>
52 * tests/Makefile.am.in ($(srcdir)/Makefile.am): Use more portable
53 $(srcdir)/../Makefile.am.in, rather than $<.
54 Suggestion from Michael Elizabeth Chastain.
56 2004-02-10 Jim Meyering <jim@meyering.net>
58 * config/install-sh: Make this script executable.
59 * Makefile.am (dist-hook): New target, to ensure that config/install-sh
60 is executable. Otherwise, on systems that lack a suitable install
61 binary, `make install' would fail, because of the way this script
62 is invoked (without `$SHELL ' prefix).
63 Reported by Bob Proulx.
65 2004-02-08 Jim Meyering <jim@meyering.net>
69 * tests/rm/rm5: Avoid triggering a bug in OSF/Tru64's sed
70 that would cause an unwarranted test failure.
71 * tests/rm/rm3: Likewise.
73 2004-02-07 Jim Meyering <jim@meyering.net>
75 Remove xstat function pointer member. The way it was used was not
76 portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
77 inline `stat' and `lstat' functions, thus making the tests of
78 `xstat == lstat' in copy.c always fail.
79 * src/copy.h (struct cp_options) [xstat]: Remove member.
81 * src/copy.c (copy_dir): Set `.dereference' member, not .xstat.
82 (copy_internal): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.
83 Use `x->dereference == DEREF_NEVER' in place of `x->xstat == lstat'.
84 (valid_options): Remove now-obsolete FIXME comments.
86 * src/cp.c (re_protect): Use `XSTAT (x, ...)' in place of
88 (do_copy): Declare/use local xstat rather than x->xstat.
89 (main): Remove code that set x.xstat.
90 * src/mv.c (cp_option_init): Don't initialize xstat member.
91 * src/install.c (cp_option_init): Likewise.
93 * Makefile.cfg (gnu_ftp_host-alpha, etc.): Un-factor .gnu.org suffix,
94 so that emit_upload_commands can use these variables, too.
96 2004-02-06 Jim Meyering <jim@meyering.net>
98 * tests/rm/deep-1: Remove `du' stack space test.
99 Apparently, `ulimit -s N' isn't portable enough.
100 This test will be restored (with a guard against losing ulimit)
101 in its own file later.
103 * tests/rm/deep-1 (deep): Remove progress-style diagnostics,
104 since this test doesn't take long enough to merit them.
105 Run du on $tmp (the containing dir), not $deep, the full path to leaf.
107 * Makefile.maint (signatures): Remove definition.
108 Now, automake's gnupload handles this.
109 (%.sig: %): Remove now-unused rule.
110 (rel-files): Use automake's $(DIST_ARCHIVES), rather than
111 `$(distdir).tar.bz2 $(distdir).tar.gz'.
112 (emit-upload-commands): Adjust to use gnupload.
114 2004-02-05 Jim Meyering <jim@meyering.net>
116 * src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP): Remove definitions.
117 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
118 Now, those are all defined in timespec.h.
121 * src/date.c: Don't include timespec.h, now that system.h does it.
123 2004-02-02 Paul Eggert <eggert@twinsun.com>
125 Don't dump core if localtime returns NULL (possible on
126 hosts with 64-bit time_t and 32-bit int).
127 * src/date.c: Include "inttostr.h".
128 (batch_convert, main):
129 If time conversion fails, exit with nonzero status.
130 (show_date): Return int to report conversion failure.
131 Print the time as an int if localtime fails.
132 * src/uptime.c: Print "??" if the current clock can't
133 be converted by localtime. This won't happen until the year
134 2*31 + 1900, but we don't want to dump core even if the current
135 clock has the wrong value.
137 * src/stat.c: Include "inttostr.h".
138 (human_time): Print the date/time as a number of seconds since the
139 epoch if it can't be converted by localtime. This is better than
140 just saying "invalid", and is consistent with what "ls" does.
141 Don't dump core if the year has more than 48 digits; this isn't
142 possible on any contemporary host, but we might as well do it right.
144 2004-01-31 Paul Eggert <eggert@twinsun.com>
146 * src/stat.c (human_time): Accept time rather than
147 pointer-to-const-time parameter, for clarity. All callers changed.
149 2004-02-02 Jim Meyering <jim@meyering.net>
151 * src/stat.c (do_stat): Remove extra trailing newline from
152 default formats. Reported by Nelson H. F. Beebe.
154 Print actual fractional seconds in time stamps, not just `.00000000'.
155 * src/stat.c (human_time): Add and use new parameter, t_ns.
156 (print_stat): Update callers.
157 * src/ls.c (TIMESPEC_NS): Remove definition.
158 * src/system.h (TIMESPEC_NS): Define here, instead, now that stat.c
159 also uses this macro.
160 Nelson H. F. Beebe noticed that ls --full-time printed nonzero
161 fractional seconds for files on an XFS file system, but that stat's
162 fractional seconds were always zero.
164 2004-01-28 Paul Eggert <eggert@twinsun.com>
166 * src/seq.c (print_numbers): Use 'double' for loop index, not
167 'int', to avoid problems with integer overflow. On almost all
168 machines 'double' works in every case where 'int' works, and
169 it works on other cases besides.
171 2004-01-27 Jim Meyering <jim@meyering.net>
173 * src/seq.c (usage): Mention that if INCREMENT is omitted,
174 it defaults to 1, even when FIRST is larger than LAST.
175 Reword so as not to exclude the possibility that INCREMENT be zero.
177 2004-01-25 Jim Meyering <jim@meyering.net>
181 * Makefile.maint (signatures): Comment out definition.
183 2004-01-23 Jim Meyering <jim@meyering.net>
185 * Makefile.maint (header_regexp): Add exitfail.
187 * man/Makefile.am (EXTRA_DIST): Add help2man.
188 Reported by Nelson H. F. Beebe.
190 * man/Makefile.am (.x.1): Prefix help2man invocation with `$(PERL) --'
191 so it works on systems with Perl installed somewhere other than in
194 * src/paste.c (paste_parallel): Declare local, chr, to be of type
195 `int', not `char', since it must hold EOF. This bug would make
196 paste infloop on some systems. Test failures reported by
197 Nelson H. F. Beebe and Christian Krackowizer.
199 2004-01-22 Jim Meyering <jim@meyering.net>
201 * tests/rmdir/fail-perm: New file. Test for just-fixed rmdir bug.
202 * tests/rmdir/Makefile.am (TESTS): Add fail-perm.
204 * man/help2man: Fix it so using --info-page='coreutils PROG' works.
205 * man/Makefile.am (.x.1): Invoke our own (tweaked) copy of help2man.
206 Use --info-page='coreutils PROG' option.
207 Now, readlink.1 refers the user to `info coreutils readlink'
208 rather than to `info readlink'. Reported by Matt Swift.
210 2004-01-21 Paul Eggert <eggert@twinsun.com>
214 * src/basename.c (usage): Use EXIT_SUCCESS, not 0, for clarity.
215 * src/cat.c, src/chgrp.c, src/chmod.c, src/chown.c, src/chroot.c,
216 * src/cksum.c, src/comm.c, src/cp.c, src/csplit.c, src/cut.c,
217 * src/date.c, src/dd.c, src/df.c, src/dircolors.c, src/dirname.c,
218 * src/du.c, src/echo.c, src/env.c, src/expand.c, src/expr.c,
219 * src/factor.c, src/fmt.c, src/fold.c, src/head.c, src/hostid.c,
220 * src/hostname.c, src/id.c, src/install.c, src/join.c, src/kill.c,
221 * src/link.c, src/ln.c, src/logname.c, src/ls.c, src/md5sum.c,
222 * src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c,
223 * src/nl.c, src/nohup.c, src/od.c, src/paste.c, src/pathchk.c,
224 * src/pinky.c, src/pr.c, src/printenv.c, src/printf.c, src/pwd.c,
225 * src/rm.c, src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c,
226 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c,
227 * src/su.c, src/sum.c, src/sync.c, src/tac.c, src/tail.c, src/tee.c,
228 * src/test.c, src/touch.c, src/tr.c, src/tsort.c, src/tty.c,
229 * src/uname.c, src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c,
230 * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c: Likewise.
232 * src/cat.c (usage): Don't bother normalizing exit status
233 since the arg is already the correct exit status now.
234 * src/cksum.c, src/comm.c, src/csplit.c, src/cut.c,
235 * src/dircolors.c, src/expand.c, src/fmt.c, src/fold.c, src/head.c,
236 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c,
237 * src/pr.c, src/split.c, src/sum.c, src/tac.c, src/tail.c, src/tr.c,
238 * src/tsort.c, unexpand.c, src/src/uniq.c, src/src/wc.c: Likewise.
240 * src/chown.c (main): Removed unused local 'fail'.
242 * src/chroot.c (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE):
245 * src/chroot.c (main): Initialize exit_failure to EXIT_FAIL.
246 * src/env.c, src/nice.c, src/su.c: Likewise.
247 * src/nohup.c (main): Likewise, to NOHUP_FAILURE.
248 * src/setuidgid.c (main): Likewise, to SETUIDGID_FAILURE.
249 * src/expr.c (main): Use initialize_exit_failure rather than
250 setting exit_failure directly; this optimizes away redundant
252 * src/printenv.c, src/sort.c, src/test.c, src/tty.c: Likewise.
254 * src/chroot.c (main): Exit with status 1 rather than 127
255 if chroot itself fails, as per documentation.
257 * src/chroot.c (main): Use EXIT_ENOENT and EXIT_CANNOT_INVOKE
258 rather than roll-your-own symbols or integers.
259 * src/env.c (main): Likewise.
260 * src/nohup.c (main): Likewise.
261 * src/su.c (run_shell): Likewise.
263 * src/cp.c (exit_status): Remove static var....
264 (main): Making it local here instead. Use =, not |=, to set it.
266 * src/cut.c (FATAL_ERROR, main): Exit with status EXIT_FAILURE,
268 * src/date.c (batch_convert, main): Likewise.
269 * src/dd.c (dd_copy): Likewise.
270 * src/pr.c (first_last_page, main, getoptarg): Likewise.
271 * src/tr.c (main): Likewise.
272 * src/date.c (main): Don't assume EXIT_FAILURE == 1, as
273 POSIX doesn't require it.
274 * src/dd.c (write_output, skip, dd_copy): Likewise.
275 * src/df.c (main): Likewise.
276 * src/id.c (main): Likewise.
277 * src/install.c (main): Likewise.
278 * src/ln.c (main): Likewise.
279 * src/ls.c (main): Likewise.
280 * src/mv.c (main): Likewise.
281 * src/shred.c (main): Likewise.
283 * src/env.c (main): Exit with status 1, not 2, on errors detected
285 * src/hostname.c (main): Likewise.
286 * src/nl.c (main): Likewise.
287 * src/stty.c (main): Likewise.
289 * src/expr.c (EXPR_FAILURE): Renamed from EXPR_ERROR, for
290 consistency with the other programs' naming conventions.
293 * src/factor.c (main): Do not report a usage error simply
294 because stdin has bad numbers.
296 * src/id.c (problems): Now a boolean int, not a counter,
297 so that we don't have to worry about int overflow. All uses changed.
298 * src/touch.c (err): Likewise.
300 * src/md5sum.c (main): Use int, not size_t, to store boolean int.
302 * src/mkfifo.c (main): Exit with status 1, not 4, if not implemented.
303 * src/mknod.c: Likewise.
305 * src/nice.c (main): Exit with status EXIT_FAIL, not EXIT_FAILURE,
306 on error; this is in case EXIT_FAILURE is unusual.
307 * src/su.c (main): Likewise.
309 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE): Remove; all uses
310 changed to EXIT_CANNOT_INVOKE.
312 * src/printenv.c (PRINTENV_FAILURE): New constant.
313 (main): Exit with status PRINTENV_FAILURE, not EXIT_FAILURE, on
314 command-line syntax problems.
316 * src/rmdir.c (remove_parents): Don't set 'fail' to a negative number.
317 (main): Avoid integer overflow when seeing whether errors occurred.
319 * src/seq.c (print_numbers): Now returns void, not (zero) int.
321 (main): Remove unused local variable 'errs'. Always exit successfully
324 * src/setuidgid.c (SETUIDGID_FAILURE): Renamed from FAIL_STATUS,
325 for consistency with other programs here. All uses changed.
326 (main): Use 'error' to exit rather than invoking 'exit' here.
328 * src/sort.c: Don't include <assert.h>.
329 (SORT_OUT_OF_ORDER, SORT_FAILURE): Now enums, not macros.
330 (usage): Don't use 'assert'.
331 (main): Remove redundant assignment to exit_failure.
333 * src/system.h (EXIT_FAIL, EXIT_CANNOT_INVOKE, EXIT_ENOENT):
335 (initialize_exit_failure): New inline function.
336 Include exitfail.h here, since we refer to exit_failure.
337 All callers changed to not include exitfail.h.
339 * src/tty.c (TTY_FAILURE, TTY_WRITE_ERROR): New enum values;
340 substitute them for the corresponding integer constants.
342 * tests/help-version (expected_failure_status_date): Remove, as
343 'date' is now normal.
344 (expected_failure_status_nohup): New var.
346 2004-01-21 Jim Meyering <jim@meyering.net>
348 * tests/touch/relative: Remove `command' syntax.
349 Thanks to Nelson H. F. Beebe and Paul Eggert.
351 * tests/touch/relative: Test only year/month/day, not hours/min/sec,
352 so as to avoid problems with systems using TAI clocks.
353 Although it's no longer necessary, set TZ=UTC0 also for the
354 initial touch command. Reported by Paul Jarc here:
355 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/1504
357 2004-01-20 Diego Biurrun <diego@biurrun.de>
359 * src/dircolors.hin: Add .mov to the list of media files.
361 2004-01-19 Paul Eggert <eggert@twinsun.com>
363 * tests/touch/relative: Use TZ=UTC0, not TZ=utc (which isn't
364 portable). Problem reported by Christian Krackowizer. Also, use
365 +0000 rather than +0 to specify a time zone, as the documentation
366 requires four digits.
368 2004-01-19 Jim Meyering <jim@meyering.net>
370 * tests/mv/hard-4: Run envvar-check in case SIMPLE_BACKUP_SUFFIX is set.
371 * tests/mv/backup-is-src: Likewise.
372 Problem reported by Peter Horst
374 2004-01-17 Jim Meyering <jim@meyering.net>
376 * announce-gen (print_changelog_deltas): Use .sig suffix, not .asc.
380 2003-12-15 Paul Eggert <eggert@twinsun.com>
382 * NEWS, doc/coreutils.texi: touch -r and -d can now both be specified,
383 with -r specifying the origin for -d.
384 * src/touch.c (flexible_date): Remove static var.
385 (get_reldate): New function.
386 (main): Use it, to implement this new behavior.
388 2004-01-16 Jim Meyering <jim@meyering.net>
390 * tests/touch/relative: New test for the above.
391 * tests/touch/Makefile.am (TESTS): Add relative.
393 2004-01-13 Jim Meyering <jim@meyering.net>
395 * src/system.h: Include contents of sys2.h.
396 * src/sys2.h: Remove file.
397 * src/Makefile.am (noinst_HEADERS): Remove sys2.h.
399 * Use automake-1.8.2. Regenerate dependent files.
401 * Update to gettext-0.13.1.
402 * configure.ac: Use gettext-0.13.1.
403 * .x-sc_space_tab: Add m4/po.m4 to the list of exceptions.
405 2004-01-12 Jim Meyering <jim@meyering.net>
407 * Makefile.maint (%.sig): Use .sig suffix rather than .asc.
409 * Makefile.maint (po-check): Ensure that cvsu works before using it.
410 Reported by Alexandre Duret-Lutz.
412 * src/tail.c (main): Warn about following stdin only when it's a tty.
414 * configure.ac: Use gl_DEFAULT_POSIX2_VERSION.
416 2004-01-10 Jim Meyering <jim@meyering.net>
418 * tests/misc/stat-fmt: Use backticks, not `$()' notation.
420 2004-01-09 Jim Meyering <jim@meyering.net>
422 * configure.ac: Quote underquoted `jm_DUMMY_1' to avoid new warning.
424 2004-01-08 Jim Meyering <jim@meyering.net>
426 * src/stat.c (human_fstype): Use %lx, not %x format for `unsigned long'.
429 * tests/Makefile.am (TESTS_ENVIRONMENT): Remove `/vg' (prerelease test
430 remnant) from PATH component. That would cause tests in this directory
431 not to run the just-built binaries, but rather whatever happened
432 to be in one's PATH. Reported by Christian Krackowizer.
434 2004-01-04 Jim Meyering <jim@meyering.net>
436 * src/csplit.c (new_control_record): Use x2nrealloc
437 rather than xrealloc.
439 * src/cp.c (re_protect): Use ASSIGN_STRDUPA rather than
441 (make_path_private): Likewise.
443 2004-01-03 Jim Meyering <jim@meyering.net>
445 * src/paste.c: Use `bool' (not int) as the type for a few
447 (collapse_escapes): Rewrite to set globals rather than modifying
449 Use size_t (not int) for all counters and related index variables.
450 (paste_parallel): Remove needless complexity of
451 using xrealloc in the loop; just allocate the buffers up front.
452 Free the two temporary buffers.
453 Move declarations of locals `down' into scope where used.
454 (paste_serial): Remove `register' attributes.
455 (main): Simplify delim-related code.
456 Free `delims', now that it's malloc'd.
458 2004-01-02 Jim Meyering <jim@meyering.net>
460 * src/chroot.c: Include "quote.h".
461 (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): Define.
462 (main): Exit with status of 127, not 1, for too-few-args,
463 chroot failure, or chdir failure.
464 Give a better diagnostic upon execvp failure.
466 * src/du.c (usage): Mention that, with its current meaning,
469 * src/tail.c (main): Warn about following stdin when it's a tty.
470 Fail when following by name but no names are specified.
472 2003-12-30 Jim Meyering <jim@meyering.net>
474 * src/fold.c (main): Use memcpy, not strcpy.
476 * src/copy.c (copy_internal): Use ASSIGN_STRDUPA rather than
479 2003-12-28 Jim Meyering <jim@meyering.net>
481 * src/unexpand.c (n_tabs_allocated): New global.
482 (add_tabstop): Use x2nrealloc rather than xrealloc.
483 * src/expand.c: Likewise.
485 * tests/misc/expand: New file.
486 * tests/misc/Makefile.am (TESTS): Add expand.
488 * src/sort.c (add_temp_dir): Use x2nrealloc rather than xrealloc.
489 (fillbuf): Use x2nrealloc rather than xrealloc.
490 (sort): Use xnmalloc rather than xmalloc.
493 2003-12-27 Jim Meyering <jim@meyering.net>
495 * src/tee.c (tee): Use xnmalloc rather than xmalloc.
497 2003-12-29 Paul Eggert <eggert@twinsun.com>
499 * NEWS: Remove support for join -j1 FIELD, -j2 FIELD, and -o LIST1
500 LIST2 in POSIX 1003.1-2001 hosts, as required by POSIX.
502 * doc/coreutils.texi (join invocation): Remove documentation
503 accordingly. Document that -t makes all separators significant.
505 * src/join.c: Include posixver.h.
506 (obsolete_usage): New var.
507 (longopts): Put obsolete options first.
508 (OBSOLETE_LONG_OPTIONS): New constant.
509 (get_option, add_file_name): New functions.
510 (main): Use them to support new behavior.
511 (usage): Remove documentation for -j1 FIELD and -j2 FIELD.
512 Do not mark -j FIELD as obsolescent; it is longstanding
513 UNIX tradition and is a valid extension to POSIX.
515 * tests/join/Test.pm (tv): Avoid obsolete -o usage.
517 2003-12-28 Paul Eggert <eggert@twinsun.com>
519 * src/join.c (add_field_list): Don't use alloca with unbounded
520 size; just modify the argument, which is no longer const *.
522 Various other minor cleanups, mostly to avoid the need for casts.
524 (extract_field): Renamed from ADD_FIELD, as it's now a function.
526 (struct field.beg): Now char *, not unsigned char const *. All
527 uses changed. It shouldn't be const since xmemcoll writes on its
529 (extract_field): Likewise, for 2nd arg.
530 (keycmp): Remove now-unnecessary cast of xmemcoll args.
532 (is_blank): New function, to avoid need to cast arg to unsigned char.
533 (extract_field): Use it.
535 (xfields): Rewrite pretty much from scratch.
537 (hard_LC_COLLATE): Now bool, not int.
538 (get_line, getseq, add_field_list): Now returns bool, not int.
539 (decode_field_spec, add_field_list): Return true on success (not
540 false), for consistency with the rest of the code. All uses changed.
542 (tab): Now char, not unsigned char. This wasn't 100% necessary
543 but is slightly cleaner.
544 (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler.
546 (empty_filler): Now const *.
548 (make_blank): Remove; wasn't needed. Remove all calls.
549 (main): Don't set uni_blank.nfields; zero is fine.
551 2003-12-27 Jim Meyering <jim@meyering.net>
553 * src/join.c: Include "quote.h".
554 (min, max): Remove definitions.
555 Make a few function parameters and corresponding
556 locals `const'. Use bool for boolean variables.
557 Use size_t (not int) for all counters and related index variables.
558 (prjoin): Remove now-useless assertion.
559 (string_to_join_field): New function.
560 (main): Accept join fields as large as SIZE_MAX.
561 (keycmp): Rename `min' to MIN and max to MAX.
563 2003-12-26 Jim Meyering <jim@meyering.net>
565 fold -s didn't work on e.g., alpha-based systems.
566 * src/fold.c (fold_file): Adjust types (int->size_t) so that using
567 x2nrealloc works properly on systems with differing sizes for int
568 and size_t. Reported by Nelson Beebe.
570 * src/fold.c: Use `bool' (not int) as the type for a few
573 2003-12-23 Paul Eggert <eggert@twinsun.com>
575 * src/ls.c (length_of_file_names_and_frills):
576 Remove forward decl; not needed.
577 (print_file_name_and_frills, length_of_file_name_and_frills):
578 With -m, don't output spaces before inum or size.
579 (print_with_commas): Don't output space just before newline.
581 2003-12-24 Jim Meyering <jim@meyering.net>
583 * tests/ls/Makefile.am (TESTS): Add m-option.
584 * tests/ls/m-option: New file. Test for above fixes.
586 2003-12-20 Jim Meyering <jim@meyering.net>
590 * src/pr.c: Change type of global, buff_allocated, to size_t.
592 * src/join.c [struct seq]: Change types of members count and alloc
593 from `int' to `size_t'.
595 * tests/Makefile.am (root-hint): Tweak wording.
597 * src/du.c: Accept new option (-0, --null) that makes it so each
598 output line is NUL-terminated rather than newline-terminated.
600 * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync.
601 Reported by Volker Paul.
602 * tests/dd/Makefile.am (TESTS): Add unblock-sync.
603 * tests/dd/unblock-sync: New test for the above.
605 2003-12-19 Jim Meyering <jim@meyering.net>
607 * tests/misc/nohup: Double quote back-ticked expression,
608 in case it ends up having an unexpected value.
610 * tests/ls/no-arg: Use ls's -1 option in both runs.
612 * src/du.c (fts_debug): New global.
613 (FTS_CROSS_CHECK, DEBUG_OPT): Define.
614 (main): Make fts use FTS_TIGHT_CYCLE_CHECK.
615 (main) [DU_DEBUG]: Accept -d option.
617 2003-12-18 Jim Meyering <jim@meyering.net>
619 * src/ls.c (format_user): Increment dired_pos via two statements,
620 `dired_pos += width; dired_pos++;' rather than one,
621 `dired_pos += width + 1;' since the latter could conceivably overflow.
622 (format_group): Likewise.
625 * configure.ac: Require automake-1.8.
627 2003-12-12 Jim Meyering <jim@meyering.net>
629 * Use automake-1.8. Regenerate dependent files.
631 2003-12-08 Jim Meyering <jim@meyering.net>
633 * Makefile.maint (news-date-check): New rule.
634 (alpha beta major): Depend on it.
636 2003-12-03 Paul Eggert <eggert@twinsun.com>
638 * NEWS: ls -l (and similar options) now adjust all columns to
639 fit the data. Generalized from a suggestion by Leah Q for file sizes.
640 * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
641 (format_user_width, format_group_width, unsigned_file_size,
642 format_group): New functions.
643 (block_size_width): Renamed from block_size_size.
644 (inode_number_width, nlink_width, owner_width, group_width,
645 author_width, major_device_number_width, minor_device_number_width,
646 file_size_width): New vars.
647 (clear_files): Initialize them.
648 (gobble_file): Set them. Don't ceiling block_size_width to 7.
649 (print_long_file): Use them.
650 (gobble_file): Use a new local variable 'f' to make the code
651 smaller and more consistent with other functions.
652 (format_user): Output to stdout, not to a buffer, so that we
653 don't have to worry about buffer overrun. Update dired_pos.
654 (print_long_file): Don't put owner, group, author into buffer;
655 just print them directly. Don't assume link counts and
656 major and minor numbers fit into unsigned long int.
657 * tests/cp/same-file, tests/mv/part-symlink: Don't assume that
658 'ls' output is fixed-width.
660 2003-12-02 Jim Meyering <jim@meyering.net>
662 * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h.
664 2003-11-27 Jim Meyering <jim@meyering.net>
666 * Use automake-1.7f. Regenerate dependent files.
668 2003-11-24 Paul Eggert <eggert@twinsun.com>
670 Parse floating-point operands and options in the C locale.
671 POSIX requires this for printf, and we might as well be
672 consistent elsewhere (tail, sleep, seq).
674 * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer
675 needed now that we assume C89. Include "c-strtod.h".
676 (xstrtod): Call c_strtod, not strtod.
677 * src/sleep.c: Include "c-strtod.h".
678 (main): Update xstrtod call to include new argument, c_strtod.
679 * src/seq.c (scan_double_arg): Likewise.
680 * src/tail.c (parse_options): Likewise.
682 2003-11-24 Jim Meyering <jim@meyering.net>
684 * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM).
685 Reported by Mark Conty.
687 2003-11-22 Jim Meyering <jim@meyering.net>
689 * Makefile.maint (sc_xalloc_h_in_src): Remove rule. Subsumed by...
690 (sc_system_h_headers): Do this test only if sys2.h exists.
692 2003-11-20 Jim Meyering <jim@meyering.net>
694 * tests/help-version: Ensure that the bug-reporting address is
695 included in the --help output for every program.
696 * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.
698 * src/ptx.c (usage): Output bug-reporting address.
699 Reported by Dan Jacobson.
701 2003-11-19 Jim Meyering <jim@meyering.net>
703 * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted
704 on the join fields. Suggestion from Bruce Robertson.
706 2003-11-18 Jim Meyering <jim@meyering.net>
708 `od -c -w9999999' could segfault
709 * src/od.c (dump): Use xnmalloc/free, not alloca.
711 2003-11-16 Jim Meyering <jim@meyering.net>
713 * Use autoconf-2.59. Regenerate dependent files.
715 * tests/du/hard-link: Minor tweak: use mkdir -p.
717 Fix read-from-free'd-buffer error detected by valgrind.
718 * src/csplit.c (remove_line): Don't return a pointer to data in
719 a freed buffer. Instead, arrange to free the buffer on the
722 * tests/misc/csplit: New test for above fix.
724 2003-11-11 Jim Meyering <jim@meyering.net>
726 * src/ls.c (extract_dirs_from_files): Avoid useless copy operations.
727 This avoids a warning from valgrind about memcpy with overlapping
728 source and destination.
730 * configure.ac: Require automake-1.7.8.
732 2003-11-09 Jim Meyering <jim@meyering.net>
734 * Use automake-1.7.9. Regenerate dependent files.
736 * src/rm.c: Support new options: --preserve-root and --no-preserve-root.
737 * src/chown.c: Likewise.
739 * src/chown-core.c: Include "root-dev-ino.h".
740 (chopt_init): Initialize new member.
741 (change_file_owner): Support rm's new --preserve-root option.
743 * src/remove.c: Include "root-dev-ino.h".
744 (remove_cwd_entries): Remove now-obsolete FIXME comment.
745 (remove_dir): Support rm's new --preserve-root option.
747 * src/chown.c: Include "root-dev-ino.h".
748 Add new options: --preserve-root and --no-preserve-root.
750 * src/chmod.c: Include "root-dev-ino.h".
751 (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
752 ROOT_DEV_INO_WARN macros.
753 (get_root_dev_ino): Remove function definition, now that it's
754 been moved to a separate file.
755 (usage): Describe new options.
757 * src/mv.c (rm_option_init): Initialized new member.
759 * src/remove.h: Include "dev-ino.h".
760 (struct rm_options): Add new member: root_dev_ino.
761 * src/chown-core.h: Include "dev-ino.h".
762 (struct Chown_option): Add new member: root_dev_ino.
764 2003-11-06 Jim Meyering <jim@meyering.net>
766 * src/paste.c (paste_parallel): Use `sizeof *var' rather than
767 hard-coding `sizeof FILE*'.
769 2003-11-05 Dennis Smit <ds@nerds-incorporated.org>
771 * src/wc.c (main): Free `fstatus' so there is no confusion about
772 whether it's leaked or not.
773 * src/who.c (who): Likewise for `utmp_buf'.
775 2003-11-05 Paul Eggert <eggert@twinsun.com>
777 Fix 'cut' problems with size_t overflow and unsigned int.
778 More generally, resize integer variables to fit use more precisely.
779 * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens.
780 (struct range_pair): Make members to be of type size_t, not unsigned.
781 (max_range_endpoint, eol_range_start): Now size_t, not unsigned.
782 (suppress_non_delimited, output_delimiter_specified,
783 have_read_stdin, print_kth, set_fields): Now bool, nt int.
784 (delim): Now unsigned char, not int.
785 (mark_printable_field, is_printable_field, is_range_start_index,
786 set_fields, set_fields, cut_bytes, cut_fields):
787 Use size_t, not unsigned, for field and byte counts.
788 (hash_int): Use uintptr_t, not unsigned, for pointers converted
789 to integers. This squeezes more info out of them.
790 (set_fields, cut_bytes, cut_fields, main):
791 Use bool, not int, for booleans.
792 (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc.
794 2003-11-05 Paul Eggert <eggert@twinsun.com>
796 * man/Makefile.am (check-programs-vs-x):
797 Work even if $(programs) contains '$'.
798 Work even if 'missing=1' in environment.
799 Don't report an error simply because $(programs) outputs nothing.
801 2003-11-05 Jim Meyering <jim@meyering.net>
803 * Use autoconf-2.58. Regenerate dependent files.
805 * src/tr.c (spec_init): Fix typo in last change.
807 * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in
808 call to variadic version_etc function, so that it works even on systems
809 for which sizeof char* != sizeof int.
810 * src/true.c (main): Likewise.
811 * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c:
812 * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c:
813 * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c:
814 * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c:
815 Similarly, cast NULL to `(char *)' in call to variadic function,
816 parse_long_options, so that it works even on systems for which
817 sizeof char* != sizeof int.
818 A similar problem was reported by Harti Brandt in
819 http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html.
821 * src/users.c (users): Free `utmp_buf' explicitly so that people
822 don't mistake this for a real leak.
823 Patch by Dennis Smit <ds@nerds-incorporated.org.
825 2003-11-04 Paul Eggert <eggert@twinsun.com>
827 * README: Document _POSIX2_VERSION.
829 2003-11-04 Jim Meyering <jim@meyering.net>
831 * src/tac.c (memrchr): Remove #if-0'd function.
832 (tac_stdin_to_mem): Clean up #if-0'd code.
834 * src/od.c (decode_format_string): Remove unnecessary casts.
835 Use more maintainable `sizeof *var'.
836 (main): Call decode_format_string rather than decode_one_format,
837 now that `spec' may be NULL.
839 * src/chmod.c (AUTHORS): Add my name.
841 * src/split.c (next_file_name): Use `sizeof *var' rather than
842 hard-coding `sizeof size_t'.
844 * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...).
846 * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc,
847 to avoid potential overflow in pointer arithmetic.
848 (set_fields): Use not `1', but rather `sizeof *printable_field' as
849 second argument to xcalloc.
850 * src/od.c (decode_format_string, dump_strings): Use x2nrealloc
851 rather than xrealloc.
852 * src/date.c (show_date): Likewise.
853 * src/join.c (ADD_FIELD, initseq, getseq): Likewise.
854 * src/pr.c (store_char): Likewise.
855 * src/fold.c (fold_file): Likewise.
857 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
858 type changes (unsigned int -> size_t) in hash.c.
859 * src/cp-hash.c (src_to_dest_hash): Likewise.
860 * src/du.c (entry_hash): Likewise.
861 * src/ls.c (dev_ino_hash): Likewise.
862 * src/cut.c (hash_int): Likewise. Declare function as static.
864 2003-11-03 Jim Meyering <jim@meyering.net>
866 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
867 * tests/misc/fold: Fail the test immediately if we're not running
868 the expected version of fold.
870 2003-11-02 Jim Meyering <jim@meyering.net>
872 * src/tr.c (append_normal_char, append_range, append_char_class)
873 (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var'
874 rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable
876 * src/copy.c (copy_internal): Likewise.
877 * src/join.c (initseq, add_field, make_blank): Likewise.
878 * src/od.c (main): Likewise.
879 * src/cp.c (make_path_private): Likewise.
880 * src/tsort.c (new_item, record_relation): Likewise.
882 * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise.
883 (main): Also remove anachronistic cast of xmalloc return value.
884 * src/ptx.c (alloc_and_compile_regex, main): Likewise.
885 (main): Also remove anachronistic cast of xmalloc return value.
886 * src/sort.c (inittables): Likewise.
887 (sort): Also Split a long line.
889 2003-10-25 Jim Meyering <jim@meyering.net>
891 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
892 type changes (unsigned int -> size_t) in hash.c.
893 * src/cp-hash.c (src_to_dest_hash): Likewise.
894 * src/du.c (entry_hash): Likewise.
895 * src/ls.c (dev_ino_hash): Likewise.
896 * src/cut.c (hash_int): Likewise. Declare function as static.
898 2003-10-21 Jim Meyering <jim@meyering.net>
900 Don't fail when run with VERBOSE=yes.
901 * tests/chgrp/basic: Do `set +x' before starting the subshell
902 from which we invoke chgrp. Otherwise, the output from the
903 VERBOSE=yes-induced `set -x' would result in spurious differences.
904 Reported by Russel Coker via Michael Stone.
906 2003-10-19 Jim Meyering <jim@meyering.net>
908 chmod now uses fts to perform a directory traversal when -R is
909 specified. Before, it operated on full path names, and as such
910 would encounter the PATH_MAX (often 4096) limit.
912 * src/chmod.c: Include "xfts.h".
913 (process_file): Rename from change_file_mode.
914 Adapt to be used with fts.
915 (process_files): New function.
917 2003-10-18 Jim Meyering <jim@meyering.net>
919 * tests/du/deref-args: Ensure that du -D now dereferences all
920 symlinks specified on the command line, not just those that
921 reference directories.
923 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
924 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
925 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
926 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
927 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
928 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
929 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
930 * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
931 of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
932 Update the call to parse_long_options so that `AUTHORS, NULL' are the
934 * src/true.c (main): Append NULL to version_etc argument list.
935 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
937 2003-10-17 Andreas Schwab <schwab@suse.de>
939 * tests/mk-script: Get $srcdir from first parameter instead of
941 (main): Update usage.
943 * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as
944 first argument of mk-script.
945 ($(srcdir)/Makefile.am): Likewise. Prepend $(srcdir) to target.
947 2003-10-17 Jim Meyering <jim@meyering.net>
949 * src/mv.c (usage): Tweak descriptions of -i and -f so that the
950 generated `man' page is more readable. Suggestion from Dan Jacobson.
952 * src/chown-core.c (change_file_owner): Handle the cases in
953 which fts_info indicates an error with the given entry.
955 * src/du.c (main): Simply assign to bit_flags.
956 Don't bother with bit arithmetic.
958 * tests/chmod/no-x: New file.
959 * tests/chgrp/no-x: New file.
960 * tests/chmod/Makefile.am (TESTS): Add no-x.
961 * tests/chgrp/Makefile.am (TESTS): Likewise.
963 * src/du.c: Include "xfts.h".
964 (du_files): Use xfts_open, rather than fts_open.
965 * src/chown-core.c (chown_files): Likewise.
967 2003-10-16 Jim Meyering <jim@meyering.net>
969 * src/chgrp.c (main): Simply assign to bit_flags.
970 Don't bother with bit arithmetic.
971 * src/chown.c (main): Likewise.
972 Rename a couple of local variables.
973 Remove unnecessary casts.
975 * src/tail.c (start_bytes): Rename local, remainder, to avoid
976 gcc's warning about shadowing a global.
978 2003-10-15 Jim Meyering <jim@meyering.net>
980 chown and chgrp now accept POSIX-mandated -H, -L, -P options and
981 use fts to perform a directory traversal when -R is specified.
982 Before, they operated on full path names, and as such would
983 encounter the PATH_MAX (often 4096) limit.
984 They are more efficient. For example, before, chgrp -R would
985 take almost 5 seconds to change about 2000 directories and fail
986 (with `File name too long'), while now it succeeds on a hierarchy
987 of depth 20,000 in 1/10 the time.
989 * src/chown.c: Include "userspec.h" and "fts_.h".
990 (WRITTEN_BY): Add my name.
991 (getpwnam, getgrnam, getgrgid): Remove declarations.
992 (endpwent): Remove definition.
994 (main): Handle new options.
995 Call new function, chown_files rather than change_file_owner.
997 * src/chgrp.c: Include "fts_.h".
998 (WRITTEN_BY): Add my name.
999 (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of
1002 (main): Handle new options.
1003 Call new function, chown_files rather than change_file_owner.
1005 Rewrite to iterate through hierarchies using fts rather than
1006 via explicit recursion.
1007 * src/chown-core.c: Include "fts_.h"
1008 (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
1009 on a single file at a time.
1010 (chown_files): New function.
1011 * src/chown-core.h [enum Dereference_symlink]: Remove declaration.
1012 [struct Chown_option] (recurse, force_silent): Change type to `bool'.
1013 [struct Chown_option] (dereference): Remove member with ambiguous name.
1014 [struct Chown_option] (affect_symlink_referent): New member.
1015 (chown_files): New prototype.
1017 * tests/chgrp/recurse: Update tests accordingly.
1018 * tests/chgrp/posix-H: New tests for the above.
1019 * tests/chgrp/Makefile.am (TESTS): Add posix-H.
1021 * src/ln.c (usage): Clarify that --directory, -d, -F probably won't
1022 work even for superuser. Suggestion from Dan Jacobson.
1024 2003-10-14 Paul Eggert <eggert@twinsun.com>
1026 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
1028 * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h,
1029 lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib.
1030 * src/sort.c (parse_field_count): Handle the case where overflow
1031 and invalid suffix char are both reported.
1033 2003-10-14 Jim Meyering <jim@meyering.net>
1035 * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the
1036 warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
1039 2003-10-13 Paul Eggert <eggert@twinsun.com>
1041 Fix to avoid a denial-of-service attack if the display width is
1042 enormous. Also, clean up the code a bit by removing duplicate code.
1044 * src/ls.c (init_column_info): Remove forward decl; no longer needed.
1045 (calculate_columns): New function, that contains code that used
1046 to be common to print_many_per_line and print_horizontal.
1047 (print_many_per_line, print_horizontal): Use it.
1048 (decode_switches): Set max_idx here, not in calculate_columns.
1049 (print_current_files): Don't call init_column_info; calculate_columns
1051 (init_column_info): Don't allocate a lot more space than is needed
1052 to represent the current set of files. Allocate all the new
1053 size_t cells in one call to xnmalloc, rather than a row at a time.
1055 2003-10-13 Jim Meyering <jim@meyering.net>
1057 * src/ls.c (init_column_info): Add another FIXME comment.
1059 2003-10-13 Paul Eggert <eggert@twinsun.com>
1061 Fix address-arithmetic bug in 'ls', reported by Georgi Guninski.
1062 Remove several arbitrary limits on hosts where int cannot represent
1065 * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent,
1066 nfiles, files_index, tabsize, line_length, struct column_info.line_len,
1067 struct column_info.col_arr[0], max_idx):
1068 Now size_t, not int.
1069 (get_funky_string): Return bool indicating success, instead of
1070 a negative count to indicate failure. Store number of columns
1071 through new parameter OUTPUT_COUNT; that way, they can never
1072 go negative. Change equals_end from int to bool. All uses
1074 (struct column_info.valid_len): Now bool, not int. All uses changed.
1075 (dired_dump_obstack, get_funky_string, clear_files,
1076 extract_dirs_from_files, print_current_files,
1077 print_many_per_line, print_horizontal, init_column_info,
1078 put_indicator, length_of_file_name_and_frills,
1079 print_with_commas): Use size_t, not int, for local variables
1081 (decode_switches): Decode sizes using xstrtoul, not xstrtol.
1082 Check for TIOCGWINSZ returing negative values (or values greater
1084 (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
1086 Use xmalloc and xnmalloc, not XMALLOC.
1087 (gobble_file): Use xnrealloc, not XREALLOC.
1088 (print_color_indicator): Remove now-unnecessary cast to size_t.
1090 2003-10-12 Paul Eggert <eggert@twinsun.com>
1092 * tests/du/no-x: Change wording of diagnostic to match latest du.c.
1093 * tests/sort/sort-tests: Remove from CVS; assume that people
1094 brave enough to check coreutils out from CVS can rebuild it.
1096 2003-10-12 Jim Meyering <jim@meyering.net>
1098 New options: --preserve-root and --no-preserve-root.
1099 * src/chmod.c (change_file_mode): Honor new option.
1100 (change_file_mode): Strip trailing slashes on directory
1101 argument passed to change_dir_mode.
1102 (get_root_dev_ino): New function.
1103 (main): Initialize global, root_dev_ino.
1105 * src/copy.c (copy_internal): Don't #ifdef-out simple uses of
1106 S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined
1108 * src/chmod.c (change_file_mode): Likewise.
1110 2003-10-08 Jim Meyering <jim@meyering.net>
1112 * src/csplit.c (main): Remove obsolete FIXME.
1114 2003-10-07 Jim Meyering <jim@meyering.net>
1116 * Use automake-1.7.8. Regenerate dependent files.
1118 2003-09-29 Paul Eggert <eggert@twinsun.com>
1122 * doc/coreutils.texi (csplit invocation):
1123 The regexp offset need not have a sign; POSIX requires support
1124 for signless offets.
1126 Be more careful about int widths. For example, remove some
1127 arbitrary limits by replacing 'unsigned' with 'size_t',
1128 'uintmax_t', etc. Use standard bool rather than a homegrown type.
1129 * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
1130 * src/csplit.c (FALSE, TRUE, boolean): Remove. All uses changed
1131 to <stdbool.h> usage.
1132 (struct control): offset is now intmax_t, not int.
1133 repeat_forever is now bool, not int.
1134 (struct cstring): len is now size_t, not unsigned int.
1135 (struct buffer_record): bytes_alloc, bytes_used, num_lines are now
1136 size_t, not unsigned. start_line, first_available are now
1137 uintmax_t, not unsigned.
1138 (hold_count, control_used): Now size_t, not unsigned.
1139 (last_line_number, current_line, bytes_written):
1140 Now uintmax_t, not unsigned.
1141 (save_to_hold_area, red_input, keep_new_line, record_line_starts,
1142 create_new_buffer, get_new_buffer, load_buffer, find_line,
1143 process_regexp, split_file, new_control_record, extract_regexp,
1144 get_format_width, get_format_prec, max_out):
1145 size args, locals, and returned values are now size_t, not unsigned
1147 (get_first_line_in_buffer, find_line, write_to_file,
1148 handle_line_error, process_line_count, regexp_error, process_regexp,
1150 File line, byte, and repetition counts are now uintmax_t, not unsigned.
1151 (check_for_offset): Don't require a sign before the offset.
1152 Use xstrtoimax to do the real work.
1153 (extract_regexp): Remove harmful cast of size to unsigned.
1154 256 -> 1<<CHAR_BIT, for clarity.
1155 (get_format_flags): Return at most 3, to avoid worries about overflow.
1157 (bytes_to_octal_digits): Remove.
1159 (cleanup): Don't check whether output_stream is NULL, since
1160 close_output_file does that for us.
1162 (new_line_control, create_new_buffer): Use "foo *p = xmalloc
1163 (sizeof *p);" instead of the more long-winded alternatives.
1165 (get_new_buffer): Use O(1) algorithm for resizing a buffer
1166 to a much larger size, instead of an O(N) algorithm.
1168 (process_regexp): Use plain NULL rather than casted 0.
1170 (make_filename): Use %u, not %d, to format unsigned file number.
1172 (new_control_record): Use xrealloc exclusively, since it handles
1175 (extract_regexp): Change misspelled word in diagnostic.
1177 (get_format_width): Even if a minimum field width is specified,
1178 allow room for enough octal digits to represent the value of
1179 the maximum representible integer. This fixes a potential
1180 buffer overrun. Calculate this room at compile-time, not
1181 at run-time; this removes the need for bytes_to_octal_digits.
1182 Check for overflow; this removes a FIXME.
1184 (get_format_prec): Don't allow precision to be signed; it's
1185 not ANSI. Check for overflow. Remove hardcoded "11" as
1186 default precision; this fixes a potential buffer overrun
1187 on hosts with wider size_t.
1189 (get_format_conv_type): Change local variable to be of type
1190 unsigned char, not int; this removes a potential subscript
1191 violation on hosts where char is signed.
1193 (max_out): Replace "for (;*p;)" with more-standard "while (*p)".
1194 Allow "%%" in format. Don't overflow when
1195 counting lots of percents.
1197 (usage): Default sprintf format is %02u, not %d.
1199 2003-10-05 Jim Meyering <jim@meyering.net>
1201 * src/chown-core.c (change_file_owner): Remove set-but-not-used local.
1203 * src/du.c (du_files): Mark diagnostic for translation.
1205 2003-10-04 Jim Meyering <jim@meyering.net>
1207 * src/du.c (du_files): Ignore any failure of fts_close.
1208 Give better diagnostics for failed fts_open.
1210 * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition.
1212 Deprecate existing use of -H (aka --si).
1213 * src/du.c (enum) [HUMAN_SI_OPTION]: New member.
1214 [long_options]: Use HUMAN_SI_OPTION, not 'H'.
1215 (main): Warn that the meaning of -H will soon change to be
1218 2003-10-03 Jim Meyering <jim@meyering.net>
1220 * src/du.c: Accept --no-dereference (-P).
1222 2003-10-02 Jim Meyering <jim@meyering.net>
1224 * tests/du/trailing-slash: Adjust for slightly different output.
1226 Rewrite du.c to use fts.
1227 * src/du.c: Include "fts_.h", not ftw.h.
1228 (opt_dereference_arguments, arg_length, suffix_length): Remove globals.
1229 (IS_FTW_DIR_TYPE): Remove definition.
1230 (IS_DIR_TYPE): Define.
1231 (is_symlink_to_dir): Remove now-unnecessary function.
1232 (process_file, du_files): Rewrite to use fts.
1234 * tests/du/inaccessible-cwd: Ensure that even when run from an
1235 inaccessible directory, du can still operate on accessible
1236 directories elsewhere.
1237 * tests/du/Makefile.am (TESTS): Add inaccessible-cwd.
1239 * tests/rm/deep-1: Ensure that du can process a hierarchy
1240 of depth 400 while using no more than 50KB of stack space.
1242 2003-10-01 Akim Demaille <akim@epita.fr>
1244 * announce-gen (print_news_deltas): New function, extracted from main.
1245 (main): Make `news_file' an array.
1246 Use '...=s' => \@var for --news and --url-directory specs.
1247 Before there were a couple of portability problems.
1249 2003-09-28 Jim Meyering <jim@meyering.net>
1251 * Makefile.maint (sc_cast_of_alloca_return_value): New rule.
1252 (syntax-check-rules): Add it.
1254 * src/copy.c: Remove unnecessary cast of alloca, since now it's
1255 guaranteed to be (void *).
1256 * src/cp.c: Likewise.
1257 * src/join.c: Likewise.
1258 * src/ln.c: Likewise.
1259 * src/ls.c: Likewise.
1260 * src/od.c: Likewise.
1261 * src/sys2.h (ASSIGN_STRDUPA): Likewise.
1263 2003-09-27 Jim Meyering <jim@meyering.net>
1265 Don't exhaust virtual memory when processing large inputs.
1266 Fix this by removing csplit's internal free-list management;
1267 instead rely on malloc for that.
1269 * src/csplit.c (free_list): Remove global.
1270 (clear_all_line_control): Remove function.
1271 (get_new_buffer): Always use create_new_buffer to obtain a
1272 new buffer, rather than searching free_list.
1273 (free_buffer): Just call free.
1274 Reported by Nikola Milutinovic.
1276 2003-09-26 Jim Meyering <jim@meyering.net>
1278 * man/rm.x: Also list `chattr' in SEE ALSO section.
1279 Suggestion from Mark Hubbart.
1281 2003-09-25 Jim Meyering <jim@meyering.net>
1283 * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now
1284 that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them.
1286 * Use autoconf-2.57d. Regenerate dependent files.
1288 2003-09-24 Jim Meyering <jim@meyering.net>
1290 Minor efficiency tweak.
1291 * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
1292 (do_link): Likewise.
1294 2003-09-23 Jim Meyering <jim@meyering.net>
1296 * src/paste.c (paste_serial): Save errno after input error,
1297 to report proper errno value.
1298 Based on a patch from Paul Eggert.
1300 * src/tee.c (tee): Adjust fwrite arguments so that the return
1301 value is the number of bytes written.
1303 2003-09-16 Paul Eggert <eggert@twinsun.com>
1305 Don't assume ferror sets errno. Bug reported by Bruno Haible.
1307 * src/comm.c (compare_files): Save errno after input error,
1308 to report proper errno value.
1309 * src/fold.c (fold_file): Likewise.
1310 * src/od.c (check_and_close, skip, read_char, read_block): Likewise.
1311 * src/unexpand.c (unexpand): Likewise.
1313 * src/csplit.c (close_output_file): Don't report bogus errno value
1314 after ferror discovers an output error. We don't know the proper
1315 errno value, since it might have been caused by any of a whole
1316 bunch of calls, and it might have been trashed in the meantime.
1317 Fixing this problem will require much more extensive changes;
1318 in the meantime just say "write error".
1319 * src/od.c (check_and_close, dump, dump_strings): Likewise.
1320 * src/uniq.c (check_file): Likewise.
1322 * src/join.c (get_line): Report error right away if I/O fails,
1323 so that the proper errno value is used.
1324 * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise.
1325 * src/tee.c (tee): Likewise.
1326 * src/uniq.c (check_file): Likewise.
1328 * src/od.c (skip): If a read fails, don't retry it later, so
1329 that we report the proper errno.
1331 * src/tac.c (tac_mem): Don't return a value; nobody uses it.
1333 * src/tee.c (tee): Once a write failure has occurred, don't bother
1334 writing anything more to that stream.
1336 * src/uniq.c (check_file): Check for ferror (stdout) even if
1339 * src/yes.c (UNROLL): Remove.
1340 (main): Exit immediately when write failure is detected.
1341 Simplify code by assigning to argv when argc == 1.
1343 2003-09-21 Paul Eggert <eggert@twinsun.com>
1345 * src/ptx.c: Switch encoding from Latin-1 to UTF-8.
1346 (WRITTEN_BY): Change "Franc,ois" (actually using
1347 c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
1350 2003-09-19 Jim Meyering <jim@meyering.net>
1352 `du -D symlink-to-dir' would mistakenly omit the slash in
1353 lines like this: 24 symlink-to-dir/subdir
1354 * src/du.c (process_file): Fix offset calculation.
1355 Reported by Jeff Sheinberg as Debian bug #211591;
1356 http://bugs.debian.org/205251
1358 * tests/du/deref-args: New file/test for the above.
1359 * tests/du/Makefile.am (TESTS): Add deref-args.
1361 * src/du.c (process_file): Remove useless disjunct.
1363 * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
1365 * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
1366 Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
1367 Mark each WRITTEN_BY string as translatable.
1369 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1370 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1371 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1372 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1373 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1374 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1375 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1376 * who.c, whoami.c, yes.c: Revert yesterday's changes.
1377 Instead, a subsequent change will embed `Written by ' in
1378 each string along with the author names.
1380 * src/true.c: Revert yesterday's changes.
1381 * src/sys2.h: Likewise.
1383 2003-09-18 Jim Meyering <jim@meyering.net>
1385 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1386 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1387 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1388 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1389 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1390 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1391 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1392 * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
1393 comma-separated list of strings and/or update the call to
1394 parse_long_options so that `AUTHORS, NULL' are the last parameters.
1395 * src/true.c (main): Append NULL to version_etc argument list.
1396 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
1398 * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
1399 shadowing the math function name. Also rename loga to log_a.
1401 2003-09-14 Jim Meyering <jim@meyering.net>
1403 * src/factor.c (print_factors): Give a separate diagnostic
1404 for numbers that are too large, but otherwise valid.
1405 Reported by Dániel Varga.
1407 2003-09-10 Jim Meyering <jim@meyering.net>
1409 * Use automake-1.7.7. Regenerate dependent files.
1411 * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
1412 of `fmt -1'. Using the just-built tr is a little cleaner.
1413 Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
1414 * man/Makefile.am (programs, check-x-vs-1): Likewise.
1416 2003-09-09 Jim Meyering <jim@meyering.net>
1418 * src/copy.c: Alphabetize includes.
1419 Remove duplicate inclusion of "same.h".
1421 2003-09-08 Jim Meyering <jim@meyering.net>
1423 * Makefile.maint (GZIP_ENV): Remove --rsyncable.
1424 Didn't give enough of a benefit, mainly because it's not yet
1429 * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
1430 (check-programs-vs-x): Fail if $(programs) is empty.
1432 * src/remove.c: Add a comment.
1434 2003-09-07 Jim Meyering <jim@meyering.net>
1436 * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
1437 Don't define. These symbols are no longer used.
1439 * tests/misc/tty-eof: Write ^D as \cD.
1440 Complete the change of 2003-08-02.
1442 * Makefile.maint (po-check): Use cvsu, so that a temporary source
1443 file in lib/ or src/ doesn't induce an unwarranted failure.
1444 Add a kludge to filter out the sole generated source file that
1445 also has translatable messages: src/false.c.
1447 2003-09-06 Jim Meyering <jim@meyering.net>
1449 * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
1450 (parse_options): Give a diagnostic for (but still accept) the
1451 deprecated --allow-missing option.
1453 2003-09-04 Paul Eggert <eggert@twinsun.com>
1455 Don't ignore -S if input is a pipe. Bug report by Michael McFarland in
1456 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
1458 * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the
1459 size_bound ourselves. if an input file is a pipe and the user
1460 specified a size, use that size instead of trying to guess the
1461 pipe size. This has the beneficial side effect of avoiding the
1462 overhead of default_sort_size in that case. All callers changed.
1463 (sort): Remove static var size; now done by sort_buffer_size.
1465 2003-09-05 Jim Meyering <jim@meyering.net>
1467 * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files.
1469 * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
1470 to start, rather than just .1. Upon failure, print unexpected state.
1472 2003-09-04 Paul Eggert <eggert@twinsun.com>
1474 * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
1475 SAFE_READ_ERROR to tmp->nbytes.
1476 * src/tail.c (pipe_lines, pipe_bytes): Likewise.
1478 * src/head.c (struct linebuffer): Change nbytes and nlines
1479 from unsigned int to size_t. unsigned int is safe (after the
1480 2003-09-03 patch) but size_t is cleaner.
1481 * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
1482 (pipe_bytes): Likewise for local variable 'i', which was 'int'.
1484 Standardize on BUFSIZ as opposed to other macro names and values.
1485 * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ.
1486 * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
1487 stdio.h has always defined it,
1488 and other code already assumes it's defined.
1489 * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
1490 (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
1491 (io_buf): IO_BUF_SIZE -> BUFSIZ.
1493 2003-09-04 Paul Eggert <eggert@twinsun.com>
1495 * src/seq.c (step): Default to 1.
1496 (print_numbers): Allow the output to be empty.
1497 (main): The default step is 1, even if LAST < FIRST;
1498 as per documentation.
1499 * tests/seq/basic (onearg-2): Output should be empty.
1501 2003-09-05 Jim Meyering <jim@meyering.net>
1503 * Makefile.cfg (wget_files): Temporarily disable, until master
1504 versions are restored to ftp.gnu.org.
1506 * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
1508 Make seq's --width (-w) option work properly even when the
1509 endpoint requiring the larger width is negative and smaller than
1511 * src/seq.c (get_width_format): Include `-' in the set of bytes
1512 allowed in a `simple' number (no decimal point, no exponent).
1513 Reported by Patrick Mauritz.
1515 2003-09-02 Paul Eggert <eggert@twinsun.com>
1517 * NEWS: sort -t '\0' now uses a NUL tab.
1518 sort option order no longer matters, unless POSIX requires it.
1519 * src/sort.c (usage): Say "blanks" instead of "whitespace",
1520 Similar fixes for many comments.
1521 (TAB_DEFAULT): New constant, so that we can support NUL as
1522 the field separator.
1523 (tab): Now int, not char. Initialize to TAB_DEFAULT.
1524 (specify_sort_size): If multiple sizes are specified, use the largest.
1525 (begfield, limfield): Support NUL tab char.
1526 (set_ordering): Do not let -i override -d.
1527 (main): Report an error if incompatible -o or -t options are given.
1528 Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
1530 2003-09-05 Jim Meyering <jim@meyering.net>
1532 * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
1534 2003-09-03 Andreas Schwab <schwab@suse.de>
1536 Bug report and patch here:
1537 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
1538 * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
1539 * src/head.c (elide_tail_lines_pipe): Likewise.
1541 2003-09-03 Jim Meyering <jim@meyering.net>
1543 * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
1544 small amount of code from him was first moved to lib/human.c, and was
1545 subsequently rewritten entirely.
1546 * src/df.c (AUTHORS): Likewise.
1548 2003-08-22 Lawrence Teo <lcteo@uncc.edu>
1550 * src/md5sum.c (split_3): Accept the BSD format for generic
1551 message digest modes. Currently works with BSD's MD5 and SHA1
1552 formats since these are the two algorithms presently used in
1553 coreutils. Updated comments to reflect this change.
1554 (bsd_split_3): Updated comments.
1556 * tests/md5sum/basic-1: New test to make sure that
1557 `md5sum --check' doesn't accept the BSD SHA1 format (adapted
1558 from `check-bsd' test in tests/sha1sum/basic-1).
1560 * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
1561 --check exit status and BSD SHA1 format (adapted from tests
1562 in tests/md5sum/basic-1).
1564 2003-08-30 Jim Meyering <jim@meyering.net>
1566 * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
1568 When source and destination arguments refer to the same file, reside
1569 on a partition (e.g. VFAT) on which distinct names may refer to the
1570 same directory entry (often due to variations in case), and when the
1571 link count for the file is 1, mv no longer unlinks the file. Instead,
1572 it gives the expected diagnostic that the source and destination are
1573 the same. WARNING: this is an incomplete fix. If the file happens
1574 to have a link count of 2 or greater, such an erroneous mv command
1575 will still unlink it.
1576 Although that is not possible on vfat or umsdos, it is possible on
1577 other file system types, e.g., ntfs, and hpfs.
1578 * src/copy.c (same_file_ok): Invoke same_name (which might still
1579 return false for names that refer to the same directory entry)
1580 only if the link count is 2 or more.
1581 * tests/mv/vfat: Show how to demonstrate the above problem.
1582 This test is not run.
1583 * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
1585 2003-08-27 Jim Meyering <jim@meyering.net>
1587 * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
1588 who's -l option has been eliciting an unconditional warning about
1589 this impending change since sh-utils-2.0.12 (April 2002).
1591 * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
1592 This would happen for nonempty files not ending with a newline.
1593 Reported by Dan Jacobson.
1594 * tests/misc/paste-no-nl: New file. Test for above-fixed bug.
1595 * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
1597 * src/stat.c (print_it): Avoid buffer overrun that would
1598 occur when the user-specified format string ends with `%'.
1599 Patch by Tommi Kyntola.
1600 * tests/misc/stat-fmt: New file. Test for above-fixed bug.
1601 * tests/misc/Makefile.am (TESTS): Add stat-fmt.
1603 2003-08-26 Jim Meyering <jim@meyering.net>
1605 Apply changes from bison.
1606 * GNUmakefile (SHELL): Define to `sh', if necessary.
1608 * Makefile.maint (WGETFLAGS): Define to `-C off'.
1609 Update all uses of $(WGET).
1611 2003-08-22 Akim Demaille <akim@epita.fr>
1613 * Makefile.cfg (local-checks-to-skip): New.
1614 * Makefile.maint (local-check): Rename as...
1615 (local-checks-available): this.
1618 2003-08-26 Akim Demaille <akim@epita.fr>
1620 * announce-gen (print_changelog_deltas): Neutralize "<#" as
1621 "<\#" to avoid magic from Gnus when posting parts of this script.
1623 2003-08-25 Jim Meyering <jim@meyering.net>
1625 * src/stat.c (main): Warn about use of deprecated `-l' option.
1627 2003-08-22 Jim Meyering <jim@meyering.net>
1629 * src/stat.c (do_stat): For link count at end of line, use %h format,
1630 instead of %-5h. The latter would make stat emit trailing spaces.
1631 Reported by Dan Jacobson.
1633 2003-08-20 Jim Meyering <jim@meyering.net>
1635 * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
1637 2003-08-19 Jim Meyering <jim@meyering.net>
1639 * src/system.h: Include stdlib.h unconditionally,
1640 as we're now assuming that part of hosted C89.
1642 2003-08-18 Jim Meyering <jim@meyering.net>
1644 * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
1645 to avoid warnings from gcc.
1647 2003-08-17 Jim Meyering <jim@meyering.net>
1649 Avoid unnecessary and sometimes time-consuming hostname lookups.
1650 * src/who.c (print_user): Use strchr, not strrchr.
1651 * src/pinky.c (print_entry): Likewise.
1652 Patch by Michael Stone.
1653 This fixes a typo I introduced in who-users.c on 1996-02-23.
1655 * Makefile.maint (makefile-check): Add 0-9 to the range of characters
1656 disallowed between `@...@'.
1658 2003-08-16 Paul Eggert <eggert@twinsun.com>
1660 * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
1661 done by gnulib .m4 files.
1662 (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
1663 * src/sys2.h (strtoull): Remove unused declaration.
1665 2003-08-16 Jim Meyering <jim@meyering.net>
1667 * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
1670 * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
1671 race condition bug. The bug would be triggered when tailing a file
1672 with file pointer not at beginning of file, and where the file was
1673 truncated to have a length of less than the initial offset at just
1674 the right moment (between the two lseek calls in this function).
1676 An invalid initial value for *read_pos would result in
1677 `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
1678 busy-wait rather than sleeping between iterations. The bug manifests
1679 itself only when tailing regular files that are initially nonempty.
1680 * src/tail.c (tail_bytes): Set *read_pos to new file offset after
1682 (tail_lines): Likewise, after lseek calls.
1683 Reported by Nick Estes. See http://bugs.debian.org/205251 for details.
1684 * tests/tail-2/tail-n0f: New file. Test for above fix.
1685 * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
1687 2003-08-15 Jim Meyering <jim@meyering.net>
1689 * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
1690 (sc_sun_os_names): Likewise.
1691 * .x-sc_space_tab, .x-sc_sun_os_names: New files.
1693 * man/help2man: Remove some SPACEs before TAB.
1695 2003-08-14 Paul Eggert <eggert@twinsun.com>
1697 * Makefile.maint (LC_ALL): Set to C.
1698 * man/Makefile.am (ASSORT): New var.
1699 (check-x-vs-1, programs): Use it.
1700 * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
1701 * tests/Makefile.am (ASSORT, all_programs): Likewise.
1703 2003-08-11 Jim Meyering <jim@meyering.net>
1705 fold -s -wN would infloop for N < 8 with TABs in the input.
1706 E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
1707 * src/fold.c (fold_file): Move contents of `else'-block
1708 out of conditional so it's used also for --spaces (-s).
1709 * tests/misc/fold: Test for the above fix.
1710 * tests/misc/Makefile.am (TESTS): Add fold.
1712 2003-08-10 Jim Meyering <jim@meyering.net>
1714 * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
1715 system.h so the types from time.h and sys/time.h are available.
1716 It appears that this is necessary for OpenBSD, NetBSD, and
1717 Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
1719 2003-08-06 Paul Eggert <eggert@twinsun.com>
1721 * NEWS: Add support for setting file timestamps to microsecond
1722 resolution, on hosts that support this.
1723 * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
1724 * src/copy.c (copy_internal):
1725 Set file timestamps with utimens, not utime.
1726 * src/cp.c (re_protect): Likewise.
1727 * src/install.c (change_timestamps): Likewise.
1728 * src/touch.c (newtime, touch, main): Likewise.
1730 2003-08-09 Jim Meyering <jim@meyering.net>
1732 * Makefile.maint (sc_sun_os_names): New rule based on a regexp
1734 (syntax-check-rules): Add it.
1736 * src/tail.c (main): Tweak Solaris OS version number in comment.
1737 * src/wc.c (wc): Likewise
1738 * tests/tail-2/fflush: Likewise.
1740 * src/tail.c: Add new undocumented option, --presume-input-pipe.
1741 (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
1743 2003-08-08 Paul Eggert <eggert@twinsun.com>
1745 Use new gnulib 'extensions' module.
1746 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
1749 2003-08-08 Paul Eggert <eggert@twinsun.com>
1751 * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
1753 2003-08-09 Jim Meyering <jim@meyering.net>
1755 * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
1756 For tests of obsolete behavior, don't presume that unsetting
1757 _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
1759 2003-08-07 Paul Eggert <eggert@twinsun.com>
1761 * doc/coreutils.texi (split invocation):
1762 Add -d or --numeric-suffixes option to 'split'.
1763 From a suggestion by Jesse Kornblum.
1764 * src/split.c (suffix_alphabet): New var.
1765 (longopts, usage, next_file_name, main): Support -d.
1766 (next_file_name, main): Allow -a0, as POSIX requires.
1767 (next_file_name): Don't assume ASCII-like encoding;
1768 'a' through 'z' are not contiguous in EBCDIC.
1770 2003-08-05 Paul Eggert <eggert@twinsun.com>
1772 Merge getline from gnulib.
1773 * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
1774 * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
1775 New files, from gnulib.
1776 * lib/getdelim2.c, lib/getdelim2.h: Remove.
1777 * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
1778 getdelim2.h to getndelim2.c and getndelim2.h.
1779 * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
1780 checking for getdelim.
1781 (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
1782 than rolling our own.
1783 * src/cut.c: Include getndelim2.h rather than getdelim2.h.
1784 (cut_fields): Invoke getndelim2 rather than getdelim2.
1786 2003-08-04 Jim Meyering <jim@meyering.net>
1788 * src/sort.c (main): Use unsigned int instead of int for `nsigs'
1789 and for the indices to iterate through nsigs.
1791 2003-08-02 Paul Eggert <eggert@twinsun.com>
1793 * src/sort.c: Minor code cleanups, mostly to use more accurate
1794 types and to remove unnecessary casts.
1795 (min, max): Remove. All uses changed to MIN and MAX.
1796 (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
1797 keyfield.skipsblanks, struct keyfield.skipeblanks, struct
1798 keyfield.numeric, struct keyfield.general_numeric, struct
1799 keyfield.month, struct keyfield.reverse, reverse, unique,
1800 have_read_stdin): Now bool, not int. All uses changed.
1801 (eolchar): Now char, not int.
1802 (struct keyfield.ignore): Now bool const *, not int *.
1803 (struct keyfield.translate): Now char const *, not char *.
1804 (struct month.name): Likewise.
1805 (blanks, nonprinting, nondictionary): Now bool[], not int[].
1806 (cleanup, inittables, keycompare, check, mergefps, first_same_file,
1807 check, sort, main): Use const * pointers when possible.
1808 (month_cmp): Rewrite to avoid casts.
1809 (inittables): Initialize tables unconditionally, to avoid branches.
1810 (fillbuf): Return bool, not int. All uses changed.
1811 (fillbuf, keycompare, new_key, main):
1812 Use SIZE_MAX rather than (size_t) -1.
1813 (trailing_blanks): Renamed from trim_trailing_blanks.
1814 Return the number of blanks to trim. All uses changed.
1815 (getmonth): Use trailing_blanks rather than open code.
1816 (keycompare): Do not cast char * to unsigned char *; not needed.
1817 CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
1819 (compare, main): Use | rather than || to avoid jumps.
1820 Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
1822 (check, first_same_file, sort, main):
1823 Use bool instead of int local vars when possible.
1824 (check): Merge the old 'checkfp' and 'check' into a single function,
1825 that returns a boolean (true if the file was ordered).
1827 (main): Use int instead of unsigned for iterating through nsigs.
1828 Rename local var "posix_pedantic" to "posixly_correct".
1830 2003-08-02 Jim Meyering <jim@meyering.net>
1832 * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
1833 to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
1835 * src/cut.c (cut_fields): Don't read again after encountering an
1836 initial EOF. E.g., `cut -f2' would do so.
1837 * tests/misc/tty-eof: Add a test for the above fix.
1839 * src/sort.c (sortlines): Add description and references.
1842 * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
1843 the tests in help-version will use the just-built binaries.
1844 Reported by Christian Krackowizer.
1846 2003-07-31 Paul Eggert <eggert@twinsun.com>
1848 * NEWS: Add --rfc-2822 option to GNU date.
1849 * doc/coreutils.texi (Time directives, Options for date, Examples
1851 * src/date.c (long_options, usage, main): Likewise.
1852 * doc/getdate.texi (General date syntax): Likewise.
1853 * doc/coreutils.texi (Options for date): Fix a typo in format:
1854 it's now %d not %_d. Add URLs.
1856 2003-08-01 Jim Meyering <jim@meyering.net>
1858 * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
1859 Otherwise, with at least the /bin/sh from HPUX 10.20,
1860 the trap code would end up converting that to exit 1 and thus an
1861 unexpected test failure. Reported by Christian Krackowizer.
1863 2003-07-31 Paul Eggert <eggert@twinsun.com>
1865 * src/ptx.c: Do not include bumpalloc.h.
1866 (WORD_TABLE): New member alloc.
1867 (ALLOC_NEW_WORD): Remove.
1868 (occurs_alloc): New var.
1869 (digest_word_file, find_occurs_in_text): Check for arithmetic
1870 overflow when computing table size. Use xrealloc rather than
1871 bumpalloc primitives.
1873 2003-07-29 Jim Meyering <jim@meyering.net>
1877 * README: When running tests as root, suggest using
1878 sudo with NON_ROOT_USERNAME=$USER.
1880 * tests/Makefile.am (all_programs): Makefile is in ../src, not
1883 2003-07-28 Jim Meyering <jim@meyering.net>
1885 * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
1887 2003-07-28 Paul Eggert <eggert@twinsun.com>
1889 * lib/stdbool.hin (_Bool): Make it signed char, instead of
1890 an enum type, so that it's guaranteed to promote to int.
1891 * src/sort.c (sortlines_temp): Undo previous change.
1893 2003-07-28 Jim Meyering <jim@meyering.net>
1895 * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
1896 `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
1897 would cause lines[-1 - swap] (with swap = false) to evaluate to
1900 2003-07-27 Jim Meyering <jim@meyering.net>
1902 * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
1903 since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
1905 * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
1906 directories, as required by POSIX. Reported by Karl Berry.
1907 * tests/rm/dir-no-w: New file. Test for the above fix.
1908 * tests/rm/Makefile.am (TESTS): Add dir-no-w.
1910 * tests/mk-script: Emit `$xx', not its expansion.
1912 2003-07-27 Paul Eggert <eggert@twinsun.com>
1914 This change was inspired by a similar proposal by Stepan Kasal.
1915 * src/sort.c (mergelines, sortlines_temp): New functions.
1916 (sortlines): Use them, to reduce the number of times that
1917 we need to copy 'struct line' values. This improved CPU
1918 performance by about 30% on one 18 MB test.
1919 (sort): Don't invoke sortlines unless we have 2 or more lines.
1921 2003-07-26 Stepan Kasal <kasal@ucw.cz>
1923 * src/sort.c (sort): Don't require two `struct line's per text line,
1924 the new sort algorithm requires just 1.5.
1926 2003-07-27 Jim Meyering <jim@meyering.net>
1928 * src/pathchk.c (validate_path): Use %lu, not %ld.
1930 * src/cut.c (is_printable_field): Simplify bit arithmetic.
1932 * src/ls.c (sort_files): Put `volatile' in the right place.
1935 2003-07-26 Jim Meyering <jim@meyering.net>
1937 Use only one bit per field/offset in array, not one `int'.
1938 * src/cut.c (printable_field): Change type to `unsigned char'.
1939 (mark_printable_field, is_printable_field): New functions.
1940 Use them in place of all direct accesses of `printable_field'.
1942 * src/expand.c (parse_tabstops): Detect overflow properly.
1943 * src/cut.c (set_fields): Likewise.
1945 * src/rm.c: Include "dirname.h".
1946 (usage): Use base_name (program_name) in body of --help output.
1948 * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
1949 Idea from Brendan O'Dea, who suggested using
1950 `program_name = basename (argv[0]);' everywhere --
1951 can't do that, but using base_name works just fine here.
1953 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
1955 2003-07-24 Paul Eggert <eggert@twinsun.com>
1957 Fix some POSIX-compliance problems with 'test'. This makes
1958 'test' more compatible with Bash.
1960 * NEWS, doc/coreutils.texi: Document the following.
1961 * src/test.c: Include exitfail.h.
1962 (TEST_FAILURE): New constant, used for exit status if 'test' fails.
1963 (test-syntax_error): Use it.
1964 (binary_operator): Now takes bool arg specifying whether left operand
1965 is -l ARG, so that caller determines this rather than us.
1967 (term): Use posixtest to evaluate parenthesized subexpressions.
1968 (unary_operator, one_argument): Remove support for -t without operand.
1969 (one_argument): Take argument from argv[pos].
1970 (one_argument, two_arguments, three_arguments): Advance pos.
1971 All callers changed.
1972 (three_arguments): Look for binary ops before "!". Then look
1973 for parenthesized one_argument expressions, instead of trusting
1974 expr () to do the right thing.
1975 (posixtest): Now takes number of args. All callers changed.
1976 Treat "( A B )" like "A B".
1977 (main): Set exit_failure to TEST_FAILURE. Don't depend on
1978 POSIXLY_CORRECT, as we now conform to POSIX by default.
1979 (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
1980 * tests/test/Test.pm (test_vector): Add several tests to check
1981 the above. Syntax errors now exit with status 2, not 1.
1982 * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
1984 2003-07-26 Jim Meyering <jim@meyering.net>
1986 * tests/help-version: Adjust for above change in test behavior:
1987 `[' exits with 2, not 1, and test doesn't accept --help or --version.
1989 * Makefile.maint (ME): Don't use trick suggested in Make manual.
1990 It doesn't work for make-3.79.1. Reported by Christian Krackowizer.
1992 * Makefile.maint (sc_system_h_headers): Another syntax check.
1993 (syntax-check-rules): Add it to the list.
1995 * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
1996 so it matches `%ld' format even on 32-bit systems.
1998 * src/fmt.c (flush_paragraph): Cast field width to `int' to
1999 avoid warning on 64-bit systems.
2001 * src/ls.c (sort_files): Make `func' volatile, so it can't be
2002 clobbered by a `longjmp' into this function.
2004 2003-07-25 Jim Meyering <jim@meyering.net>
2006 * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
2009 * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
2010 because it'd evoke spurious failure on 64-bit systems.
2012 2003-07-24 Jim Meyering <jim@meyering.net>
2014 * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
2015 output its current record counts. Reported by Jurriaan.
2017 * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
2018 `wc' with no options. This goes along with the change of 2003-07-20.
2020 2003-07-23 Jim Meyering <jim@meyering.net>
2022 Don't include headers already included by system.h:
2023 * src/tr.c: Don't include errno.h.
2024 * src/true.c: Don't include version-etc.h.
2025 * src/test.c: Don't include limits.h or error.h.
2026 * src/stat.c: Don't include unistd.h or time.h.
2027 * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
2028 * src/pr.c: Don't include time.h.
2029 * src/pathchk.c: Don't include errno.h.
2030 * src/nice.c: Don't include sys/time.h.
2031 * src/ls.c: Don't include stdlib.h.
2033 * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
2034 * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
2035 * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
2036 * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
2037 * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
2038 * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
2039 * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
2040 * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
2041 Don't include closeout.h.
2043 * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
2044 can access the required version of rm.
2045 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
2047 * tests/cut/Test.pm (out-delim3a): New test.
2049 * man/help2man: Update to version 1.33.
2051 * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
2053 * src/dircolors.c: Include xstrndup.h.
2054 (xstrndup): Remove function, now that it's been factored out into
2057 2003-07-22 Paul Eggert <eggert@twinsun.com>
2059 * src/wc.c (wc): Fix typo in computation of file from file_x,
2060 which caused the former to be used uninitialized if file_x was
2063 2003-07-22 Jim Meyering <jim@meyering.net>
2065 * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
2067 * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
2068 help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by
2069 Thomas Luzat. See http://bugs.debian.org/202413 for details.
2071 * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
2073 * src/hostid.c: Don't include <unistd.h>. system.h already does that.
2075 * src/cut.c (set_fields): Mark all selected indices before trying to
2076 determine range endpoints.
2077 * tests/cut/Test.pm: New test for the above fix.
2079 Begin to address this comment: What if someone wants to
2080 extract the 1,000,000-th field of some huge input file?
2081 The first step is to rearrange things so that the values
2082 in the printable_field array are all 0/1 rather than 0/1/2.
2083 * src/cut.c (RANGE_START_SENTINEL): Remove.
2084 Store range-start indices in a hash table, rather than
2085 overloading the `printable_field' array.
2086 (range_start_ht): New global.
2087 (hash_int, hash_compare_ints, is_range_start_index): New functions.
2088 (print_kth): Use is_range_start_index; don't test printable_field.
2089 (set_fields): Detect overflow.
2090 (set_fields): Insert each range-start index into range_start_ht.
2091 (main): Call set_fields only once, and only after
2092 output_delimiter_specified and (if required) range_start_ht have
2095 2003-07-20 Paul Eggert <eggert@twinsun.com>
2097 * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
2098 invoked with a null pointer when there were no file arguments.
2100 2003-07-20 Jim Meyering <jim@meyering.net>
2102 * Makefile.maint (sc_changelog): Add another nit-picky check.
2104 * src/wc.c (write_counts): Add a comment.
2105 (wc): Rename `file' parameter.
2106 Set new local, `file', to be the file name, or (when it's NULL)
2107 _("standard output") so that all uses of `file' use the proper value.
2108 Use STREQ, not strcmp.
2110 2003-07-20 Paul Eggert <eggert@twinsun.com>
2112 wc count field widths now are heuristically adjusted depending
2113 on the input size, if known. If only one count is printed, it
2114 is guaranteed to be printed without leading spaces.
2116 Previously, wc did not align the count fields if
2117 POSIXLY_CORRECT was set, but POSIX did not actually require
2118 this undesirable behavior, so it has been removed.
2120 * NEWS: Document this.
2121 * doc/coreutils.texi (wc invocation): Likewise.
2123 * src/wc.c (number_width): New var.
2124 (posixly_correct): Remove.
2125 (struct fstatus): New struct.
2126 (write_counts): Output fields of width number_width.
2127 Do not worry about POSIXLY_CORRECT.
2128 Use null file, not empty-string file, to denote stdin,
2129 since "" is a valid file name on some hosts.
2130 (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
2132 (wc): Avoid problems if end_pos - current_pos overflows.
2133 Do not print odd message if stdin has a read error.
2134 (get_input_fstatus, compute_number_width): New functions.
2135 (main): Use them to implement the new behavior.
2136 Ignore POSIXLY_CORRECT.
2138 * tests/wc/Test.pm: Adjust to the new output widths.
2140 2003-07-19 Jim Meyering <jim@meyering.net>
2142 * tests/rm/fail-eperm: Don't create temporary directory --
2145 * tests/shred/remove: Don't open-code test for UID != 0.
2146 Use priv-check's require-non-root instead.
2147 Update to use newer framework.
2149 * tests/help-version (expected_failure_status_expr): Record that
2150 expr exits with status of 3 for e.g., a write error.
2152 * tests/priv-check: Use `id -u' to see if we're running as root,
2153 rather than trying go write to an write-protected file.
2154 When running as root, ensure $NON_ROOT_USERNAME is valid.
2155 When running as root with `require-non-root', ensure that `.'
2156 is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
2157 to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test.
2159 * src/printenv.c: Include "exitfail.h".
2160 (main): Set exit_failure rather than calling close_stdout_set_status.
2161 * src/date.c: Likewise.
2162 * src/sort.c: Likewise.
2163 * src/tty.c: Likewise.
2165 2003-07-18 Jim Meyering <jim@meyering.net>
2167 * tests/touch/not-owner: Update to use newer framework.
2169 * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
2170 directory, and remove Perl-coded `you may not run as root' test.
2171 * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
2172 hard-coding something not quite equivalent.
2173 Paul Jarc reported the inconsistent diagnostics.
2175 * src/sort.c (main): Use close_stdout via atexit.
2176 Now `sort --version' and `sort --help' fail, as they should
2177 when their output is redirected to /dev/full.
2179 * src/su.c (usage): Don't call close_stdout here.
2180 (main): Use close_stdout via atexit.
2181 Now `su --version > /dev/full' fails, as it should.
2182 Somehow, the change of 2000-05-07 that purports to fix this
2185 * tests/help-version (--help/--version vs. /dev/full): Special-case
2186 `[' to protect it from expected_failure_status-`eval'.
2188 * src/uniq.c (writeline): Use a SPACE, not a TAB between the
2189 count and the corresponding line, as required by POSIX.
2190 Reported by Clement Wang.
2191 * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
2193 * tests/expr/basic: Add tests for when exit status is 2.
2195 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
2196 Use an anonymous `enum', rather than #define.
2198 2003-07-17 Paul Eggert <eggert@twinsun.com>
2200 * src/expr.c: Include "exitfail.h", "quotearg.h".
2201 (EXPR_INVALID, EXPR_ERROR): New constants.
2202 (nomoreargs, null, toarith, nextarg): Return bool, not int.
2203 (syntax_error): New function, exiting with status 2. Use it
2204 insteading of printing "syntax error" ourselves.
2205 (main): Initialize exit_failure to EXPR_ERROR.
2206 Exit with EXPR_INVALID on syntax error (too few arguments).
2207 (nextarg): Use strcmp, not strcoll; strcoll might return
2208 an undesirable 0, or might fail.
2209 (docolon, eval4, eval3): Exit with status 3 on invalid argument type
2210 or other such error.
2211 (eval2): Report an error if strcoll fails in a string comparison.
2212 * src/sort.c: Include "exitfail.h".
2213 (main): Set exit_failure, not xalloc_exit_failure and
2214 xmemcoll_exit_failure.
2215 * tests/expr/basic: Invalid value exits with status 3, not 2.
2217 2003-07-16 Jim Meyering <jim@meyering.net>
2219 * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
2220 per GNU maintainer guidelines. The next non-beta release will be 5.1.
2222 This script would have caught at least two recent bugs:
2223 those in [ and kill.
2224 * tests/help-version: Revive this script.
2225 It wasn't doing anything useful, since $all_programs wasn't being
2226 defined by the invoking Makefile.am.
2227 Reflect that nohup is no longer a script, so don't exclude it.
2228 Add framework to handle the programs added since it was last run:
2229 kill, stat, unlink, [, link, readlink.
2230 Fix path-related problems deriving from the move of this script
2231 from src/ to its present location.
2232 * tests/Makefile.am (all_programs): Define.
2233 (TESTS_ENVIRONMENT): Use it.
2235 * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
2236 whereby kill would always attempt to operate on argv[0] and fail.
2238 * src/test.c (integer_expected_error): Improve diagnostic -- now,
2239 it also matches the one from bash's builtin test.
2240 (binary_operator): Add \n at end of diagnostic.
2242 * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ...
2243 * tests/priv-check: Move setuidgid-related and
2244 NON_ROOT_USERNAME-checking code to this file.
2246 * README: Update section on testing as `root'.
2247 Suggestion from Paul Jarc.
2249 * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
2250 names of authors that I just found in bash's builtins/test.def.
2252 Running `[' with no arguments would evoke a segfault.
2253 * src/test.c (main) [LBRACKET]: Move initialization of argv to
2254 precede potential use via test_syntax_error.
2256 * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
2257 warning from automake -Wall.
2259 2003-07-15 Jim Meyering <jim@meyering.net>
2263 * Makefile.maint (%.asc): Remove target first, so gpg doesn't
2266 * announce-gen (print_changelog_deltas): Relax tests for matching
2267 version-number line in NEWS.
2268 Change the .sig suffix to .asc here, too.
2270 2003-07-14 Jim Meyering <jim@meyering.net>
2272 * Makefile.maint (%.asc): Renamed from %.sig.
2273 Generate and use ascii-armored signatures.
2274 Use gpg's -o option.
2276 2003-07-13 Jim Meyering <jim@meyering.net>
2278 * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
2281 * Makefile.maint (syntax-check): Move each individual check into
2283 (syntax-check-rules): This is the list of syntax-check targets.
2284 (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
2285 (sc_cast_of_x_alloc_return_value, sc_space_tab):
2286 (sc_error_exit_success, sc_xalloc_h_in_src): New targets.
2288 2003-07-12 Jim Meyering <jim@meyering.net>
2290 * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
2291 traces of the nohup script.
2293 * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
2294 $(OPTIONAL_BIN_ZCRIPTS).
2296 * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
2297 target, not before the `>'.
2299 * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
2300 now that that function no longer calls `error'.
2302 * src/df.c (find_mount_point): Emit a diagnostic for each
2303 failed syscall, rather than relying on caller to do that.
2304 The caller couldn't do a good job, anyhow -- too many different
2305 ways to fail (each with a different referent).
2306 Give a diagnostic upon failed save_cwd, now that that function
2307 no longer calls `error'.
2308 (show_point): Don't diagnose find_mount_point's errors, now that
2309 it handles them itself.
2311 * src/df.c (find_mount_point): Don't let free clobber errno upon
2314 * src/sys2.h: Remove alloca-related block.
2315 * src/system.h: Include <alloca.h> here, instead.
2317 It appears that the `#pragma alloca' included via "system.h" is
2318 adequate, since join.c uses alloca, yet lacked an in-file #pragma.
2319 * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
2320 * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
2322 * src/chown-core.c (change_file_owner): Do not restore any special
2323 permission bits (e.g., set-user-ID, set-group-ID) that are reset
2324 by chown(2) on some systems. Suggestion and insistence :-) from
2327 * tests/input-tty: Also check `test -t 1'.
2328 This is necessary on linux-2.4.21. Otherwise, the stty/basic-1
2329 test would block when run in the background.
2331 2003-07-11 Jim Meyering <jim@meyering.net>
2333 * tests/sample-test: Also fail if cat-to-create-expected-output
2334 fails. Otherwise, if both `exp' and `out' were to end up empty
2335 because of e.g., a full disk, they would mistakenly compare equal.
2337 * src/nohup.c: New file. Rewrite of nohup.sh in C.
2338 This solves a portability problem: on at least Solaris systems,
2339 when nohup.sh used the vendor /bin/sh, it would exit with status
2340 of `1' rather than the required 126 or 127 upon failure to exec
2341 the specified program.
2343 * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
2344 (bin_PROGRAMS): Add nohup.
2345 (EXTRA_DIST): Remove nohup.sh.
2346 (all_programs): Remove use of $(EXTRA_SCRIPTS).
2347 * src/nohup.sh: Remove file.
2348 * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
2350 * tests/misc/nohup: Tests for the above.
2351 * tests/misc/Makefile.am (TESTS): Add nohup.
2353 * src/head.c (diagnose_copy_fd_failure): New function, renamed from
2354 the macro, COPY_FD_DIAGNOSE.
2355 (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
2356 (head_file): Likewise.
2358 * src/date.c: Include "quote.h".
2359 (batch_convert): Use the quote function rather than using literal `...'
2362 * src/setuidgid.c (main): Enclose diagnostic in _(...).
2363 * src/fmt.c (main): Likewise.
2364 * src/mknod.c (main): Likewise.
2365 * src/tac.c (tac_seekable): Likewise.
2366 * src/yes.c (main): Likewise.
2367 * src/od.c (main): Likewise.
2368 * src/install.c (change_attributes): Likewise.
2370 2003-07-10 Jim Meyering <jim@meyering.net>
2372 * src/head.c (usage): Use 1024*1024 in place of 1048576.
2373 * src/tail.c (usage): Likewise.
2375 * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
2376 place of the kludge in this test. Suggestion from Paul Jarc.
2378 * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
2379 * src/setuidgid.c: New program, solely for testing (not installed).
2381 * src/chown-core.c (change_file_owner): Don't leak file descriptors
2382 when dereferencing symlinks.
2384 2003-07-09 Jim Meyering <jim@meyering.net>
2386 * tests/du/slash: New file/test for today's lib/ftw.c fix.
2387 * tests/du/Makefile.am (TESTS): Add slash
2389 * src/tail.c (xlseek): Avoid warning about ``return without value
2390 from function returning non-void''.
2392 2003-07-08 Jim Meyering <jim@meyering.net>
2394 * man/help2man: Update to version 1.29.
2396 * man/help2man: Add END handler to close STDOUT and check for errors.
2398 2003-06-30 Paul Eggert <eggert@twinsun.com>
2400 Add support for a "[" that conforms to the GNU coding standards,
2401 i.e., that does not depend on its name.
2402 * src/lbracket.c: New file.
2404 * man/Makefile.am (programs): Ignore "[", since it doesn't have
2405 a separate man page.
2406 * src/Makefile.am (bin_PROGRAMS): Add "[".
2407 (__SOURCES): New var.
2408 * src/test.c (LBRACKET): Define to 0 if not defined.
2409 (main): Use LBRACKET rather than argv[0].
2411 * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
2412 Reported by Paul Jarc and Dan Jacobson.
2414 * src/test.c (main): Do not recognize --help or --version if
2415 POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
2416 Do not bother testing that margv[margc] is non-null.
2418 2003-07-04 Jim Meyering <jim@meyering.net>
2420 * src/who.c (print_line): Rewrite to use asprintf, in order to be
2421 able to avoid emitting trailing spaces. Reported by Dan Jacobson.
2423 * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
2424 option, and perform the +1600 invocations of head IFF the envvar
2425 RUN_EXPENSIVE_TESTS is set.
2427 2003-07-03 Jim Meyering <jim@meyering.net>
2429 * src/cp.c (do_copy): Give a better diagnostic when failing due
2430 to nonexistent destination directory. Reported by Dmitry Rutsky.
2431 See http://bugs.debian.org/199730 for details.
2433 2003-06-27 Jim Meyering <jim@meyering.net>
2435 split's --verbose option did nothing [broken in 4.5.10 and 5.0]
2436 * src/split.c (longopts): Use `1', not `0' as the value for
2437 for &verbose. Reported by Keith Thompson.
2439 Test for the above fix.
2440 * tests/misc/split-a: Also use --verbose and compare stderr
2441 output with what we'd expect.
2443 2003-06-20 Jim Meyering <jim@meyering.net>
2445 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2446 Use `error_t' (rather than int) as type for local `err'.
2447 From Alfred M. Szmidt.
2449 2003-06-19 Marcus Brinkmann <marcus@gnu.org>
2451 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2452 Fix author preservation code.
2454 2003-06-19 Jim Meyering <jim@meyering.net>
2456 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
2457 (do_link): Don't warn about hard link to symlink.
2459 2003-06-18 Jim Meyering <jim@meyering.net>
2461 * src/cut.c: Include "getdelim2.h", not "getstr.h".
2462 Reflect renaming: getstr -> getdelim2.
2464 * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
2465 readline -> readlinebuffer.
2467 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2469 * src/readlink.c: Include <sys/types.h> before system.h (because
2470 the latter includes <sys/stat.h>). Required on Ultrix 4.3.
2472 2003-06-17 Jim Meyering <jim@meyering.net>
2474 * src/system.h (initialize_main): Define.
2475 Use it in every `main'. Applied via this:
2476 p='initialize_main (&argc, &argv);'
2477 perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \
2478 $(grep -l program_name.=.argv.0 *.c)
2479 test.c uses margc/margv, so I made the change manually for that file.
2480 Based on a patch from Bernard Giroud.
2482 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2484 Fix for build failure on Ultrix 4.3.
2485 * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
2486 Include sys/param.h and sys/mount.h on ultrix.
2488 2003-06-16 Jim Meyering <jim@meyering.net>
2490 * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
2492 * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
2493 them here instead, but with one change: define EISDIR to -1, not 0.
2495 * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
2496 guaranteed to be defined.
2497 * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
2499 * README: Mention the CVS repository.
2500 Encourage addition of test cases.
2502 2003-06-12 Jim Meyering <jim@meyering.net>
2504 * src/touch.c (touch): Call close only if necessary.
2507 * src/wc.c (usage): Correct wording: wc prints counts in the order
2508 `newline, word, byte'. Reported by Keith M. Briggs.
2509 * man/wc.x: Fix it here, too. And change `lines' to `newlines'.
2511 2003-06-10 Jim Meyering <jim@meyering.net>
2513 * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
2515 2003-06-07 Jim Meyering <jim@meyering.net>
2517 * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
2520 2003-06-06 Jim Meyering <jim@meyering.net>
2522 * src/extract-magic (main): Avoid newer 3-arg form of open,
2523 so this script works also with e.g., perl5.005_03.
2524 Patch by John David Anglin.
2526 2003-06-04 Paul Eggert <eggert@twinsun.com>
2528 * src/system.h: Include <stdbool.h> unconditionally.
2530 2003-06-04 Jim Meyering <jim@meyering.net>
2532 * man/Makefile.am (check-programs-vs-x): Rename target
2533 from check-programs-vs-1. Adjust rule to check for the
2534 primary (.x) file, not the generated one (.1).
2536 2003-06-03 Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
2538 * man/kill.x: New file.
2539 * man/Makefile.am (dist_man_MANS): Add kill.1.
2542 2003-06-04 Jim Meyering <jim@meyering.net>
2544 Ensure that the .x file for a new program is never forgotten again.
2545 * man/Makefile.am (programs): Define.
2546 (check-programs-vs-1): New phony target.
2547 (check-local): Depend on it.
2549 2003-06-03 Jim Meyering <jim@meyering.net>
2551 Avoid unnecessary copying of environment.
2552 * src/env.c (main): Rather than clearing the environment and --
2553 unless told to ignore environment -- copying all settings from
2554 the saved, original environment, clear the environment only when
2555 that is requested. Suggested by Jens Elkner.
2557 2003-06-02 Jim Meyering <jim@meyering.net>
2559 * src/system.h: Always include <string.h>, since we assume C89.
2560 Include <limits.h> without checking for HAVE_LIMITS_H.
2562 * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
2563 (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
2565 2003-06-01 Jim Meyering <jim@meyering.net>
2567 Avoid a race condition in `tail -f' described by Ken Raeburn in
2568 http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
2569 * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
2570 (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
2571 (tail_bytes, tail_lines, tail): Likewise.
2572 (tail_file): Use the new `read_pos' value as the size,
2573 rather than stats.st_size from the fstat call.
2575 2003-05-28 Jim Meyering <jim@meyering.net>
2577 * src/extract-magic: Allow expansion of `$file' in the here-
2578 document corresponding to the comment at the top of fs.h.
2580 2003-05-26 Jim Meyering <jim@meyering.net>
2582 * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
2583 <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
2584 Use #if/#elif/... cascade so we get only one set of include files.
2585 Reported by Nelson Beebe.
2587 2003-05-24 Jim Meyering <jim@meyering.net>
2589 * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
2590 * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
2591 accept the BSD format.
2593 2003-03-28 Joe Orton <jorton@redhat.com>
2595 * src/md5sum.c (bsd_split_3): New function.
2596 (split_3): Detect checksums from BSD 'md5' command and handle them
2599 * tests/md5sum/basic-1: New tests for --check exit status, and for
2600 BSD-style checksum files.
2602 2003-05-21 Jim Meyering <jim@meyering.net>
2604 * src/head.c (elide_tail_lines_pipe): Fix a thinko.
2605 This sort of thing is why it'd be *Really Good* to factor
2606 out the common code used here and in tail.c.
2608 2003-05-14 Jim Meyering <jim@meyering.net>
2610 * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
2612 * tests/du/slink: Skip this test if `.' is on an XFS file system.
2614 * tests/du/fd-leak: New file. Test for the bug in du that
2615 was fixed by the 2003-05-12 change to lib/ftw.c.
2616 * tests/du/Makefile.am (TESTS): Add fd-leak.
2618 * src/head.c (AUTHORS): Enclose string in N_(...), now that it
2619 includes a translatable word, `and'.
2621 * src/dd.c (usage): Don't use `,' as the thousands separator
2622 in e.g. 1,000,000 and 1,048,576. Instead, do this:
2623 `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
2624 * src/df.c (usage): Likewise.
2625 * src/du.c (usage): Likewise.
2626 * src/ls.c (usage): Likewise.
2628 * Makefile.maint (syntax-check): Add another check.
2630 2003-05-13 Paul Eggert <eggert@twinsun.com>
2632 Fix uniq to conform to POSIX, which requires that "uniq -d -u"
2633 must output nothing. Problem reported by Josh Hyman.
2635 * src/uniq.c (enum output_mode, mode): Remove, replacing with:
2636 (output_unique, output_first_repeated, output_later_repeated):
2637 New vars. All uses of "mode" changed to use these variables,
2638 which are not mutually exclusive as "mode" was.
2639 (writeline): New arg "match", used to control whether to
2640 obey output_first_repeated or output_later_repeated.
2641 All callers changed.
2642 (check_file, main): Adjust to above changes.
2644 * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
2646 2003-05-14 Jim Meyering <jim@meyering.net>
2648 * tests/rm/rm3: Use tr's \n notation rather than \012.
2649 This package can afford to do that, since its tests are guaranteed use
2650 GNU tr, which has accepted the more modern notation for 10 years.
2651 * tests/rm/rm5: Likewise.
2652 * tests/cp/same-file: Likewise.
2653 * tests/stty/row-col-1: Likewise.
2654 * tests/stty/basic-1: Likewise.
2655 * tests/rm/deep-1: Likewise.
2656 * tests/mv/part-symlink: Likewise.
2657 * tests/mkdir/perm: Likewise.
2658 * tests/misc/nice: Likewise.
2660 2003-05-13 Jim Meyering <jim@meyering.net>
2662 * src/copy.c (struct F_triple) [name]: Remove const attribute.
2663 (triple_free): Don't apply cast to argument of free.
2664 (seen_file): Add cast here instead.
2666 * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
2667 (src_to_dest_free): Don't apply cast to argument of free.
2669 * src/sort.c (zaptemp): Don't apply cast to argument of free.
2670 * src/pr.c (init_fps, init_store_cols): Likewise.
2671 * src/join.c (delseq, freeline): Likewise.
2672 * src/expr.c (OLD): Likewise.
2673 * src/sort.c (sort): Likewise.
2674 * src/head.c (elide_tail_lines_pipe): Likewise.
2676 * src/tail.c: Include "quote.h".
2677 Use quote in diagnostics. Change many error format strings
2678 from just `%s' to e.g., `error reading %s'.
2679 (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
2680 Rewrite newline-counting loop to use memchr.
2682 * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
2683 Now that assert is no longer used, don't include <assert.h>.
2685 2003-05-12 Jim Meyering <jim@meyering.net>
2687 * src/head.c: Include <assert.h>.
2688 (AUTHORS): Add my name.
2689 (elide_tail_lines_pipe): New function.
2691 2003-05-10 Jim Meyering <jim@meyering.net>
2693 * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
2695 * src/readlink.c (main): Set program_name before first use.
2696 Remove that (redundant) first use.
2697 Don't exit successfully just because --verbose was specified.
2698 Pass 0, not EXIT_SUCCESS, as first argument to error; when that
2699 parameter is 0, error does not exit.
2701 * src/uname.c (main): When failing due to too many arguments, also say
2702 that, rather than just "Try `uname --help' for more information.".
2703 * src/comm.c (main): Likewise, but for too few arguments.
2704 * src/logname.c: Include error.h.
2705 (main): Say why we're failing.
2707 * src/uniq.c (main): Don't segfault when argc < optind.
2708 * src/who.c (main): Handle argc < optind.
2709 * src/df.c (main): Likewise.
2710 * src/install.c (main): Likewise.
2711 * src/mv.c (main): Likewise.
2712 * src/pwd.c (main): Likewise.
2713 * src/tty.c (main): Likewise.
2714 * src/chroot.c (main): Likewise.
2715 * src/hostname.c: Likewise.
2716 * src/du.c (main): Likewise.
2717 * src/expand.c (main): Likewise.
2718 * src/env.c (main): Likewise.
2719 * src/unexpand.c (main): Likewise.
2720 * src/printenv.c (main): Likewise.
2721 * src/sync.c (main): Handle argc == 0.
2722 * src/expr.c (main): Likewise.
2723 * src/printf.c (main): Likewise.
2724 * src/basename.c (main): Likewise.
2725 * src/ln.c (main): Test for `missing argument' before computing n_files.
2726 * src/tail.c (main): Test for the case of no arguments before
2729 * src/kill.c (send_signals): Don't check command line arguments here.
2730 (main): Check them here instead. Handle argc < optind.
2732 * src/logname.c (main): Use error, rather than fprintf, for the sake
2735 * src/rm.c (main): Don't overrun array bound if argc is 0.
2737 2003-05-09 Jim Meyering <jim@meyering.net>
2739 * src/sort.c (main): Don't overrun array bound if argc is 0.
2740 That would happen when invoked via: execl ("/usr/bin/sort", NULL);
2741 Reported by Wartan Hachaturow.
2743 2003-05-07 Jim Meyering <jim@meyering.net>
2745 Implement support so that `head --lines=-N' works on seekable files.
2746 * src/head.c (enum Copy_fd_status): Define.
2747 (COPY_FD_DIAGNOSE): New macro.
2748 (elide_tail_lines_seekable): New funtion.
2749 (elide_tail_lines_file): Call it here.
2751 2003-05-06 Jim Meyering <jim@meyering.net>
2753 * src/sys2.h (CHAR_BIT): Remove duplicate definition.
2755 2003-05-04 Jim Meyering <jim@meyering.net>
2757 * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
2758 caused the addition of thousands of small files to the tar archive.
2759 * tests/misc/head-elide-tail: New file. Add them here instead.
2760 * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
2762 2003-05-04 Paul Eggert <eggert@twinsun.com>
2764 * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
2765 (IF_READDIR_NEEDS_REWINDDIR): Remove.
2766 (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
2767 which was a bit weird because it couldn't be emulated by a function.
2769 2003-05-03 Jim Meyering <jim@meyering.net>
2771 Extend head to accept --lines=-N (--bytes=-N) and to print all
2772 but the N lines (bytes) at the end of the file.
2773 * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
2774 Use quote() in diagnostics, rather than literal `' marks.
2775 (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
2777 (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
2778 (head_file): Reorganize so as to call head from only one place.
2779 (main): Likewise, for head_file.
2780 Handle new, undocumented option, --presume-input-pipe.
2781 Handle negative line and byte counts.
2782 * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
2784 * tests/du/8gb: Skip test if the file system of `.' doesn't support
2785 sparse files -- otherwise it'd create a file of size 8GB.
2787 2003-05-02 Jim Meyering <jim@meyering.net>
2789 * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
2790 Instead explain about `-' and standard input.
2791 (main): Give a proper diagnostic for e.g., `fmt -c -72'.
2792 Reported by Keith Thompson.
2793 * tests/fmt/basic: Add test for the above fix.
2795 * src/fmt.c: Include "quote.h".
2796 Use quote() in diagnostics, rather than literal `' marks.
2797 (main): Exit nonzero when unable to open an input file.
2798 * tests/fmt/basic: Add test for the above fix.
2800 * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
2801 specifications like `-72x'.
2802 * tests/fmt/basic: Add test for the above fix.
2804 Work around nasty readdir bug on Darwin6.5.
2805 * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
2806 [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
2807 returned NULL and there has been at least one successful unlink or
2808 rmdir call since the opendir or previous rewinddir, then call
2809 rewinddir and reiterate the loop.
2811 Factor out common code.
2812 * src/remove.c (readdir_ignoring_dotdirs): New function.
2813 (is_empty_dir): Use it here.
2814 (remove_cwd_entries): Use it here.
2816 2003-05-01 Jim Meyering <jim@meyering.net>
2818 * tests/rm/r-3: Create 500 rather than just 300 files.
2819 There's a bug in Darwin6.5's readdir that shows up only with
2821 Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
2825 Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
2826 (dump_remainder): Move two declarations `down' into the scope
2827 where they are used.
2828 (xlseek): Return the resulting offset.
2829 (file_lines): Rename parameter, file_length, to end_pos.
2830 (pipe_lines): Don't coerce safe_read return value to `int'.
2831 Adapt tests accordingly.
2832 (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
2834 Change type of `total_bytes' from `int' to `size_t',
2835 since the former wouldn't always be wide enough.
2836 Don't coerce safe_read return value to `int',
2837 and adapt tests accordingly.
2838 Now that testing for a read error no longer involves
2839 using `tmp', handle that case *after* freeing `tmp'.
2840 (start_bytes): Clean up.
2841 (tail_bytes): Now that `n_bytes' may be larger than
2842 OFF_T_MAX, test for that condition and, if it's true, don't
2843 use lseek optimizations.
2844 (parse_options): Don't fail just because N_UNITS is larger than
2845 the maximum size of a file -- tail may be applied to an input
2846 stream (e.g., a pipe) with more data than that.
2848 * Makefile.maint (syntax-check): Rename from alloc-check.
2849 Also check for SPACE-TAB sequences.
2850 Also check for malloc/calloc/realloc casts.
2852 2003-05-01 Jim Meyering <jim@meyering.net>
2854 * src/tail.c (start_lines): Rewrite to use memchr. Clean up.
2856 2003-04-28 Jim Meyering <jim@meyering.net>
2858 * tests/misc/tty-eof: Send two tokens, not just one, so we don't
2859 make the now-more-picky tsort fail.
2861 2003-04-24 Jim Meyering <jim@meyering.net>
2863 * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
2864 (main): Minor syntactic clean-up.
2866 * src/tsort.c (tsort): Fail if the input contains an odd number of
2867 tokens. Reported by junkio@cox.net.
2869 * tests/tsort/basic-1: Test for the above fix.
2871 2003-04-21 Jim Meyering <jim@meyering.net>
2873 * tests/misc/printf: Add tests for the printf fixes below.
2875 * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
2877 2003-04-20 Paul Eggert <eggert@twinsun.com>
2879 Fix printf POSIX compatibility bug reported by Ben Harris in
2880 <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
2881 * doc/coreutils.texi (printf invocation): It's \NNN in the format,
2882 \0NNN in the %b operand.
2883 * src/printf.c (usage): Likewise.
2884 (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
2885 is desired. All uses changed. Behave like Bash printf if %b
2886 operand uses \NNN where the initial N is not 0.
2888 2003-04-17 Jim Meyering <jim@meyering.net>
2890 * src/stty.c: Remove uses of PROTOTYPE macro.
2892 2003-04-15 Jim Meyering <jim@meyering.net>
2894 * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
2895 each sequence of spaces before a TAB character.
2897 2003-04-13 Jim Meyering <jim@meyering.net>
2899 * src/remove.c (is_empty_dir): Don't closedir (NULL).
2901 2003-04-12 Jim Meyering <jim@meyering.net>
2903 Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
2904 --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
2905 FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
2906 * src/nl.c (main): Fix those problems and remove literal quote marks
2907 (e.g., "`%s'") from format string; instead use "%s" in each format
2908 string and `quote (optarg)' as the corresponding argument.
2909 Also, diagnose all invalid command line options before failing.
2911 * src/nl.c (proc_text): Fix a bug that would make nl output extra
2912 newlines in some cases. Details here: http://bugs.debian.org/177256.
2913 This bug was introduced on 2001-11-10 for textutils-2.0.17.
2914 * tests/misc/nl: Add test for the above-fixed bug.
2916 * tests/misc/readlink: New file. Test the --canonicalize option.
2917 * tests/misc/Makefile.am (TESTS): Add readlink.
2919 2003-04-11 Jim Meyering <jim@meyering.net>
2922 * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
2923 * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
2924 * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
2925 retain alignment) each sequence of spaces before a TAB character.
2927 * src/ls.c: Include <stdlib.h> unconditionally.
2929 * Makefile.maint (xalloc-check): Rename from header-check.
2931 * src/yes.c: Include error.h after system.h, not before.
2934 * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
2935 * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
2936 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
2937 * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
2938 * src/tr.c: * src/unexpand.c, src/users.c:
2939 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
2940 return values and of xrealloc's first argument.
2941 Fix the former with this:
2942 perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
2944 2003-04-10 Jim Meyering <jim@meyering.net>
2946 * src/stty.c (wrapf): Declare with format attribute.
2948 The S_MAGIC_... names shouldn't be maintained in two places (prior
2949 to this change, one would have to keep stat.c and fs.h in sync).
2950 This change makes it so those names and the corresponding
2951 hexadecimal constants all reside in stat.c. fs.h is now generated.
2952 * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
2953 (BUILT_SOURCES): Add fs.h, now that it's generated.
2954 (EXTRA_DIST): Add extract-magic.
2955 * src/extract-magic: New script to extract fs.h definitions from stat.c.
2956 * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
2957 fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
2959 * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
2960 file with nominal length > 4GB fails. Reported by Michael Deutschmann.
2962 * man/unexpand.x: Add `SEE ALSO' reference to expand.
2963 * man/expand.x: Add `SEE ALSO' reference to unexpand.
2964 Suggestion from Dan Jacobson.
2966 2003-04-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
2968 * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
2969 * src/stat.c (human_fstype): Handle Linux's devpts.
2971 2003-04-09 Paul Eggert <eggert@twinsun.com>
2973 * src/split.c (line_bytes_split): Arg is of type size_t, since
2974 that's all that is supported for now.
2975 (main): Check for overflow in obsolescent line count option.
2977 2003-04-09 Jim Meyering <jim@meyering.net>
2979 * tests/misc/split-fail: Add a new test for the above fix.
2981 * src/split.c (bytes_split): Use size_t temporary (rather than
2982 uintmax_t original) in remaining computations. From Paul Eggert.
2984 Handle command line option arguments larger than 2^31.
2985 This allows e.g., splitting into files of size 2GB and larger,
2986 and running split --lines=N with N=2^31 or more.
2987 But for --line-bytes=N, the restriction that N <= SIZE_MAX
2988 remains (for now), due to the way it is implemented.
2990 * src/split.c: Include "inttostr.h".
2991 (bytes_split, lines_split, line_bytes_split, main):
2992 Use uintmax_t, not size_t, for file sizes.
2993 (main): Give a better diagnostic for option arguments == 0.
2994 Use umaxtostr to print file sizes.
2995 Reported by Luke Hassell.
2997 2003-04-08 Jim Meyering <jim@meyering.net>
2999 * src/rm.c (usage): Mention that --directory (-d) works only
3000 on some systems. Suggestion from Samuel Tardieu.
3002 * tests/basename/basic: Run $PERL to see if it is available,
3003 rather than testing its value.
3004 * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
3005 * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
3006 * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
3007 * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
3008 * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
3009 * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
3010 * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
3011 * tests/sum/basic-1, tests/seq/basic: Likewise.
3013 * tests/misc/Makefile.am (TESTS): Add split-fail.
3014 * tests/misc/split-fail: New file.
3016 * src/split.c: Rename local variables: nchars -> n_bytes.
3017 (lines_split): Rename local, nlines -> n_lines.
3018 (main): Rename local variable: s/accum/n_units/.
3019 (main): Use STDIN_FILENO, not literal `0'.
3021 2003-04-07 Jim Meyering <jim@meyering.net>
3023 * src/stat.c: Add #include directives for Ultrix 4.4.
3024 Based on a suggested change from Bert Deknuydt.
3026 2003-04-06 Jim Meyering <jim@meyering.net>
3028 * Makefile.maint (makefile-check): New rule.
3029 (local-check): Add it.
3031 2003-04-05 Jim Meyering <jim@meyering.net>
3033 * Makefile.am (nearly all of them):
3034 Use $(VAR) rather than @VAR@, now that we can rely on automake to
3035 emit a definition for each substituted variable.
3036 * tests/Makefile.am.in: Likewise.
3038 * tests/rm/rm5: Add a comment explaining why this test fails when
3039 using Tru64's broken sed.
3040 * tests/rm/rm3: Likewise.
3042 Make `kill -t' output signal descriptions (not `?') on Tru64.
3043 * src/kill.c (sys_siglist): Also check for __sys_siglist.
3044 Patch by Tony Leneis.
3045 * configure.ac: Also check for declaration of __sys_siglist.
3046 Required for Tru64 4.0D, 4.0F, and 5.1.
3047 Reported by Tony Leneis.
3049 2003-04-04 Jim Meyering <jim@meyering.net>
3051 * src/Makefile.am (PERL): Remove unnecessary definition.
3053 Because of inappropriate (but POSIX-mandated) behavior of rename,
3054 `mv a b' would not remove `a' in some unusual cases. Work around
3055 this by unlinking `a' when necessary.
3057 * src/copy.c (same_file_ok): Add an output parameter.
3058 Set it in the offending case.
3059 (copy_internal): When necessary, unlink SRC_PATH and inform caller.
3060 Reported by Ed Avis.
3061 * tests/mv/hard-4: New test for the above.
3062 * tests/mv/Makefile.am (TESTS): Add hard-4.
3064 Clean up rules for automatically generated sources:
3065 * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
3066 Make each generated file be read-only.
3067 Add each file name to BUILT_SOURCES separately.
3068 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
3070 Put LOCALEDIR macro definition in new file: localedir.h.
3071 * src/Makefile.am (DEFS): Remove definition.
3072 (localedir.h): New rule.
3073 (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
3074 * src/system.h: Include "localedir.h".
3076 2003-04-02 Jim Meyering <jim@meyering.net>
3080 * tests/misc/Makefile.am (TESTS): Add false.
3082 * Makefile.maint (TMPDIR): Make sure it's defined.
3083 (my-distcheck): Build in $(TMPDIR), not `.'.
3085 * src/Makefile.am (false.c): Change all occurrences of
3086 `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
3087 unsuccessfully also with --help. Reported by Paul Jarc,
3088 * tests/misc/false: New test for the above.
3090 2003-03-30 Jim Meyering <jim@meyering.net>
3092 * NEWS: Note the location of older NEWS files.
3094 * src/remove.c (is_empty_dir): Don't let a failing closedir
3095 clobber errno. Spotted by Arnold Robbins.
3097 * src/env.c: Fix typo in comment. From Arnold Robbins.
3099 2003-03-29 Jim Meyering <jim@meyering.net>
3103 * README: Note to expect build problems for stat.c on Ultrix 4.3.
3104 Note that there are some harmless test failures when running
3105 `make check' as root on some systems.
3107 2003-03-28 Jim Meyering <jim@meyering.net>
3109 * tests/stty/row-col-1: Skip this test if stty can't get window size.
3110 This happens when connecting to sparc-solaris5.7 via ssh from within
3111 emacs. Reported by Karl Berry.
3113 * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
3114 Otherwise, on systems (DJGPP) that emulate pipes using files,
3115 this test would never complete, waiting for `yes' to terminate.
3116 * tests/du/slink: As above, use seq, not `yes' to generate link target.
3117 * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
3118 Reported by Rich Dawe.
3120 2003-03-27 Jim Meyering <jim@meyering.net>
3122 * src/id.c: Remove Arnold Robbins' obsolete e-mail address
3123 from `written by...' comment, at his request.
3125 2003-03-24 Paul Eggert <eggert@twinsun.com>
3127 Fix buffer overrun problem reported by TAKAI Kousuke, along
3128 with some other POSIX incompatibilities.
3130 * src/printf.c (print_esc): Do not treat \x specially if
3131 POSIXLY_CORRECT. Avoid buffer overrun if the format ends
3132 in backslash. Treat incomplete escape sequences as strings
3133 of characters, as POSIX requires.
3134 (print_formatted): Allow multiple flags. Avoid buffer overrun
3135 if the format is incomplete.
3137 2003-03-24 Jim Meyering <jim@meyering.net>
3139 * tests/misc/printf: Add tests for the above fixes and changes.
3141 2003-03-26 Jim Meyering <jim@meyering.net>
3143 * src/copy.h (struct cp_options): Add a comment.
3145 2003-03-23 Jim Meyering <jim@meyering.net>
3147 * README: Describe problem with 64-bit mode on HPUX 11.x,
3148 with patch for /usr/include/inttypes.h.
3149 * TODO: Plan to add an autoconf test to work around the bug.
3151 2003-03-22 Jim Meyering <jim@meyering.net>
3153 * src/stat.c: Don't include <sys/sysmacros.h>.
3154 That is already done via system.h. Otherwise, the multiple
3155 inclusion would evoke redefinition warnings from Cray's /bin/cc,
3156 aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28.
3157 (human_fstype): Factor some directives `up', out of this function.
3158 Cast away `const' to avoid error from Cray's /bin/cc.
3160 2003-03-20 Jim Meyering <jim@meyering.net>
3162 * announce-gen (print_changelog_deltas): Ensure that a newline
3163 precedes each row of `*'s.
3165 2003-03-20 Jim Meyering <jim@meyering.net>
3169 * src/seq.c (valid_format): Also accept ` ' and `'' as valid
3170 format flag characters.
3171 Do not require that a field width be specified.
3172 Do not fail when given a field width of `0'.
3173 Reported by Dan Jacobson.
3174 * tests/seq/basic: Add new tests for the above-fixed bug.
3176 * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
3177 (install-root): Likewise.
3178 (install-exec-local): Likewise.
3179 Based on a patch from Richard Dawe.
3181 2003-03-19 Jim Meyering <jim@meyering.net>
3183 * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
3184 because the DJGPP 2.03 port of 'ln -s' doesn't work.
3185 Include $(EXEEXT) in program names.
3186 Since $(LN_S) may degenerate to `cp -p', be careful
3187 to invoke it from the destination directory.
3188 Mostly from Richard Dawe.
3189 * configure.ac: Use AC_PROG_LN_S.
3191 * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the
3192 CDPATH shell variable set could cause this test to fail.
3193 Reported by Karl Berry.
3195 2003-03-18 Jim Meyering <jim@meyering.net>
3197 * src/fmt.c [struct Word] (paren, period, punct, final): Change the
3198 type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
3199 AIX 5.1's xlc could not compile the former.
3200 Patch by Petter Reinholdtsen. Also reported by Mike Jetzer.
3202 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
3204 * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
3205 program names, since automake only adds $(EXEEXT) to programs
3208 2003-03-16 Jim Meyering <jim@meyering.net>
3210 * src/remove.c (rm): Put two local variables in static storage,
3211 so they can't be clobbered by the potential longjmp.
3213 2003-03-15 Jim Meyering <jim@meyering.net>
3215 * Makefile.cfg (gnu_rel_host): Fix code to match the comment
3216 so that a version number with a two-digit component can still count
3217 as an alpha release. Reported by Richard A Downing.
3218 (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
3220 2003-03-14 Jim Meyering <jim@meyering.net>
3222 * src/ansi2knr.c: Remove no-longer-used file.
3223 * src/ansi2knr.1: Likewise.
3225 * Makefile.maint (prev_version_file): Don't use ?= for this particular
3226 assignment, since it causes trouble with old versions of GNU make
3227 (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here.
3228 http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
3229 Patch from Alexandre Duret-Lutz.
3231 * Use patched automake-1.7.3. Regenerate Makefile.in files in
3232 subdirectories so that each includes a definition of ACLOCAL_M4.
3234 * announce-gen (main): Label the compressed source URLs.
3238 * tests/du/slink: Relax the test for the `local'ness of a file system,
3239 so that now it works also for tmpfs.
3241 * tests/du/hard-link: Transform output from first du, so that this
3242 test doesn't fail on file systems like tmpfs that order directory
3243 entries differently.
3245 2003-03-13 Jim Meyering <jim@meyering.net>
3247 * tests/du/8gb: Work around what appears to be an NFS failure that
3248 would make this test fail on some systems.
3250 2003-03-11 Jim Meyering <jim@meyering.net>
3252 * tests/du/basic: Make the test file exactly 4k bytes long.
3254 * src/split.c (longopts): Don't hard-code `2' here.
3255 Instead, just specify `&verbose', and ...
3256 (main): ... remove the `case 2:' block for --verbose.
3258 * tests/du/basic: Make the test file larger than 64 bytes, so that
3259 we don't immediately disqualify file systems (e.g., NetApp) on which
3260 smaller files take up zero disk blocks. Reported by Vin Shelton.
3262 2003-03-10 Jim Meyering <jim@meyering.net>
3264 Don't segfault for a negative field width or precision in format string.
3265 Note that this is just a stopgap fix. The longer term solution may
3266 involve adapting bash's builtins/printf.def.
3268 * src/printf.c: (UNSPECIFIED): Define.
3269 (print_direc): Use the special value, UNSPECIFIED, to indicate
3270 that field_width or precision has not been specified.
3271 (print_formatted): Fail if field_width or precision is the
3272 special value, UNSPECIFIED.
3273 Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
3275 * src/sys2.h (INT_MIN): Define, if necessary.
3276 * tests/misc/printf: Add a test for the above-fixed bug.
3278 2003-03-09 Jim Meyering <jim@meyering.net>
3280 * src/remove.c (AD_stack_pop): Cast sizeof... to int before
3281 changing its sign. This avoids a warning from gcc on 64-bit systems.
3282 Reported by Bob Proulx.
3283 (pop_dir): Reverse order of sign change and cast, to be consistent
3286 2003-03-08 Jim Meyering <jim@meyering.net>
3288 * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
3289 shell variable, but only in the environment. With /bin/sh->bash, the
3290 shell variable is set to `y', and that would cause a spurious warning.
3291 Reported by Bob Proulx.
3293 * tests/Makefile.am (check-root): Remove touch/fifo.
3294 It doesn't appear to have to be run as root.
3296 * tests/rm/fail-2eperm: Rather than simply using the first non-root
3297 user name, make sure that the selected user name has a usable shell.
3298 Reported by Paul Jarc.
3300 Before, when using shred on a device, one had to specify --exact,
3301 or be careful to choose a size that would not be rounded up and
3302 exceed the maximum value; that could result in a failure of
3304 * src/shred.c (do_wipefd): --exact is now the default for non-regular
3305 files. Suggestion from Ben Elliston.
3308 * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
3309 Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
3310 Patch by Bob Proulx.
3312 * src/Makefile.am (check-misc): Check for use of `defined' in
3314 Change to $(srcdir) before running grep.
3316 * src/sleep.c: Remove now-unused #include and #define directives.
3318 * src/du.c (process_file): If a file's size is not being counted
3319 e.g., because it's a hard link to a file we've already counted,
3320 then don't print a line for it.
3322 * tests/du/hard-link: New test for the above-fixed bug.
3323 * tests/du/Makefile.am (TESTS): Add hard-link.
3326 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
3327 and make the two-array approach work.
3329 * tests/du/basic: Correct/add tests for the above fix.
3330 Set LC_ALL, etc., now that we use sort.
3331 Check the block/size of a small file, too.
3332 Correct expected results for simple dir1/dir2/file case.
3333 Add another test of du -S.
3335 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
3337 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
3338 middle-end/9986). As one of GCC's optimizations, it transforms a
3339 fputs_unlocked call to a fputc_unlocked call when the string is
3340 one character long. However, hpux doesn't have fputc_unlocked.
3342 * expr.c (usage): Use putchar, not fputs, to output a single character.
3343 * ls.c (dired_dump_obstack): Likewise.
3344 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
3345 * stat.c (print_it): Likewise.
3347 2003-03-07 Jim Meyering <jim@meyering.net>
3349 * src/cp.c: Remove everything associated with mmap-stack.c.
3350 This reverts the two changes of 2003-02-21.
3351 * src/du.c: Remove everything associated with mmap-stack.c.
3352 This reverts the change of 2003-02-19.
3354 2003-03-06 Jim Meyering <jim@meyering.net>
3356 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
3357 CDPATH shell variable set could cause this test to fail.
3358 Reported by Karl Berry.
3360 2003-03-05 Jim Meyering <jim@meyering.net>
3364 * src/printf.c (print_esc): Remove pointless comparison of unsigned
3365 integer with zero, to avoid a warning from Intel's ecc.
3366 Reported by Nelson Beebe.
3368 * src/du.c (process_file): Sizes must all be of type uintmax_t.
3369 Otherwise, for files or totals that are too big, numbers would
3370 be truncated. Patch mostly by Michael Stone.
3371 Reported by Ingo Saitz as Debian bug #183210.
3373 * tests/du/8gb: New test for the above-fixed bug.
3374 * tests/du/Makefile.am (TESTS): Add 8gb.
3376 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
3377 rather than UTILS_OPEN_MAX - 10.
3379 2003-03-04 Jim Meyering <jim@meyering.net>
3381 * README: Refer new feature discussion to bug-coreutils@gnu.org,
3382 rather than bug-gnu-utils, now that the former is better known.
3383 Suggestion from Göran Uddeborg.
3385 * src/stat.c (usage): Capitalize consistently.
3386 Reported by Göran Uddeborg.
3388 * Makefile.maint (rel-files): Include $(signatures), so that
3389 those files are also copied into $(release_archive_dir).
3391 * src/df.c (find_mount_point): Call error here, now that restore_cwd
3393 * src/remove.c (AD_pop_and_chdir): Likewise.
3395 * tests/Makefile.am (check-root): Add fail-2eperm.
3397 2003-03-03 Jim Meyering <jim@meyering.net>
3399 * src/remove.c (remove_cwd_entries): Include the full filename of
3400 the offending file, not just the basename.
3402 * tests/misc/tty-eof: Set $ME properly.
3404 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
3405 Remove now-unused variables.
3406 (tag-prev-version, prev-cvs-tag): Likewise.
3408 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
3409 accurate diagnostic when failing to remove a file owned by some other
3410 user. Reported by Ivo Timmermans via Michael Stone.
3411 This fixes Debian bug# 178471.
3413 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
3414 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
3415 Based on a report from Ivo Timmermans.
3417 2003-03-02 Jim Meyering <jim@meyering.net>
3419 * src/copy.c (copy_internal) [un_backup]: When recovering from a
3420 failure to create a hard link, do not remove the entry associating
3421 the source dev/ino with the destination file name.
3422 * tests/mv/Makefile.am (TESTS): Add hard-3.
3423 * tests/mv/hard-3: New test, for the above-fixed bug.
3424 Inspired by a report from Iida Yosiaki.
3426 2003-03-01 Jim Meyering <jim@meyering.net>
3428 * src/df.c (print_header): Don't embed spaces in a separate `Type'
3429 header string. Instead, put `Filesystem' and `Type' headers in the
3430 same string, so translators can use horizontal space as needed.
3431 Reported by Jean Charles Delepine.
3433 2003-02-28 Jim Meyering <jim@meyering.net>
3435 * src/copy.c (copy_internal): When link fails because of an
3436 existing destination file, unlink that file and try again.
3437 Reported by Iida Yosiaki.
3439 * tests/mv/Makefile.am (TESTS): Add hard-2.
3440 * tests/mv/hard-2: New test for the above-fixed bug.
3441 Based on a test case from Iida Yosiaki.
3443 2003-02-26 Jim Meyering <jim@meyering.net>
3445 * tests/du/basic: Don't test du's -b option here. Directory byte
3446 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
3447 and IBM AIX 4.2. Reported by Nelson Beebe.
3449 2003-02-25 Jim Meyering <jim@meyering.net>
3451 * Makefile.maint (announcement): Now that ChangeLog entries
3452 are output by announce-gen, don't do it here.
3453 * announce-gen (print_changelog_deltas): New function.
3456 2003-02-22 Jim Meyering <jim@meyering.net>
3458 * announce-gen: New option: --release-type=TYPE
3459 * Makefile.maint (beta, major): New targets. Remove `release'.
3460 Put them all together on a line.
3461 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
3462 invocation of `announcement'.
3463 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
3465 * announce-gen: New option: --news=NEWS_FILE.
3466 Extract NEWS entries here, not via rules in Makefile.maint.
3467 * Makefile.maint (announcement): Now that NEWS entries are
3468 extracted by announce-gen, don't do it here.
3469 (news-r1, news-r2): Remove now-unused definitions.
3471 2003-02-21 Jim Meyering <jim@meyering.net>
3475 Merge in changes from autoconf's version of this file.
3476 * Makefile.maint (www-gnu): Define.
3477 (standards.texi-url_prefix): Use $(www-gnu).
3478 (make-stds.texi-url_prefix): Likewise.
3480 * src/cp.c: Include "mmap-stack.h".
3481 (main): Invoke `run' through a macro that (when possible) runs it
3482 with a large, mmap'd stack.
3484 * src/cp.c (run): New function, preparing for the above.
3485 Exit from this function, not from main
3488 * src/du.c: New option: --apparent-size.
3489 (enum) [APPARENT_SIZE_OPTION]: New member.
3490 (long_options): Add it.
3491 (usage): Describe it.
3493 ['b']: Set apparent_size.
3494 David Eisner reported that the behavior of --bytes had changed.
3495 Paul Eggert proposed the use of a new option, --apparent-size.
3497 * src/du.c (apparent_size): New global.
3498 (print_only_size): Reflect the fact that we're printing byte counts,
3499 not ST_NBLOCKSIZE-byte-block counts.
3500 (print_size): Call print_only_size rather than duplicating its code.
3501 (process_file): Accumulate byte counts, rather than block counts.
3503 * src/du.c (process_file): Always reset size_to_propagate_to_parent
3504 for --separate-dirs (-S).
3506 2003-02-20 Jim Meyering <jim@meyering.net>
3508 * Use automake-1.7.3. Regenerate dependent files.
3510 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
3511 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
3512 (usage) [%B]: Describe it.
3515 * src/du.c (process_file): Reorganize the code to use only
3516 one `sum' array, and change how -S works back to the way it was
3517 before 2003-01-31. Patch by Bruno Haible.
3519 * tests/du/basic: New test.
3520 * tests/du/Makefile.am (TESTS): Add basic.
3522 * tests/envvar-check: Add checks for the following:
3523 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
3525 * tests/Makefile.am: Rename phony target envvar-check to evar-check
3526 so as not to conflict with the distributed file by the same name.
3528 * src/du.c (process_file): Set info->skip before any possible return.
3530 Report correct usage for directories, not 0.
3531 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
3532 _before_ recording the dev/ino of a directory.
3533 Reported by Bruno Haible.
3535 Now, df always displays the device file name corresponding to the
3536 listed mount point under `Filesystem'. Before, for an unmounted
3537 block- or character-special file argument, it would display the
3538 command-line argument instead.
3539 * src/df.c (show_disk): Return a value indicating whether
3540 there was a match. Don't try to find a mount point here.
3541 (show_entry): If show_disk doesn't find a match, call show_point.
3543 2003-02-19 Jim Meyering <jim@meyering.net>
3545 * src/du.c: Include "mmap-stack.h".
3546 (du_files): Add prototype with ATTRIBUTE_NORETURN.
3547 Exit from this function, not from...
3549 Instead, if possible, invoke du_files through a macro that
3550 runs it with a large, mmap'd stack.
3552 * src/join.c (usage): Change wording in --help output:
3553 use FILENUM instead of `SIDE' and say what FILENUM means.
3554 Reported by Bernhard Gabler.
3556 * src/df.c (print_header): Rather than using a hard-coded literal
3557 string of spaces matching the length of the English `...Type' header,
3558 output the right number of spaces to match the selected translation.
3559 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
3561 * src/split.c (bytes_split): Remove unnecessary `else' after break.
3562 (lines_split): Likewise. and correct misleading indentation.
3564 * src/split.c: Include "full-read.h".
3565 (bytes_split, lines_split, line_bytes_split): Use full_read,
3566 not safe_read. The way split was using the latter, a short read
3567 could cause split to terminate before EOF.
3569 * tests/misc/tty-eof: Test all programs that can read stdin,
3570 requiring no arguments and that write to standard output.
3572 * tests/misc/tty-eof: New file. Renamed from ...
3573 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
3574 * tests/misc/Makefile.am (TESTS): Reflect renaming.
3576 2003-02-18 Jim Meyering <jim@meyering.net>
3578 cksum would perform an extra read after encountering EOF
3579 * src/cksum.c (cksum): Exit the loop upon EOF, too.
3580 Patch by Michael Bacarella.
3582 Test for the bug fixed today in cksum, md5sum, and sha1sum.
3583 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
3584 cat, cksum, md5sum, and sha1sum all in the same loop.
3586 2003-02-14 Jim Meyering <jim@meyering.net>
3588 * src/remove.c: Include "euidaccess.h".
3589 Remove declaration of euidaccess.
3591 2003-02-12 Jim Meyering <jim@meyering.net>
3593 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
3594 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
3596 2003-02-10 Jim Meyering <jim@meyering.net>
3598 * src/test.c: Don't include group-member.h.
3599 Include euidaccess.h.
3600 (eaccess): Rewrite function to set the real uid and gid temporarily
3601 to the effective uid and gid, then invoke 'access', and then set the
3602 real uid and gid back. On systems that lack setreuid or setregid,
3603 fall back on the kludges in euidaccess. Before, it would not work
3604 for e.g., files with ACLs, files that were marked immutable,
3605 or on file systems mounted read-only. Nelson Beebe raised the issue.
3606 Paul Eggert suggested the new implementation.
3608 2003-02-09 Jim Meyering <jim@meyering.net>
3610 * src/test.c (test_stat): Remove function. It's job is done (only
3611 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
3613 2003-02-08 Jim Meyering <jim@meyering.net>
3617 * tests/mv/part-symlink: Don't assume that the file owner username
3618 length is less than 9 in ls output: instead, omit that field
3619 altogether. Reported by, and suggested fix from, Ferdinand.
3621 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
3622 * tests/du/Makefile.am (TESTS): Add restore-wd.
3624 * src/rm.c: Correct now-invalid comment about cycle-detection.
3626 2003-02-06 Jim Meyering <jim@meyering.net>
3628 * NEWS: Add entries from old/*/NEWS
3629 from fileutils-4.1 through 4.1.11 and
3630 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
3634 * src/du.c (process_file): Don't return early for excluded files
3635 or for files whose dev/inode we've already seen.
3637 2003-02-05 Jim Meyering <jim@meyering.net>
3639 * tests/du/exclude: New file.
3640 * tests/du/Makefile.am (TESTS): Add exclude.
3642 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
3644 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
3645 Fix memory allocation arithmetic.
3647 2003-02-04 Jim Meyering <jim@meyering.net>
3649 `df /dev/block-or-char-device-file--not-mounted' now reports
3650 the name of the file system on which the file resides, usually `/'.
3651 Before, it would leave the `Mounted on' field blank.
3652 * src/df.c (show_disk): Move function to precede find_mount_point.
3653 (show_disk): Add parameter: STATP.
3654 If we don't find a matching device name, then resort to calling
3655 find_mount_point. Reported by Bob Proulx.
3657 2003-02-03 Andreas Schwab <schwab@suse.de>
3659 * tests/rm/cycle: Require non-root.
3660 * tests/rm/isatty: Likewise.
3662 2003-02-02 Jim Meyering <jim@meyering.net>
3666 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
3668 Ensure that there are no offending uses of `:'.
3669 * Makefile.maint (makefile_path_separator_check): New rule.
3670 (local-check): Add it to the list.
3672 2003-02-01 Jim Meyering <jim@meyering.net>
3674 * src/du.c (MAX_N_DESCRIPTORS): Define.
3676 * src/stat.c (G_fail): New global.
3677 (human_time): Diagnose failed localtime, not failed nstrftime.
3678 (main): Fail if G_fail is set.
3680 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3682 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
3683 hard-coding the path-separator. Also double-quote the new PATH,
3684 to avoid problems when the path-separator is a semi-colon or when
3685 `pwd` contains e.g. a space.
3686 * tests/chgrp/Makefile.am: Likewise.
3687 * tests/chmod/Makefile.am: Likewise.
3688 * tests/chown/Makefile.am: Likewise.
3689 * tests/cp/Makefile.am: Likewise.
3690 * tests/dd/Makefile.am: Likewise.
3691 * tests/dircolors/Makefile.am: Likewise.
3692 * tests/du/Makefile.am: Likewise.
3693 * tests/expr/Makefile.am: Likewise.
3694 * tests/factor/Makefile.am: Likewise.
3695 * tests/fmt/Makefile.am: Likewise.
3696 * tests/install/Makefile.am: Likewise.
3697 * tests/ln/Makefile.am: Likewise.
3698 * tests/ls/Makefile.am: Likewise.
3699 * tests/ls-2/Makefile.am: Likewise.
3700 * tests/md5sum/Makefile.am: Likewise.
3701 * tests/misc/Makefile.am: Likewise.
3702 * tests/mkdir/Makefile.am: Likewise.
3703 * tests/mv/Makefile.am: Likewise.
3704 * tests/od/Makefile.am: Likewise.
3705 * tests/rm/Makefile.am: Likewise.
3706 * tests/rmdir/Makefile.am: Likewise.
3707 * tests/seq/Makefile.am: Likewise.
3708 * tests/sha1sum/Makefile.am: Likewise.
3709 * tests/shred/Makefile.am: Likewise.
3710 * tests/stty/Makefile.am: Likewise.
3711 * tests/sum/Makefile.am: Likewise.
3712 * tests/tail-2/Makefile.am: Likewise.
3713 * tests/touch/Makefile.am: Likewise.
3714 * tests/tsort/Makefile.am: Likewise.
3715 * tests/unexpand/Makefile.am: Likewise.
3717 2003-01-31 Jim Meyering <jim@meyering.net>
3719 * src/stat.c: Include "file-type.h"
3720 (print_human_type): Remove function.
3721 (human_access): Rename from print_human_access. Return a string.
3722 (human_time): Rename from print_human_time. Return a string.
3723 (print_stat): Arrange so that field width and an alignment specifier
3724 are honored for the %A, %F, %x, %y, and %z formats.
3725 [%F]: Use file_type; this gives slightly different file type strings,
3726 e.g., `directory' instead of `Directory' and `regular file' or
3727 `regular empty file' instead of `Regular file'.
3728 Prompted by a report from Richard Dawe that the uses of
3729 S_IFSOCK and S_IFIFO in print_human_time were not portable
3730 to systems using e.g., DJGPP.
3732 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3734 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
3735 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
3737 2003-01-31 Jim Meyering <jim@meyering.net>
3739 * src/du.c (main): Upon processing an invalid option or an invalid
3740 --exclude-from or --max-depth option argument, don't exit right away,
3741 in case there are others. Rather record the failure and exit after
3742 processing other options.
3744 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
3745 tar archive easier to reproduce.
3747 Rewrite to perform directory traversal using nftw.
3749 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
3750 (AUTHORS): Add self.
3751 (opt_one_file_system): Move global into `main'.
3752 (path, xstat, exit_status): Remove declarations.
3753 (arg_length, suffix_length): New globals.
3754 (G_fail): New global, sort of like the old `exit_status'.
3755 (IS_FTW_DIR_TYPE): Define.
3756 (print_only_size): New function.
3757 (process_file): New function.
3758 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
3759 (str_trunc, pop_dir, count_entry): Likewise.
3760 (du_files): Rewrite to use nftw.
3762 2003-01-30 Jim Meyering <jim@meyering.net>
3764 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
3765 symlink-to-directory with -L, even without the trailing slash.
3767 2003-01-27 Jim Meyering <jim@meyering.net>
3769 * src/Makefile.am (check-misc): Check for st_blocks, too.
3771 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
3772 Reported by Richard Dawe.
3774 2003-01-27 Andreas Schwab <schwab@suse.de>
3776 * src/ls.c (quote_name): Add fourth parameter, width, into which to
3777 store the screen columns, and return the number of bytes instead.
3778 (print_dir): Pass NULL as fourth parameter of quote_name.
3779 (print_name_with_quoting): Likewise.
3780 (length_of_file_name_and_frills): Get the width from the fourth
3781 parameter of quote_name instead of return value.
3783 2003-01-27 Jim Meyering <jim@meyering.net>
3785 * src/ls.c (decode_switches): If `dired' is set without
3786 `format == long_format', then silently reset dired. This doesn't
3787 change the behavior of ls (all prior uses of dired were protected
3788 by `&& format == long_format'), and lets us...
3789 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
3790 (PUSH_CURRENT_DIRED_POS): Likewise.
3793 2003-01-22 Jim Meyering <jim@meyering.net>
3795 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
3796 * tests/du/Makefile.am (TESTS): Add no-x.
3798 2003-01-21 Jim Meyering <jim@meyering.net>
3800 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
3801 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
3802 it may still be a directory -- or not (e.g., with FreeBSD on an
3803 NFS-mounted file system), so resort to calling lstat to find out.
3804 Based on a patch by Michael van Elst.
3806 * tests/cp/same-file: Don't assume that the file owner username
3807 length is less than 9 in ls output: instead, omit that field
3808 altogether. Reported by, and suggested fix from, Ferdinand.
3810 2003-01-20 Jim Meyering <jim@meyering.net>
3812 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
3813 large format widths no longer cause strftime to infloop.
3815 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
3817 2003-01-19 Jim Meyering <jim@meyering.net>
3819 * src/readlink.c: Include "canonicalize.h".
3821 2003-01-18 Jim Meyering <jim@meyering.net>
3823 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
3825 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
3826 (long_options): Add option --dereference-command-line-symlink-to-dir.
3827 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
3828 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
3829 -d, -F, -l options is specified.
3830 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
3831 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
3832 Change --dereference-command-line (-H) to dereference *all*
3833 command line arguments, including broken symlinks.
3835 2003-01-15 Paul Eggert <eggert@twinsun.com>
3837 Change ls -H back to the way it was yesterday, since this is
3838 compatible with FreeBSD and the POSIX spec is confusing
3839 and somewhat contradictory.
3841 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
3842 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
3843 (long_options): Change the long option name back.
3844 (usage): Change the usage back.
3845 (gobble_file): When -H is specified, dereference a top-level
3846 arg even if it points to a non-directory.
3848 2003-01-15 Jim Meyering <jim@meyering.net>
3850 * src/ls.c (gobble_file): Fall back on using lstat when required:
3851 when --dereference (-L) is not specified, and
3852 - when operating on a dangling symlink
3853 - when operating on command-line-symlink-to-directories
3854 This fixes numerous problems. Here are examples:
3855 - `ls dangling-symlink' would fail with `no such file...'
3856 Now it prints `dangling-symlink'.
3857 - `ls -i symlink' would mistakenly print the inode of the referent.
3858 Now it prints the inode of the symlink. Likewise for --size (-s).
3859 Based on a patch from Michael Stone.
3860 Reported by Deepak Goel as Debian bug #173793.
3862 Rename ls's --dereference-command-line (-H)
3863 option to --dereference-command-line-symlink-to-dir.
3864 * src/ls.c [enum Dereference_symlink]
3865 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
3866 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
3867 (long_options): Rename the long option.
3868 (usage): Say that --dereference-... changes how ls treats
3869 only symlinks to directories specified on the command line.
3871 2003-01-14 Jim Meyering <jim@meyering.net>
3873 * tests/ls/dangle: New file/test, for the above fix.
3874 * tests/ls/inode: Another new file/test, for the above fix.
3875 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
3877 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
3878 so that ls --color would no longer highlight the names of files with
3879 the execute bit set when not specified on the command line.
3880 Patch by Michael Stone. Reported by Stephen Depooter as
3883 * tests/ls-2/tests (color-exe): New test, for the above fix.
3885 2003-01-13 Jim Meyering <jim@meyering.net>
3887 * tests/shred/exact: Also test for just fixed bug with --zero.
3889 * src/shred.c (long_opts): --zero does not require an argument.
3890 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
3892 2003-01-12 Jim Meyering <jim@meyering.net>
3894 * Makefile.maint (cvs-update): Skip any file with local modifications.
3896 * src/unexpand.c (usage): Document --first-only and mention that
3897 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
3899 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
3901 * src/df.c: Include "canonicalize.h".
3902 Use canonicalize_file_name unconditionally.
3904 2003-01-09 Jim Meyering <jim@meyering.net>
3906 * README: Add readlink.
3908 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3910 * src/df.c: Include "xgetcwd.h".
3911 * src/pwd.c: Likewise.
3913 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3915 * src/shred.c: Remove declaration of xstrdup.
3916 We already get it via xalloc.h which is included via system.h.
3918 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
3920 New program: readlink.
3922 * src/Makefile.am (bin_PROGRAMS): Add readlink.
3923 * src/readlink.c: New file.
3925 * man/readlink.x: New file.
3926 * man/Makefile.am (dist_man_MANS): Add readlink.1.
3927 (readlink.1): New rule.
3929 2003-01-09 Jim Meyering <jim@meyering.net>
3931 When selecting ranges of byte offsets (as opposed to ranges of fields)
3932 and when --output-delimiter=STRING is specified, output STRING between
3933 ranges of selected bytes.
3934 * src/cut.c (RANGE_START_SENTINEL): Define.
3935 (output_delimiter_specified): New global.
3936 (print_kth): Add parameter. Adjust all callers.
3937 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
3938 (cut_bytes): When requested, output STRING between ranges of
3940 (main): Make a diagnostic a little clearer.
3941 Based on a patch from Jan Nieuwenhuizen.
3943 * tests/cut/Test.pm: New tests for the above.
3945 * src/cut.c (set_fields): Make code agree with comment:
3946 Don't merge abutting ranges like 4- and 2-3. This makes no
3947 difference currently, but is required to support an upcoming change.
3949 2003-01-07 Jim Meyering <jim@meyering.net>
3951 * src/cut.c (set_fields): Fix typo in comment.
3953 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
3954 * tests/touch/Makefile.am (TESTS): Add not-owner.
3955 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
3956 Now, this tests only the nonexistent-directory diagnostic.
3957 Suggestion from Michael Stone.
3959 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
3961 2003-01-04 Jim Meyering <jim@meyering.net>
3963 * src/copy.h: Remove use of PARAMS.
3964 * src/remove.h: Likewise.
3965 * src/chown-core.h: Likewise.
3967 rm could be tricked into mistakenly reporting a cycle.
3968 * src/remove.c: [cycle_check_state]: New global.
3969 (remove_cwd_entries): Adapt to new semantics of cycle_check.
3970 (rm): Call cycle_check_init and cycle_check_free for each file.
3971 * tests/rm/cycle (rm): New test, for the above fix.
3972 * tests/rm/Makefile.am (TESTS): Add cycle.
3974 When rm detects a cycle, don't abort the entire command,
3975 but rather just the affected command line argument.
3976 * src/remove.c: Include <setjmp.h>
3977 (struct dirstack_state) [current_arg_jumpbuf]: New member.
3978 (remove_cwd_entries): Call longjmp if we detect a cycle.
3979 (rm): Call setjmp here.
3981 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
3982 Instead, include cycle-check.h and use it.
3984 * src/remove.h (struct dev_ino): Remove declaration.
3986 * src/remove.c (remove_cwd_entries): Fix typos in comment.
3988 Don't include trailing /. in diagnostics about directories.
3989 * src/remove.c (full_filename_): When FILENAME is just `.'
3990 and there is a nonempty directory-name part, don't append `/.'.
3991 * tests/rm/unread2: Remove trailing /. from diagnostic.
3992 * tests/rm/rm2: Likewise.
3994 * src/remove.c (struct dirstack_state): Define.
3995 To be used in place of these file-scoped globals ...
3996 (dir_stack, len_stack, Active_dir): Remove globals.
3997 (ds_init, ds_free): New functions.
3998 (full_filename): Define.
3999 (full_filename_): Rename from full_filename.
4001 Begin to make AD_* functions more generic.
4002 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
4003 (AD_push): Likewise.
4004 (AD_INIT_OTHER_MEMBERS): Define.
4005 (remove_dir): Define the `status' member manually after each
4006 call to AD_push or AD_push_initial.
4008 * src/Makefile.am (check-misc): New rule, to ensure that no more
4009 S_IS* macro definitions sneak into the code.
4010 (check): Depend on check-misc.
4012 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
4013 * src/du.c (count_entry) [S_ISLNK]: Don't define.
4014 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
4016 2003-01-03 Jim Meyering <jim@meyering.net>
4018 * src/true.c: Add copyright.
4019 (AUTHORS): I suppose I've written it.
4021 * src/Makefile.am (false.c): Make the generated file be read-only.
4023 2003-01-04 Jim Meyering <jim@meyering.net>
4025 * src/ls.c: Include "dev-ino.h".
4026 [struct dev_ino]: Remove declaration.
4028 2003-01-02 Jim Meyering <jim@meyering.net>
4030 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
4031 from mv: s/missing file arguments/missing file argument/.
4032 With --target-directory=DIR, cp and mv work with a single file argument.
4033 Reported by Karl Berry.
4035 * tests/rm/isatty: Enable this test.
4037 2002-12-31 Jim Meyering <jim@meyering.net>
4039 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
4040 (AD_push): Likewise.
4041 (AD_INIT_OTHER_MEMBERS): Define.
4042 (remove_dir): Define the `status' member manually after each
4043 call to AD_push or AD_push_initial.
4045 * src/ls.c [struct dev_ino]: Remove definition.
4046 Include "dev-ino.h" instead.
4048 2002-12-28 Jim Meyering <jim@meyering.net>
4050 * tests/du/Makefile.am (TESTS): Add no-deref.
4051 * tests/du/no-deref: New script.
4053 2002-12-23 Jim Meyering <jim@meyering.net>
4055 * src/remove.c (remove_cwd_entries): Fix typo in comment.
4057 2002-12-21 Jim Meyering <jim@meyering.net>
4059 * announce-gen: Generate MML-formatted announcement.
4060 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
4062 2002-12-20 Jim Meyering <jim@meyering.net>
4064 * src/touch.c (touch): Change the wording of a diagnostic so
4065 that it makes sense both when the file exists and when it doesn't.
4066 Suggestion from Michael Stone.
4068 2002-12-18 Jim Meyering <jim@meyering.net>
4070 * src/stty.c (valid_options): Declare to be static.
4072 2002-12-15 Jim Meyering <jim@meyering.net>
4074 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
4076 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
4077 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
4078 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
4079 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
4080 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
4082 * src/remove.c (PARAMS): Remove definition.
4083 * src/sys2.h: Likewise.
4085 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
4086 Include strftime.h instead.
4088 2002-12-14 Jim Meyering <jim@meyering.net>
4090 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
4092 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
4093 This is necessary at least for Irix6.5 when using c89.
4094 Reported by Nelson Beebe.
4096 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
4098 * tests/misc/cat-tty-eof: New test.
4100 * src/mknod.c (usage): Specify how major and minor mode numbers
4101 are interpreted. Report forwarded by Kristin E Thomas.
4102 * src/mknod.c: Remove now-redundant usage-specifying comment.
4104 2002-12-13 Jim Meyering <jim@meyering.net>
4108 * tests/du/trailing-slash: Allow for a directory of size `0'.
4109 That happens at least on file systems of type tmpfs on linux-2.4.18.
4111 * announce-gen: New script to begin replacing the commands
4112 associated with the rule here...
4113 * Makefile.maint (announcement): Invoke announce-gen.
4114 * Makefile.am (EXTRA_DIST): Add announce-gen.
4116 * tests/cp/preserve-2: New file/test, for latest fix.
4117 * tests/cp/Makefile.am (TESTS): Add preserve-2.
4119 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
4121 Fix a bug whereby cp would fail to parse an option like
4122 --preserve=mode,ownership.
4123 * src/cp.c (decode_preserve_arg): Advance `comma' to
4124 point the character following the comma.
4126 2002-12-11 Jim Meyering <jim@meyering.net>
4128 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
4129 in case it's already defined.
4131 2002-12-09 Jim Meyering <jim@meyering.net>
4133 * tests/touch/fail-diag: Don't get a test failure if /no exists.
4134 Instead, evoke a framework failure if /no-$$ exists.
4135 Reported by Michael Stone.
4137 2002-12-08 Jim Meyering <jim@meyering.net>
4139 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
4140 Define to rpl_lstat, so that even on systems like Solaris 5.8,
4141 du honors (per POSIX) the trailing slash on an argument referring
4142 to a symlink-to-directory.
4144 2002-12-06 Jim Meyering <jim@meyering.net>
4146 * Use autoconf-2.57. Regenerate dependent files.
4147 * Use automake-1.7.2. Regenerate dependent files.
4149 * src/ls.c (gobble_file): Also stat the file if it's a
4150 regular file and --indicator-style=classify (aka -F).
4151 Thanks to Ed Santiago for opening my eyes.
4153 * tests/ls/file-type: New file. Test for the above.
4154 A test to contrast ls -F and ls --indicator-style=file-type.
4155 * tests/ls/Makefile.am (TESTS): Add file-type.
4157 2002-12-04 Jim Meyering <jim@meyering.net>
4159 * tests/ls/follow-slink: Make sure the symlink was created.
4160 Richard Dawe reported that `ln -s link link' succeeds, but creates
4161 no file on systems running some version of the DJGPP libc.
4163 2002-12-03 Jim Meyering <jim@meyering.net>
4165 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
4166 since this package no longer panders to K&R compilers.
4168 2002-12-02 Jim Meyering <jim@meyering.net>
4170 * tests/du/slink: Skip this test if `.' is on a non-local file system.
4172 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
4173 something to replace.
4175 2002-12-01 Jim Meyering <jim@meyering.net>
4177 * src/stat.c: Don't include <string.h> or <ctype.h>.
4178 That's already done via system.h.
4179 * src/dircolors.c: Don't include <ctype.h>.
4181 2002-11-30 Jim Meyering <jim@meyering.net>
4183 * ls.c (gobble_file): Remove the block of code that caused
4184 `ls --color -F symlink-to-dir' to list the files in
4185 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
4186 like `ls -F symlink-to-dir') but with the addition of highlighting.
4187 Similarly, `ls --color -dF symlink-to-dir' would print
4188 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
4189 Reported by Jeff Sheinberg as Debian bug #168203.
4190 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
4192 ls is now more efficient: with certain options, it no longer needs
4193 to stat each directory entry on systems with valid dirent.d_type.
4194 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
4195 (main): Make --recursive set format_needs_type, not format_needs_stat.
4196 (gobble_file): Remove a FIXME comment, now that it's fixed.
4198 2002-11-24 Jim Meyering <jim@meyering.net>
4200 * src/du.c (du_files): Don't strip any trailing slash.
4201 Rewrite so that `/' is no longer represented internally as
4203 (count_entry): When appending a file name component,
4204 account for the fact that the current path may end in `/'.
4205 François Pinard reported that `du symlink-to-dir/' was not
4206 equivalent to `du symlink-to-dir/.'. Now it is.
4207 * tests/du/trailing-slash: New file/test, for the above fix.
4208 * tests/du/Makefile.am (TESTS): Add trailing-slash.
4210 2002-11-23 Jim Meyering <jim@meyering.net>
4212 * src/tac.c (output): Declare some local variables to be of type size_t,
4213 rather than `int' to avoid warnings from gcc.
4215 2002-11-21 Paul Eggert <eggert@twinsun.com>
4217 * src/ls.c (decode_switches): Use case-sensitive matching to
4218 decode the QUOTING_STYLE environment variable. This is more
4219 consistent with the documentation, and with --quoting-style.
4221 2002-11-21 Martin Buck <martin.buck@ascom.ch
4223 * src/stty.c (struct speeds): Add support for all baud rates defined
4226 2002-11-19 Jim Meyering <jim@meyering.net>
4228 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
4229 run in a UTF locale. Report and suggested fix by Bruno Haible.
4230 * tests/fmt/basic: Likewise.
4232 2002-11-17 Jim Meyering <jim@meyering.net>
4234 * configure.ac: Update via autoupdate.
4235 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
4237 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
4238 Reported by Hans Ginzel.
4240 2002-11-15 Jim Meyering <jim@meyering.net>
4242 * Makefile.cfg (gnu_rel_host): Define.
4243 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
4244 on whether $(VERSION) looks like a major release number.
4246 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
4247 (release): Rename from `alpha'.
4248 (alpha): Depend on release.
4250 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
4252 2002-11-14 Jim Meyering <jim@meyering.net>
4254 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
4255 (announcement): Use the new variable.
4257 * Makefile.maint: Sync with Bison, i.e.:
4258 (po-check): Scan .l and .y files instead of the
4259 .c and the .h files that they generate. This fixes the bug
4260 reported by Tim Van Holder in:
4261 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
4262 Look for N_ as well as for _. Try to avoid matching #define for
4266 2002-11-12 Jim Meyering <jim@meyering.net>
4268 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
4269 Replace sole use with equivalent `#ifdef S_ISLNK'.
4270 Inconsistency reported by Dmitry V. Levin.
4272 2002-11-11 Jim Meyering <jim@meyering.net>
4274 * src/stat.c (usage): Transform --help items output via s/ - / /,
4275 so that help2man produces properly formatted man pages.
4276 Reported by Herbert Xu as Debian bug #168400.
4278 2002-11-10 Jim Meyering <jim@meyering.net>
4280 * src/ls.c (sighandler): Handle SIGTSTP specially.
4281 Based on suggestions from Solar Designer and Dmitry V. Levin.
4284 * Makefile.cfg (cvs_files): Define. From autoconf.
4285 (local_updates): Likewise.
4287 * src/ls.c (restore_default_color_handler, sigtstp_handler):
4289 (sighandler): New function, based on the one in sort.c.
4290 (main): Use sigaction, if possible; otherwise signal.
4291 Handle these signals:
4292 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
4293 Don't register our handler if the signal is already being ignored.
4295 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
4296 * src/csplit.c (interrupt_handler): Likewise.
4297 * src/sort.c (sighandler): Likewise.
4298 (main): Declare `i' and `nsigs' to be unsigned, not int.
4300 2002-11-09 Jim Meyering <jim@meyering.net>
4302 ls --color: restore terminal text color upon signal.
4303 * src/ls.c: Include "full-write.h" and <signal.h>.
4304 (restore_default_color, restore_default_color_handler): New functions.
4305 (sigtstp_handler, put_indicator_direct): New functions.
4306 (main) [print_with_color]: Register signal handlers.
4307 Patch mostly by Solar Designer and Stanislav Ievlev.
4309 Update from autoconf.
4310 * Makefile.maint (AMTAR): Remove definition.
4311 (update, cvs-update, po-update, do-po-update): New rules.
4312 (wget-update): Update (thus renaming to cvs-update).
4313 (automake_repo): Use anoncvs@sources.redhat.com.
4315 2002-11-06 Jim Meyering <jim@meyering.net>
4317 * tests/misc/Makefile.am (TESTS): Add printf-hex.
4319 * tests/misc/printf: Be careful to test the code in this package,
4320 not the shell built-in function.
4322 * src/printf.c (print_esc): A hexadecimal escape sequence has
4323 at most two hex. digits, not three. Reported by Padraig Brady.
4324 (usage): Update description.
4325 * tests/misc/printf-hex: New file/test, for the above fix.
4327 2002-10-07 Paul Eggert <eggert@twinsun.com>
4329 Add support for locale-specific size indications (e.g.,
4330 thousands-separators) and for explicit size suffixes on output.
4332 * doc/coreutils.texi (Block size): Say that:
4333 This affects display format as well as block size.
4334 Fractional block counts are rounded up.
4335 ls file size blocksize defaults to 1.
4336 A block size spec preceded by ' generates thousands separators.
4337 A suffix without a preceding integer generates suffixes.
4338 (tail invocation): 32k -> 32 KiB.
4339 (What information is listed): ls -h is now equivalent to
4340 ls --block-size=human, and ls -H is now equivalent to
4341 ls --block-size=si. Displayed file size is now always affected by
4344 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
4345 lib/umaxtostr.c: New files, taken from GNU tar.
4347 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
4349 (EXTRA_DIST): Add inttostr.c.
4351 * lib/human.c, lib/human.h: Rewrite to support locale-specific
4352 notations like thousands separators.
4353 Specify what includer of include.h must include beforehand.
4354 (human_group_digits, human_suppress_point_zero, human_autoscale,
4355 human_base_1024, human_SI, human_B): New enum values.
4356 (human_readable): Rename from human_readable_inexact; put the
4357 options before the sizes. All uses changed. The old human_readable
4358 function has been removed; use inttostr.h instead.
4359 (human_options): Renamed from human_block_size, with new signature
4360 that allows block sizes up to UINTMAX_MAX. All callers changed.
4362 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
4363 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
4364 freestanding C89. No need to check for stdlib.h or string.h since
4365 autoconf does this now.
4367 * src/cksum.c (cksum): Use primitives from inttostr.h, not
4368 human.h, to print large numbers simply.
4369 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
4370 * src/dd.c (print_stats, main): Likewise.
4371 * src/df.c (print_header): Likewise.
4372 * src/factor.c (print_factors): Likewise.
4373 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
4374 * src/shred.c (dopass): Likewise.
4375 * src/sort.c (checkfp): Likewise.
4376 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
4377 * src/tail.c (xlseek): Likewise.
4378 * src/wc.c (write_counts, wc): Likewise.
4380 * src/df.c (human_output_opts): New var.
4381 (output_block_size): Now uintmax_t, not int, to handle larger
4382 block sizes. All uses changed.
4383 * src/du.c: Likewise.
4384 * src/ls.c: Likewise.
4386 * src/df.c (print_header): In the header line, prefer SI to human
4387 representation if it's shorter; if neither is shorter, try to
4388 intuit what the user would prefer.
4390 * src/expr.c (inttostr): Remove; use new imaxtostr library
4393 * src/ls.c (file_output_block_size): New var, to distinguish
4394 file sizes from other sizes.
4395 (decode_switches): Set it.
4397 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
4398 (dopass): When printing progress, use floor for what has been done
4399 so far (since we should be conservative there), and ceiling for
4400 what needs to be done (since that's what other programs use).
4402 2002-10-19 Jim Meyering <jim@meyering.net>
4404 * src/pinky.c (print_heading): Align TTY and Name headings.
4405 Reported by Karl Eichwalder.
4407 2002-10-18 Jim Meyering <jim@meyering.net>
4409 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
4410 Remove now-useless cast.
4411 (stdread): Remove function.
4412 (bytes_split): Use size_t instead of int.
4413 Use safe_read, not stdread.
4414 (lines_split): Likewise.
4415 Use memchr rather than a `while' loop.
4416 (line_bytes_split): Use size_t instead of int.
4417 Use safe_read, not stdread.
4418 (main): Add some FIXME comments to remind me to remove casts.
4420 * src/system.h (ST_BLKSIZE): Correct comment describing how to
4421 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
4423 2002-10-17 Jim Meyering <jim@meyering.net>
4425 Fix a problem that could make e.g., `cat' misbehave on systems which
4426 give invalid (unreasonably large) values for stat.st_blksize.
4427 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
4428 Reported by Petter Reinholdtsen.
4430 2002-10-14 Jim Meyering <jim@meyering.net>
4432 Specifying a printf conversion specifer as nl's separator string
4433 could cause nl to segfault.
4434 * src/nl.c (build_print_fmt): Don't include separator string
4435 in the printf format; it might contain `%'.
4436 Use a better bound on the length of the print_fmt buffer.
4437 (print_lineno): Print the separator here instead.
4438 Reported by Doug Coleman.
4440 * tests/misc/nl: New file/tests, including a test for the above.
4441 * tests/misc/Makefile.am (TESTS): Add nl.
4443 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
4444 * tests/misc/Makefile.am (TESTS): Add split-l.
4446 2002-10-13 Jim Meyering <jim@meyering.net>
4450 * src/du.c (usage): Tweak description of --dereference-args/-D.
4452 * src/du.c (count_entry): Also save cwd when dereferencing (via
4453 --dereference-args, -D) a command-line argument.
4454 Reported by Michal Svec. Based on a patch by Andreas Schwab.
4456 * src/Makefile.am (../AUTHORS): New target/rule.
4458 2002-10-12 Jim Meyering <jim@meyering.net>
4460 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
4461 of type size_t, since that's the way it's used and avoids a warning.
4463 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
4464 since that's how it's always used and avoids a new warning from gcc.
4465 (read_input): Adapt to new safe_read ABI.
4467 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
4470 * src/pinky.c (print_long_entry): fread returns size_t.
4471 Declare local `bytes' accordingly, to avoid warning.
4473 tail -c +N would perform an extra read after encountering EOF
4474 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
4475 * src/tail.c (start_bytes): Detect EOF, inform caller.
4476 (tail_bytes): Upon EOF in start_bytes, return immediately.
4477 (file_lines): Reorganize to use memrchr rather than an explicit loop.
4478 Adapt to new safe_read ABI.
4480 2002-10-11 Jim Meyering <jim@meyering.net>
4482 * tests/du/deref: New file/test, for the above fix.
4483 * tests/du/Makefile.am (TESTS): Add deref.
4485 2002-10-10 Jim Meyering <jim@meyering.net>
4487 * tests/ln/Makefile.am (TESTS): Add target-1.
4488 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
4490 2002-10-09 Jim Meyering <jim@meyering.net>
4492 * tests/cp/backup-is-src: Ensure that certain environment variables
4493 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
4495 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
4496 consume 4GB of disk space on systems without support for sparse files.
4497 Fix a logic error that'd make it `cat err' even though dd didn't fail.
4499 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
4500 Patch by steven@magelico.net, forwarded by Michael Stone.
4502 * tests/ls/dired: Ensure that ls produces English messages.
4503 Patch by Alexey Vyskubov, forwarded by Michael Stone.
4505 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
4507 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
4509 2002-10-08 Jim Meyering <jim@meyering.net>
4511 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
4512 Fix syntax in test: use =, not ==.
4513 Reported by Bob Proulx.
4514 Change all the rest like this: grep -lR "testing framework'" .\
4515 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
4517 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
4518 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
4519 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
4520 * src/wc.c (wc): Likewise.
4522 2002-10-07 Paul Eggert <eggert@twinsun.com>
4525 Don't advance the write pointer past the end of the write buffer.
4526 * src/sort.c (begfield, limfield): Likewise.
4528 2002-10-07 Jim Meyering <jim@meyering.net>
4530 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
4531 * src/head.c (head_bytes, head_lines): Likewise.
4533 2002-10-06 Jim Meyering <jim@meyering.net>
4535 * src/dd.c (scanargs): Ensure that specified block sizes (specified
4536 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
4537 (skip, dd_copy): Adapt to new safe_read ABI.
4539 * Makefile.maint (signatures): Define.
4541 (announcement): Depend on $(signatures).
4543 * Makefile.maint (announcement): Output all URLs for detached
4544 signatures, not just the last one from the previous loop.
4546 2002-10-05 Jim Meyering <jim@meyering.net>
4550 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
4551 don't recurse into directory, DIR. Prompted by a report from
4554 * tests/rm/i-no-r: New file/test, for the above fix.
4555 * tests/rm/Makefile.am (TESTS): Add i-no-r.
4557 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
4558 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
4560 2002-10-03 Jim Meyering <jim@meyering.net>
4562 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
4563 * src/df.c (AUTHORS): Likewise.
4564 * src/du.c (AUTHORS): Likewise.
4565 * src/tail.c (AUTHORS): Likewise.
4566 * src/touch.c (AUTHORS): Likewise.
4568 2002-10-02 Jim Meyering <jim@meyering.net>
4570 * Makefile.am (SUBDIRS): Remove `old'.
4571 (EXTRA_DIST): List the files in old/.
4572 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
4573 Suggestion from Akim Demaille.
4575 2002-10-01 Jim Meyering <jim@meyering.net>
4577 * src/sys2.h (SSIZE_MAX): Define.
4579 2002-09-30 Jim Meyering <jim@meyering.net>
4581 * src/csplit.c: Don't include stdlib.h here. It's already included
4584 2002-09-29 Jim Meyering <jim@meyering.net>
4586 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
4587 expression to avoid bogus warning from gcc.
4589 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
4590 (cat): Declare insize and outsize to be of type size_t, not int.
4591 Rearrange pointer/integer expressions to avoid bogus warnings.
4592 (main): Declare insize and outsize to be of type size_t, not int.
4594 * src/tail.c (parse_options): Give a sensible diagnostic for
4595 an invalid byte or line count. Reported by Mikko Tuumanen.
4597 * src/touch.c (main): Split a long line.
4599 * tests/du/Makefile.am (TESTS): Add slink.
4600 * tests/du/slink: New test for system.h change of 2002-08-31.
4602 In move mode, always first try to rename. Before, upon failure to
4603 rename a directory, this code would never attempt to rename any
4604 other file in that directory, but would thenceforth always copy.
4605 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
4606 may fail with EXDEV, yet renaming files within that directory to
4607 a newly-created destination directory succeeds.
4608 * src/copy.c (copy_internal): Remove local, move_mode;
4609 use x->move_mode instead. Based on a patch from Tom Haynes.
4611 2002-09-28 Jim Meyering <jim@meyering.net>
4613 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
4614 Factor out some duplication.
4616 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
4618 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
4620 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
4621 to avoid compiler warnings.
4623 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
4626 Fix things so `mkdir -p' can create very deep directories, e.g.,
4627 mkdir -p $(perl -e 'print "a/" x 40000') now works.
4628 * src/mkdir.c (main): For --parents (-p), call make_path with the
4629 entire directory name, so we don't ever require that file operations
4630 like stat or chmod be performed on the entire command line argument.
4631 * makepath.c (make_path): Restore umask *before* creating the final
4634 2002-09-27 Andreas Schwab <schwab@suse.de>
4636 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
4637 to avoid overflow. Reported by Hans Lermen.
4639 2002-09-26 Jim Meyering <jim@meyering.net>
4641 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
4643 2002-09-25 Jim Meyering <jim@meyering.net>
4645 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
4646 and add a cast, to avoid a warning about `signed and unsigned type in
4647 conditional expression'.
4649 2002-09-22 Jim Meyering <jim@meyering.net>
4651 * src/rmdir.c: Include "dirname.h", for declaration of
4652 strip_trailing_slashes.
4654 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
4655 Now they're defined through system.h.
4657 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
4658 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
4659 since it's already included from sys2.h via system.h.
4661 * Use automake-1.6f. Regenerate dependent files.
4663 * src/Makefile.am (PERL): Remove duplicate definition.
4665 fmt's -s, -t, -c options didn't work properly for long lines.
4666 Since get_line may end up calling put_paragraph (for long lines),
4667 be sure to set global, `other_indent', before it is used there.
4669 * src/fmt.c (set_other_indent): New function, factored out of...
4670 (get_paragraph): ... here. Call it.
4671 (get_line): Call set_other_indent before calling flush_paragraph,
4672 which calls fmt_paragraph, which in turn calls put_paragraph,
4673 which uses other_indent.
4675 * tests/fmt/Makefile.am (TESTS): Add long-line.
4676 * tests/fmt/long-line: New file/test, for the above fix.
4678 2002-09-21 Jim Meyering <jim@meyering.net>
4680 * src/od.c: No longer include deprecated <values.h>.
4681 It was required solely for now-removed reference to BITSPERBYTE.
4682 * src/install.c: Likewise.
4683 Suggestion from Bruno Haible.
4685 2002-09-06 Andreas Schwab <schwab@suse.de>
4687 `rmdir -p dir-specified-with-trailing-slash/' would fail.
4688 * src/rmdir.c (remove_parents): Strip trailing slashes.
4690 2002-09-20 Jim Meyering <jim@meyering.net>
4692 * tests/rmdir/t-slash: New file/test, for the above fix.
4693 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
4695 * Makefile.maint (announcement): Arrange to gpg-sign the message.
4696 Add a URL for each detached signature file.
4698 2002-09-07 Bruno Haible <bruno@clisp.org>
4700 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
4702 2002-09-18 Jim Meyering <jim@meyering.net>
4704 `od -t x8' used the wrong (`l'-prefixed) printf format.
4705 Likewise for the o8 and u8 formats.
4706 * src/od.c (ISPEC_TO_FORMAT): Define macro.
4707 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
4708 Reported by Arun Sharma.
4710 2002-09-17 Jim Meyering <jim@meyering.net>
4712 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
4713 From gettext's intl/loadmsgcat.c.
4715 * tests/od/x8: New file/test, for the above fix.
4716 * tests/od/Makefile.am (TESTS): Add x8.
4718 2002-09-15 Jim Meyering <jim@meyering.net>
4720 * Use autoconf-2.54. Regenerate dependent files.
4722 * src/csplit.c (get_format_width): Add cast to avoid
4723 warning about `signed and unsigned type in conditional expression'.
4725 2002-09-14 Jim Meyering <jim@meyering.net>
4727 * src/who.c (print_user): Change type of local to size_t
4728 to avoid warnings about `comparison between signed and unsigned'.
4729 * src/ptx.c (generate_all_output): Likewise.
4731 * src/dd.c (main, skip): Add casts to avoid warnings about
4732 `comparison between signed and unsigned'.
4734 * src/id.c (print_full_info, print_group_list): Add casts to avoid
4735 warnings about `signed and unsigned type in conditional expression'.
4737 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
4738 to avoid warnings about `comparison between signed and unsigned'.
4739 (split_3): Change parameter names to be readable and add comment.
4740 Clean up the test for whether a line may be ignored.
4742 2002-09-13 Jim Meyering <jim@meyering.net>
4744 * src/printf.c (main): Handle leading command line argument of `--'.
4745 Reported by Raul: DervishD <raul@pleyades.net>
4746 * tests/misc/printf: New file: test for the above.
4747 * tests/misc/Makefile.am (TESTS): Add printf.
4749 * src/date.c (usage): Explain that %S's range of [0..60] is required --
4750 rather than 0..59 -- to accommodate the occasional positive leap second.
4751 Reported by Richard Neill.
4753 2002-09-12 Jim Meyering <jim@meyering.net>
4755 * src/Makefile.am (nanosec_libs): Define.
4756 (sleep_LDADD, tail_LDADD): Use it here.
4758 Factor nanosleep-related code into ../lib/xnanosleep.c.
4759 * src/sleep.c: Include xnanosleep.h.
4760 Factor out fenv.h-related code.
4761 (timespec_subtract): Remove function.
4762 (main): Remove code that deals with computing start and stop times
4763 as well as the loop around nanosleep. Now that's in xnanosleep.c.
4765 Allow S (in --sleep-interval=S) to be a floating point value.
4766 * src/tail.c: Include xnanosleep.h and xstrtod.h.
4767 Move declaration of global variable, sleep_interval, to ...
4769 (usage): Update description of --sleep-interval option.
4770 (tail_forever): New parameter, sleep_interval. Update caller.
4771 Use xnanosleep, rather than sleep.
4772 (parse_options): New parameter, sleep_interval. Update caller.
4773 Use xstrtod, now that we accept floating point values.
4774 Prompted by a patch from Augey Mikus.
4776 2002-09-06 Jim Meyering <jim@meyering.net>
4778 * src/remove.c (prompt): Change comment to give a better note to
4779 translators. From Michael Piefel.
4781 2002-09-02 Jim Meyering <jim@meyering.net>
4783 * README: A good problem report/patch includes diffs against
4784 the most recent test release.
4786 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
4787 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
4789 * src/kill.c (print_table_row): Use an unsigned type for widths
4790 to avoid warning about comparison between signed and unsigned.
4791 (list_signals): Likewise.
4793 * src/od.c (skip): Add a cast to avoid warning about comparison
4794 between signed and unsigned.
4795 * src/install.c (get_ids): Likewise. Also rearrange range-checking
4796 comparisons to make them more readable.
4798 2002-09-01 Jim Meyering <jim@meyering.net>
4802 2002-08-31 Jim Meyering <jim@meyering.net>
4804 Symlinks were always reported as using 0 blocks.
4805 * src/system.h (ST_NBLOCKS): Don't depend on file type.
4806 This reverts the change of 2000-01-30.
4807 Based on a report and patch from Neil Brown via Michael Stone.
4808 This fixes Debian Bug#156358.
4810 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
4811 `exit (1)' to `exit (EXIT_FAILURE)', and
4812 `usage (1)' to `usage (EXIT_FAILURE)'.
4814 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
4815 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
4816 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
4817 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
4818 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
4819 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
4820 error never exits successfully.
4822 2002-08-29 Jim Meyering <jim@meyering.net>
4824 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
4825 when ignoring any return value.
4827 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
4828 failures. On some systems (at least EMC Celerra and Solaris5.8),
4829 this appears to be necessary.
4830 (is_empty_dir): Likewise. Also, always close directory handle.
4831 * src/ls.c (print_dir): Likewise.
4832 (print_dir): Rename local variable: reading -> dirp.
4833 Reported by Mike Coleman.
4835 2002-08-28 Jim Meyering <jim@meyering.net>
4837 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
4838 Give a diagnostic and fail if closedir fails.
4840 2002-08-26 Jim Meyering <jim@meyering.net>
4842 * Makefile.am (THANKS-to-translators): New rule.
4843 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
4844 * THANKStt.in: New file.
4846 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
4848 (main): Register it with atexit.
4849 Close STDOUT_FILENO, to avoid a problem when writing to
4850 /dev/audio on at least Solaris 5.7 and 5.8 systems.
4851 Reported by Shing-Shong Shei.
4853 2002-08-25 Jim Meyering <jim@meyering.net>
4855 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
4856 * src/tac.c (main): Likewise.
4857 * src/tail.c (main): Likewise.
4858 * src/tee.c (main): Likewise.
4859 * src/tr.c (main): Likewise.
4860 * src/wc.c (main): Likewise.
4862 2002-08-20 Jim Meyering <jim@meyering.net>
4864 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
4866 2002-08-10 Paul Eggert <eggert@twinsun.com>
4868 * src/nohup.sh: Don't use "exec --"; it's not portable and
4869 shouldn't be needed.
4871 2002-08-09 Jim Meyering <jim@meyering.net>
4873 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
4874 (usage): Clarify help text for the -COLUMN option.
4875 Patch by Padraig Brady.
4876 * tests/pr/Test.pm [col-last]: New test for the above.
4878 * configure.ac: Start with version 4.5.1, chosen so that it's larger
4879 than the latest version numbers of the component packages.
4881 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
4884 2002-08-08 Jim Meyering <jim@meyering.net>
4886 * src/date.c: Guard inclusion of <langinfo.h> with
4887 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
4888 * src/sort.c: Likewise.
4889 Patch by GOTO Masanori.
4891 2002-08-05 Paul Eggert <eggert@twinsun.com>
4893 Fix some minor time-related bugs with POSIX time arguments.
4894 Some valid time stamps were being rejected (notably -1, and
4895 time stamps before 1900 on 64-bit hosts). And some invalid
4896 time stamps were being accepted, e.g. September 31.
4898 * src/date.c (main): Adjust to posixtime signature change.
4899 * src/touch.c (main): Likewise. Remove unnecessary initialization.
4900 Use localtime, not posixtm, to warn about obsolete "touch".
4902 2002-08-05 Jim Meyering <jim@meyering.net>
4904 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
4906 2002-08-04 Jim Meyering <jim@meyering.net>
4908 * src/Makefile.am (check-README): New target/rule.
4909 (check): Depend on it.
4911 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
4913 2002-08-03 Jim Meyering <jim@meyering.net>
4915 * Makefile.am (SUBDIRS): Add old.
4916 * old/: New directory, containing legacy ChangeLog* and NEWS files
4917 from the fileutils, sh-utils, and textutils packages.
4919 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
4921 2002-08-02 Paul Eggert <eggert@twinsun.com>
4923 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
4925 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
4926 (hard_LC_COLLATE): New var.
4927 (different): Args are now char *, not const char *.
4928 Use xmemcoll instead of memcmp to compare lines, so that
4929 LC_COLLATE has effect. However, use memcmp if it is an
4931 (check_file): Do not include newline in comparison, so that
4932 xmemcoll has a byte to stomp on temporarily.
4933 (main): Set hard_LC_COLLATE.
4935 2002-07-29 Jim Meyering <jim@meyering.net>
4937 * Makefile.am (SUBDIRS): Remove djgpp, for now.
4939 2002-07-20 Jim Meyering <jim@meyering.net>
4941 * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
4942 into EXIT_FAILURE. Otherwise, false --help and false --version
4945 2002-07-08 Jim Meyering <jim@meyering.net>
4947 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
4948 rather than the hard-coded `sh-utils'.
4950 2002-07-01 Jim Meyering <jim@meyering.net>
4952 * configure.ac: Merge the three files from fileutils,
4953 textutils, and sh-utils.
4954 * Makefile.am: Likewise.
4955 * src/Makefile.am: Likewise.