1 2004-02-22 Jim Meyering <jim@meyering.net>
5 * src/du.c (usage): Separate -H and --si. Say that the meaning
6 of -H will soon change to that of --dereference-args (-D).
8 2004-02-21 Jim Meyering <jim@meyering.net>
10 * src/comm.c (usage): Tell what comm does when there are no options.
11 Reword in terms of FILE1 and FILE2 rather than `left file' and
12 `right file'. Suggestion from Dan Jacobson.
14 2004-02-15 Paul Eggert <eggert@twinsun.com>
16 Fix some POSIX-conformance bugs in expr.
18 * NEWS: document the following changes to src/expr.c.
19 * doc/coreutils.texi (expr invocation): Likewise.
20 Document what forms integers may take, and say "integer"
21 consistently instead of "number". Warn about operands
22 that "expr" can misinterpret, and how to work around the
24 * src/expr.c (eval, eval7, eval6, eval5, eval4, eval3, eval2, eval1):
25 Accept a bool argument specifying whether to evaluate the
26 expression. This is to allow short-circuit evaluation. All
28 (null): Report that a string is zero even if it has
29 a form like "-0" or "00".
30 (eval1, eval): Use short-circuit evaluation for | and &.
31 (eval): Return 0 if both arguments are null or zero, instead
32 of returning the first argument.
33 * tests/expr/basic: Add some tests for the above.
35 2004-02-17 Jim Meyering <jim@meyering.net>
39 `make check' from a build inside a chroot environment would fail
40 * tests/help-version: Specify an argument (`/') for df, in the
41 unusual event that there is no valid entry in /etc/mtab.
42 Likewise for id: add the -u option, so we don't get spurious
43 failures when there are no user or group names.
46 * src/sort.c (usage) [-u]: Add punctuation so that the description in
47 the help2man-generated (line-joined) man page is more readable.
48 Reported by Tim Waugh.
49 [-T]: Add a semicolon, for the same reason.
51 2004-02-15 Jim Meyering <jim@meyering.net>
53 * Makefile.am (dist-hook): Qualify target with $(srcdir)/ prefix.
55 2004-02-11 Jim Meyering <jim@meyering.net>
57 * tests/Makefile.am.in ($(srcdir)/Makefile.am): Use more portable
58 $(srcdir)/../Makefile.am.in, rather than $<.
59 Suggestion from Michael Elizabeth Chastain.
61 2004-02-10 Jim Meyering <jim@meyering.net>
63 * config/install-sh: Make this script executable.
64 * Makefile.am (dist-hook): New target, to ensure that config/install-sh
65 is executable. Otherwise, on systems that lack a suitable install
66 binary, `make install' would fail, because of the way this script
67 is invoked (without `$SHELL ' prefix).
68 Reported by Bob Proulx.
70 2004-02-08 Jim Meyering <jim@meyering.net>
74 * tests/rm/rm5: Avoid triggering a bug in OSF/Tru64's sed
75 that would cause an unwarranted test failure.
76 * tests/rm/rm3: Likewise.
78 2004-02-07 Jim Meyering <jim@meyering.net>
80 Remove xstat function pointer member. The way it was used was not
81 portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
82 inline `stat' and `lstat' functions, thus making the tests of
83 `xstat == lstat' in copy.c always fail.
84 * src/copy.h (struct cp_options) [xstat]: Remove member.
86 * src/copy.c (copy_dir): Set `.dereference' member, not .xstat.
87 (copy_internal): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.
88 Use `x->dereference == DEREF_NEVER' in place of `x->xstat == lstat'.
89 (valid_options): Remove now-obsolete FIXME comments.
91 * src/cp.c (re_protect): Use `XSTAT (x, ...)' in place of
93 (do_copy): Declare/use local xstat rather than x->xstat.
94 (main): Remove code that set x.xstat.
95 * src/mv.c (cp_option_init): Don't initialize xstat member.
96 * src/install.c (cp_option_init): Likewise.
98 * Makefile.cfg (gnu_ftp_host-alpha, etc.): Un-factor .gnu.org suffix,
99 so that emit_upload_commands can use these variables, too.
101 2004-02-06 Jim Meyering <jim@meyering.net>
103 * tests/rm/deep-1: Remove `du' stack space test.
104 Apparently, `ulimit -s N' isn't portable enough.
105 This test will be restored (with a guard against losing ulimit)
106 in its own file later.
108 * tests/rm/deep-1 (deep): Remove progress-style diagnostics,
109 since this test doesn't take long enough to merit them.
110 Run du on $tmp (the containing dir), not $deep, the full path to leaf.
112 * Makefile.maint (signatures): Remove definition.
113 Now, automake's gnupload handles this.
114 (%.sig: %): Remove now-unused rule.
115 (rel-files): Use automake's $(DIST_ARCHIVES), rather than
116 `$(distdir).tar.bz2 $(distdir).tar.gz'.
117 (emit-upload-commands): Adjust to use gnupload.
119 2004-02-05 Jim Meyering <jim@meyering.net>
121 * src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP): Remove definitions.
122 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
123 Now, those are all defined in timespec.h.
126 * src/date.c: Don't include timespec.h, now that system.h does it.
128 2004-02-02 Paul Eggert <eggert@twinsun.com>
130 Don't dump core if localtime returns NULL (possible on
131 hosts with 64-bit time_t and 32-bit int).
132 * src/date.c: Include "inttostr.h".
133 (batch_convert, main):
134 If time conversion fails, exit with nonzero status.
135 (show_date): Return int to report conversion failure.
136 Print the time as an int if localtime fails.
137 * src/uptime.c: Print "??" if the current clock can't
138 be converted by localtime. This won't happen until the year
139 2*31 + 1900, but we don't want to dump core even if the current
140 clock has the wrong value.
142 * src/stat.c: Include "inttostr.h".
143 (human_time): Print the date/time as a number of seconds since the
144 epoch if it can't be converted by localtime. This is better than
145 just saying "invalid", and is consistent with what "ls" does.
146 Don't dump core if the year has more than 48 digits; this isn't
147 possible on any contemporary host, but we might as well do it right.
149 2004-01-31 Paul Eggert <eggert@twinsun.com>
151 * src/stat.c (human_time): Accept time rather than
152 pointer-to-const-time parameter, for clarity. All callers changed.
154 2004-02-02 Jim Meyering <jim@meyering.net>
156 * src/stat.c (do_stat): Remove extra trailing newline from
157 default formats. Reported by Nelson H. F. Beebe.
159 Print actual fractional seconds in time stamps, not just `.00000000'.
160 * src/stat.c (human_time): Add and use new parameter, t_ns.
161 (print_stat): Update callers.
162 * src/ls.c (TIMESPEC_NS): Remove definition.
163 * src/system.h (TIMESPEC_NS): Define here, instead, now that stat.c
164 also uses this macro.
165 Nelson H. F. Beebe noticed that ls --full-time printed nonzero
166 fractional seconds for files on an XFS file system, but that stat's
167 fractional seconds were always zero.
169 2004-01-28 Paul Eggert <eggert@twinsun.com>
171 * src/seq.c (print_numbers): Use 'double' for loop index, not
172 'int', to avoid problems with integer overflow. On almost all
173 machines 'double' works in every case where 'int' works, and
174 it works on other cases besides.
176 2004-01-27 Jim Meyering <jim@meyering.net>
178 * src/seq.c (usage): Mention that if INCREMENT is omitted,
179 it defaults to 1, even when FIRST is larger than LAST.
180 Reword so as not to exclude the possibility that INCREMENT be zero.
182 2004-01-25 Jim Meyering <jim@meyering.net>
186 * Makefile.maint (signatures): Comment out definition.
188 2004-01-23 Jim Meyering <jim@meyering.net>
190 * Makefile.maint (header_regexp): Add exitfail.
192 * man/Makefile.am (EXTRA_DIST): Add help2man.
193 Reported by Nelson H. F. Beebe.
195 * man/Makefile.am (.x.1): Prefix help2man invocation with `$(PERL) --'
196 so it works on systems with Perl installed somewhere other than in
199 * src/paste.c (paste_parallel): Declare local, chr, to be of type
200 `int', not `char', since it must hold EOF. This bug would make
201 paste infloop on some systems. Test failures reported by
202 Nelson H. F. Beebe and Christian Krackowizer.
204 2004-01-22 Jim Meyering <jim@meyering.net>
206 * tests/rmdir/fail-perm: New file. Test for just-fixed rmdir bug.
207 * tests/rmdir/Makefile.am (TESTS): Add fail-perm.
209 * man/help2man: Fix it so using --info-page='coreutils PROG' works.
210 * man/Makefile.am (.x.1): Invoke our own (tweaked) copy of help2man.
211 Use --info-page='coreutils PROG' option.
212 Now, readlink.1 refers the user to `info coreutils readlink'
213 rather than to `info readlink'. Reported by Matt Swift.
215 2004-01-21 Paul Eggert <eggert@twinsun.com>
219 * src/basename.c (usage): Use EXIT_SUCCESS, not 0, for clarity.
220 * src/cat.c, src/chgrp.c, src/chmod.c, src/chown.c, src/chroot.c,
221 * src/cksum.c, src/comm.c, src/cp.c, src/csplit.c, src/cut.c,
222 * src/date.c, src/dd.c, src/df.c, src/dircolors.c, src/dirname.c,
223 * src/du.c, src/echo.c, src/env.c, src/expand.c, src/expr.c,
224 * src/factor.c, src/fmt.c, src/fold.c, src/head.c, src/hostid.c,
225 * src/hostname.c, src/id.c, src/install.c, src/join.c, src/kill.c,
226 * src/link.c, src/ln.c, src/logname.c, src/ls.c, src/md5sum.c,
227 * src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c,
228 * src/nl.c, src/nohup.c, src/od.c, src/paste.c, src/pathchk.c,
229 * src/pinky.c, src/pr.c, src/printenv.c, src/printf.c, src/pwd.c,
230 * src/rm.c, src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c,
231 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c,
232 * src/su.c, src/sum.c, src/sync.c, src/tac.c, src/tail.c, src/tee.c,
233 * src/test.c, src/touch.c, src/tr.c, src/tsort.c, src/tty.c,
234 * src/uname.c, src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c,
235 * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c: Likewise.
237 * src/cat.c (usage): Don't bother normalizing exit status
238 since the arg is already the correct exit status now.
239 * src/cksum.c, src/comm.c, src/csplit.c, src/cut.c,
240 * src/dircolors.c, src/expand.c, src/fmt.c, src/fold.c, src/head.c,
241 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c,
242 * src/pr.c, src/split.c, src/sum.c, src/tac.c, src/tail.c, src/tr.c,
243 * src/tsort.c, unexpand.c, src/src/uniq.c, src/src/wc.c: Likewise.
245 * src/chown.c (main): Removed unused local 'fail'.
247 * src/chroot.c (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE):
250 * src/chroot.c (main): Initialize exit_failure to EXIT_FAIL.
251 * src/env.c, src/nice.c, src/su.c: Likewise.
252 * src/nohup.c (main): Likewise, to NOHUP_FAILURE.
253 * src/setuidgid.c (main): Likewise, to SETUIDGID_FAILURE.
254 * src/expr.c (main): Use initialize_exit_failure rather than
255 setting exit_failure directly; this optimizes away redundant
257 * src/printenv.c, src/sort.c, src/test.c, src/tty.c: Likewise.
259 * src/chroot.c (main): Exit with status 1 rather than 127
260 if chroot itself fails, as per documentation.
262 * src/chroot.c (main): Use EXIT_ENOENT and EXIT_CANNOT_INVOKE
263 rather than roll-your-own symbols or integers.
264 * src/env.c (main): Likewise.
265 * src/nohup.c (main): Likewise.
266 * src/su.c (run_shell): Likewise.
268 * src/cp.c (exit_status): Remove static var....
269 (main): Making it local here instead. Use =, not |=, to set it.
271 * src/cut.c (FATAL_ERROR, main): Exit with status EXIT_FAILURE,
273 * src/date.c (batch_convert, main): Likewise.
274 * src/dd.c (dd_copy): Likewise.
275 * src/pr.c (first_last_page, main, getoptarg): Likewise.
276 * src/tr.c (main): Likewise.
277 * src/date.c (main): Don't assume EXIT_FAILURE == 1, as
278 POSIX doesn't require it.
279 * src/dd.c (write_output, skip, dd_copy): Likewise.
280 * src/df.c (main): Likewise.
281 * src/id.c (main): Likewise.
282 * src/install.c (main): Likewise.
283 * src/ln.c (main): Likewise.
284 * src/ls.c (main): Likewise.
285 * src/mv.c (main): Likewise.
286 * src/shred.c (main): Likewise.
288 * src/env.c (main): Exit with status 1, not 2, on errors detected
290 * src/hostname.c (main): Likewise.
291 * src/nl.c (main): Likewise.
292 * src/stty.c (main): Likewise.
294 * src/expr.c (EXPR_FAILURE): Renamed from EXPR_ERROR, for
295 consistency with the other programs' naming conventions.
298 * src/factor.c (main): Do not report a usage error simply
299 because stdin has bad numbers.
301 * src/id.c (problems): Now a boolean int, not a counter,
302 so that we don't have to worry about int overflow. All uses changed.
303 * src/touch.c (err): Likewise.
305 * src/md5sum.c (main): Use int, not size_t, to store boolean int.
307 * src/mkfifo.c (main): Exit with status 1, not 4, if not implemented.
308 * src/mknod.c: Likewise.
310 * src/nice.c (main): Exit with status EXIT_FAIL, not EXIT_FAILURE,
311 on error; this is in case EXIT_FAILURE is unusual.
312 * src/su.c (main): Likewise.
314 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE): Remove; all uses
315 changed to EXIT_CANNOT_INVOKE.
317 * src/printenv.c (PRINTENV_FAILURE): New constant.
318 (main): Exit with status PRINTENV_FAILURE, not EXIT_FAILURE, on
319 command-line syntax problems.
321 * src/rmdir.c (remove_parents): Don't set 'fail' to a negative number.
322 (main): Avoid integer overflow when seeing whether errors occurred.
324 * src/seq.c (print_numbers): Now returns void, not (zero) int.
326 (main): Remove unused local variable 'errs'. Always exit successfully
329 * src/setuidgid.c (SETUIDGID_FAILURE): Renamed from FAIL_STATUS,
330 for consistency with other programs here. All uses changed.
331 (main): Use 'error' to exit rather than invoking 'exit' here.
333 * src/sort.c: Don't include <assert.h>.
334 (SORT_OUT_OF_ORDER, SORT_FAILURE): Now enums, not macros.
335 (usage): Don't use 'assert'.
336 (main): Remove redundant assignment to exit_failure.
338 * src/system.h (EXIT_FAIL, EXIT_CANNOT_INVOKE, EXIT_ENOENT):
340 (initialize_exit_failure): New inline function.
341 Include exitfail.h here, since we refer to exit_failure.
342 All callers changed to not include exitfail.h.
344 * src/tty.c (TTY_FAILURE, TTY_WRITE_ERROR): New enum values;
345 substitute them for the corresponding integer constants.
347 * tests/help-version (expected_failure_status_date): Remove, as
348 'date' is now normal.
349 (expected_failure_status_nohup): New var.
351 2004-01-21 Jim Meyering <jim@meyering.net>
353 * tests/touch/relative: Remove `command' syntax.
354 Thanks to Nelson H. F. Beebe and Paul Eggert.
356 * tests/touch/relative: Test only year/month/day, not hours/min/sec,
357 so as to avoid problems with systems using TAI clocks.
358 Although it's no longer necessary, set TZ=UTC0 also for the
359 initial touch command. Reported by Paul Jarc here:
360 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/1504
362 2004-01-20 Diego Biurrun <diego@biurrun.de>
364 * src/dircolors.hin: Add .mov to the list of media files.
366 2004-01-19 Paul Eggert <eggert@twinsun.com>
368 * tests/touch/relative: Use TZ=UTC0, not TZ=utc (which isn't
369 portable). Problem reported by Christian Krackowizer. Also, use
370 +0000 rather than +0 to specify a time zone, as the documentation
371 requires four digits.
373 2004-01-19 Jim Meyering <jim@meyering.net>
375 * tests/mv/hard-4: Run envvar-check in case SIMPLE_BACKUP_SUFFIX is set.
376 * tests/mv/backup-is-src: Likewise.
377 Problem reported by Peter Horst
379 2004-01-17 Jim Meyering <jim@meyering.net>
381 * announce-gen (print_changelog_deltas): Use .sig suffix, not .asc.
385 2003-12-15 Paul Eggert <eggert@twinsun.com>
387 * NEWS, doc/coreutils.texi: touch -r and -d can now both be specified,
388 with -r specifying the origin for -d.
389 * src/touch.c (flexible_date): Remove static var.
390 (get_reldate): New function.
391 (main): Use it, to implement this new behavior.
393 2004-01-16 Jim Meyering <jim@meyering.net>
395 * tests/touch/relative: New test for the above.
396 * tests/touch/Makefile.am (TESTS): Add relative.
398 2004-01-13 Jim Meyering <jim@meyering.net>
400 * src/system.h: Include contents of sys2.h.
401 * src/sys2.h: Remove file.
402 * src/Makefile.am (noinst_HEADERS): Remove sys2.h.
404 * Use automake-1.8.2. Regenerate dependent files.
406 * Update to gettext-0.13.1.
407 * configure.ac: Use gettext-0.13.1.
408 * .x-sc_space_tab: Add m4/po.m4 to the list of exceptions.
410 2004-01-12 Jim Meyering <jim@meyering.net>
412 * Makefile.maint (%.sig): Use .sig suffix rather than .asc.
414 * Makefile.maint (po-check): Ensure that cvsu works before using it.
415 Reported by Alexandre Duret-Lutz.
417 * src/tail.c (main): Warn about following stdin only when it's a tty.
419 * configure.ac: Use gl_DEFAULT_POSIX2_VERSION.
421 2004-01-10 Jim Meyering <jim@meyering.net>
423 * tests/misc/stat-fmt: Use backticks, not `$()' notation.
425 2004-01-09 Jim Meyering <jim@meyering.net>
427 * configure.ac: Quote underquoted `jm_DUMMY_1' to avoid new warning.
429 2004-01-08 Jim Meyering <jim@meyering.net>
431 * src/stat.c (human_fstype): Use %lx, not %x format for `unsigned long'.
434 * tests/Makefile.am (TESTS_ENVIRONMENT): Remove `/vg' (prerelease test
435 remnant) from PATH component. That would cause tests in this directory
436 not to run the just-built binaries, but rather whatever happened
437 to be in one's PATH. Reported by Christian Krackowizer.
439 2004-01-04 Jim Meyering <jim@meyering.net>
441 * src/csplit.c (new_control_record): Use x2nrealloc
442 rather than xrealloc.
444 * src/cp.c (re_protect): Use ASSIGN_STRDUPA rather than
446 (make_path_private): Likewise.
448 2004-01-03 Jim Meyering <jim@meyering.net>
450 * src/paste.c: Use `bool' (not int) as the type for a few
452 (collapse_escapes): Rewrite to set globals rather than modifying
454 Use size_t (not int) for all counters and related index variables.
455 (paste_parallel): Remove needless complexity of
456 using xrealloc in the loop; just allocate the buffers up front.
457 Free the two temporary buffers.
458 Move declarations of locals `down' into scope where used.
459 (paste_serial): Remove `register' attributes.
460 (main): Simplify delim-related code.
461 Free `delims', now that it's malloc'd.
463 2004-01-02 Jim Meyering <jim@meyering.net>
465 * src/chroot.c: Include "quote.h".
466 (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): Define.
467 (main): Exit with status of 127, not 1, for too-few-args,
468 chroot failure, or chdir failure.
469 Give a better diagnostic upon execvp failure.
471 * src/du.c (usage): Mention that, with its current meaning,
474 * src/tail.c (main): Warn about following stdin when it's a tty.
475 Fail when following by name but no names are specified.
477 2003-12-30 Jim Meyering <jim@meyering.net>
479 * src/fold.c (main): Use memcpy, not strcpy.
481 * src/copy.c (copy_internal): Use ASSIGN_STRDUPA rather than
484 2003-12-28 Jim Meyering <jim@meyering.net>
486 * src/unexpand.c (n_tabs_allocated): New global.
487 (add_tabstop): Use x2nrealloc rather than xrealloc.
488 * src/expand.c: Likewise.
490 * tests/misc/expand: New file.
491 * tests/misc/Makefile.am (TESTS): Add expand.
493 * src/sort.c (add_temp_dir): Use x2nrealloc rather than xrealloc.
494 (fillbuf): Use x2nrealloc rather than xrealloc.
495 (sort): Use xnmalloc rather than xmalloc.
498 2003-12-27 Jim Meyering <jim@meyering.net>
500 * src/tee.c (tee): Use xnmalloc rather than xmalloc.
502 2003-12-29 Paul Eggert <eggert@twinsun.com>
504 * NEWS: Remove support for join -j1 FIELD, -j2 FIELD, and -o LIST1
505 LIST2 in POSIX 1003.1-2001 hosts, as required by POSIX.
507 * doc/coreutils.texi (join invocation): Remove documentation
508 accordingly. Document that -t makes all separators significant.
510 * src/join.c: Include posixver.h.
511 (obsolete_usage): New var.
512 (longopts): Put obsolete options first.
513 (OBSOLETE_LONG_OPTIONS): New constant.
514 (get_option, add_file_name): New functions.
515 (main): Use them to support new behavior.
516 (usage): Remove documentation for -j1 FIELD and -j2 FIELD.
517 Do not mark -j FIELD as obsolescent; it is longstanding
518 UNIX tradition and is a valid extension to POSIX.
520 * tests/join/Test.pm (tv): Avoid obsolete -o usage.
522 2003-12-28 Paul Eggert <eggert@twinsun.com>
524 * src/join.c (add_field_list): Don't use alloca with unbounded
525 size; just modify the argument, which is no longer const *.
527 Various other minor cleanups, mostly to avoid the need for casts.
529 (extract_field): Renamed from ADD_FIELD, as it's now a function.
531 (struct field.beg): Now char *, not unsigned char const *. All
532 uses changed. It shouldn't be const since xmemcoll writes on its
534 (extract_field): Likewise, for 2nd arg.
535 (keycmp): Remove now-unnecessary cast of xmemcoll args.
537 (is_blank): New function, to avoid need to cast arg to unsigned char.
538 (extract_field): Use it.
540 (xfields): Rewrite pretty much from scratch.
542 (hard_LC_COLLATE): Now bool, not int.
543 (get_line, getseq, add_field_list): Now returns bool, not int.
544 (decode_field_spec, add_field_list): Return true on success (not
545 false), for consistency with the rest of the code. All uses changed.
547 (tab): Now char, not unsigned char. This wasn't 100% necessary
548 but is slightly cleaner.
549 (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler.
551 (empty_filler): Now const *.
553 (make_blank): Remove; wasn't needed. Remove all calls.
554 (main): Don't set uni_blank.nfields; zero is fine.
556 2003-12-27 Jim Meyering <jim@meyering.net>
558 * src/join.c: Include "quote.h".
559 (min, max): Remove definitions.
560 Make a few function parameters and corresponding
561 locals `const'. Use bool for boolean variables.
562 Use size_t (not int) for all counters and related index variables.
563 (prjoin): Remove now-useless assertion.
564 (string_to_join_field): New function.
565 (main): Accept join fields as large as SIZE_MAX.
566 (keycmp): Rename `min' to MIN and max to MAX.
568 2003-12-26 Jim Meyering <jim@meyering.net>
570 fold -s didn't work on e.g., alpha-based systems.
571 * src/fold.c (fold_file): Adjust types (int->size_t) so that using
572 x2nrealloc works properly on systems with differing sizes for int
573 and size_t. Reported by Nelson Beebe.
575 * src/fold.c: Use `bool' (not int) as the type for a few
578 2003-12-23 Paul Eggert <eggert@twinsun.com>
580 * src/ls.c (length_of_file_names_and_frills):
581 Remove forward decl; not needed.
582 (print_file_name_and_frills, length_of_file_name_and_frills):
583 With -m, don't output spaces before inum or size.
584 (print_with_commas): Don't output space just before newline.
586 2003-12-24 Jim Meyering <jim@meyering.net>
588 * tests/ls/Makefile.am (TESTS): Add m-option.
589 * tests/ls/m-option: New file. Test for above fixes.
591 2003-12-20 Jim Meyering <jim@meyering.net>
595 * src/pr.c: Change type of global, buff_allocated, to size_t.
597 * src/join.c [struct seq]: Change types of members count and alloc
598 from `int' to `size_t'.
600 * tests/Makefile.am (root-hint): Tweak wording.
602 * src/du.c: Accept new option (-0, --null) that makes it so each
603 output line is NUL-terminated rather than newline-terminated.
605 * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync.
606 Reported by Volker Paul.
607 * tests/dd/Makefile.am (TESTS): Add unblock-sync.
608 * tests/dd/unblock-sync: New test for the above.
610 2003-12-19 Jim Meyering <jim@meyering.net>
612 * tests/misc/nohup: Double quote back-ticked expression,
613 in case it ends up having an unexpected value.
615 * tests/ls/no-arg: Use ls's -1 option in both runs.
617 * src/du.c (fts_debug): New global.
618 (FTS_CROSS_CHECK, DEBUG_OPT): Define.
619 (main): Make fts use FTS_TIGHT_CYCLE_CHECK.
620 (main) [DU_DEBUG]: Accept -d option.
622 2003-12-18 Jim Meyering <jim@meyering.net>
624 * src/ls.c (format_user): Increment dired_pos via two statements,
625 `dired_pos += width; dired_pos++;' rather than one,
626 `dired_pos += width + 1;' since the latter could conceivably overflow.
627 (format_group): Likewise.
630 * configure.ac: Require automake-1.8.
632 2003-12-12 Jim Meyering <jim@meyering.net>
634 * Use automake-1.8. Regenerate dependent files.
636 2003-12-08 Jim Meyering <jim@meyering.net>
638 * Makefile.maint (news-date-check): New rule.
639 (alpha beta major): Depend on it.
641 2003-12-03 Paul Eggert <eggert@twinsun.com>
643 * NEWS: ls -l (and similar options) now adjust all columns to
644 fit the data. Generalized from a suggestion by Leah Q for file sizes.
645 * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
646 (format_user_width, format_group_width, unsigned_file_size,
647 format_group): New functions.
648 (block_size_width): Renamed from block_size_size.
649 (inode_number_width, nlink_width, owner_width, group_width,
650 author_width, major_device_number_width, minor_device_number_width,
651 file_size_width): New vars.
652 (clear_files): Initialize them.
653 (gobble_file): Set them. Don't ceiling block_size_width to 7.
654 (print_long_file): Use them.
655 (gobble_file): Use a new local variable 'f' to make the code
656 smaller and more consistent with other functions.
657 (format_user): Output to stdout, not to a buffer, so that we
658 don't have to worry about buffer overrun. Update dired_pos.
659 (print_long_file): Don't put owner, group, author into buffer;
660 just print them directly. Don't assume link counts and
661 major and minor numbers fit into unsigned long int.
662 * tests/cp/same-file, tests/mv/part-symlink: Don't assume that
663 'ls' output is fixed-width.
665 2003-12-02 Jim Meyering <jim@meyering.net>
667 * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h.
669 2003-11-27 Jim Meyering <jim@meyering.net>
671 * Use automake-1.7f. Regenerate dependent files.
673 2003-11-24 Paul Eggert <eggert@twinsun.com>
675 Parse floating-point operands and options in the C locale.
676 POSIX requires this for printf, and we might as well be
677 consistent elsewhere (tail, sleep, seq).
679 * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer
680 needed now that we assume C89. Include "c-strtod.h".
681 (xstrtod): Call c_strtod, not strtod.
682 * src/sleep.c: Include "c-strtod.h".
683 (main): Update xstrtod call to include new argument, c_strtod.
684 * src/seq.c (scan_double_arg): Likewise.
685 * src/tail.c (parse_options): Likewise.
687 2003-11-24 Jim Meyering <jim@meyering.net>
689 * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM).
690 Reported by Mark Conty.
692 2003-11-22 Jim Meyering <jim@meyering.net>
694 * Makefile.maint (sc_xalloc_h_in_src): Remove rule. Subsumed by...
695 (sc_system_h_headers): Do this test only if sys2.h exists.
697 2003-11-20 Jim Meyering <jim@meyering.net>
699 * tests/help-version: Ensure that the bug-reporting address is
700 included in the --help output for every program.
701 * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.
703 * src/ptx.c (usage): Output bug-reporting address.
704 Reported by Dan Jacobson.
706 2003-11-19 Jim Meyering <jim@meyering.net>
708 * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted
709 on the join fields. Suggestion from Bruce Robertson.
711 2003-11-18 Jim Meyering <jim@meyering.net>
713 `od -c -w9999999' could segfault
714 * src/od.c (dump): Use xnmalloc/free, not alloca.
716 2003-11-16 Jim Meyering <jim@meyering.net>
718 * Use autoconf-2.59. Regenerate dependent files.
720 * tests/du/hard-link: Minor tweak: use mkdir -p.
722 Fix read-from-free'd-buffer error detected by valgrind.
723 * src/csplit.c (remove_line): Don't return a pointer to data in
724 a freed buffer. Instead, arrange to free the buffer on the
727 * tests/misc/csplit: New test for above fix.
729 2003-11-11 Jim Meyering <jim@meyering.net>
731 * src/ls.c (extract_dirs_from_files): Avoid useless copy operations.
732 This avoids a warning from valgrind about memcpy with overlapping
733 source and destination.
735 * configure.ac: Require automake-1.7.8.
737 2003-11-09 Jim Meyering <jim@meyering.net>
739 * Use automake-1.7.9. Regenerate dependent files.
741 * src/rm.c: Support new options: --preserve-root and --no-preserve-root.
742 * src/chown.c: Likewise.
744 * src/chown-core.c: Include "root-dev-ino.h".
745 (chopt_init): Initialize new member.
746 (change_file_owner): Support rm's new --preserve-root option.
748 * src/remove.c: Include "root-dev-ino.h".
749 (remove_cwd_entries): Remove now-obsolete FIXME comment.
750 (remove_dir): Support rm's new --preserve-root option.
752 * src/chown.c: Include "root-dev-ino.h".
753 Add new options: --preserve-root and --no-preserve-root.
755 * src/chmod.c: Include "root-dev-ino.h".
756 (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
757 ROOT_DEV_INO_WARN macros.
758 (get_root_dev_ino): Remove function definition, now that it's
759 been moved to a separate file.
760 (usage): Describe new options.
762 * src/mv.c (rm_option_init): Initialized new member.
764 * src/remove.h: Include "dev-ino.h".
765 (struct rm_options): Add new member: root_dev_ino.
766 * src/chown-core.h: Include "dev-ino.h".
767 (struct Chown_option): Add new member: root_dev_ino.
769 2003-11-06 Jim Meyering <jim@meyering.net>
771 * src/paste.c (paste_parallel): Use `sizeof *var' rather than
772 hard-coding `sizeof FILE*'.
774 2003-11-05 Dennis Smit <ds@nerds-incorporated.org>
776 * src/wc.c (main): Free `fstatus' so there is no confusion about
777 whether it's leaked or not.
778 * src/who.c (who): Likewise for `utmp_buf'.
780 2003-11-05 Paul Eggert <eggert@twinsun.com>
782 Fix 'cut' problems with size_t overflow and unsigned int.
783 More generally, resize integer variables to fit use more precisely.
784 * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens.
785 (struct range_pair): Make members to be of type size_t, not unsigned.
786 (max_range_endpoint, eol_range_start): Now size_t, not unsigned.
787 (suppress_non_delimited, output_delimiter_specified,
788 have_read_stdin, print_kth, set_fields): Now bool, nt int.
789 (delim): Now unsigned char, not int.
790 (mark_printable_field, is_printable_field, is_range_start_index,
791 set_fields, set_fields, cut_bytes, cut_fields):
792 Use size_t, not unsigned, for field and byte counts.
793 (hash_int): Use uintptr_t, not unsigned, for pointers converted
794 to integers. This squeezes more info out of them.
795 (set_fields, cut_bytes, cut_fields, main):
796 Use bool, not int, for booleans.
797 (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc.
799 2003-11-05 Paul Eggert <eggert@twinsun.com>
801 * man/Makefile.am (check-programs-vs-x):
802 Work even if $(programs) contains '$'.
803 Work even if 'missing=1' in environment.
804 Don't report an error simply because $(programs) outputs nothing.
806 2003-11-05 Jim Meyering <jim@meyering.net>
808 * Use autoconf-2.58. Regenerate dependent files.
810 * src/tr.c (spec_init): Fix typo in last change.
812 * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in
813 call to variadic version_etc function, so that it works even on systems
814 for which sizeof char* != sizeof int.
815 * src/true.c (main): Likewise.
816 * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c:
817 * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c:
818 * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c:
819 * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c:
820 Similarly, cast NULL to `(char *)' in call to variadic function,
821 parse_long_options, so that it works even on systems for which
822 sizeof char* != sizeof int.
823 A similar problem was reported by Harti Brandt in
824 http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html.
826 * src/users.c (users): Free `utmp_buf' explicitly so that people
827 don't mistake this for a real leak.
828 Patch by Dennis Smit <ds@nerds-incorporated.org.
830 2003-11-04 Paul Eggert <eggert@twinsun.com>
832 * README: Document _POSIX2_VERSION.
834 2003-11-04 Jim Meyering <jim@meyering.net>
836 * src/tac.c (memrchr): Remove #if-0'd function.
837 (tac_stdin_to_mem): Clean up #if-0'd code.
839 * src/od.c (decode_format_string): Remove unnecessary casts.
840 Use more maintainable `sizeof *var'.
841 (main): Call decode_format_string rather than decode_one_format,
842 now that `spec' may be NULL.
844 * src/chmod.c (AUTHORS): Add my name.
846 * src/split.c (next_file_name): Use `sizeof *var' rather than
847 hard-coding `sizeof size_t'.
849 * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...).
851 * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc,
852 to avoid potential overflow in pointer arithmetic.
853 (set_fields): Use not `1', but rather `sizeof *printable_field' as
854 second argument to xcalloc.
855 * src/od.c (decode_format_string, dump_strings): Use x2nrealloc
856 rather than xrealloc.
857 * src/date.c (show_date): Likewise.
858 * src/join.c (ADD_FIELD, initseq, getseq): Likewise.
859 * src/pr.c (store_char): Likewise.
860 * src/fold.c (fold_file): Likewise.
862 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
863 type changes (unsigned int -> size_t) in hash.c.
864 * src/cp-hash.c (src_to_dest_hash): Likewise.
865 * src/du.c (entry_hash): Likewise.
866 * src/ls.c (dev_ino_hash): Likewise.
867 * src/cut.c (hash_int): Likewise. Declare function as static.
869 2003-11-03 Jim Meyering <jim@meyering.net>
871 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
872 * tests/misc/fold: Fail the test immediately if we're not running
873 the expected version of fold.
875 2003-11-02 Jim Meyering <jim@meyering.net>
877 * src/tr.c (append_normal_char, append_range, append_char_class)
878 (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var'
879 rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable
881 * src/copy.c (copy_internal): Likewise.
882 * src/join.c (initseq, add_field, make_blank): Likewise.
883 * src/od.c (main): Likewise.
884 * src/cp.c (make_path_private): Likewise.
885 * src/tsort.c (new_item, record_relation): Likewise.
887 * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise.
888 (main): Also remove anachronistic cast of xmalloc return value.
889 * src/ptx.c (alloc_and_compile_regex, main): Likewise.
890 (main): Also remove anachronistic cast of xmalloc return value.
891 * src/sort.c (inittables): Likewise.
892 (sort): Also Split a long line.
894 2003-10-25 Jim Meyering <jim@meyering.net>
896 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
897 type changes (unsigned int -> size_t) in hash.c.
898 * src/cp-hash.c (src_to_dest_hash): Likewise.
899 * src/du.c (entry_hash): Likewise.
900 * src/ls.c (dev_ino_hash): Likewise.
901 * src/cut.c (hash_int): Likewise. Declare function as static.
903 2003-10-21 Jim Meyering <jim@meyering.net>
905 Don't fail when run with VERBOSE=yes.
906 * tests/chgrp/basic: Do `set +x' before starting the subshell
907 from which we invoke chgrp. Otherwise, the output from the
908 VERBOSE=yes-induced `set -x' would result in spurious differences.
909 Reported by Russel Coker via Michael Stone.
911 2003-10-19 Jim Meyering <jim@meyering.net>
913 chmod now uses fts to perform a directory traversal when -R is
914 specified. Before, it operated on full path names, and as such
915 would encounter the PATH_MAX (often 4096) limit.
917 * src/chmod.c: Include "xfts.h".
918 (process_file): Rename from change_file_mode.
919 Adapt to be used with fts.
920 (process_files): New function.
922 2003-10-18 Jim Meyering <jim@meyering.net>
924 * tests/du/deref-args: Ensure that du -D now dereferences all
925 symlinks specified on the command line, not just those that
926 reference directories.
928 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
929 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
930 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
931 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
932 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
933 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
934 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
935 * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
936 of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
937 Update the call to parse_long_options so that `AUTHORS, NULL' are the
939 * src/true.c (main): Append NULL to version_etc argument list.
940 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
942 2003-10-17 Andreas Schwab <schwab@suse.de>
944 * tests/mk-script: Get $srcdir from first parameter instead of
946 (main): Update usage.
948 * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as
949 first argument of mk-script.
950 ($(srcdir)/Makefile.am): Likewise. Prepend $(srcdir) to target.
952 2003-10-17 Jim Meyering <jim@meyering.net>
954 * src/mv.c (usage): Tweak descriptions of -i and -f so that the
955 generated `man' page is more readable. Suggestion from Dan Jacobson.
957 * src/chown-core.c (change_file_owner): Handle the cases in
958 which fts_info indicates an error with the given entry.
960 * src/du.c (main): Simply assign to bit_flags.
961 Don't bother with bit arithmetic.
963 * tests/chmod/no-x: New file.
964 * tests/chgrp/no-x: New file.
965 * tests/chmod/Makefile.am (TESTS): Add no-x.
966 * tests/chgrp/Makefile.am (TESTS): Likewise.
968 * src/du.c: Include "xfts.h".
969 (du_files): Use xfts_open, rather than fts_open.
970 * src/chown-core.c (chown_files): Likewise.
972 2003-10-16 Jim Meyering <jim@meyering.net>
974 * src/chgrp.c (main): Simply assign to bit_flags.
975 Don't bother with bit arithmetic.
976 * src/chown.c (main): Likewise.
977 Rename a couple of local variables.
978 Remove unnecessary casts.
980 * src/tail.c (start_bytes): Rename local, remainder, to avoid
981 gcc's warning about shadowing a global.
983 2003-10-15 Jim Meyering <jim@meyering.net>
985 chown and chgrp now accept POSIX-mandated -H, -L, -P options and
986 use fts to perform a directory traversal when -R is specified.
987 Before, they operated on full path names, and as such would
988 encounter the PATH_MAX (often 4096) limit.
989 They are more efficient. For example, before, chgrp -R would
990 take almost 5 seconds to change about 2000 directories and fail
991 (with `File name too long'), while now it succeeds on a hierarchy
992 of depth 20,000 in 1/10 the time.
994 * src/chown.c: Include "userspec.h" and "fts_.h".
995 (WRITTEN_BY): Add my name.
996 (getpwnam, getgrnam, getgrgid): Remove declarations.
997 (endpwent): Remove definition.
999 (main): Handle new options.
1000 Call new function, chown_files rather than change_file_owner.
1002 * src/chgrp.c: Include "fts_.h".
1003 (WRITTEN_BY): Add my name.
1004 (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of
1007 (main): Handle new options.
1008 Call new function, chown_files rather than change_file_owner.
1010 Rewrite to iterate through hierarchies using fts rather than
1011 via explicit recursion.
1012 * src/chown-core.c: Include "fts_.h"
1013 (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
1014 on a single file at a time.
1015 (chown_files): New function.
1016 * src/chown-core.h [enum Dereference_symlink]: Remove declaration.
1017 [struct Chown_option] (recurse, force_silent): Change type to `bool'.
1018 [struct Chown_option] (dereference): Remove member with ambiguous name.
1019 [struct Chown_option] (affect_symlink_referent): New member.
1020 (chown_files): New prototype.
1022 * tests/chgrp/recurse: Update tests accordingly.
1023 * tests/chgrp/posix-H: New tests for the above.
1024 * tests/chgrp/Makefile.am (TESTS): Add posix-H.
1026 * src/ln.c (usage): Clarify that --directory, -d, -F probably won't
1027 work even for superuser. Suggestion from Dan Jacobson.
1029 2003-10-14 Paul Eggert <eggert@twinsun.com>
1031 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
1033 * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h,
1034 lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib.
1035 * src/sort.c (parse_field_count): Handle the case where overflow
1036 and invalid suffix char are both reported.
1038 2003-10-14 Jim Meyering <jim@meyering.net>
1040 * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the
1041 warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
1044 2003-10-13 Paul Eggert <eggert@twinsun.com>
1046 Fix to avoid a denial-of-service attack if the display width is
1047 enormous. Also, clean up the code a bit by removing duplicate code.
1049 * src/ls.c (init_column_info): Remove forward decl; no longer needed.
1050 (calculate_columns): New function, that contains code that used
1051 to be common to print_many_per_line and print_horizontal.
1052 (print_many_per_line, print_horizontal): Use it.
1053 (decode_switches): Set max_idx here, not in calculate_columns.
1054 (print_current_files): Don't call init_column_info; calculate_columns
1056 (init_column_info): Don't allocate a lot more space than is needed
1057 to represent the current set of files. Allocate all the new
1058 size_t cells in one call to xnmalloc, rather than a row at a time.
1060 2003-10-13 Jim Meyering <jim@meyering.net>
1062 * src/ls.c (init_column_info): Add another FIXME comment.
1064 2003-10-13 Paul Eggert <eggert@twinsun.com>
1066 Fix address-arithmetic bug in 'ls', reported by Georgi Guninski.
1067 Remove several arbitrary limits on hosts where int cannot represent
1070 * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent,
1071 nfiles, files_index, tabsize, line_length, struct column_info.line_len,
1072 struct column_info.col_arr[0], max_idx):
1073 Now size_t, not int.
1074 (get_funky_string): Return bool indicating success, instead of
1075 a negative count to indicate failure. Store number of columns
1076 through new parameter OUTPUT_COUNT; that way, they can never
1077 go negative. Change equals_end from int to bool. All uses
1079 (struct column_info.valid_len): Now bool, not int. All uses changed.
1080 (dired_dump_obstack, get_funky_string, clear_files,
1081 extract_dirs_from_files, print_current_files,
1082 print_many_per_line, print_horizontal, init_column_info,
1083 put_indicator, length_of_file_name_and_frills,
1084 print_with_commas): Use size_t, not int, for local variables
1086 (decode_switches): Decode sizes using xstrtoul, not xstrtol.
1087 Check for TIOCGWINSZ returing negative values (or values greater
1089 (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
1091 Use xmalloc and xnmalloc, not XMALLOC.
1092 (gobble_file): Use xnrealloc, not XREALLOC.
1093 (print_color_indicator): Remove now-unnecessary cast to size_t.
1095 2003-10-12 Paul Eggert <eggert@twinsun.com>
1097 * tests/du/no-x: Change wording of diagnostic to match latest du.c.
1098 * tests/sort/sort-tests: Remove from CVS; assume that people
1099 brave enough to check coreutils out from CVS can rebuild it.
1101 2003-10-12 Jim Meyering <jim@meyering.net>
1103 New options: --preserve-root and --no-preserve-root.
1104 * src/chmod.c (change_file_mode): Honor new option.
1105 (change_file_mode): Strip trailing slashes on directory
1106 argument passed to change_dir_mode.
1107 (get_root_dev_ino): New function.
1108 (main): Initialize global, root_dev_ino.
1110 * src/copy.c (copy_internal): Don't #ifdef-out simple uses of
1111 S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined
1113 * src/chmod.c (change_file_mode): Likewise.
1115 2003-10-08 Jim Meyering <jim@meyering.net>
1117 * src/csplit.c (main): Remove obsolete FIXME.
1119 2003-10-07 Jim Meyering <jim@meyering.net>
1121 * Use automake-1.7.8. Regenerate dependent files.
1123 2003-09-29 Paul Eggert <eggert@twinsun.com>
1127 * doc/coreutils.texi (csplit invocation):
1128 The regexp offset need not have a sign; POSIX requires support
1129 for signless offets.
1131 Be more careful about int widths. For example, remove some
1132 arbitrary limits by replacing 'unsigned' with 'size_t',
1133 'uintmax_t', etc. Use standard bool rather than a homegrown type.
1134 * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
1135 * src/csplit.c (FALSE, TRUE, boolean): Remove. All uses changed
1136 to <stdbool.h> usage.
1137 (struct control): offset is now intmax_t, not int.
1138 repeat_forever is now bool, not int.
1139 (struct cstring): len is now size_t, not unsigned int.
1140 (struct buffer_record): bytes_alloc, bytes_used, num_lines are now
1141 size_t, not unsigned. start_line, first_available are now
1142 uintmax_t, not unsigned.
1143 (hold_count, control_used): Now size_t, not unsigned.
1144 (last_line_number, current_line, bytes_written):
1145 Now uintmax_t, not unsigned.
1146 (save_to_hold_area, red_input, keep_new_line, record_line_starts,
1147 create_new_buffer, get_new_buffer, load_buffer, find_line,
1148 process_regexp, split_file, new_control_record, extract_regexp,
1149 get_format_width, get_format_prec, max_out):
1150 size args, locals, and returned values are now size_t, not unsigned
1152 (get_first_line_in_buffer, find_line, write_to_file,
1153 handle_line_error, process_line_count, regexp_error, process_regexp,
1155 File line, byte, and repetition counts are now uintmax_t, not unsigned.
1156 (check_for_offset): Don't require a sign before the offset.
1157 Use xstrtoimax to do the real work.
1158 (extract_regexp): Remove harmful cast of size to unsigned.
1159 256 -> 1<<CHAR_BIT, for clarity.
1160 (get_format_flags): Return at most 3, to avoid worries about overflow.
1162 (bytes_to_octal_digits): Remove.
1164 (cleanup): Don't check whether output_stream is NULL, since
1165 close_output_file does that for us.
1167 (new_line_control, create_new_buffer): Use "foo *p = xmalloc
1168 (sizeof *p);" instead of the more long-winded alternatives.
1170 (get_new_buffer): Use O(1) algorithm for resizing a buffer
1171 to a much larger size, instead of an O(N) algorithm.
1173 (process_regexp): Use plain NULL rather than casted 0.
1175 (make_filename): Use %u, not %d, to format unsigned file number.
1177 (new_control_record): Use xrealloc exclusively, since it handles
1180 (extract_regexp): Change misspelled word in diagnostic.
1182 (get_format_width): Even if a minimum field width is specified,
1183 allow room for enough octal digits to represent the value of
1184 the maximum representible integer. This fixes a potential
1185 buffer overrun. Calculate this room at compile-time, not
1186 at run-time; this removes the need for bytes_to_octal_digits.
1187 Check for overflow; this removes a FIXME.
1189 (get_format_prec): Don't allow precision to be signed; it's
1190 not ANSI. Check for overflow. Remove hardcoded "11" as
1191 default precision; this fixes a potential buffer overrun
1192 on hosts with wider size_t.
1194 (get_format_conv_type): Change local variable to be of type
1195 unsigned char, not int; this removes a potential subscript
1196 violation on hosts where char is signed.
1198 (max_out): Replace "for (;*p;)" with more-standard "while (*p)".
1199 Allow "%%" in format. Don't overflow when
1200 counting lots of percents.
1202 (usage): Default sprintf format is %02u, not %d.
1204 2003-10-05 Jim Meyering <jim@meyering.net>
1206 * src/chown-core.c (change_file_owner): Remove set-but-not-used local.
1208 * src/du.c (du_files): Mark diagnostic for translation.
1210 2003-10-04 Jim Meyering <jim@meyering.net>
1212 * src/du.c (du_files): Ignore any failure of fts_close.
1213 Give better diagnostics for failed fts_open.
1215 * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition.
1217 Deprecate existing use of -H (aka --si).
1218 * src/du.c (enum) [HUMAN_SI_OPTION]: New member.
1219 [long_options]: Use HUMAN_SI_OPTION, not 'H'.
1220 (main): Warn that the meaning of -H will soon change to be
1223 2003-10-03 Jim Meyering <jim@meyering.net>
1225 * src/du.c: Accept --no-dereference (-P).
1227 2003-10-02 Jim Meyering <jim@meyering.net>
1229 * tests/du/trailing-slash: Adjust for slightly different output.
1231 Rewrite du.c to use fts.
1232 * src/du.c: Include "fts_.h", not ftw.h.
1233 (opt_dereference_arguments, arg_length, suffix_length): Remove globals.
1234 (IS_FTW_DIR_TYPE): Remove definition.
1235 (IS_DIR_TYPE): Define.
1236 (is_symlink_to_dir): Remove now-unnecessary function.
1237 (process_file, du_files): Rewrite to use fts.
1239 * tests/du/inaccessible-cwd: Ensure that even when run from an
1240 inaccessible directory, du can still operate on accessible
1241 directories elsewhere.
1242 * tests/du/Makefile.am (TESTS): Add inaccessible-cwd.
1244 * tests/rm/deep-1: Ensure that du can process a hierarchy
1245 of depth 400 while using no more than 50KB of stack space.
1247 2003-10-01 Akim Demaille <akim@epita.fr>
1249 * announce-gen (print_news_deltas): New function, extracted from main.
1250 (main): Make `news_file' an array.
1251 Use '...=s' => \@var for --news and --url-directory specs.
1252 Before there were a couple of portability problems.
1254 2003-09-28 Jim Meyering <jim@meyering.net>
1256 * Makefile.maint (sc_cast_of_alloca_return_value): New rule.
1257 (syntax-check-rules): Add it.
1259 * src/copy.c: Remove unnecessary cast of alloca, since now it's
1260 guaranteed to be (void *).
1261 * src/cp.c: Likewise.
1262 * src/join.c: Likewise.
1263 * src/ln.c: Likewise.
1264 * src/ls.c: Likewise.
1265 * src/od.c: Likewise.
1266 * src/sys2.h (ASSIGN_STRDUPA): Likewise.
1268 2003-09-27 Jim Meyering <jim@meyering.net>
1270 Don't exhaust virtual memory when processing large inputs.
1271 Fix this by removing csplit's internal free-list management;
1272 instead rely on malloc for that.
1274 * src/csplit.c (free_list): Remove global.
1275 (clear_all_line_control): Remove function.
1276 (get_new_buffer): Always use create_new_buffer to obtain a
1277 new buffer, rather than searching free_list.
1278 (free_buffer): Just call free.
1279 Reported by Nikola Milutinovic.
1281 2003-09-26 Jim Meyering <jim@meyering.net>
1283 * man/rm.x: Also list `chattr' in SEE ALSO section.
1284 Suggestion from Mark Hubbart.
1286 2003-09-25 Jim Meyering <jim@meyering.net>
1288 * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now
1289 that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them.
1291 * Use autoconf-2.57d. Regenerate dependent files.
1293 2003-09-24 Jim Meyering <jim@meyering.net>
1295 Minor efficiency tweak.
1296 * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
1297 (do_link): Likewise.
1299 2003-09-23 Jim Meyering <jim@meyering.net>
1301 * src/paste.c (paste_serial): Save errno after input error,
1302 to report proper errno value.
1303 Based on a patch from Paul Eggert.
1305 * src/tee.c (tee): Adjust fwrite arguments so that the return
1306 value is the number of bytes written.
1308 2003-09-16 Paul Eggert <eggert@twinsun.com>
1310 Don't assume ferror sets errno. Bug reported by Bruno Haible.
1312 * src/comm.c (compare_files): Save errno after input error,
1313 to report proper errno value.
1314 * src/fold.c (fold_file): Likewise.
1315 * src/od.c (check_and_close, skip, read_char, read_block): Likewise.
1316 * src/unexpand.c (unexpand): Likewise.
1318 * src/csplit.c (close_output_file): Don't report bogus errno value
1319 after ferror discovers an output error. We don't know the proper
1320 errno value, since it might have been caused by any of a whole
1321 bunch of calls, and it might have been trashed in the meantime.
1322 Fixing this problem will require much more extensive changes;
1323 in the meantime just say "write error".
1324 * src/od.c (check_and_close, dump, dump_strings): Likewise.
1325 * src/uniq.c (check_file): Likewise.
1327 * src/join.c (get_line): Report error right away if I/O fails,
1328 so that the proper errno value is used.
1329 * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise.
1330 * src/tee.c (tee): Likewise.
1331 * src/uniq.c (check_file): Likewise.
1333 * src/od.c (skip): If a read fails, don't retry it later, so
1334 that we report the proper errno.
1336 * src/tac.c (tac_mem): Don't return a value; nobody uses it.
1338 * src/tee.c (tee): Once a write failure has occurred, don't bother
1339 writing anything more to that stream.
1341 * src/uniq.c (check_file): Check for ferror (stdout) even if
1344 * src/yes.c (UNROLL): Remove.
1345 (main): Exit immediately when write failure is detected.
1346 Simplify code by assigning to argv when argc == 1.
1348 2003-09-21 Paul Eggert <eggert@twinsun.com>
1350 * src/ptx.c: Switch encoding from Latin-1 to UTF-8.
1351 (WRITTEN_BY): Change "Franc,ois" (actually using
1352 c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
1355 2003-09-19 Jim Meyering <jim@meyering.net>
1357 `du -D symlink-to-dir' would mistakenly omit the slash in
1358 lines like this: 24 symlink-to-dir/subdir
1359 * src/du.c (process_file): Fix offset calculation.
1360 Reported by Jeff Sheinberg as Debian bug #211591;
1361 http://bugs.debian.org/205251
1363 * tests/du/deref-args: New file/test for the above.
1364 * tests/du/Makefile.am (TESTS): Add deref-args.
1366 * src/du.c (process_file): Remove useless disjunct.
1368 * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
1370 * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
1371 Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
1372 Mark each WRITTEN_BY string as translatable.
1374 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1375 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1376 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1377 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1378 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1379 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1380 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1381 * who.c, whoami.c, yes.c: Revert yesterday's changes.
1382 Instead, a subsequent change will embed `Written by ' in
1383 each string along with the author names.
1385 * src/true.c: Revert yesterday's changes.
1386 * src/sys2.h: Likewise.
1388 2003-09-18 Jim Meyering <jim@meyering.net>
1390 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1391 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1392 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1393 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1394 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1395 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1396 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1397 * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
1398 comma-separated list of strings and/or update the call to
1399 parse_long_options so that `AUTHORS, NULL' are the last parameters.
1400 * src/true.c (main): Append NULL to version_etc argument list.
1401 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
1403 * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
1404 shadowing the math function name. Also rename loga to log_a.
1406 2003-09-14 Jim Meyering <jim@meyering.net>
1408 * src/factor.c (print_factors): Give a separate diagnostic
1409 for numbers that are too large, but otherwise valid.
1410 Reported by Dániel Varga.
1412 2003-09-10 Jim Meyering <jim@meyering.net>
1414 * Use automake-1.7.7. Regenerate dependent files.
1416 * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
1417 of `fmt -1'. Using the just-built tr is a little cleaner.
1418 Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
1419 * man/Makefile.am (programs, check-x-vs-1): Likewise.
1421 2003-09-09 Jim Meyering <jim@meyering.net>
1423 * src/copy.c: Alphabetize includes.
1424 Remove duplicate inclusion of "same.h".
1426 2003-09-08 Jim Meyering <jim@meyering.net>
1428 * Makefile.maint (GZIP_ENV): Remove --rsyncable.
1429 Didn't give enough of a benefit, mainly because it's not yet
1434 * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
1435 (check-programs-vs-x): Fail if $(programs) is empty.
1437 * src/remove.c: Add a comment.
1439 2003-09-07 Jim Meyering <jim@meyering.net>
1441 * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
1442 Don't define. These symbols are no longer used.
1444 * tests/misc/tty-eof: Write ^D as \cD.
1445 Complete the change of 2003-08-02.
1447 * Makefile.maint (po-check): Use cvsu, so that a temporary source
1448 file in lib/ or src/ doesn't induce an unwarranted failure.
1449 Add a kludge to filter out the sole generated source file that
1450 also has translatable messages: src/false.c.
1452 2003-09-06 Jim Meyering <jim@meyering.net>
1454 * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
1455 (parse_options): Give a diagnostic for (but still accept) the
1456 deprecated --allow-missing option.
1458 2003-09-04 Paul Eggert <eggert@twinsun.com>
1460 Don't ignore -S if input is a pipe. Bug report by Michael McFarland in
1461 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
1463 * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the
1464 size_bound ourselves. if an input file is a pipe and the user
1465 specified a size, use that size instead of trying to guess the
1466 pipe size. This has the beneficial side effect of avoiding the
1467 overhead of default_sort_size in that case. All callers changed.
1468 (sort): Remove static var size; now done by sort_buffer_size.
1470 2003-09-05 Jim Meyering <jim@meyering.net>
1472 * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files.
1474 * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
1475 to start, rather than just .1. Upon failure, print unexpected state.
1477 2003-09-04 Paul Eggert <eggert@twinsun.com>
1479 * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
1480 SAFE_READ_ERROR to tmp->nbytes.
1481 * src/tail.c (pipe_lines, pipe_bytes): Likewise.
1483 * src/head.c (struct linebuffer): Change nbytes and nlines
1484 from unsigned int to size_t. unsigned int is safe (after the
1485 2003-09-03 patch) but size_t is cleaner.
1486 * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
1487 (pipe_bytes): Likewise for local variable 'i', which was 'int'.
1489 Standardize on BUFSIZ as opposed to other macro names and values.
1490 * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ.
1491 * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
1492 stdio.h has always defined it,
1493 and other code already assumes it's defined.
1494 * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
1495 (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
1496 (io_buf): IO_BUF_SIZE -> BUFSIZ.
1498 2003-09-04 Paul Eggert <eggert@twinsun.com>
1500 * src/seq.c (step): Default to 1.
1501 (print_numbers): Allow the output to be empty.
1502 (main): The default step is 1, even if LAST < FIRST;
1503 as per documentation.
1504 * tests/seq/basic (onearg-2): Output should be empty.
1506 2003-09-05 Jim Meyering <jim@meyering.net>
1508 * Makefile.cfg (wget_files): Temporarily disable, until master
1509 versions are restored to ftp.gnu.org.
1511 * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
1513 Make seq's --width (-w) option work properly even when the
1514 endpoint requiring the larger width is negative and smaller than
1516 * src/seq.c (get_width_format): Include `-' in the set of bytes
1517 allowed in a `simple' number (no decimal point, no exponent).
1518 Reported by Patrick Mauritz.
1520 2003-09-02 Paul Eggert <eggert@twinsun.com>
1522 * NEWS: sort -t '\0' now uses a NUL tab.
1523 sort option order no longer matters, unless POSIX requires it.
1524 * src/sort.c (usage): Say "blanks" instead of "whitespace",
1525 Similar fixes for many comments.
1526 (TAB_DEFAULT): New constant, so that we can support NUL as
1527 the field separator.
1528 (tab): Now int, not char. Initialize to TAB_DEFAULT.
1529 (specify_sort_size): If multiple sizes are specified, use the largest.
1530 (begfield, limfield): Support NUL tab char.
1531 (set_ordering): Do not let -i override -d.
1532 (main): Report an error if incompatible -o or -t options are given.
1533 Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
1535 2003-09-05 Jim Meyering <jim@meyering.net>
1537 * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
1539 2003-09-03 Andreas Schwab <schwab@suse.de>
1541 Bug report and patch here:
1542 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
1543 * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
1544 * src/head.c (elide_tail_lines_pipe): Likewise.
1546 2003-09-03 Jim Meyering <jim@meyering.net>
1548 * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
1549 small amount of code from him was first moved to lib/human.c, and was
1550 subsequently rewritten entirely.
1551 * src/df.c (AUTHORS): Likewise.
1553 2003-08-22 Lawrence Teo <lcteo@uncc.edu>
1555 * src/md5sum.c (split_3): Accept the BSD format for generic
1556 message digest modes. Currently works with BSD's MD5 and SHA1
1557 formats since these are the two algorithms presently used in
1558 coreutils. Updated comments to reflect this change.
1559 (bsd_split_3): Updated comments.
1561 * tests/md5sum/basic-1: New test to make sure that
1562 `md5sum --check' doesn't accept the BSD SHA1 format (adapted
1563 from `check-bsd' test in tests/sha1sum/basic-1).
1565 * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
1566 --check exit status and BSD SHA1 format (adapted from tests
1567 in tests/md5sum/basic-1).
1569 2003-08-30 Jim Meyering <jim@meyering.net>
1571 * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
1573 When source and destination arguments refer to the same file, reside
1574 on a partition (e.g. VFAT) on which distinct names may refer to the
1575 same directory entry (often due to variations in case), and when the
1576 link count for the file is 1, mv no longer unlinks the file. Instead,
1577 it gives the expected diagnostic that the source and destination are
1578 the same. WARNING: this is an incomplete fix. If the file happens
1579 to have a link count of 2 or greater, such an erroneous mv command
1580 will still unlink it.
1581 Although that is not possible on vfat or umsdos, it is possible on
1582 other file system types, e.g., ntfs, and hpfs.
1583 * src/copy.c (same_file_ok): Invoke same_name (which might still
1584 return false for names that refer to the same directory entry)
1585 only if the link count is 2 or more.
1586 * tests/mv/vfat: Show how to demonstrate the above problem.
1587 This test is not run.
1588 * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
1590 2003-08-27 Jim Meyering <jim@meyering.net>
1592 * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
1593 who's -l option has been eliciting an unconditional warning about
1594 this impending change since sh-utils-2.0.12 (April 2002).
1596 * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
1597 This would happen for nonempty files not ending with a newline.
1598 Reported by Dan Jacobson.
1599 * tests/misc/paste-no-nl: New file. Test for above-fixed bug.
1600 * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
1602 * src/stat.c (print_it): Avoid buffer overrun that would
1603 occur when the user-specified format string ends with `%'.
1604 Patch by Tommi Kyntola.
1605 * tests/misc/stat-fmt: New file. Test for above-fixed bug.
1606 * tests/misc/Makefile.am (TESTS): Add stat-fmt.
1608 2003-08-26 Jim Meyering <jim@meyering.net>
1610 Apply changes from bison.
1611 * GNUmakefile (SHELL): Define to `sh', if necessary.
1613 * Makefile.maint (WGETFLAGS): Define to `-C off'.
1614 Update all uses of $(WGET).
1616 2003-08-22 Akim Demaille <akim@epita.fr>
1618 * Makefile.cfg (local-checks-to-skip): New.
1619 * Makefile.maint (local-check): Rename as...
1620 (local-checks-available): this.
1623 2003-08-26 Akim Demaille <akim@epita.fr>
1625 * announce-gen (print_changelog_deltas): Neutralize "<#" as
1626 "<\#" to avoid magic from Gnus when posting parts of this script.
1628 2003-08-25 Jim Meyering <jim@meyering.net>
1630 * src/stat.c (main): Warn about use of deprecated `-l' option.
1632 2003-08-22 Jim Meyering <jim@meyering.net>
1634 * src/stat.c (do_stat): For link count at end of line, use %h format,
1635 instead of %-5h. The latter would make stat emit trailing spaces.
1636 Reported by Dan Jacobson.
1638 2003-08-20 Jim Meyering <jim@meyering.net>
1640 * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
1642 2003-08-19 Jim Meyering <jim@meyering.net>
1644 * src/system.h: Include stdlib.h unconditionally,
1645 as we're now assuming that part of hosted C89.
1647 2003-08-18 Jim Meyering <jim@meyering.net>
1649 * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
1650 to avoid warnings from gcc.
1652 2003-08-17 Jim Meyering <jim@meyering.net>
1654 Avoid unnecessary and sometimes time-consuming hostname lookups.
1655 * src/who.c (print_user): Use strchr, not strrchr.
1656 * src/pinky.c (print_entry): Likewise.
1657 Patch by Michael Stone.
1658 This fixes a typo I introduced in who-users.c on 1996-02-23.
1660 * Makefile.maint (makefile-check): Add 0-9 to the range of characters
1661 disallowed between `@...@'.
1663 2003-08-16 Paul Eggert <eggert@twinsun.com>
1665 * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
1666 done by gnulib .m4 files.
1667 (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
1668 * src/sys2.h (strtoull): Remove unused declaration.
1670 2003-08-16 Jim Meyering <jim@meyering.net>
1672 * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
1675 * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
1676 race condition bug. The bug would be triggered when tailing a file
1677 with file pointer not at beginning of file, and where the file was
1678 truncated to have a length of less than the initial offset at just
1679 the right moment (between the two lseek calls in this function).
1681 An invalid initial value for *read_pos would result in
1682 `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
1683 busy-wait rather than sleeping between iterations. The bug manifests
1684 itself only when tailing regular files that are initially nonempty.
1685 * src/tail.c (tail_bytes): Set *read_pos to new file offset after
1687 (tail_lines): Likewise, after lseek calls.
1688 Reported by Nick Estes. See http://bugs.debian.org/205251 for details.
1689 * tests/tail-2/tail-n0f: New file. Test for above fix.
1690 * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
1692 2003-08-15 Jim Meyering <jim@meyering.net>
1694 * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
1695 (sc_sun_os_names): Likewise.
1696 * .x-sc_space_tab, .x-sc_sun_os_names: New files.
1698 * man/help2man: Remove some SPACEs before TAB.
1700 2003-08-14 Paul Eggert <eggert@twinsun.com>
1702 * Makefile.maint (LC_ALL): Set to C.
1703 * man/Makefile.am (ASSORT): New var.
1704 (check-x-vs-1, programs): Use it.
1705 * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
1706 * tests/Makefile.am (ASSORT, all_programs): Likewise.
1708 2003-08-11 Jim Meyering <jim@meyering.net>
1710 fold -s -wN would infloop for N < 8 with TABs in the input.
1711 E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
1712 * src/fold.c (fold_file): Move contents of `else'-block
1713 out of conditional so it's used also for --spaces (-s).
1714 * tests/misc/fold: Test for the above fix.
1715 * tests/misc/Makefile.am (TESTS): Add fold.
1717 2003-08-10 Jim Meyering <jim@meyering.net>
1719 * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
1720 system.h so the types from time.h and sys/time.h are available.
1721 It appears that this is necessary for OpenBSD, NetBSD, and
1722 Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
1724 2003-08-06 Paul Eggert <eggert@twinsun.com>
1726 * NEWS: Add support for setting file timestamps to microsecond
1727 resolution, on hosts that support this.
1728 * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
1729 * src/copy.c (copy_internal):
1730 Set file timestamps with utimens, not utime.
1731 * src/cp.c (re_protect): Likewise.
1732 * src/install.c (change_timestamps): Likewise.
1733 * src/touch.c (newtime, touch, main): Likewise.
1735 2003-08-09 Jim Meyering <jim@meyering.net>
1737 * Makefile.maint (sc_sun_os_names): New rule based on a regexp
1739 (syntax-check-rules): Add it.
1741 * src/tail.c (main): Tweak Solaris OS version number in comment.
1742 * src/wc.c (wc): Likewise
1743 * tests/tail-2/fflush: Likewise.
1745 * src/tail.c: Add new undocumented option, --presume-input-pipe.
1746 (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
1748 2003-08-08 Paul Eggert <eggert@twinsun.com>
1750 Use new gnulib 'extensions' module.
1751 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
1754 2003-08-08 Paul Eggert <eggert@twinsun.com>
1756 * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
1758 2003-08-09 Jim Meyering <jim@meyering.net>
1760 * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
1761 For tests of obsolete behavior, don't presume that unsetting
1762 _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
1764 2003-08-07 Paul Eggert <eggert@twinsun.com>
1766 * doc/coreutils.texi (split invocation):
1767 Add -d or --numeric-suffixes option to 'split'.
1768 From a suggestion by Jesse Kornblum.
1769 * src/split.c (suffix_alphabet): New var.
1770 (longopts, usage, next_file_name, main): Support -d.
1771 (next_file_name, main): Allow -a0, as POSIX requires.
1772 (next_file_name): Don't assume ASCII-like encoding;
1773 'a' through 'z' are not contiguous in EBCDIC.
1775 2003-08-05 Paul Eggert <eggert@twinsun.com>
1777 Merge getline from gnulib.
1778 * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
1779 * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
1780 New files, from gnulib.
1781 * lib/getdelim2.c, lib/getdelim2.h: Remove.
1782 * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
1783 getdelim2.h to getndelim2.c and getndelim2.h.
1784 * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
1785 checking for getdelim.
1786 (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
1787 than rolling our own.
1788 * src/cut.c: Include getndelim2.h rather than getdelim2.h.
1789 (cut_fields): Invoke getndelim2 rather than getdelim2.
1791 2003-08-04 Jim Meyering <jim@meyering.net>
1793 * src/sort.c (main): Use unsigned int instead of int for `nsigs'
1794 and for the indices to iterate through nsigs.
1796 2003-08-02 Paul Eggert <eggert@twinsun.com>
1798 * src/sort.c: Minor code cleanups, mostly to use more accurate
1799 types and to remove unnecessary casts.
1800 (min, max): Remove. All uses changed to MIN and MAX.
1801 (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
1802 keyfield.skipsblanks, struct keyfield.skipeblanks, struct
1803 keyfield.numeric, struct keyfield.general_numeric, struct
1804 keyfield.month, struct keyfield.reverse, reverse, unique,
1805 have_read_stdin): Now bool, not int. All uses changed.
1806 (eolchar): Now char, not int.
1807 (struct keyfield.ignore): Now bool const *, not int *.
1808 (struct keyfield.translate): Now char const *, not char *.
1809 (struct month.name): Likewise.
1810 (blanks, nonprinting, nondictionary): Now bool[], not int[].
1811 (cleanup, inittables, keycompare, check, mergefps, first_same_file,
1812 check, sort, main): Use const * pointers when possible.
1813 (month_cmp): Rewrite to avoid casts.
1814 (inittables): Initialize tables unconditionally, to avoid branches.
1815 (fillbuf): Return bool, not int. All uses changed.
1816 (fillbuf, keycompare, new_key, main):
1817 Use SIZE_MAX rather than (size_t) -1.
1818 (trailing_blanks): Renamed from trim_trailing_blanks.
1819 Return the number of blanks to trim. All uses changed.
1820 (getmonth): Use trailing_blanks rather than open code.
1821 (keycompare): Do not cast char * to unsigned char *; not needed.
1822 CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
1824 (compare, main): Use | rather than || to avoid jumps.
1825 Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
1827 (check, first_same_file, sort, main):
1828 Use bool instead of int local vars when possible.
1829 (check): Merge the old 'checkfp' and 'check' into a single function,
1830 that returns a boolean (true if the file was ordered).
1832 (main): Use int instead of unsigned for iterating through nsigs.
1833 Rename local var "posix_pedantic" to "posixly_correct".
1835 2003-08-02 Jim Meyering <jim@meyering.net>
1837 * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
1838 to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
1840 * src/cut.c (cut_fields): Don't read again after encountering an
1841 initial EOF. E.g., `cut -f2' would do so.
1842 * tests/misc/tty-eof: Add a test for the above fix.
1844 * src/sort.c (sortlines): Add description and references.
1847 * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
1848 the tests in help-version will use the just-built binaries.
1849 Reported by Christian Krackowizer.
1851 2003-07-31 Paul Eggert <eggert@twinsun.com>
1853 * NEWS: Add --rfc-2822 option to GNU date.
1854 * doc/coreutils.texi (Time directives, Options for date, Examples
1856 * src/date.c (long_options, usage, main): Likewise.
1857 * doc/getdate.texi (General date syntax): Likewise.
1858 * doc/coreutils.texi (Options for date): Fix a typo in format:
1859 it's now %d not %_d. Add URLs.
1861 2003-08-01 Jim Meyering <jim@meyering.net>
1863 * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
1864 Otherwise, with at least the /bin/sh from HPUX 10.20,
1865 the trap code would end up converting that to exit 1 and thus an
1866 unexpected test failure. Reported by Christian Krackowizer.
1868 2003-07-31 Paul Eggert <eggert@twinsun.com>
1870 * src/ptx.c: Do not include bumpalloc.h.
1871 (WORD_TABLE): New member alloc.
1872 (ALLOC_NEW_WORD): Remove.
1873 (occurs_alloc): New var.
1874 (digest_word_file, find_occurs_in_text): Check for arithmetic
1875 overflow when computing table size. Use xrealloc rather than
1876 bumpalloc primitives.
1878 2003-07-29 Jim Meyering <jim@meyering.net>
1882 * README: When running tests as root, suggest using
1883 sudo with NON_ROOT_USERNAME=$USER.
1885 * tests/Makefile.am (all_programs): Makefile is in ../src, not
1888 2003-07-28 Jim Meyering <jim@meyering.net>
1890 * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
1892 2003-07-28 Paul Eggert <eggert@twinsun.com>
1894 * lib/stdbool.hin (_Bool): Make it signed char, instead of
1895 an enum type, so that it's guaranteed to promote to int.
1896 * src/sort.c (sortlines_temp): Undo previous change.
1898 2003-07-28 Jim Meyering <jim@meyering.net>
1900 * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
1901 `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
1902 would cause lines[-1 - swap] (with swap = false) to evaluate to
1905 2003-07-27 Jim Meyering <jim@meyering.net>
1907 * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
1908 since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
1910 * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
1911 directories, as required by POSIX. Reported by Karl Berry.
1912 * tests/rm/dir-no-w: New file. Test for the above fix.
1913 * tests/rm/Makefile.am (TESTS): Add dir-no-w.
1915 * tests/mk-script: Emit `$xx', not its expansion.
1917 2003-07-27 Paul Eggert <eggert@twinsun.com>
1919 This change was inspired by a similar proposal by Stepan Kasal.
1920 * src/sort.c (mergelines, sortlines_temp): New functions.
1921 (sortlines): Use them, to reduce the number of times that
1922 we need to copy 'struct line' values. This improved CPU
1923 performance by about 30% on one 18 MB test.
1924 (sort): Don't invoke sortlines unless we have 2 or more lines.
1926 2003-07-26 Stepan Kasal <kasal@ucw.cz>
1928 * src/sort.c (sort): Don't require two `struct line's per text line,
1929 the new sort algorithm requires just 1.5.
1931 2003-07-27 Jim Meyering <jim@meyering.net>
1933 * src/pathchk.c (validate_path): Use %lu, not %ld.
1935 * src/cut.c (is_printable_field): Simplify bit arithmetic.
1937 * src/ls.c (sort_files): Put `volatile' in the right place.
1940 2003-07-26 Jim Meyering <jim@meyering.net>
1942 Use only one bit per field/offset in array, not one `int'.
1943 * src/cut.c (printable_field): Change type to `unsigned char'.
1944 (mark_printable_field, is_printable_field): New functions.
1945 Use them in place of all direct accesses of `printable_field'.
1947 * src/expand.c (parse_tabstops): Detect overflow properly.
1948 * src/cut.c (set_fields): Likewise.
1950 * src/rm.c: Include "dirname.h".
1951 (usage): Use base_name (program_name) in body of --help output.
1953 * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
1954 Idea from Brendan O'Dea, who suggested using
1955 `program_name = basename (argv[0]);' everywhere --
1956 can't do that, but using base_name works just fine here.
1958 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
1960 2003-07-24 Paul Eggert <eggert@twinsun.com>
1962 Fix some POSIX-compliance problems with 'test'. This makes
1963 'test' more compatible with Bash.
1965 * NEWS, doc/coreutils.texi: Document the following.
1966 * src/test.c: Include exitfail.h.
1967 (TEST_FAILURE): New constant, used for exit status if 'test' fails.
1968 (test-syntax_error): Use it.
1969 (binary_operator): Now takes bool arg specifying whether left operand
1970 is -l ARG, so that caller determines this rather than us.
1972 (term): Use posixtest to evaluate parenthesized subexpressions.
1973 (unary_operator, one_argument): Remove support for -t without operand.
1974 (one_argument): Take argument from argv[pos].
1975 (one_argument, two_arguments, three_arguments): Advance pos.
1976 All callers changed.
1977 (three_arguments): Look for binary ops before "!". Then look
1978 for parenthesized one_argument expressions, instead of trusting
1979 expr () to do the right thing.
1980 (posixtest): Now takes number of args. All callers changed.
1981 Treat "( A B )" like "A B".
1982 (main): Set exit_failure to TEST_FAILURE. Don't depend on
1983 POSIXLY_CORRECT, as we now conform to POSIX by default.
1984 (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
1985 * tests/test/Test.pm (test_vector): Add several tests to check
1986 the above. Syntax errors now exit with status 2, not 1.
1987 * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
1989 2003-07-26 Jim Meyering <jim@meyering.net>
1991 * tests/help-version: Adjust for above change in test behavior:
1992 `[' exits with 2, not 1, and test doesn't accept --help or --version.
1994 * Makefile.maint (ME): Don't use trick suggested in Make manual.
1995 It doesn't work for make-3.79.1. Reported by Christian Krackowizer.
1997 * Makefile.maint (sc_system_h_headers): Another syntax check.
1998 (syntax-check-rules): Add it to the list.
2000 * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
2001 so it matches `%ld' format even on 32-bit systems.
2003 * src/fmt.c (flush_paragraph): Cast field width to `int' to
2004 avoid warning on 64-bit systems.
2006 * src/ls.c (sort_files): Make `func' volatile, so it can't be
2007 clobbered by a `longjmp' into this function.
2009 2003-07-25 Jim Meyering <jim@meyering.net>
2011 * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
2014 * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
2015 because it'd evoke spurious failure on 64-bit systems.
2017 2003-07-24 Jim Meyering <jim@meyering.net>
2019 * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
2020 output its current record counts. Reported by Jurriaan.
2022 * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
2023 `wc' with no options. This goes along with the change of 2003-07-20.
2025 2003-07-23 Jim Meyering <jim@meyering.net>
2027 Don't include headers already included by system.h:
2028 * src/tr.c: Don't include errno.h.
2029 * src/true.c: Don't include version-etc.h.
2030 * src/test.c: Don't include limits.h or error.h.
2031 * src/stat.c: Don't include unistd.h or time.h.
2032 * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
2033 * src/pr.c: Don't include time.h.
2034 * src/pathchk.c: Don't include errno.h.
2035 * src/nice.c: Don't include sys/time.h.
2036 * src/ls.c: Don't include stdlib.h.
2038 * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
2039 * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
2040 * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
2041 * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
2042 * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
2043 * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
2044 * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
2045 * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
2046 Don't include closeout.h.
2048 * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
2049 can access the required version of rm.
2050 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
2052 * tests/cut/Test.pm (out-delim3a): New test.
2054 * man/help2man: Update to version 1.33.
2056 * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
2058 * src/dircolors.c: Include xstrndup.h.
2059 (xstrndup): Remove function, now that it's been factored out into
2062 2003-07-22 Paul Eggert <eggert@twinsun.com>
2064 * src/wc.c (wc): Fix typo in computation of file from file_x,
2065 which caused the former to be used uninitialized if file_x was
2068 2003-07-22 Jim Meyering <jim@meyering.net>
2070 * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
2072 * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
2073 help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by
2074 Thomas Luzat. See http://bugs.debian.org/202413 for details.
2076 * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
2078 * src/hostid.c: Don't include <unistd.h>. system.h already does that.
2080 * src/cut.c (set_fields): Mark all selected indices before trying to
2081 determine range endpoints.
2082 * tests/cut/Test.pm: New test for the above fix.
2084 Begin to address this comment: What if someone wants to
2085 extract the 1,000,000-th field of some huge input file?
2086 The first step is to rearrange things so that the values
2087 in the printable_field array are all 0/1 rather than 0/1/2.
2088 * src/cut.c (RANGE_START_SENTINEL): Remove.
2089 Store range-start indices in a hash table, rather than
2090 overloading the `printable_field' array.
2091 (range_start_ht): New global.
2092 (hash_int, hash_compare_ints, is_range_start_index): New functions.
2093 (print_kth): Use is_range_start_index; don't test printable_field.
2094 (set_fields): Detect overflow.
2095 (set_fields): Insert each range-start index into range_start_ht.
2096 (main): Call set_fields only once, and only after
2097 output_delimiter_specified and (if required) range_start_ht have
2100 2003-07-20 Paul Eggert <eggert@twinsun.com>
2102 * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
2103 invoked with a null pointer when there were no file arguments.
2105 2003-07-20 Jim Meyering <jim@meyering.net>
2107 * Makefile.maint (sc_changelog): Add another nit-picky check.
2109 * src/wc.c (write_counts): Add a comment.
2110 (wc): Rename `file' parameter.
2111 Set new local, `file', to be the file name, or (when it's NULL)
2112 _("standard output") so that all uses of `file' use the proper value.
2113 Use STREQ, not strcmp.
2115 2003-07-20 Paul Eggert <eggert@twinsun.com>
2117 wc count field widths now are heuristically adjusted depending
2118 on the input size, if known. If only one count is printed, it
2119 is guaranteed to be printed without leading spaces.
2121 Previously, wc did not align the count fields if
2122 POSIXLY_CORRECT was set, but POSIX did not actually require
2123 this undesirable behavior, so it has been removed.
2125 * NEWS: Document this.
2126 * doc/coreutils.texi (wc invocation): Likewise.
2128 * src/wc.c (number_width): New var.
2129 (posixly_correct): Remove.
2130 (struct fstatus): New struct.
2131 (write_counts): Output fields of width number_width.
2132 Do not worry about POSIXLY_CORRECT.
2133 Use null file, not empty-string file, to denote stdin,
2134 since "" is a valid file name on some hosts.
2135 (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
2137 (wc): Avoid problems if end_pos - current_pos overflows.
2138 Do not print odd message if stdin has a read error.
2139 (get_input_fstatus, compute_number_width): New functions.
2140 (main): Use them to implement the new behavior.
2141 Ignore POSIXLY_CORRECT.
2143 * tests/wc/Test.pm: Adjust to the new output widths.
2145 2003-07-19 Jim Meyering <jim@meyering.net>
2147 * tests/rm/fail-eperm: Don't create temporary directory --
2150 * tests/shred/remove: Don't open-code test for UID != 0.
2151 Use priv-check's require-non-root instead.
2152 Update to use newer framework.
2154 * tests/help-version (expected_failure_status_expr): Record that
2155 expr exits with status of 3 for e.g., a write error.
2157 * tests/priv-check: Use `id -u' to see if we're running as root,
2158 rather than trying go write to an write-protected file.
2159 When running as root, ensure $NON_ROOT_USERNAME is valid.
2160 When running as root with `require-non-root', ensure that `.'
2161 is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
2162 to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test.
2164 * src/printenv.c: Include "exitfail.h".
2165 (main): Set exit_failure rather than calling close_stdout_set_status.
2166 * src/date.c: Likewise.
2167 * src/sort.c: Likewise.
2168 * src/tty.c: Likewise.
2170 2003-07-18 Jim Meyering <jim@meyering.net>
2172 * tests/touch/not-owner: Update to use newer framework.
2174 * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
2175 directory, and remove Perl-coded `you may not run as root' test.
2176 * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
2177 hard-coding something not quite equivalent.
2178 Paul Jarc reported the inconsistent diagnostics.
2180 * src/sort.c (main): Use close_stdout via atexit.
2181 Now `sort --version' and `sort --help' fail, as they should
2182 when their output is redirected to /dev/full.
2184 * src/su.c (usage): Don't call close_stdout here.
2185 (main): Use close_stdout via atexit.
2186 Now `su --version > /dev/full' fails, as it should.
2187 Somehow, the change of 2000-05-07 that purports to fix this
2190 * tests/help-version (--help/--version vs. /dev/full): Special-case
2191 `[' to protect it from expected_failure_status-`eval'.
2193 * src/uniq.c (writeline): Use a SPACE, not a TAB between the
2194 count and the corresponding line, as required by POSIX.
2195 Reported by Clement Wang.
2196 * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
2198 * tests/expr/basic: Add tests for when exit status is 2.
2200 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
2201 Use an anonymous `enum', rather than #define.
2203 2003-07-17 Paul Eggert <eggert@twinsun.com>
2205 * src/expr.c: Include "exitfail.h", "quotearg.h".
2206 (EXPR_INVALID, EXPR_ERROR): New constants.
2207 (nomoreargs, null, toarith, nextarg): Return bool, not int.
2208 (syntax_error): New function, exiting with status 2. Use it
2209 insteading of printing "syntax error" ourselves.
2210 (main): Initialize exit_failure to EXPR_ERROR.
2211 Exit with EXPR_INVALID on syntax error (too few arguments).
2212 (nextarg): Use strcmp, not strcoll; strcoll might return
2213 an undesirable 0, or might fail.
2214 (docolon, eval4, eval3): Exit with status 3 on invalid argument type
2215 or other such error.
2216 (eval2): Report an error if strcoll fails in a string comparison.
2217 * src/sort.c: Include "exitfail.h".
2218 (main): Set exit_failure, not xalloc_exit_failure and
2219 xmemcoll_exit_failure.
2220 * tests/expr/basic: Invalid value exits with status 3, not 2.
2222 2003-07-16 Jim Meyering <jim@meyering.net>
2224 * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
2225 per GNU maintainer guidelines. The next non-beta release will be 5.1.
2227 This script would have caught at least two recent bugs:
2228 those in [ and kill.
2229 * tests/help-version: Revive this script.
2230 It wasn't doing anything useful, since $all_programs wasn't being
2231 defined by the invoking Makefile.am.
2232 Reflect that nohup is no longer a script, so don't exclude it.
2233 Add framework to handle the programs added since it was last run:
2234 kill, stat, unlink, [, link, readlink.
2235 Fix path-related problems deriving from the move of this script
2236 from src/ to its present location.
2237 * tests/Makefile.am (all_programs): Define.
2238 (TESTS_ENVIRONMENT): Use it.
2240 * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
2241 whereby kill would always attempt to operate on argv[0] and fail.
2243 * src/test.c (integer_expected_error): Improve diagnostic -- now,
2244 it also matches the one from bash's builtin test.
2245 (binary_operator): Add \n at end of diagnostic.
2247 * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ...
2248 * tests/priv-check: Move setuidgid-related and
2249 NON_ROOT_USERNAME-checking code to this file.
2251 * README: Update section on testing as `root'.
2252 Suggestion from Paul Jarc.
2254 * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
2255 names of authors that I just found in bash's builtins/test.def.
2257 Running `[' with no arguments would evoke a segfault.
2258 * src/test.c (main) [LBRACKET]: Move initialization of argv to
2259 precede potential use via test_syntax_error.
2261 * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
2262 warning from automake -Wall.
2264 2003-07-15 Jim Meyering <jim@meyering.net>
2268 * Makefile.maint (%.asc): Remove target first, so gpg doesn't
2271 * announce-gen (print_changelog_deltas): Relax tests for matching
2272 version-number line in NEWS.
2273 Change the .sig suffix to .asc here, too.
2275 2003-07-14 Jim Meyering <jim@meyering.net>
2277 * Makefile.maint (%.asc): Renamed from %.sig.
2278 Generate and use ascii-armored signatures.
2279 Use gpg's -o option.
2281 2003-07-13 Jim Meyering <jim@meyering.net>
2283 * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
2286 * Makefile.maint (syntax-check): Move each individual check into
2288 (syntax-check-rules): This is the list of syntax-check targets.
2289 (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
2290 (sc_cast_of_x_alloc_return_value, sc_space_tab):
2291 (sc_error_exit_success, sc_xalloc_h_in_src): New targets.
2293 2003-07-12 Jim Meyering <jim@meyering.net>
2295 * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
2296 traces of the nohup script.
2298 * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
2299 $(OPTIONAL_BIN_ZCRIPTS).
2301 * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
2302 target, not before the `>'.
2304 * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
2305 now that that function no longer calls `error'.
2307 * src/df.c (find_mount_point): Emit a diagnostic for each
2308 failed syscall, rather than relying on caller to do that.
2309 The caller couldn't do a good job, anyhow -- too many different
2310 ways to fail (each with a different referent).
2311 Give a diagnostic upon failed save_cwd, now that that function
2312 no longer calls `error'.
2313 (show_point): Don't diagnose find_mount_point's errors, now that
2314 it handles them itself.
2316 * src/df.c (find_mount_point): Don't let free clobber errno upon
2319 * src/sys2.h: Remove alloca-related block.
2320 * src/system.h: Include <alloca.h> here, instead.
2322 It appears that the `#pragma alloca' included via "system.h" is
2323 adequate, since join.c uses alloca, yet lacked an in-file #pragma.
2324 * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
2325 * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
2327 * src/chown-core.c (change_file_owner): Do not restore any special
2328 permission bits (e.g., set-user-ID, set-group-ID) that are reset
2329 by chown(2) on some systems. Suggestion and insistence :-) from
2332 * tests/input-tty: Also check `test -t 1'.
2333 This is necessary on linux-2.4.21. Otherwise, the stty/basic-1
2334 test would block when run in the background.
2336 2003-07-11 Jim Meyering <jim@meyering.net>
2338 * tests/sample-test: Also fail if cat-to-create-expected-output
2339 fails. Otherwise, if both `exp' and `out' were to end up empty
2340 because of e.g., a full disk, they would mistakenly compare equal.
2342 * src/nohup.c: New file. Rewrite of nohup.sh in C.
2343 This solves a portability problem: on at least Solaris systems,
2344 when nohup.sh used the vendor /bin/sh, it would exit with status
2345 of `1' rather than the required 126 or 127 upon failure to exec
2346 the specified program.
2348 * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
2349 (bin_PROGRAMS): Add nohup.
2350 (EXTRA_DIST): Remove nohup.sh.
2351 (all_programs): Remove use of $(EXTRA_SCRIPTS).
2352 * src/nohup.sh: Remove file.
2353 * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
2355 * tests/misc/nohup: Tests for the above.
2356 * tests/misc/Makefile.am (TESTS): Add nohup.
2358 * src/head.c (diagnose_copy_fd_failure): New function, renamed from
2359 the macro, COPY_FD_DIAGNOSE.
2360 (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
2361 (head_file): Likewise.
2363 * src/date.c: Include "quote.h".
2364 (batch_convert): Use the quote function rather than using literal `...'
2367 * src/setuidgid.c (main): Enclose diagnostic in _(...).
2368 * src/fmt.c (main): Likewise.
2369 * src/mknod.c (main): Likewise.
2370 * src/tac.c (tac_seekable): Likewise.
2371 * src/yes.c (main): Likewise.
2372 * src/od.c (main): Likewise.
2373 * src/install.c (change_attributes): Likewise.
2375 2003-07-10 Jim Meyering <jim@meyering.net>
2377 * src/head.c (usage): Use 1024*1024 in place of 1048576.
2378 * src/tail.c (usage): Likewise.
2380 * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
2381 place of the kludge in this test. Suggestion from Paul Jarc.
2383 * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
2384 * src/setuidgid.c: New program, solely for testing (not installed).
2386 * src/chown-core.c (change_file_owner): Don't leak file descriptors
2387 when dereferencing symlinks.
2389 2003-07-09 Jim Meyering <jim@meyering.net>
2391 * tests/du/slash: New file/test for today's lib/ftw.c fix.
2392 * tests/du/Makefile.am (TESTS): Add slash
2394 * src/tail.c (xlseek): Avoid warning about ``return without value
2395 from function returning non-void''.
2397 2003-07-08 Jim Meyering <jim@meyering.net>
2399 * man/help2man: Update to version 1.29.
2401 * man/help2man: Add END handler to close STDOUT and check for errors.
2403 2003-06-30 Paul Eggert <eggert@twinsun.com>
2405 Add support for a "[" that conforms to the GNU coding standards,
2406 i.e., that does not depend on its name.
2407 * src/lbracket.c: New file.
2409 * man/Makefile.am (programs): Ignore "[", since it doesn't have
2410 a separate man page.
2411 * src/Makefile.am (bin_PROGRAMS): Add "[".
2412 (__SOURCES): New var.
2413 * src/test.c (LBRACKET): Define to 0 if not defined.
2414 (main): Use LBRACKET rather than argv[0].
2416 * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
2417 Reported by Paul Jarc and Dan Jacobson.
2419 * src/test.c (main): Do not recognize --help or --version if
2420 POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
2421 Do not bother testing that margv[margc] is non-null.
2423 2003-07-04 Jim Meyering <jim@meyering.net>
2425 * src/who.c (print_line): Rewrite to use asprintf, in order to be
2426 able to avoid emitting trailing spaces. Reported by Dan Jacobson.
2428 * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
2429 option, and perform the +1600 invocations of head IFF the envvar
2430 RUN_EXPENSIVE_TESTS is set.
2432 2003-07-03 Jim Meyering <jim@meyering.net>
2434 * src/cp.c (do_copy): Give a better diagnostic when failing due
2435 to nonexistent destination directory. Reported by Dmitry Rutsky.
2436 See http://bugs.debian.org/199730 for details.
2438 2003-06-27 Jim Meyering <jim@meyering.net>
2440 split's --verbose option did nothing [broken in 4.5.10 and 5.0]
2441 * src/split.c (longopts): Use `1', not `0' as the value for
2442 for &verbose. Reported by Keith Thompson.
2444 Test for the above fix.
2445 * tests/misc/split-a: Also use --verbose and compare stderr
2446 output with what we'd expect.
2448 2003-06-20 Jim Meyering <jim@meyering.net>
2450 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2451 Use `error_t' (rather than int) as type for local `err'.
2452 From Alfred M. Szmidt.
2454 2003-06-19 Marcus Brinkmann <marcus@gnu.org>
2456 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2457 Fix author preservation code.
2459 2003-06-19 Jim Meyering <jim@meyering.net>
2461 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
2462 (do_link): Don't warn about hard link to symlink.
2464 2003-06-18 Jim Meyering <jim@meyering.net>
2466 * src/cut.c: Include "getdelim2.h", not "getstr.h".
2467 Reflect renaming: getstr -> getdelim2.
2469 * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
2470 readline -> readlinebuffer.
2472 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2474 * src/readlink.c: Include <sys/types.h> before system.h (because
2475 the latter includes <sys/stat.h>). Required on Ultrix 4.3.
2477 2003-06-17 Jim Meyering <jim@meyering.net>
2479 * src/system.h (initialize_main): Define.
2480 Use it in every `main'. Applied via this:
2481 p='initialize_main (&argc, &argv);'
2482 perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \
2483 $(grep -l program_name.=.argv.0 *.c)
2484 test.c uses margc/margv, so I made the change manually for that file.
2485 Based on a patch from Bernard Giroud.
2487 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2489 Fix for build failure on Ultrix 4.3.
2490 * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
2491 Include sys/param.h and sys/mount.h on ultrix.
2493 2003-06-16 Jim Meyering <jim@meyering.net>
2495 * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
2497 * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
2498 them here instead, but with one change: define EISDIR to -1, not 0.
2500 * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
2501 guaranteed to be defined.
2502 * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
2504 * README: Mention the CVS repository.
2505 Encourage addition of test cases.
2507 2003-06-12 Jim Meyering <jim@meyering.net>
2509 * src/touch.c (touch): Call close only if necessary.
2512 * src/wc.c (usage): Correct wording: wc prints counts in the order
2513 `newline, word, byte'. Reported by Keith M. Briggs.
2514 * man/wc.x: Fix it here, too. And change `lines' to `newlines'.
2516 2003-06-10 Jim Meyering <jim@meyering.net>
2518 * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
2520 2003-06-07 Jim Meyering <jim@meyering.net>
2522 * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
2525 2003-06-06 Jim Meyering <jim@meyering.net>
2527 * src/extract-magic (main): Avoid newer 3-arg form of open,
2528 so this script works also with e.g., perl5.005_03.
2529 Patch by John David Anglin.
2531 2003-06-04 Paul Eggert <eggert@twinsun.com>
2533 * src/system.h: Include <stdbool.h> unconditionally.
2535 2003-06-04 Jim Meyering <jim@meyering.net>
2537 * man/Makefile.am (check-programs-vs-x): Rename target
2538 from check-programs-vs-1. Adjust rule to check for the
2539 primary (.x) file, not the generated one (.1).
2541 2003-06-03 Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
2543 * man/kill.x: New file.
2544 * man/Makefile.am (dist_man_MANS): Add kill.1.
2547 2003-06-04 Jim Meyering <jim@meyering.net>
2549 Ensure that the .x file for a new program is never forgotten again.
2550 * man/Makefile.am (programs): Define.
2551 (check-programs-vs-1): New phony target.
2552 (check-local): Depend on it.
2554 2003-06-03 Jim Meyering <jim@meyering.net>
2556 Avoid unnecessary copying of environment.
2557 * src/env.c (main): Rather than clearing the environment and --
2558 unless told to ignore environment -- copying all settings from
2559 the saved, original environment, clear the environment only when
2560 that is requested. Suggested by Jens Elkner.
2562 2003-06-02 Jim Meyering <jim@meyering.net>
2564 * src/system.h: Always include <string.h>, since we assume C89.
2565 Include <limits.h> without checking for HAVE_LIMITS_H.
2567 * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
2568 (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
2570 2003-06-01 Jim Meyering <jim@meyering.net>
2572 Avoid a race condition in `tail -f' described by Ken Raeburn in
2573 http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
2574 * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
2575 (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
2576 (tail_bytes, tail_lines, tail): Likewise.
2577 (tail_file): Use the new `read_pos' value as the size,
2578 rather than stats.st_size from the fstat call.
2580 2003-05-28 Jim Meyering <jim@meyering.net>
2582 * src/extract-magic: Allow expansion of `$file' in the here-
2583 document corresponding to the comment at the top of fs.h.
2585 2003-05-26 Jim Meyering <jim@meyering.net>
2587 * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
2588 <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
2589 Use #if/#elif/... cascade so we get only one set of include files.
2590 Reported by Nelson Beebe.
2592 2003-05-24 Jim Meyering <jim@meyering.net>
2594 * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
2595 * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
2596 accept the BSD format.
2598 2003-03-28 Joe Orton <jorton@redhat.com>
2600 * src/md5sum.c (bsd_split_3): New function.
2601 (split_3): Detect checksums from BSD 'md5' command and handle them
2604 * tests/md5sum/basic-1: New tests for --check exit status, and for
2605 BSD-style checksum files.
2607 2003-05-21 Jim Meyering <jim@meyering.net>
2609 * src/head.c (elide_tail_lines_pipe): Fix a thinko.
2610 This sort of thing is why it'd be *Really Good* to factor
2611 out the common code used here and in tail.c.
2613 2003-05-14 Jim Meyering <jim@meyering.net>
2615 * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
2617 * tests/du/slink: Skip this test if `.' is on an XFS file system.
2619 * tests/du/fd-leak: New file. Test for the bug in du that
2620 was fixed by the 2003-05-12 change to lib/ftw.c.
2621 * tests/du/Makefile.am (TESTS): Add fd-leak.
2623 * src/head.c (AUTHORS): Enclose string in N_(...), now that it
2624 includes a translatable word, `and'.
2626 * src/dd.c (usage): Don't use `,' as the thousands separator
2627 in e.g. 1,000,000 and 1,048,576. Instead, do this:
2628 `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
2629 * src/df.c (usage): Likewise.
2630 * src/du.c (usage): Likewise.
2631 * src/ls.c (usage): Likewise.
2633 * Makefile.maint (syntax-check): Add another check.
2635 2003-05-13 Paul Eggert <eggert@twinsun.com>
2637 Fix uniq to conform to POSIX, which requires that "uniq -d -u"
2638 must output nothing. Problem reported by Josh Hyman.
2640 * src/uniq.c (enum output_mode, mode): Remove, replacing with:
2641 (output_unique, output_first_repeated, output_later_repeated):
2642 New vars. All uses of "mode" changed to use these variables,
2643 which are not mutually exclusive as "mode" was.
2644 (writeline): New arg "match", used to control whether to
2645 obey output_first_repeated or output_later_repeated.
2646 All callers changed.
2647 (check_file, main): Adjust to above changes.
2649 * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
2651 2003-05-14 Jim Meyering <jim@meyering.net>
2653 * tests/rm/rm3: Use tr's \n notation rather than \012.
2654 This package can afford to do that, since its tests are guaranteed use
2655 GNU tr, which has accepted the more modern notation for 10 years.
2656 * tests/rm/rm5: Likewise.
2657 * tests/cp/same-file: Likewise.
2658 * tests/stty/row-col-1: Likewise.
2659 * tests/stty/basic-1: Likewise.
2660 * tests/rm/deep-1: Likewise.
2661 * tests/mv/part-symlink: Likewise.
2662 * tests/mkdir/perm: Likewise.
2663 * tests/misc/nice: Likewise.
2665 2003-05-13 Jim Meyering <jim@meyering.net>
2667 * src/copy.c (struct F_triple) [name]: Remove const attribute.
2668 (triple_free): Don't apply cast to argument of free.
2669 (seen_file): Add cast here instead.
2671 * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
2672 (src_to_dest_free): Don't apply cast to argument of free.
2674 * src/sort.c (zaptemp): Don't apply cast to argument of free.
2675 * src/pr.c (init_fps, init_store_cols): Likewise.
2676 * src/join.c (delseq, freeline): Likewise.
2677 * src/expr.c (OLD): Likewise.
2678 * src/sort.c (sort): Likewise.
2679 * src/head.c (elide_tail_lines_pipe): Likewise.
2681 * src/tail.c: Include "quote.h".
2682 Use quote in diagnostics. Change many error format strings
2683 from just `%s' to e.g., `error reading %s'.
2684 (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
2685 Rewrite newline-counting loop to use memchr.
2687 * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
2688 Now that assert is no longer used, don't include <assert.h>.
2690 2003-05-12 Jim Meyering <jim@meyering.net>
2692 * src/head.c: Include <assert.h>.
2693 (AUTHORS): Add my name.
2694 (elide_tail_lines_pipe): New function.
2696 2003-05-10 Jim Meyering <jim@meyering.net>
2698 * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
2700 * src/readlink.c (main): Set program_name before first use.
2701 Remove that (redundant) first use.
2702 Don't exit successfully just because --verbose was specified.
2703 Pass 0, not EXIT_SUCCESS, as first argument to error; when that
2704 parameter is 0, error does not exit.
2706 * src/uname.c (main): When failing due to too many arguments, also say
2707 that, rather than just "Try `uname --help' for more information.".
2708 * src/comm.c (main): Likewise, but for too few arguments.
2709 * src/logname.c: Include error.h.
2710 (main): Say why we're failing.
2712 * src/uniq.c (main): Don't segfault when argc < optind.
2713 * src/who.c (main): Handle argc < optind.
2714 * src/df.c (main): Likewise.
2715 * src/install.c (main): Likewise.
2716 * src/mv.c (main): Likewise.
2717 * src/pwd.c (main): Likewise.
2718 * src/tty.c (main): Likewise.
2719 * src/chroot.c (main): Likewise.
2720 * src/hostname.c: Likewise.
2721 * src/du.c (main): Likewise.
2722 * src/expand.c (main): Likewise.
2723 * src/env.c (main): Likewise.
2724 * src/unexpand.c (main): Likewise.
2725 * src/printenv.c (main): Likewise.
2726 * src/sync.c (main): Handle argc == 0.
2727 * src/expr.c (main): Likewise.
2728 * src/printf.c (main): Likewise.
2729 * src/basename.c (main): Likewise.
2730 * src/ln.c (main): Test for `missing argument' before computing n_files.
2731 * src/tail.c (main): Test for the case of no arguments before
2734 * src/kill.c (send_signals): Don't check command line arguments here.
2735 (main): Check them here instead. Handle argc < optind.
2737 * src/logname.c (main): Use error, rather than fprintf, for the sake
2740 * src/rm.c (main): Don't overrun array bound if argc is 0.
2742 2003-05-09 Jim Meyering <jim@meyering.net>
2744 * src/sort.c (main): Don't overrun array bound if argc is 0.
2745 That would happen when invoked via: execl ("/usr/bin/sort", NULL);
2746 Reported by Wartan Hachaturow.
2748 2003-05-07 Jim Meyering <jim@meyering.net>
2750 Implement support so that `head --lines=-N' works on seekable files.
2751 * src/head.c (enum Copy_fd_status): Define.
2752 (COPY_FD_DIAGNOSE): New macro.
2753 (elide_tail_lines_seekable): New funtion.
2754 (elide_tail_lines_file): Call it here.
2756 2003-05-06 Jim Meyering <jim@meyering.net>
2758 * src/sys2.h (CHAR_BIT): Remove duplicate definition.
2760 2003-05-04 Jim Meyering <jim@meyering.net>
2762 * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
2763 caused the addition of thousands of small files to the tar archive.
2764 * tests/misc/head-elide-tail: New file. Add them here instead.
2765 * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
2767 2003-05-04 Paul Eggert <eggert@twinsun.com>
2769 * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
2770 (IF_READDIR_NEEDS_REWINDDIR): Remove.
2771 (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
2772 which was a bit weird because it couldn't be emulated by a function.
2774 2003-05-03 Jim Meyering <jim@meyering.net>
2776 Extend head to accept --lines=-N (--bytes=-N) and to print all
2777 but the N lines (bytes) at the end of the file.
2778 * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
2779 Use quote() in diagnostics, rather than literal `' marks.
2780 (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
2782 (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
2783 (head_file): Reorganize so as to call head from only one place.
2784 (main): Likewise, for head_file.
2785 Handle new, undocumented option, --presume-input-pipe.
2786 Handle negative line and byte counts.
2787 * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
2789 * tests/du/8gb: Skip test if the file system of `.' doesn't support
2790 sparse files -- otherwise it'd create a file of size 8GB.
2792 2003-05-02 Jim Meyering <jim@meyering.net>
2794 * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
2795 Instead explain about `-' and standard input.
2796 (main): Give a proper diagnostic for e.g., `fmt -c -72'.
2797 Reported by Keith Thompson.
2798 * tests/fmt/basic: Add test for the above fix.
2800 * src/fmt.c: Include "quote.h".
2801 Use quote() in diagnostics, rather than literal `' marks.
2802 (main): Exit nonzero when unable to open an input file.
2803 * tests/fmt/basic: Add test for the above fix.
2805 * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
2806 specifications like `-72x'.
2807 * tests/fmt/basic: Add test for the above fix.
2809 Work around nasty readdir bug on Darwin6.5.
2810 * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
2811 [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
2812 returned NULL and there has been at least one successful unlink or
2813 rmdir call since the opendir or previous rewinddir, then call
2814 rewinddir and reiterate the loop.
2816 Factor out common code.
2817 * src/remove.c (readdir_ignoring_dotdirs): New function.
2818 (is_empty_dir): Use it here.
2819 (remove_cwd_entries): Use it here.
2821 2003-05-01 Jim Meyering <jim@meyering.net>
2823 * tests/rm/r-3: Create 500 rather than just 300 files.
2824 There's a bug in Darwin6.5's readdir that shows up only with
2826 Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
2830 Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
2831 (dump_remainder): Move two declarations `down' into the scope
2832 where they are used.
2833 (xlseek): Return the resulting offset.
2834 (file_lines): Rename parameter, file_length, to end_pos.
2835 (pipe_lines): Don't coerce safe_read return value to `int'.
2836 Adapt tests accordingly.
2837 (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
2839 Change type of `total_bytes' from `int' to `size_t',
2840 since the former wouldn't always be wide enough.
2841 Don't coerce safe_read return value to `int',
2842 and adapt tests accordingly.
2843 Now that testing for a read error no longer involves
2844 using `tmp', handle that case *after* freeing `tmp'.
2845 (start_bytes): Clean up.
2846 (tail_bytes): Now that `n_bytes' may be larger than
2847 OFF_T_MAX, test for that condition and, if it's true, don't
2848 use lseek optimizations.
2849 (parse_options): Don't fail just because N_UNITS is larger than
2850 the maximum size of a file -- tail may be applied to an input
2851 stream (e.g., a pipe) with more data than that.
2853 * Makefile.maint (syntax-check): Rename from alloc-check.
2854 Also check for SPACE-TAB sequences.
2855 Also check for malloc/calloc/realloc casts.
2857 2003-05-01 Jim Meyering <jim@meyering.net>
2859 * src/tail.c (start_lines): Rewrite to use memchr. Clean up.
2861 2003-04-28 Jim Meyering <jim@meyering.net>
2863 * tests/misc/tty-eof: Send two tokens, not just one, so we don't
2864 make the now-more-picky tsort fail.
2866 2003-04-24 Jim Meyering <jim@meyering.net>
2868 * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
2869 (main): Minor syntactic clean-up.
2871 * src/tsort.c (tsort): Fail if the input contains an odd number of
2872 tokens. Reported by junkio@cox.net.
2874 * tests/tsort/basic-1: Test for the above fix.
2876 2003-04-21 Jim Meyering <jim@meyering.net>
2878 * tests/misc/printf: Add tests for the printf fixes below.
2880 * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
2882 2003-04-20 Paul Eggert <eggert@twinsun.com>
2884 Fix printf POSIX compatibility bug reported by Ben Harris in
2885 <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
2886 * doc/coreutils.texi (printf invocation): It's \NNN in the format,
2887 \0NNN in the %b operand.
2888 * src/printf.c (usage): Likewise.
2889 (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
2890 is desired. All uses changed. Behave like Bash printf if %b
2891 operand uses \NNN where the initial N is not 0.
2893 2003-04-17 Jim Meyering <jim@meyering.net>
2895 * src/stty.c: Remove uses of PROTOTYPE macro.
2897 2003-04-15 Jim Meyering <jim@meyering.net>
2899 * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
2900 each sequence of spaces before a TAB character.
2902 2003-04-13 Jim Meyering <jim@meyering.net>
2904 * src/remove.c (is_empty_dir): Don't closedir (NULL).
2906 2003-04-12 Jim Meyering <jim@meyering.net>
2908 Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
2909 --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
2910 FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
2911 * src/nl.c (main): Fix those problems and remove literal quote marks
2912 (e.g., "`%s'") from format string; instead use "%s" in each format
2913 string and `quote (optarg)' as the corresponding argument.
2914 Also, diagnose all invalid command line options before failing.
2916 * src/nl.c (proc_text): Fix a bug that would make nl output extra
2917 newlines in some cases. Details here: http://bugs.debian.org/177256.
2918 This bug was introduced on 2001-11-10 for textutils-2.0.17.
2919 * tests/misc/nl: Add test for the above-fixed bug.
2921 * tests/misc/readlink: New file. Test the --canonicalize option.
2922 * tests/misc/Makefile.am (TESTS): Add readlink.
2924 2003-04-11 Jim Meyering <jim@meyering.net>
2927 * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
2928 * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
2929 * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
2930 retain alignment) each sequence of spaces before a TAB character.
2932 * src/ls.c: Include <stdlib.h> unconditionally.
2934 * Makefile.maint (xalloc-check): Rename from header-check.
2936 * src/yes.c: Include error.h after system.h, not before.
2939 * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
2940 * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
2941 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
2942 * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
2943 * src/tr.c: * src/unexpand.c, src/users.c:
2944 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
2945 return values and of xrealloc's first argument.
2946 Fix the former with this:
2947 perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
2949 2003-04-10 Jim Meyering <jim@meyering.net>
2951 * src/stty.c (wrapf): Declare with format attribute.
2953 The S_MAGIC_... names shouldn't be maintained in two places (prior
2954 to this change, one would have to keep stat.c and fs.h in sync).
2955 This change makes it so those names and the corresponding
2956 hexadecimal constants all reside in stat.c. fs.h is now generated.
2957 * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
2958 (BUILT_SOURCES): Add fs.h, now that it's generated.
2959 (EXTRA_DIST): Add extract-magic.
2960 * src/extract-magic: New script to extract fs.h definitions from stat.c.
2961 * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
2962 fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
2964 * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
2965 file with nominal length > 4GB fails. Reported by Michael Deutschmann.
2967 * man/unexpand.x: Add `SEE ALSO' reference to expand.
2968 * man/expand.x: Add `SEE ALSO' reference to unexpand.
2969 Suggestion from Dan Jacobson.
2971 2003-04-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
2973 * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
2974 * src/stat.c (human_fstype): Handle Linux's devpts.
2976 2003-04-09 Paul Eggert <eggert@twinsun.com>
2978 * src/split.c (line_bytes_split): Arg is of type size_t, since
2979 that's all that is supported for now.
2980 (main): Check for overflow in obsolescent line count option.
2982 2003-04-09 Jim Meyering <jim@meyering.net>
2984 * tests/misc/split-fail: Add a new test for the above fix.
2986 * src/split.c (bytes_split): Use size_t temporary (rather than
2987 uintmax_t original) in remaining computations. From Paul Eggert.
2989 Handle command line option arguments larger than 2^31.
2990 This allows e.g., splitting into files of size 2GB and larger,
2991 and running split --lines=N with N=2^31 or more.
2992 But for --line-bytes=N, the restriction that N <= SIZE_MAX
2993 remains (for now), due to the way it is implemented.
2995 * src/split.c: Include "inttostr.h".
2996 (bytes_split, lines_split, line_bytes_split, main):
2997 Use uintmax_t, not size_t, for file sizes.
2998 (main): Give a better diagnostic for option arguments == 0.
2999 Use umaxtostr to print file sizes.
3000 Reported by Luke Hassell.
3002 2003-04-08 Jim Meyering <jim@meyering.net>
3004 * src/rm.c (usage): Mention that --directory (-d) works only
3005 on some systems. Suggestion from Samuel Tardieu.
3007 * tests/basename/basic: Run $PERL to see if it is available,
3008 rather than testing its value.
3009 * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
3010 * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
3011 * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
3012 * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
3013 * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
3014 * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
3015 * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
3016 * tests/sum/basic-1, tests/seq/basic: Likewise.
3018 * tests/misc/Makefile.am (TESTS): Add split-fail.
3019 * tests/misc/split-fail: New file.
3021 * src/split.c: Rename local variables: nchars -> n_bytes.
3022 (lines_split): Rename local, nlines -> n_lines.
3023 (main): Rename local variable: s/accum/n_units/.
3024 (main): Use STDIN_FILENO, not literal `0'.
3026 2003-04-07 Jim Meyering <jim@meyering.net>
3028 * src/stat.c: Add #include directives for Ultrix 4.4.
3029 Based on a suggested change from Bert Deknuydt.
3031 2003-04-06 Jim Meyering <jim@meyering.net>
3033 * Makefile.maint (makefile-check): New rule.
3034 (local-check): Add it.
3036 2003-04-05 Jim Meyering <jim@meyering.net>
3038 * Makefile.am (nearly all of them):
3039 Use $(VAR) rather than @VAR@, now that we can rely on automake to
3040 emit a definition for each substituted variable.
3041 * tests/Makefile.am.in: Likewise.
3043 * tests/rm/rm5: Add a comment explaining why this test fails when
3044 using Tru64's broken sed.
3045 * tests/rm/rm3: Likewise.
3047 Make `kill -t' output signal descriptions (not `?') on Tru64.
3048 * src/kill.c (sys_siglist): Also check for __sys_siglist.
3049 Patch by Tony Leneis.
3050 * configure.ac: Also check for declaration of __sys_siglist.
3051 Required for Tru64 4.0D, 4.0F, and 5.1.
3052 Reported by Tony Leneis.
3054 2003-04-04 Jim Meyering <jim@meyering.net>
3056 * src/Makefile.am (PERL): Remove unnecessary definition.
3058 Because of inappropriate (but POSIX-mandated) behavior of rename,
3059 `mv a b' would not remove `a' in some unusual cases. Work around
3060 this by unlinking `a' when necessary.
3062 * src/copy.c (same_file_ok): Add an output parameter.
3063 Set it in the offending case.
3064 (copy_internal): When necessary, unlink SRC_PATH and inform caller.
3065 Reported by Ed Avis.
3066 * tests/mv/hard-4: New test for the above.
3067 * tests/mv/Makefile.am (TESTS): Add hard-4.
3069 Clean up rules for automatically generated sources:
3070 * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
3071 Make each generated file be read-only.
3072 Add each file name to BUILT_SOURCES separately.
3073 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
3075 Put LOCALEDIR macro definition in new file: localedir.h.
3076 * src/Makefile.am (DEFS): Remove definition.
3077 (localedir.h): New rule.
3078 (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
3079 * src/system.h: Include "localedir.h".
3081 2003-04-02 Jim Meyering <jim@meyering.net>
3085 * tests/misc/Makefile.am (TESTS): Add false.
3087 * Makefile.maint (TMPDIR): Make sure it's defined.
3088 (my-distcheck): Build in $(TMPDIR), not `.'.
3090 * src/Makefile.am (false.c): Change all occurrences of
3091 `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
3092 unsuccessfully also with --help. Reported by Paul Jarc,
3093 * tests/misc/false: New test for the above.
3095 2003-03-30 Jim Meyering <jim@meyering.net>
3097 * NEWS: Note the location of older NEWS files.
3099 * src/remove.c (is_empty_dir): Don't let a failing closedir
3100 clobber errno. Spotted by Arnold Robbins.
3102 * src/env.c: Fix typo in comment. From Arnold Robbins.
3104 2003-03-29 Jim Meyering <jim@meyering.net>
3108 * README: Note to expect build problems for stat.c on Ultrix 4.3.
3109 Note that there are some harmless test failures when running
3110 `make check' as root on some systems.
3112 2003-03-28 Jim Meyering <jim@meyering.net>
3114 * tests/stty/row-col-1: Skip this test if stty can't get window size.
3115 This happens when connecting to sparc-solaris5.7 via ssh from within
3116 emacs. Reported by Karl Berry.
3118 * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
3119 Otherwise, on systems (DJGPP) that emulate pipes using files,
3120 this test would never complete, waiting for `yes' to terminate.
3121 * tests/du/slink: As above, use seq, not `yes' to generate link target.
3122 * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
3123 Reported by Rich Dawe.
3125 2003-03-27 Jim Meyering <jim@meyering.net>
3127 * src/id.c: Remove Arnold Robbins' obsolete e-mail address
3128 from `written by...' comment, at his request.
3130 2003-03-24 Paul Eggert <eggert@twinsun.com>
3132 Fix buffer overrun problem reported by TAKAI Kousuke, along
3133 with some other POSIX incompatibilities.
3135 * src/printf.c (print_esc): Do not treat \x specially if
3136 POSIXLY_CORRECT. Avoid buffer overrun if the format ends
3137 in backslash. Treat incomplete escape sequences as strings
3138 of characters, as POSIX requires.
3139 (print_formatted): Allow multiple flags. Avoid buffer overrun
3140 if the format is incomplete.
3142 2003-03-24 Jim Meyering <jim@meyering.net>
3144 * tests/misc/printf: Add tests for the above fixes and changes.
3146 2003-03-26 Jim Meyering <jim@meyering.net>
3148 * src/copy.h (struct cp_options): Add a comment.
3150 2003-03-23 Jim Meyering <jim@meyering.net>
3152 * README: Describe problem with 64-bit mode on HPUX 11.x,
3153 with patch for /usr/include/inttypes.h.
3154 * TODO: Plan to add an autoconf test to work around the bug.
3156 2003-03-22 Jim Meyering <jim@meyering.net>
3158 * src/stat.c: Don't include <sys/sysmacros.h>.
3159 That is already done via system.h. Otherwise, the multiple
3160 inclusion would evoke redefinition warnings from Cray's /bin/cc,
3161 aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28.
3162 (human_fstype): Factor some directives `up', out of this function.
3163 Cast away `const' to avoid error from Cray's /bin/cc.
3165 2003-03-20 Jim Meyering <jim@meyering.net>
3167 * announce-gen (print_changelog_deltas): Ensure that a newline
3168 precedes each row of `*'s.
3170 2003-03-20 Jim Meyering <jim@meyering.net>
3174 * src/seq.c (valid_format): Also accept ` ' and `'' as valid
3175 format flag characters.
3176 Do not require that a field width be specified.
3177 Do not fail when given a field width of `0'.
3178 Reported by Dan Jacobson.
3179 * tests/seq/basic: Add new tests for the above-fixed bug.
3181 * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
3182 (install-root): Likewise.
3183 (install-exec-local): Likewise.
3184 Based on a patch from Richard Dawe.
3186 2003-03-19 Jim Meyering <jim@meyering.net>
3188 * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
3189 because the DJGPP 2.03 port of 'ln -s' doesn't work.
3190 Include $(EXEEXT) in program names.
3191 Since $(LN_S) may degenerate to `cp -p', be careful
3192 to invoke it from the destination directory.
3193 Mostly from Richard Dawe.
3194 * configure.ac: Use AC_PROG_LN_S.
3196 * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the
3197 CDPATH shell variable set could cause this test to fail.
3198 Reported by Karl Berry.
3200 2003-03-18 Jim Meyering <jim@meyering.net>
3202 * src/fmt.c [struct Word] (paren, period, punct, final): Change the
3203 type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
3204 AIX 5.1's xlc could not compile the former.
3205 Patch by Petter Reinholdtsen. Also reported by Mike Jetzer.
3207 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
3209 * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
3210 program names, since automake only adds $(EXEEXT) to programs
3213 2003-03-16 Jim Meyering <jim@meyering.net>
3215 * src/remove.c (rm): Put two local variables in static storage,
3216 so they can't be clobbered by the potential longjmp.
3218 2003-03-15 Jim Meyering <jim@meyering.net>
3220 * Makefile.cfg (gnu_rel_host): Fix code to match the comment
3221 so that a version number with a two-digit component can still count
3222 as an alpha release. Reported by Richard A Downing.
3223 (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
3225 2003-03-14 Jim Meyering <jim@meyering.net>
3227 * src/ansi2knr.c: Remove no-longer-used file.
3228 * src/ansi2knr.1: Likewise.
3230 * Makefile.maint (prev_version_file): Don't use ?= for this particular
3231 assignment, since it causes trouble with old versions of GNU make
3232 (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here.
3233 http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
3234 Patch from Alexandre Duret-Lutz.
3236 * Use patched automake-1.7.3. Regenerate Makefile.in files in
3237 subdirectories so that each includes a definition of ACLOCAL_M4.
3239 * announce-gen (main): Label the compressed source URLs.
3243 * tests/du/slink: Relax the test for the `local'ness of a file system,
3244 so that now it works also for tmpfs.
3246 * tests/du/hard-link: Transform output from first du, so that this
3247 test doesn't fail on file systems like tmpfs that order directory
3248 entries differently.
3250 2003-03-13 Jim Meyering <jim@meyering.net>
3252 * tests/du/8gb: Work around what appears to be an NFS failure that
3253 would make this test fail on some systems.
3255 2003-03-11 Jim Meyering <jim@meyering.net>
3257 * tests/du/basic: Make the test file exactly 4k bytes long.
3259 * src/split.c (longopts): Don't hard-code `2' here.
3260 Instead, just specify `&verbose', and ...
3261 (main): ... remove the `case 2:' block for --verbose.
3263 * tests/du/basic: Make the test file larger than 64 bytes, so that
3264 we don't immediately disqualify file systems (e.g., NetApp) on which
3265 smaller files take up zero disk blocks. Reported by Vin Shelton.
3267 2003-03-10 Jim Meyering <jim@meyering.net>
3269 Don't segfault for a negative field width or precision in format string.
3270 Note that this is just a stopgap fix. The longer term solution may
3271 involve adapting bash's builtins/printf.def.
3273 * src/printf.c: (UNSPECIFIED): Define.
3274 (print_direc): Use the special value, UNSPECIFIED, to indicate
3275 that field_width or precision has not been specified.
3276 (print_formatted): Fail if field_width or precision is the
3277 special value, UNSPECIFIED.
3278 Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
3280 * src/sys2.h (INT_MIN): Define, if necessary.
3281 * tests/misc/printf: Add a test for the above-fixed bug.
3283 2003-03-09 Jim Meyering <jim@meyering.net>
3285 * src/remove.c (AD_stack_pop): Cast sizeof... to int before
3286 changing its sign. This avoids a warning from gcc on 64-bit systems.
3287 Reported by Bob Proulx.
3288 (pop_dir): Reverse order of sign change and cast, to be consistent
3291 2003-03-08 Jim Meyering <jim@meyering.net>
3293 * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
3294 shell variable, but only in the environment. With /bin/sh->bash, the
3295 shell variable is set to `y', and that would cause a spurious warning.
3296 Reported by Bob Proulx.
3298 * tests/Makefile.am (check-root): Remove touch/fifo.
3299 It doesn't appear to have to be run as root.
3301 * tests/rm/fail-2eperm: Rather than simply using the first non-root
3302 user name, make sure that the selected user name has a usable shell.
3303 Reported by Paul Jarc.
3305 Before, when using shred on a device, one had to specify --exact,
3306 or be careful to choose a size that would not be rounded up and
3307 exceed the maximum value; that could result in a failure of
3309 * src/shred.c (do_wipefd): --exact is now the default for non-regular
3310 files. Suggestion from Ben Elliston.
3313 * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
3314 Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
3315 Patch by Bob Proulx.
3317 * src/Makefile.am (check-misc): Check for use of `defined' in
3319 Change to $(srcdir) before running grep.
3321 * src/sleep.c: Remove now-unused #include and #define directives.
3323 * src/du.c (process_file): If a file's size is not being counted
3324 e.g., because it's a hard link to a file we've already counted,
3325 then don't print a line for it.
3327 * tests/du/hard-link: New test for the above-fixed bug.
3328 * tests/du/Makefile.am (TESTS): Add hard-link.
3331 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
3332 and make the two-array approach work.
3334 * tests/du/basic: Correct/add tests for the above fix.
3335 Set LC_ALL, etc., now that we use sort.
3336 Check the block/size of a small file, too.
3337 Correct expected results for simple dir1/dir2/file case.
3338 Add another test of du -S.
3340 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
3342 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
3343 middle-end/9986). As one of GCC's optimizations, it transforms a
3344 fputs_unlocked call to a fputc_unlocked call when the string is
3345 one character long. However, hpux doesn't have fputc_unlocked.
3347 * expr.c (usage): Use putchar, not fputs, to output a single character.
3348 * ls.c (dired_dump_obstack): Likewise.
3349 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
3350 * stat.c (print_it): Likewise.
3352 2003-03-07 Jim Meyering <jim@meyering.net>
3354 * src/cp.c: Remove everything associated with mmap-stack.c.
3355 This reverts the two changes of 2003-02-21.
3356 * src/du.c: Remove everything associated with mmap-stack.c.
3357 This reverts the change of 2003-02-19.
3359 2003-03-06 Jim Meyering <jim@meyering.net>
3361 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
3362 CDPATH shell variable set could cause this test to fail.
3363 Reported by Karl Berry.
3365 2003-03-05 Jim Meyering <jim@meyering.net>
3369 * src/printf.c (print_esc): Remove pointless comparison of unsigned
3370 integer with zero, to avoid a warning from Intel's ecc.
3371 Reported by Nelson Beebe.
3373 * src/du.c (process_file): Sizes must all be of type uintmax_t.
3374 Otherwise, for files or totals that are too big, numbers would
3375 be truncated. Patch mostly by Michael Stone.
3376 Reported by Ingo Saitz as Debian bug #183210.
3378 * tests/du/8gb: New test for the above-fixed bug.
3379 * tests/du/Makefile.am (TESTS): Add 8gb.
3381 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
3382 rather than UTILS_OPEN_MAX - 10.
3384 2003-03-04 Jim Meyering <jim@meyering.net>
3386 * README: Refer new feature discussion to bug-coreutils@gnu.org,
3387 rather than bug-gnu-utils, now that the former is better known.
3388 Suggestion from Göran Uddeborg.
3390 * src/stat.c (usage): Capitalize consistently.
3391 Reported by Göran Uddeborg.
3393 * Makefile.maint (rel-files): Include $(signatures), so that
3394 those files are also copied into $(release_archive_dir).
3396 * src/df.c (find_mount_point): Call error here, now that restore_cwd
3398 * src/remove.c (AD_pop_and_chdir): Likewise.
3400 * tests/Makefile.am (check-root): Add fail-2eperm.
3402 2003-03-03 Jim Meyering <jim@meyering.net>
3404 * src/remove.c (remove_cwd_entries): Include the full filename of
3405 the offending file, not just the basename.
3407 * tests/misc/tty-eof: Set $ME properly.
3409 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
3410 Remove now-unused variables.
3411 (tag-prev-version, prev-cvs-tag): Likewise.
3413 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
3414 accurate diagnostic when failing to remove a file owned by some other
3415 user. Reported by Ivo Timmermans via Michael Stone.
3416 This fixes Debian bug# 178471.
3418 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
3419 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
3420 Based on a report from Ivo Timmermans.
3422 2003-03-02 Jim Meyering <jim@meyering.net>
3424 * src/copy.c (copy_internal) [un_backup]: When recovering from a
3425 failure to create a hard link, do not remove the entry associating
3426 the source dev/ino with the destination file name.
3427 * tests/mv/Makefile.am (TESTS): Add hard-3.
3428 * tests/mv/hard-3: New test, for the above-fixed bug.
3429 Inspired by a report from Iida Yosiaki.
3431 2003-03-01 Jim Meyering <jim@meyering.net>
3433 * src/df.c (print_header): Don't embed spaces in a separate `Type'
3434 header string. Instead, put `Filesystem' and `Type' headers in the
3435 same string, so translators can use horizontal space as needed.
3436 Reported by Jean Charles Delepine.
3438 2003-02-28 Jim Meyering <jim@meyering.net>
3440 * src/copy.c (copy_internal): When link fails because of an
3441 existing destination file, unlink that file and try again.
3442 Reported by Iida Yosiaki.
3444 * tests/mv/Makefile.am (TESTS): Add hard-2.
3445 * tests/mv/hard-2: New test for the above-fixed bug.
3446 Based on a test case from Iida Yosiaki.
3448 2003-02-26 Jim Meyering <jim@meyering.net>
3450 * tests/du/basic: Don't test du's -b option here. Directory byte
3451 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
3452 and IBM AIX 4.2. Reported by Nelson Beebe.
3454 2003-02-25 Jim Meyering <jim@meyering.net>
3456 * Makefile.maint (announcement): Now that ChangeLog entries
3457 are output by announce-gen, don't do it here.
3458 * announce-gen (print_changelog_deltas): New function.
3461 2003-02-22 Jim Meyering <jim@meyering.net>
3463 * announce-gen: New option: --release-type=TYPE
3464 * Makefile.maint (beta, major): New targets. Remove `release'.
3465 Put them all together on a line.
3466 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
3467 invocation of `announcement'.
3468 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
3470 * announce-gen: New option: --news=NEWS_FILE.
3471 Extract NEWS entries here, not via rules in Makefile.maint.
3472 * Makefile.maint (announcement): Now that NEWS entries are
3473 extracted by announce-gen, don't do it here.
3474 (news-r1, news-r2): Remove now-unused definitions.
3476 2003-02-21 Jim Meyering <jim@meyering.net>
3480 Merge in changes from autoconf's version of this file.
3481 * Makefile.maint (www-gnu): Define.
3482 (standards.texi-url_prefix): Use $(www-gnu).
3483 (make-stds.texi-url_prefix): Likewise.
3485 * src/cp.c: Include "mmap-stack.h".
3486 (main): Invoke `run' through a macro that (when possible) runs it
3487 with a large, mmap'd stack.
3489 * src/cp.c (run): New function, preparing for the above.
3490 Exit from this function, not from main
3493 * src/du.c: New option: --apparent-size.
3494 (enum) [APPARENT_SIZE_OPTION]: New member.
3495 (long_options): Add it.
3496 (usage): Describe it.
3498 ['b']: Set apparent_size.
3499 David Eisner reported that the behavior of --bytes had changed.
3500 Paul Eggert proposed the use of a new option, --apparent-size.
3502 * src/du.c (apparent_size): New global.
3503 (print_only_size): Reflect the fact that we're printing byte counts,
3504 not ST_NBLOCKSIZE-byte-block counts.
3505 (print_size): Call print_only_size rather than duplicating its code.
3506 (process_file): Accumulate byte counts, rather than block counts.
3508 * src/du.c (process_file): Always reset size_to_propagate_to_parent
3509 for --separate-dirs (-S).
3511 2003-02-20 Jim Meyering <jim@meyering.net>
3513 * Use automake-1.7.3. Regenerate dependent files.
3515 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
3516 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
3517 (usage) [%B]: Describe it.
3520 * src/du.c (process_file): Reorganize the code to use only
3521 one `sum' array, and change how -S works back to the way it was
3522 before 2003-01-31. Patch by Bruno Haible.
3524 * tests/du/basic: New test.
3525 * tests/du/Makefile.am (TESTS): Add basic.
3527 * tests/envvar-check: Add checks for the following:
3528 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
3530 * tests/Makefile.am: Rename phony target envvar-check to evar-check
3531 so as not to conflict with the distributed file by the same name.
3533 * src/du.c (process_file): Set info->skip before any possible return.
3535 Report correct usage for directories, not 0.
3536 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
3537 _before_ recording the dev/ino of a directory.
3538 Reported by Bruno Haible.
3540 Now, df always displays the device file name corresponding to the
3541 listed mount point under `Filesystem'. Before, for an unmounted
3542 block- or character-special file argument, it would display the
3543 command-line argument instead.
3544 * src/df.c (show_disk): Return a value indicating whether
3545 there was a match. Don't try to find a mount point here.
3546 (show_entry): If show_disk doesn't find a match, call show_point.
3548 2003-02-19 Jim Meyering <jim@meyering.net>
3550 * src/du.c: Include "mmap-stack.h".
3551 (du_files): Add prototype with ATTRIBUTE_NORETURN.
3552 Exit from this function, not from...
3554 Instead, if possible, invoke du_files through a macro that
3555 runs it with a large, mmap'd stack.
3557 * src/join.c (usage): Change wording in --help output:
3558 use FILENUM instead of `SIDE' and say what FILENUM means.
3559 Reported by Bernhard Gabler.
3561 * src/df.c (print_header): Rather than using a hard-coded literal
3562 string of spaces matching the length of the English `...Type' header,
3563 output the right number of spaces to match the selected translation.
3564 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
3566 * src/split.c (bytes_split): Remove unnecessary `else' after break.
3567 (lines_split): Likewise. and correct misleading indentation.
3569 * src/split.c: Include "full-read.h".
3570 (bytes_split, lines_split, line_bytes_split): Use full_read,
3571 not safe_read. The way split was using the latter, a short read
3572 could cause split to terminate before EOF.
3574 * tests/misc/tty-eof: Test all programs that can read stdin,
3575 requiring no arguments and that write to standard output.
3577 * tests/misc/tty-eof: New file. Renamed from ...
3578 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
3579 * tests/misc/Makefile.am (TESTS): Reflect renaming.
3581 2003-02-18 Jim Meyering <jim@meyering.net>
3583 cksum would perform an extra read after encountering EOF
3584 * src/cksum.c (cksum): Exit the loop upon EOF, too.
3585 Patch by Michael Bacarella.
3587 Test for the bug fixed today in cksum, md5sum, and sha1sum.
3588 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
3589 cat, cksum, md5sum, and sha1sum all in the same loop.
3591 2003-02-14 Jim Meyering <jim@meyering.net>
3593 * src/remove.c: Include "euidaccess.h".
3594 Remove declaration of euidaccess.
3596 2003-02-12 Jim Meyering <jim@meyering.net>
3598 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
3599 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
3601 2003-02-10 Jim Meyering <jim@meyering.net>
3603 * src/test.c: Don't include group-member.h.
3604 Include euidaccess.h.
3605 (eaccess): Rewrite function to set the real uid and gid temporarily
3606 to the effective uid and gid, then invoke 'access', and then set the
3607 real uid and gid back. On systems that lack setreuid or setregid,
3608 fall back on the kludges in euidaccess. Before, it would not work
3609 for e.g., files with ACLs, files that were marked immutable,
3610 or on file systems mounted read-only. Nelson Beebe raised the issue.
3611 Paul Eggert suggested the new implementation.
3613 2003-02-09 Jim Meyering <jim@meyering.net>
3615 * src/test.c (test_stat): Remove function. It's job is done (only
3616 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
3618 2003-02-08 Jim Meyering <jim@meyering.net>
3622 * tests/mv/part-symlink: Don't assume that the file owner username
3623 length is less than 9 in ls output: instead, omit that field
3624 altogether. Reported by, and suggested fix from, Ferdinand.
3626 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
3627 * tests/du/Makefile.am (TESTS): Add restore-wd.
3629 * src/rm.c: Correct now-invalid comment about cycle-detection.
3631 2003-02-06 Jim Meyering <jim@meyering.net>
3633 * NEWS: Add entries from old/*/NEWS
3634 from fileutils-4.1 through 4.1.11 and
3635 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
3639 * src/du.c (process_file): Don't return early for excluded files
3640 or for files whose dev/inode we've already seen.
3642 2003-02-05 Jim Meyering <jim@meyering.net>
3644 * tests/du/exclude: New file.
3645 * tests/du/Makefile.am (TESTS): Add exclude.
3647 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
3649 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
3650 Fix memory allocation arithmetic.
3652 2003-02-04 Jim Meyering <jim@meyering.net>
3654 `df /dev/block-or-char-device-file--not-mounted' now reports
3655 the name of the file system on which the file resides, usually `/'.
3656 Before, it would leave the `Mounted on' field blank.
3657 * src/df.c (show_disk): Move function to precede find_mount_point.
3658 (show_disk): Add parameter: STATP.
3659 If we don't find a matching device name, then resort to calling
3660 find_mount_point. Reported by Bob Proulx.
3662 2003-02-03 Andreas Schwab <schwab@suse.de>
3664 * tests/rm/cycle: Require non-root.
3665 * tests/rm/isatty: Likewise.
3667 2003-02-02 Jim Meyering <jim@meyering.net>
3671 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
3673 Ensure that there are no offending uses of `:'.
3674 * Makefile.maint (makefile_path_separator_check): New rule.
3675 (local-check): Add it to the list.
3677 2003-02-01 Jim Meyering <jim@meyering.net>
3679 * src/du.c (MAX_N_DESCRIPTORS): Define.
3681 * src/stat.c (G_fail): New global.
3682 (human_time): Diagnose failed localtime, not failed nstrftime.
3683 (main): Fail if G_fail is set.
3685 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3687 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
3688 hard-coding the path-separator. Also double-quote the new PATH,
3689 to avoid problems when the path-separator is a semi-colon or when
3690 `pwd` contains e.g. a space.
3691 * tests/chgrp/Makefile.am: Likewise.
3692 * tests/chmod/Makefile.am: Likewise.
3693 * tests/chown/Makefile.am: Likewise.
3694 * tests/cp/Makefile.am: Likewise.
3695 * tests/dd/Makefile.am: Likewise.
3696 * tests/dircolors/Makefile.am: Likewise.
3697 * tests/du/Makefile.am: Likewise.
3698 * tests/expr/Makefile.am: Likewise.
3699 * tests/factor/Makefile.am: Likewise.
3700 * tests/fmt/Makefile.am: Likewise.
3701 * tests/install/Makefile.am: Likewise.
3702 * tests/ln/Makefile.am: Likewise.
3703 * tests/ls/Makefile.am: Likewise.
3704 * tests/ls-2/Makefile.am: Likewise.
3705 * tests/md5sum/Makefile.am: Likewise.
3706 * tests/misc/Makefile.am: Likewise.
3707 * tests/mkdir/Makefile.am: Likewise.
3708 * tests/mv/Makefile.am: Likewise.
3709 * tests/od/Makefile.am: Likewise.
3710 * tests/rm/Makefile.am: Likewise.
3711 * tests/rmdir/Makefile.am: Likewise.
3712 * tests/seq/Makefile.am: Likewise.
3713 * tests/sha1sum/Makefile.am: Likewise.
3714 * tests/shred/Makefile.am: Likewise.
3715 * tests/stty/Makefile.am: Likewise.
3716 * tests/sum/Makefile.am: Likewise.
3717 * tests/tail-2/Makefile.am: Likewise.
3718 * tests/touch/Makefile.am: Likewise.
3719 * tests/tsort/Makefile.am: Likewise.
3720 * tests/unexpand/Makefile.am: Likewise.
3722 2003-01-31 Jim Meyering <jim@meyering.net>
3724 * src/stat.c: Include "file-type.h"
3725 (print_human_type): Remove function.
3726 (human_access): Rename from print_human_access. Return a string.
3727 (human_time): Rename from print_human_time. Return a string.
3728 (print_stat): Arrange so that field width and an alignment specifier
3729 are honored for the %A, %F, %x, %y, and %z formats.
3730 [%F]: Use file_type; this gives slightly different file type strings,
3731 e.g., `directory' instead of `Directory' and `regular file' or
3732 `regular empty file' instead of `Regular file'.
3733 Prompted by a report from Richard Dawe that the uses of
3734 S_IFSOCK and S_IFIFO in print_human_time were not portable
3735 to systems using e.g., DJGPP.
3737 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3739 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
3740 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
3742 2003-01-31 Jim Meyering <jim@meyering.net>
3744 * src/du.c (main): Upon processing an invalid option or an invalid
3745 --exclude-from or --max-depth option argument, don't exit right away,
3746 in case there are others. Rather record the failure and exit after
3747 processing other options.
3749 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
3750 tar archive easier to reproduce.
3752 Rewrite to perform directory traversal using nftw.
3754 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
3755 (AUTHORS): Add self.
3756 (opt_one_file_system): Move global into `main'.
3757 (path, xstat, exit_status): Remove declarations.
3758 (arg_length, suffix_length): New globals.
3759 (G_fail): New global, sort of like the old `exit_status'.
3760 (IS_FTW_DIR_TYPE): Define.
3761 (print_only_size): New function.
3762 (process_file): New function.
3763 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
3764 (str_trunc, pop_dir, count_entry): Likewise.
3765 (du_files): Rewrite to use nftw.
3767 2003-01-30 Jim Meyering <jim@meyering.net>
3769 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
3770 symlink-to-directory with -L, even without the trailing slash.
3772 2003-01-27 Jim Meyering <jim@meyering.net>
3774 * src/Makefile.am (check-misc): Check for st_blocks, too.
3776 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
3777 Reported by Richard Dawe.
3779 2003-01-27 Andreas Schwab <schwab@suse.de>
3781 * src/ls.c (quote_name): Add fourth parameter, width, into which to
3782 store the screen columns, and return the number of bytes instead.
3783 (print_dir): Pass NULL as fourth parameter of quote_name.
3784 (print_name_with_quoting): Likewise.
3785 (length_of_file_name_and_frills): Get the width from the fourth
3786 parameter of quote_name instead of return value.
3788 2003-01-27 Jim Meyering <jim@meyering.net>
3790 * src/ls.c (decode_switches): If `dired' is set without
3791 `format == long_format', then silently reset dired. This doesn't
3792 change the behavior of ls (all prior uses of dired were protected
3793 by `&& format == long_format'), and lets us...
3794 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
3795 (PUSH_CURRENT_DIRED_POS): Likewise.
3798 2003-01-22 Jim Meyering <jim@meyering.net>
3800 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
3801 * tests/du/Makefile.am (TESTS): Add no-x.
3803 2003-01-21 Jim Meyering <jim@meyering.net>
3805 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
3806 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
3807 it may still be a directory -- or not (e.g., with FreeBSD on an
3808 NFS-mounted file system), so resort to calling lstat to find out.
3809 Based on a patch by Michael van Elst.
3811 * tests/cp/same-file: Don't assume that the file owner username
3812 length is less than 9 in ls output: instead, omit that field
3813 altogether. Reported by, and suggested fix from, Ferdinand.
3815 2003-01-20 Jim Meyering <jim@meyering.net>
3817 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
3818 large format widths no longer cause strftime to infloop.
3820 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
3822 2003-01-19 Jim Meyering <jim@meyering.net>
3824 * src/readlink.c: Include "canonicalize.h".
3826 2003-01-18 Jim Meyering <jim@meyering.net>
3828 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
3830 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
3831 (long_options): Add option --dereference-command-line-symlink-to-dir.
3832 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
3833 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
3834 -d, -F, -l options is specified.
3835 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
3836 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
3837 Change --dereference-command-line (-H) to dereference *all*
3838 command line arguments, including broken symlinks.
3840 2003-01-15 Paul Eggert <eggert@twinsun.com>
3842 Change ls -H back to the way it was yesterday, since this is
3843 compatible with FreeBSD and the POSIX spec is confusing
3844 and somewhat contradictory.
3846 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
3847 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
3848 (long_options): Change the long option name back.
3849 (usage): Change the usage back.
3850 (gobble_file): When -H is specified, dereference a top-level
3851 arg even if it points to a non-directory.
3853 2003-01-15 Jim Meyering <jim@meyering.net>
3855 * src/ls.c (gobble_file): Fall back on using lstat when required:
3856 when --dereference (-L) is not specified, and
3857 - when operating on a dangling symlink
3858 - when operating on command-line-symlink-to-directories
3859 This fixes numerous problems. Here are examples:
3860 - `ls dangling-symlink' would fail with `no such file...'
3861 Now it prints `dangling-symlink'.
3862 - `ls -i symlink' would mistakenly print the inode of the referent.
3863 Now it prints the inode of the symlink. Likewise for --size (-s).
3864 Based on a patch from Michael Stone.
3865 Reported by Deepak Goel as Debian bug #173793.
3867 Rename ls's --dereference-command-line (-H)
3868 option to --dereference-command-line-symlink-to-dir.
3869 * src/ls.c [enum Dereference_symlink]
3870 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
3871 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
3872 (long_options): Rename the long option.
3873 (usage): Say that --dereference-... changes how ls treats
3874 only symlinks to directories specified on the command line.
3876 2003-01-14 Jim Meyering <jim@meyering.net>
3878 * tests/ls/dangle: New file/test, for the above fix.
3879 * tests/ls/inode: Another new file/test, for the above fix.
3880 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
3882 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
3883 so that ls --color would no longer highlight the names of files with
3884 the execute bit set when not specified on the command line.
3885 Patch by Michael Stone. Reported by Stephen Depooter as
3888 * tests/ls-2/tests (color-exe): New test, for the above fix.
3890 2003-01-13 Jim Meyering <jim@meyering.net>
3892 * tests/shred/exact: Also test for just fixed bug with --zero.
3894 * src/shred.c (long_opts): --zero does not require an argument.
3895 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
3897 2003-01-12 Jim Meyering <jim@meyering.net>
3899 * Makefile.maint (cvs-update): Skip any file with local modifications.
3901 * src/unexpand.c (usage): Document --first-only and mention that
3902 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
3904 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
3906 * src/df.c: Include "canonicalize.h".
3907 Use canonicalize_file_name unconditionally.
3909 2003-01-09 Jim Meyering <jim@meyering.net>
3911 * README: Add readlink.
3913 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3915 * src/df.c: Include "xgetcwd.h".
3916 * src/pwd.c: Likewise.
3918 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3920 * src/shred.c: Remove declaration of xstrdup.
3921 We already get it via xalloc.h which is included via system.h.
3923 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
3925 New program: readlink.
3927 * src/Makefile.am (bin_PROGRAMS): Add readlink.
3928 * src/readlink.c: New file.
3930 * man/readlink.x: New file.
3931 * man/Makefile.am (dist_man_MANS): Add readlink.1.
3932 (readlink.1): New rule.
3934 2003-01-09 Jim Meyering <jim@meyering.net>
3936 When selecting ranges of byte offsets (as opposed to ranges of fields)
3937 and when --output-delimiter=STRING is specified, output STRING between
3938 ranges of selected bytes.
3939 * src/cut.c (RANGE_START_SENTINEL): Define.
3940 (output_delimiter_specified): New global.
3941 (print_kth): Add parameter. Adjust all callers.
3942 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
3943 (cut_bytes): When requested, output STRING between ranges of
3945 (main): Make a diagnostic a little clearer.
3946 Based on a patch from Jan Nieuwenhuizen.
3948 * tests/cut/Test.pm: New tests for the above.
3950 * src/cut.c (set_fields): Make code agree with comment:
3951 Don't merge abutting ranges like 4- and 2-3. This makes no
3952 difference currently, but is required to support an upcoming change.
3954 2003-01-07 Jim Meyering <jim@meyering.net>
3956 * src/cut.c (set_fields): Fix typo in comment.
3958 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
3959 * tests/touch/Makefile.am (TESTS): Add not-owner.
3960 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
3961 Now, this tests only the nonexistent-directory diagnostic.
3962 Suggestion from Michael Stone.
3964 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
3966 2003-01-04 Jim Meyering <jim@meyering.net>
3968 * src/copy.h: Remove use of PARAMS.
3969 * src/remove.h: Likewise.
3970 * src/chown-core.h: Likewise.
3972 rm could be tricked into mistakenly reporting a cycle.
3973 * src/remove.c: [cycle_check_state]: New global.
3974 (remove_cwd_entries): Adapt to new semantics of cycle_check.
3975 (rm): Call cycle_check_init and cycle_check_free for each file.
3976 * tests/rm/cycle (rm): New test, for the above fix.
3977 * tests/rm/Makefile.am (TESTS): Add cycle.
3979 When rm detects a cycle, don't abort the entire command,
3980 but rather just the affected command line argument.
3981 * src/remove.c: Include <setjmp.h>
3982 (struct dirstack_state) [current_arg_jumpbuf]: New member.
3983 (remove_cwd_entries): Call longjmp if we detect a cycle.
3984 (rm): Call setjmp here.
3986 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
3987 Instead, include cycle-check.h and use it.
3989 * src/remove.h (struct dev_ino): Remove declaration.
3991 * src/remove.c (remove_cwd_entries): Fix typos in comment.
3993 Don't include trailing /. in diagnostics about directories.
3994 * src/remove.c (full_filename_): When FILENAME is just `.'
3995 and there is a nonempty directory-name part, don't append `/.'.
3996 * tests/rm/unread2: Remove trailing /. from diagnostic.
3997 * tests/rm/rm2: Likewise.
3999 * src/remove.c (struct dirstack_state): Define.
4000 To be used in place of these file-scoped globals ...
4001 (dir_stack, len_stack, Active_dir): Remove globals.
4002 (ds_init, ds_free): New functions.
4003 (full_filename): Define.
4004 (full_filename_): Rename from full_filename.
4006 Begin to make AD_* functions more generic.
4007 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
4008 (AD_push): Likewise.
4009 (AD_INIT_OTHER_MEMBERS): Define.
4010 (remove_dir): Define the `status' member manually after each
4011 call to AD_push or AD_push_initial.
4013 * src/Makefile.am (check-misc): New rule, to ensure that no more
4014 S_IS* macro definitions sneak into the code.
4015 (check): Depend on check-misc.
4017 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
4018 * src/du.c (count_entry) [S_ISLNK]: Don't define.
4019 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
4021 2003-01-03 Jim Meyering <jim@meyering.net>
4023 * src/true.c: Add copyright.
4024 (AUTHORS): I suppose I've written it.
4026 * src/Makefile.am (false.c): Make the generated file be read-only.
4028 2003-01-04 Jim Meyering <jim@meyering.net>
4030 * src/ls.c: Include "dev-ino.h".
4031 [struct dev_ino]: Remove declaration.
4033 2003-01-02 Jim Meyering <jim@meyering.net>
4035 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
4036 from mv: s/missing file arguments/missing file argument/.
4037 With --target-directory=DIR, cp and mv work with a single file argument.
4038 Reported by Karl Berry.
4040 * tests/rm/isatty: Enable this test.
4042 2002-12-31 Jim Meyering <jim@meyering.net>
4044 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
4045 (AD_push): Likewise.
4046 (AD_INIT_OTHER_MEMBERS): Define.
4047 (remove_dir): Define the `status' member manually after each
4048 call to AD_push or AD_push_initial.
4050 * src/ls.c [struct dev_ino]: Remove definition.
4051 Include "dev-ino.h" instead.
4053 2002-12-28 Jim Meyering <jim@meyering.net>
4055 * tests/du/Makefile.am (TESTS): Add no-deref.
4056 * tests/du/no-deref: New script.
4058 2002-12-23 Jim Meyering <jim@meyering.net>
4060 * src/remove.c (remove_cwd_entries): Fix typo in comment.
4062 2002-12-21 Jim Meyering <jim@meyering.net>
4064 * announce-gen: Generate MML-formatted announcement.
4065 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
4067 2002-12-20 Jim Meyering <jim@meyering.net>
4069 * src/touch.c (touch): Change the wording of a diagnostic so
4070 that it makes sense both when the file exists and when it doesn't.
4071 Suggestion from Michael Stone.
4073 2002-12-18 Jim Meyering <jim@meyering.net>
4075 * src/stty.c (valid_options): Declare to be static.
4077 2002-12-15 Jim Meyering <jim@meyering.net>
4079 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
4081 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
4082 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
4083 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
4084 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
4085 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
4087 * src/remove.c (PARAMS): Remove definition.
4088 * src/sys2.h: Likewise.
4090 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
4091 Include strftime.h instead.
4093 2002-12-14 Jim Meyering <jim@meyering.net>
4095 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
4097 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
4098 This is necessary at least for Irix6.5 when using c89.
4099 Reported by Nelson Beebe.
4101 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
4103 * tests/misc/cat-tty-eof: New test.
4105 * src/mknod.c (usage): Specify how major and minor mode numbers
4106 are interpreted. Report forwarded by Kristin E Thomas.
4107 * src/mknod.c: Remove now-redundant usage-specifying comment.
4109 2002-12-13 Jim Meyering <jim@meyering.net>
4113 * tests/du/trailing-slash: Allow for a directory of size `0'.
4114 That happens at least on file systems of type tmpfs on linux-2.4.18.
4116 * announce-gen: New script to begin replacing the commands
4117 associated with the rule here...
4118 * Makefile.maint (announcement): Invoke announce-gen.
4119 * Makefile.am (EXTRA_DIST): Add announce-gen.
4121 * tests/cp/preserve-2: New file/test, for latest fix.
4122 * tests/cp/Makefile.am (TESTS): Add preserve-2.
4124 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
4126 Fix a bug whereby cp would fail to parse an option like
4127 --preserve=mode,ownership.
4128 * src/cp.c (decode_preserve_arg): Advance `comma' to
4129 point the character following the comma.
4131 2002-12-11 Jim Meyering <jim@meyering.net>
4133 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
4134 in case it's already defined.
4136 2002-12-09 Jim Meyering <jim@meyering.net>
4138 * tests/touch/fail-diag: Don't get a test failure if /no exists.
4139 Instead, evoke a framework failure if /no-$$ exists.
4140 Reported by Michael Stone.
4142 2002-12-08 Jim Meyering <jim@meyering.net>
4144 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
4145 Define to rpl_lstat, so that even on systems like Solaris 5.8,
4146 du honors (per POSIX) the trailing slash on an argument referring
4147 to a symlink-to-directory.
4149 2002-12-06 Jim Meyering <jim@meyering.net>
4151 * Use autoconf-2.57. Regenerate dependent files.
4152 * Use automake-1.7.2. Regenerate dependent files.
4154 * src/ls.c (gobble_file): Also stat the file if it's a
4155 regular file and --indicator-style=classify (aka -F).
4156 Thanks to Ed Santiago for opening my eyes.
4158 * tests/ls/file-type: New file. Test for the above.
4159 A test to contrast ls -F and ls --indicator-style=file-type.
4160 * tests/ls/Makefile.am (TESTS): Add file-type.
4162 2002-12-04 Jim Meyering <jim@meyering.net>
4164 * tests/ls/follow-slink: Make sure the symlink was created.
4165 Richard Dawe reported that `ln -s link link' succeeds, but creates
4166 no file on systems running some version of the DJGPP libc.
4168 2002-12-03 Jim Meyering <jim@meyering.net>
4170 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
4171 since this package no longer panders to K&R compilers.
4173 2002-12-02 Jim Meyering <jim@meyering.net>
4175 * tests/du/slink: Skip this test if `.' is on a non-local file system.
4177 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
4178 something to replace.
4180 2002-12-01 Jim Meyering <jim@meyering.net>
4182 * src/stat.c: Don't include <string.h> or <ctype.h>.
4183 That's already done via system.h.
4184 * src/dircolors.c: Don't include <ctype.h>.
4186 2002-11-30 Jim Meyering <jim@meyering.net>
4188 * ls.c (gobble_file): Remove the block of code that caused
4189 `ls --color -F symlink-to-dir' to list the files in
4190 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
4191 like `ls -F symlink-to-dir') but with the addition of highlighting.
4192 Similarly, `ls --color -dF symlink-to-dir' would print
4193 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
4194 Reported by Jeff Sheinberg as Debian bug #168203.
4195 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
4197 ls is now more efficient: with certain options, it no longer needs
4198 to stat each directory entry on systems with valid dirent.d_type.
4199 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
4200 (main): Make --recursive set format_needs_type, not format_needs_stat.
4201 (gobble_file): Remove a FIXME comment, now that it's fixed.
4203 2002-11-24 Jim Meyering <jim@meyering.net>
4205 * src/du.c (du_files): Don't strip any trailing slash.
4206 Rewrite so that `/' is no longer represented internally as
4208 (count_entry): When appending a file name component,
4209 account for the fact that the current path may end in `/'.
4210 François Pinard reported that `du symlink-to-dir/' was not
4211 equivalent to `du symlink-to-dir/.'. Now it is.
4212 * tests/du/trailing-slash: New file/test, for the above fix.
4213 * tests/du/Makefile.am (TESTS): Add trailing-slash.
4215 2002-11-23 Jim Meyering <jim@meyering.net>
4217 * src/tac.c (output): Declare some local variables to be of type size_t,
4218 rather than `int' to avoid warnings from gcc.
4220 2002-11-21 Paul Eggert <eggert@twinsun.com>
4222 * src/ls.c (decode_switches): Use case-sensitive matching to
4223 decode the QUOTING_STYLE environment variable. This is more
4224 consistent with the documentation, and with --quoting-style.
4226 2002-11-21 Martin Buck <martin.buck@ascom.ch
4228 * src/stty.c (struct speeds): Add support for all baud rates defined
4231 2002-11-19 Jim Meyering <jim@meyering.net>
4233 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
4234 run in a UTF locale. Report and suggested fix by Bruno Haible.
4235 * tests/fmt/basic: Likewise.
4237 2002-11-17 Jim Meyering <jim@meyering.net>
4239 * configure.ac: Update via autoupdate.
4240 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
4242 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
4243 Reported by Hans Ginzel.
4245 2002-11-15 Jim Meyering <jim@meyering.net>
4247 * Makefile.cfg (gnu_rel_host): Define.
4248 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
4249 on whether $(VERSION) looks like a major release number.
4251 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
4252 (release): Rename from `alpha'.
4253 (alpha): Depend on release.
4255 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
4257 2002-11-14 Jim Meyering <jim@meyering.net>
4259 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
4260 (announcement): Use the new variable.
4262 * Makefile.maint: Sync with Bison, i.e.:
4263 (po-check): Scan .l and .y files instead of the
4264 .c and the .h files that they generate. This fixes the bug
4265 reported by Tim Van Holder in:
4266 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
4267 Look for N_ as well as for _. Try to avoid matching #define for
4271 2002-11-12 Jim Meyering <jim@meyering.net>
4273 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
4274 Replace sole use with equivalent `#ifdef S_ISLNK'.
4275 Inconsistency reported by Dmitry V. Levin.
4277 2002-11-11 Jim Meyering <jim@meyering.net>
4279 * src/stat.c (usage): Transform --help items output via s/ - / /,
4280 so that help2man produces properly formatted man pages.
4281 Reported by Herbert Xu as Debian bug #168400.
4283 2002-11-10 Jim Meyering <jim@meyering.net>
4285 * src/ls.c (sighandler): Handle SIGTSTP specially.
4286 Based on suggestions from Solar Designer and Dmitry V. Levin.
4289 * Makefile.cfg (cvs_files): Define. From autoconf.
4290 (local_updates): Likewise.
4292 * src/ls.c (restore_default_color_handler, sigtstp_handler):
4294 (sighandler): New function, based on the one in sort.c.
4295 (main): Use sigaction, if possible; otherwise signal.
4296 Handle these signals:
4297 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
4298 Don't register our handler if the signal is already being ignored.
4300 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
4301 * src/csplit.c (interrupt_handler): Likewise.
4302 * src/sort.c (sighandler): Likewise.
4303 (main): Declare `i' and `nsigs' to be unsigned, not int.
4305 2002-11-09 Jim Meyering <jim@meyering.net>
4307 ls --color: restore terminal text color upon signal.
4308 * src/ls.c: Include "full-write.h" and <signal.h>.
4309 (restore_default_color, restore_default_color_handler): New functions.
4310 (sigtstp_handler, put_indicator_direct): New functions.
4311 (main) [print_with_color]: Register signal handlers.
4312 Patch mostly by Solar Designer and Stanislav Ievlev.
4314 Update from autoconf.
4315 * Makefile.maint (AMTAR): Remove definition.
4316 (update, cvs-update, po-update, do-po-update): New rules.
4317 (wget-update): Update (thus renaming to cvs-update).
4318 (automake_repo): Use anoncvs@sources.redhat.com.
4320 2002-11-06 Jim Meyering <jim@meyering.net>
4322 * tests/misc/Makefile.am (TESTS): Add printf-hex.
4324 * tests/misc/printf: Be careful to test the code in this package,
4325 not the shell built-in function.
4327 * src/printf.c (print_esc): A hexadecimal escape sequence has
4328 at most two hex. digits, not three. Reported by Padraig Brady.
4329 (usage): Update description.
4330 * tests/misc/printf-hex: New file/test, for the above fix.
4332 2002-10-07 Paul Eggert <eggert@twinsun.com>
4334 Add support for locale-specific size indications (e.g.,
4335 thousands-separators) and for explicit size suffixes on output.
4337 * doc/coreutils.texi (Block size): Say that:
4338 This affects display format as well as block size.
4339 Fractional block counts are rounded up.
4340 ls file size blocksize defaults to 1.
4341 A block size spec preceded by ' generates thousands separators.
4342 A suffix without a preceding integer generates suffixes.
4343 (tail invocation): 32k -> 32 KiB.
4344 (What information is listed): ls -h is now equivalent to
4345 ls --block-size=human, and ls -H is now equivalent to
4346 ls --block-size=si. Displayed file size is now always affected by
4349 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
4350 lib/umaxtostr.c: New files, taken from GNU tar.
4352 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
4354 (EXTRA_DIST): Add inttostr.c.
4356 * lib/human.c, lib/human.h: Rewrite to support locale-specific
4357 notations like thousands separators.
4358 Specify what includer of include.h must include beforehand.
4359 (human_group_digits, human_suppress_point_zero, human_autoscale,
4360 human_base_1024, human_SI, human_B): New enum values.
4361 (human_readable): Rename from human_readable_inexact; put the
4362 options before the sizes. All uses changed. The old human_readable
4363 function has been removed; use inttostr.h instead.
4364 (human_options): Renamed from human_block_size, with new signature
4365 that allows block sizes up to UINTMAX_MAX. All callers changed.
4367 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
4368 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
4369 freestanding C89. No need to check for stdlib.h or string.h since
4370 autoconf does this now.
4372 * src/cksum.c (cksum): Use primitives from inttostr.h, not
4373 human.h, to print large numbers simply.
4374 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
4375 * src/dd.c (print_stats, main): Likewise.
4376 * src/df.c (print_header): Likewise.
4377 * src/factor.c (print_factors): Likewise.
4378 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
4379 * src/shred.c (dopass): Likewise.
4380 * src/sort.c (checkfp): Likewise.
4381 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
4382 * src/tail.c (xlseek): Likewise.
4383 * src/wc.c (write_counts, wc): Likewise.
4385 * src/df.c (human_output_opts): New var.
4386 (output_block_size): Now uintmax_t, not int, to handle larger
4387 block sizes. All uses changed.
4388 * src/du.c: Likewise.
4389 * src/ls.c: Likewise.
4391 * src/df.c (print_header): In the header line, prefer SI to human
4392 representation if it's shorter; if neither is shorter, try to
4393 intuit what the user would prefer.
4395 * src/expr.c (inttostr): Remove; use new imaxtostr library
4398 * src/ls.c (file_output_block_size): New var, to distinguish
4399 file sizes from other sizes.
4400 (decode_switches): Set it.
4402 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
4403 (dopass): When printing progress, use floor for what has been done
4404 so far (since we should be conservative there), and ceiling for
4405 what needs to be done (since that's what other programs use).
4407 2002-10-19 Jim Meyering <jim@meyering.net>
4409 * src/pinky.c (print_heading): Align TTY and Name headings.
4410 Reported by Karl Eichwalder.
4412 2002-10-18 Jim Meyering <jim@meyering.net>
4414 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
4415 Remove now-useless cast.
4416 (stdread): Remove function.
4417 (bytes_split): Use size_t instead of int.
4418 Use safe_read, not stdread.
4419 (lines_split): Likewise.
4420 Use memchr rather than a `while' loop.
4421 (line_bytes_split): Use size_t instead of int.
4422 Use safe_read, not stdread.
4423 (main): Add some FIXME comments to remind me to remove casts.
4425 * src/system.h (ST_BLKSIZE): Correct comment describing how to
4426 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
4428 2002-10-17 Jim Meyering <jim@meyering.net>
4430 Fix a problem that could make e.g., `cat' misbehave on systems which
4431 give invalid (unreasonably large) values for stat.st_blksize.
4432 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
4433 Reported by Petter Reinholdtsen.
4435 2002-10-14 Jim Meyering <jim@meyering.net>
4437 Specifying a printf conversion specifer as nl's separator string
4438 could cause nl to segfault.
4439 * src/nl.c (build_print_fmt): Don't include separator string
4440 in the printf format; it might contain `%'.
4441 Use a better bound on the length of the print_fmt buffer.
4442 (print_lineno): Print the separator here instead.
4443 Reported by Doug Coleman.
4445 * tests/misc/nl: New file/tests, including a test for the above.
4446 * tests/misc/Makefile.am (TESTS): Add nl.
4448 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
4449 * tests/misc/Makefile.am (TESTS): Add split-l.
4451 2002-10-13 Jim Meyering <jim@meyering.net>
4455 * src/du.c (usage): Tweak description of --dereference-args/-D.
4457 * src/du.c (count_entry): Also save cwd when dereferencing (via
4458 --dereference-args, -D) a command-line argument.
4459 Reported by Michal Svec. Based on a patch by Andreas Schwab.
4461 * src/Makefile.am (../AUTHORS): New target/rule.
4463 2002-10-12 Jim Meyering <jim@meyering.net>
4465 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
4466 of type size_t, since that's the way it's used and avoids a warning.
4468 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
4469 since that's how it's always used and avoids a new warning from gcc.
4470 (read_input): Adapt to new safe_read ABI.
4472 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
4475 * src/pinky.c (print_long_entry): fread returns size_t.
4476 Declare local `bytes' accordingly, to avoid warning.
4478 tail -c +N would perform an extra read after encountering EOF
4479 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
4480 * src/tail.c (start_bytes): Detect EOF, inform caller.
4481 (tail_bytes): Upon EOF in start_bytes, return immediately.
4482 (file_lines): Reorganize to use memrchr rather than an explicit loop.
4483 Adapt to new safe_read ABI.
4485 2002-10-11 Jim Meyering <jim@meyering.net>
4487 * tests/du/deref: New file/test, for the above fix.
4488 * tests/du/Makefile.am (TESTS): Add deref.
4490 2002-10-10 Jim Meyering <jim@meyering.net>
4492 * tests/ln/Makefile.am (TESTS): Add target-1.
4493 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
4495 2002-10-09 Jim Meyering <jim@meyering.net>
4497 * tests/cp/backup-is-src: Ensure that certain environment variables
4498 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
4500 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
4501 consume 4GB of disk space on systems without support for sparse files.
4502 Fix a logic error that'd make it `cat err' even though dd didn't fail.
4504 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
4505 Patch by steven@magelico.net, forwarded by Michael Stone.
4507 * tests/ls/dired: Ensure that ls produces English messages.
4508 Patch by Alexey Vyskubov, forwarded by Michael Stone.
4510 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
4512 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
4514 2002-10-08 Jim Meyering <jim@meyering.net>
4516 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
4517 Fix syntax in test: use =, not ==.
4518 Reported by Bob Proulx.
4519 Change all the rest like this: grep -lR "testing framework'" .\
4520 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
4522 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
4523 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
4524 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
4525 * src/wc.c (wc): Likewise.
4527 2002-10-07 Paul Eggert <eggert@twinsun.com>
4530 Don't advance the write pointer past the end of the write buffer.
4531 * src/sort.c (begfield, limfield): Likewise.
4533 2002-10-07 Jim Meyering <jim@meyering.net>
4535 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
4536 * src/head.c (head_bytes, head_lines): Likewise.
4538 2002-10-06 Jim Meyering <jim@meyering.net>
4540 * src/dd.c (scanargs): Ensure that specified block sizes (specified
4541 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
4542 (skip, dd_copy): Adapt to new safe_read ABI.
4544 * Makefile.maint (signatures): Define.
4546 (announcement): Depend on $(signatures).
4548 * Makefile.maint (announcement): Output all URLs for detached
4549 signatures, not just the last one from the previous loop.
4551 2002-10-05 Jim Meyering <jim@meyering.net>
4555 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
4556 don't recurse into directory, DIR. Prompted by a report from
4559 * tests/rm/i-no-r: New file/test, for the above fix.
4560 * tests/rm/Makefile.am (TESTS): Add i-no-r.
4562 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
4563 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
4565 2002-10-03 Jim Meyering <jim@meyering.net>
4567 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
4568 * src/df.c (AUTHORS): Likewise.
4569 * src/du.c (AUTHORS): Likewise.
4570 * src/tail.c (AUTHORS): Likewise.
4571 * src/touch.c (AUTHORS): Likewise.
4573 2002-10-02 Jim Meyering <jim@meyering.net>
4575 * Makefile.am (SUBDIRS): Remove `old'.
4576 (EXTRA_DIST): List the files in old/.
4577 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
4578 Suggestion from Akim Demaille.
4580 2002-10-01 Jim Meyering <jim@meyering.net>
4582 * src/sys2.h (SSIZE_MAX): Define.
4584 2002-09-30 Jim Meyering <jim@meyering.net>
4586 * src/csplit.c: Don't include stdlib.h here. It's already included
4589 2002-09-29 Jim Meyering <jim@meyering.net>
4591 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
4592 expression to avoid bogus warning from gcc.
4594 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
4595 (cat): Declare insize and outsize to be of type size_t, not int.
4596 Rearrange pointer/integer expressions to avoid bogus warnings.
4597 (main): Declare insize and outsize to be of type size_t, not int.
4599 * src/tail.c (parse_options): Give a sensible diagnostic for
4600 an invalid byte or line count. Reported by Mikko Tuumanen.
4602 * src/touch.c (main): Split a long line.
4604 * tests/du/Makefile.am (TESTS): Add slink.
4605 * tests/du/slink: New test for system.h change of 2002-08-31.
4607 In move mode, always first try to rename. Before, upon failure to
4608 rename a directory, this code would never attempt to rename any
4609 other file in that directory, but would thenceforth always copy.
4610 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
4611 may fail with EXDEV, yet renaming files within that directory to
4612 a newly-created destination directory succeeds.
4613 * src/copy.c (copy_internal): Remove local, move_mode;
4614 use x->move_mode instead. Based on a patch from Tom Haynes.
4616 2002-09-28 Jim Meyering <jim@meyering.net>
4618 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
4619 Factor out some duplication.
4621 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
4623 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
4625 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
4626 to avoid compiler warnings.
4628 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
4631 Fix things so `mkdir -p' can create very deep directories, e.g.,
4632 mkdir -p $(perl -e 'print "a/" x 40000') now works.
4633 * src/mkdir.c (main): For --parents (-p), call make_path with the
4634 entire directory name, so we don't ever require that file operations
4635 like stat or chmod be performed on the entire command line argument.
4636 * makepath.c (make_path): Restore umask *before* creating the final
4639 2002-09-27 Andreas Schwab <schwab@suse.de>
4641 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
4642 to avoid overflow. Reported by Hans Lermen.
4644 2002-09-26 Jim Meyering <jim@meyering.net>
4646 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
4648 2002-09-25 Jim Meyering <jim@meyering.net>
4650 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
4651 and add a cast, to avoid a warning about `signed and unsigned type in
4652 conditional expression'.
4654 2002-09-22 Jim Meyering <jim@meyering.net>
4656 * src/rmdir.c: Include "dirname.h", for declaration of
4657 strip_trailing_slashes.
4659 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
4660 Now they're defined through system.h.
4662 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
4663 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
4664 since it's already included from sys2.h via system.h.
4666 * Use automake-1.6f. Regenerate dependent files.
4668 * src/Makefile.am (PERL): Remove duplicate definition.
4670 fmt's -s, -t, -c options didn't work properly for long lines.
4671 Since get_line may end up calling put_paragraph (for long lines),
4672 be sure to set global, `other_indent', before it is used there.
4674 * src/fmt.c (set_other_indent): New function, factored out of...
4675 (get_paragraph): ... here. Call it.
4676 (get_line): Call set_other_indent before calling flush_paragraph,
4677 which calls fmt_paragraph, which in turn calls put_paragraph,
4678 which uses other_indent.
4680 * tests/fmt/Makefile.am (TESTS): Add long-line.
4681 * tests/fmt/long-line: New file/test, for the above fix.
4683 2002-09-21 Jim Meyering <jim@meyering.net>
4685 * src/od.c: No longer include deprecated <values.h>.
4686 It was required solely for now-removed reference to BITSPERBYTE.
4687 * src/install.c: Likewise.
4688 Suggestion from Bruno Haible.
4690 2002-09-06 Andreas Schwab <schwab@suse.de>
4692 `rmdir -p dir-specified-with-trailing-slash/' would fail.
4693 * src/rmdir.c (remove_parents): Strip trailing slashes.
4695 2002-09-20 Jim Meyering <jim@meyering.net>
4697 * tests/rmdir/t-slash: New file/test, for the above fix.
4698 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
4700 * Makefile.maint (announcement): Arrange to gpg-sign the message.
4701 Add a URL for each detached signature file.
4703 2002-09-07 Bruno Haible <bruno@clisp.org>
4705 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
4707 2002-09-18 Jim Meyering <jim@meyering.net>
4709 `od -t x8' used the wrong (`l'-prefixed) printf format.
4710 Likewise for the o8 and u8 formats.
4711 * src/od.c (ISPEC_TO_FORMAT): Define macro.
4712 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
4713 Reported by Arun Sharma.
4715 2002-09-17 Jim Meyering <jim@meyering.net>
4717 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
4718 From gettext's intl/loadmsgcat.c.
4720 * tests/od/x8: New file/test, for the above fix.
4721 * tests/od/Makefile.am (TESTS): Add x8.
4723 2002-09-15 Jim Meyering <jim@meyering.net>
4725 * Use autoconf-2.54. Regenerate dependent files.
4727 * src/csplit.c (get_format_width): Add cast to avoid
4728 warning about `signed and unsigned type in conditional expression'.
4730 2002-09-14 Jim Meyering <jim@meyering.net>
4732 * src/who.c (print_user): Change type of local to size_t
4733 to avoid warnings about `comparison between signed and unsigned'.
4734 * src/ptx.c (generate_all_output): Likewise.
4736 * src/dd.c (main, skip): Add casts to avoid warnings about
4737 `comparison between signed and unsigned'.
4739 * src/id.c (print_full_info, print_group_list): Add casts to avoid
4740 warnings about `signed and unsigned type in conditional expression'.
4742 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
4743 to avoid warnings about `comparison between signed and unsigned'.
4744 (split_3): Change parameter names to be readable and add comment.
4745 Clean up the test for whether a line may be ignored.
4747 2002-09-13 Jim Meyering <jim@meyering.net>
4749 * src/printf.c (main): Handle leading command line argument of `--'.
4750 Reported by Raul: DervishD <raul@pleyades.net>
4751 * tests/misc/printf: New file: test for the above.
4752 * tests/misc/Makefile.am (TESTS): Add printf.
4754 * src/date.c (usage): Explain that %S's range of [0..60] is required --
4755 rather than 0..59 -- to accommodate the occasional positive leap second.
4756 Reported by Richard Neill.
4758 2002-09-12 Jim Meyering <jim@meyering.net>
4760 * src/Makefile.am (nanosec_libs): Define.
4761 (sleep_LDADD, tail_LDADD): Use it here.
4763 Factor nanosleep-related code into ../lib/xnanosleep.c.
4764 * src/sleep.c: Include xnanosleep.h.
4765 Factor out fenv.h-related code.
4766 (timespec_subtract): Remove function.
4767 (main): Remove code that deals with computing start and stop times
4768 as well as the loop around nanosleep. Now that's in xnanosleep.c.
4770 Allow S (in --sleep-interval=S) to be a floating point value.
4771 * src/tail.c: Include xnanosleep.h and xstrtod.h.
4772 Move declaration of global variable, sleep_interval, to ...
4774 (usage): Update description of --sleep-interval option.
4775 (tail_forever): New parameter, sleep_interval. Update caller.
4776 Use xnanosleep, rather than sleep.
4777 (parse_options): New parameter, sleep_interval. Update caller.
4778 Use xstrtod, now that we accept floating point values.
4779 Prompted by a patch from Augey Mikus.
4781 2002-09-06 Jim Meyering <jim@meyering.net>
4783 * src/remove.c (prompt): Change comment to give a better note to
4784 translators. From Michael Piefel.
4786 2002-09-02 Jim Meyering <jim@meyering.net>
4788 * README: A good problem report/patch includes diffs against
4789 the most recent test release.
4791 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
4792 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
4794 * src/kill.c (print_table_row): Use an unsigned type for widths
4795 to avoid warning about comparison between signed and unsigned.
4796 (list_signals): Likewise.
4798 * src/od.c (skip): Add a cast to avoid warning about comparison
4799 between signed and unsigned.
4800 * src/install.c (get_ids): Likewise. Also rearrange range-checking
4801 comparisons to make them more readable.
4803 2002-09-01 Jim Meyering <jim@meyering.net>
4807 2002-08-31 Jim Meyering <jim@meyering.net>
4809 Symlinks were always reported as using 0 blocks.
4810 * src/system.h (ST_NBLOCKS): Don't depend on file type.
4811 This reverts the change of 2000-01-30.
4812 Based on a report and patch from Neil Brown via Michael Stone.
4813 This fixes Debian Bug#156358.
4815 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
4816 `exit (1)' to `exit (EXIT_FAILURE)', and
4817 `usage (1)' to `usage (EXIT_FAILURE)'.
4819 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
4820 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
4821 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
4822 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
4823 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
4824 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
4825 error never exits successfully.
4827 2002-08-29 Jim Meyering <jim@meyering.net>
4829 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
4830 when ignoring any return value.
4832 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
4833 failures. On some systems (at least EMC Celerra and Solaris5.8),
4834 this appears to be necessary.
4835 (is_empty_dir): Likewise. Also, always close directory handle.
4836 * src/ls.c (print_dir): Likewise.
4837 (print_dir): Rename local variable: reading -> dirp.
4838 Reported by Mike Coleman.
4840 2002-08-28 Jim Meyering <jim@meyering.net>
4842 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
4843 Give a diagnostic and fail if closedir fails.
4845 2002-08-26 Jim Meyering <jim@meyering.net>
4847 * Makefile.am (THANKS-to-translators): New rule.
4848 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
4849 * THANKStt.in: New file.
4851 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
4853 (main): Register it with atexit.
4854 Close STDOUT_FILENO, to avoid a problem when writing to
4855 /dev/audio on at least Solaris 5.7 and 5.8 systems.
4856 Reported by Shing-Shong Shei.
4858 2002-08-25 Jim Meyering <jim@meyering.net>
4860 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
4861 * src/tac.c (main): Likewise.
4862 * src/tail.c (main): Likewise.
4863 * src/tee.c (main): Likewise.
4864 * src/tr.c (main): Likewise.
4865 * src/wc.c (main): Likewise.
4867 2002-08-20 Jim Meyering <jim@meyering.net>
4869 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
4871 2002-08-10 Paul Eggert <eggert@twinsun.com>
4873 * src/nohup.sh: Don't use "exec --"; it's not portable and
4874 shouldn't be needed.
4876 2002-08-09 Jim Meyering <jim@meyering.net>
4878 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
4879 (usage): Clarify help text for the -COLUMN option.
4880 Patch by Padraig Brady.
4881 * tests/pr/Test.pm [col-last]: New test for the above.
4883 * configure.ac: Start with version 4.5.1, chosen so that it's larger
4884 than the latest version numbers of the component packages.
4886 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
4889 2002-08-08 Jim Meyering <jim@meyering.net>
4891 * src/date.c: Guard inclusion of <langinfo.h> with
4892 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
4893 * src/sort.c: Likewise.
4894 Patch by GOTO Masanori.
4896 2002-08-05 Paul Eggert <eggert@twinsun.com>
4898 Fix some minor time-related bugs with POSIX time arguments.
4899 Some valid time stamps were being rejected (notably -1, and
4900 time stamps before 1900 on 64-bit hosts). And some invalid
4901 time stamps were being accepted, e.g. September 31.
4903 * src/date.c (main): Adjust to posixtime signature change.
4904 * src/touch.c (main): Likewise. Remove unnecessary initialization.
4905 Use localtime, not posixtm, to warn about obsolete "touch".
4907 2002-08-05 Jim Meyering <jim@meyering.net>
4909 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
4911 2002-08-04 Jim Meyering <jim@meyering.net>
4913 * src/Makefile.am (check-README): New target/rule.
4914 (check): Depend on it.
4916 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
4918 2002-08-03 Jim Meyering <jim@meyering.net>
4920 * Makefile.am (SUBDIRS): Add old.
4921 * old/: New directory, containing legacy ChangeLog* and NEWS files
4922 from the fileutils, sh-utils, and textutils packages.
4924 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
4926 2002-08-02 Paul Eggert <eggert@twinsun.com>
4928 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
4930 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
4931 (hard_LC_COLLATE): New var.
4932 (different): Args are now char *, not const char *.
4933 Use xmemcoll instead of memcmp to compare lines, so that
4934 LC_COLLATE has effect. However, use memcmp if it is an
4936 (check_file): Do not include newline in comparison, so that
4937 xmemcoll has a byte to stomp on temporarily.
4938 (main): Set hard_LC_COLLATE.
4940 2002-07-29 Jim Meyering <jim@meyering.net>
4942 * Makefile.am (SUBDIRS): Remove djgpp, for now.
4944 2002-07-20 Jim Meyering <jim@meyering.net>
4946 * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
4947 into EXIT_FAILURE. Otherwise, false --help and false --version
4950 2002-07-08 Jim Meyering <jim@meyering.net>
4952 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
4953 rather than the hard-coded `sh-utils'.
4955 2002-07-01 Jim Meyering <jim@meyering.net>
4957 * configure.ac: Merge the three files from fileutils,
4958 textutils, and sh-utils.
4959 * Makefile.am: Likewise.
4960 * src/Makefile.am: Likewise.