1 2004-03-12 Jim Meyering <jim@meyering.net>
5 Sometimes, when source and destination partition are different,
6 mv mistakenly fails to preserve a hard link. Reported by IIDA Yosiaki.
8 * src/copy.c: When moving a set of N hard-linked files between
9 partitions, via two or more command line arguments where the
10 command line argument containing the Nth link contains no other
11 link to that same file, mv would mistakenly copy the file, rather
12 than hard-linking it to the other(s). That happens because when the
13 final link is processed, its link count has been reduced to 1 since
14 the other links have been `copied' to the destination partition
15 and the source links have been removed.
16 (copy_internal): When in move mode, use the source dev/inode
17 pair to look up destination name even when st_nlink == 1.
18 * src/cp-hash.c (src_to_dest_lookup): New function.
19 * src/cp-hash.h (src_to_dest_lookup): Add prototype.
21 * tests/mv/part-hardlink: New file. Test for the above fix.
22 * tests/mv/Makefile.am (TESTS): Add part-hardlink.
24 2004-03-11 Jim Meyering <jim@meyering.net>
26 * Use automake-1.8.3. Regenerate dependent files.
28 2004-03-10 Jim Meyering <jim@meyering.net>
30 * tests/du/deref-args: Also convert sizes in the 70-79 kB range,
31 so that this test works with SELinux-enable systems.
32 Based on a patch from Tim Waugh.
34 `join -1 x' would give a misleading diagnostic
35 * src/join.c (string_to_join_field): Report that a non-numeric field
36 number is invalid, rather than `so large that it is not representable'.
37 * tests/join/Test.pm (invalid-j): New partial test for the above fix.
39 2004-03-06 Jim Meyering <jim@meyering.net>
41 cp --sparse=always sparse-image-file.img /dev/hda1 could
42 produce an invalid copy on the destination device.
44 * src/copy.c (copy_reg): Even with --sparse=always, try to
45 make `holes' only if the destination is a regular file.
46 Reported by Szakacsits Szabolcs.
48 2004-03-03 Paul Eggert <eggert@twinsun.com>
50 * src/nohup.c (main): Don't invoke set_cloexec_flag with
51 a file descriptor of -1.
53 2004-03-02 Dmitry V. Levin <ldv@altlinux.org>
55 * src/nohup.c: Include "cloexec.h".
56 (main): Set the copy of stderr to close on exec.
58 2004-03-01 Paul Eggert <eggert@twinsun.com>
60 * configure.ac: Include <signal.h> when checking for strsignal,
61 sys_siglist, and friends. Problem reported by Tony Leneis in
62 <http://mail.gnu.org/archive/html/bug-coreutils/2004-02/msg00136.html>.
64 2004-02-25 Paul Eggert <eggert@twinsun.com>
66 * tests/du/deref-args, tests/du/exclude, tests/du/slash:
67 * tests/du/trailing-slash: Run envvar-check in case BLOCK_SIZE
70 2004-02-23 Paul Eggert <eggert@twinsun.com>
72 * NEWS: Document how chown's USER.GROUP argument is now parsed.
74 2004-02-23 Jim Meyering <jim@meyering.net>
76 * src/seq.c (usage): Remove stray space after \n in --help output.
78 2004-02-22 Jim Meyering <jim@meyering.net>
80 * src/du.c (usage): Separate -H and --si. Say that the meaning
81 of -H will soon change to that of --dereference-args (-D).
83 2004-02-21 Jim Meyering <jim@meyering.net>
85 * src/comm.c (usage): Tell what comm does when there are no options.
86 Reword in terms of FILE1 and FILE2 rather than `left file' and
87 `right file'. Suggestion from Dan Jacobson.
89 2004-02-15 Paul Eggert <eggert@twinsun.com>
91 Fix some POSIX-conformance bugs in expr.
93 * NEWS: document the following changes to src/expr.c.
94 * doc/coreutils.texi (expr invocation): Likewise.
95 Document what forms integers may take, and say "integer"
96 consistently instead of "number". Warn about operands
97 that "expr" can misinterpret, and how to work around the
99 * src/expr.c (eval, eval7, eval6, eval5, eval4, eval3, eval2, eval1):
100 Accept a bool argument specifying whether to evaluate the
101 expression. This is to allow short-circuit evaluation. All
103 (null): Report that a string is zero even if it has
104 a form like "-0" or "00".
105 (eval1, eval): Use short-circuit evaluation for | and &.
106 (eval): Return 0 if both arguments are null or zero, instead
107 of returning the first argument.
108 * tests/expr/basic: Add some tests for the above.
110 2004-02-17 Jim Meyering <jim@meyering.net>
114 `make check' from a build inside a chroot environment would fail
115 * tests/help-version: Specify an argument (`/') for df, in the
116 unusual event that there is no valid entry in /etc/mtab.
117 Likewise for id: add the -u option, so we don't get spurious
118 failures when there are no user or group names.
121 * src/sort.c (usage) [-u]: Add punctuation so that the description in
122 the help2man-generated (line-joined) man page is more readable.
123 Reported by Tim Waugh.
124 [-T]: Add a semicolon, for the same reason.
126 2004-02-15 Jim Meyering <jim@meyering.net>
128 * Makefile.am (dist-hook): Qualify target with $(srcdir)/ prefix.
130 2004-02-11 Jim Meyering <jim@meyering.net>
132 * tests/Makefile.am.in ($(srcdir)/Makefile.am): Use more portable
133 $(srcdir)/../Makefile.am.in, rather than $<.
134 Suggestion from Michael Elizabeth Chastain.
136 2004-02-10 Jim Meyering <jim@meyering.net>
138 * config/install-sh: Make this script executable.
139 * Makefile.am (dist-hook): New target, to ensure that config/install-sh
140 is executable. Otherwise, on systems that lack a suitable install
141 binary, `make install' would fail, because of the way this script
142 is invoked (without `$SHELL ' prefix).
143 Reported by Bob Proulx.
145 2004-02-08 Jim Meyering <jim@meyering.net>
149 * tests/rm/rm5: Avoid triggering a bug in OSF/Tru64's sed
150 that would cause an unwarranted test failure.
151 * tests/rm/rm3: Likewise.
153 2004-02-07 Jim Meyering <jim@meyering.net>
155 Remove xstat function pointer member. The way it was used was not
156 portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
157 inline `stat' and `lstat' functions, thus making the tests of
158 `xstat == lstat' in copy.c always fail.
159 * src/copy.h (struct cp_options) [xstat]: Remove member.
161 * src/copy.c (copy_dir): Set `.dereference' member, not .xstat.
162 (copy_internal): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.
163 Use `x->dereference == DEREF_NEVER' in place of `x->xstat == lstat'.
164 (valid_options): Remove now-obsolete FIXME comments.
166 * src/cp.c (re_protect): Use `XSTAT (x, ...)' in place of
168 (do_copy): Declare/use local xstat rather than x->xstat.
169 (main): Remove code that set x.xstat.
170 * src/mv.c (cp_option_init): Don't initialize xstat member.
171 * src/install.c (cp_option_init): Likewise.
173 * Makefile.cfg (gnu_ftp_host-alpha, etc.): Un-factor .gnu.org suffix,
174 so that emit_upload_commands can use these variables, too.
176 2004-02-06 Jim Meyering <jim@meyering.net>
178 * tests/rm/deep-1: Remove `du' stack space test.
179 Apparently, `ulimit -s N' isn't portable enough.
180 This test will be restored (with a guard against losing ulimit)
181 in its own file later.
183 * tests/rm/deep-1 (deep): Remove progress-style diagnostics,
184 since this test doesn't take long enough to merit them.
185 Run du on $tmp (the containing dir), not $deep, the full path to leaf.
187 * Makefile.maint (signatures): Remove definition.
188 Now, automake's gnupload handles this.
189 (%.sig: %): Remove now-unused rule.
190 (rel-files): Use automake's $(DIST_ARCHIVES), rather than
191 `$(distdir).tar.bz2 $(distdir).tar.gz'.
192 (emit-upload-commands): Adjust to use gnupload.
194 2004-02-05 Jim Meyering <jim@meyering.net>
196 * src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP): Remove definitions.
197 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
198 Now, those are all defined in timespec.h.
201 * src/date.c: Don't include timespec.h, now that system.h does it.
203 2004-02-02 Paul Eggert <eggert@twinsun.com>
205 Don't dump core if localtime returns NULL (possible on
206 hosts with 64-bit time_t and 32-bit int).
207 * src/date.c: Include "inttostr.h".
208 (batch_convert, main):
209 If time conversion fails, exit with nonzero status.
210 (show_date): Return int to report conversion failure.
211 Print the time as an int if localtime fails.
212 * src/uptime.c: Print "??" if the current clock can't
213 be converted by localtime. This won't happen until the year
214 2*31 + 1900, but we don't want to dump core even if the current
215 clock has the wrong value.
217 * src/stat.c: Include "inttostr.h".
218 (human_time): Print the date/time as a number of seconds since the
219 epoch if it can't be converted by localtime. This is better than
220 just saying "invalid", and is consistent with what "ls" does.
221 Don't dump core if the year has more than 48 digits; this isn't
222 possible on any contemporary host, but we might as well do it right.
224 2004-01-31 Paul Eggert <eggert@twinsun.com>
226 * src/stat.c (human_time): Accept time rather than
227 pointer-to-const-time parameter, for clarity. All callers changed.
229 2004-02-02 Jim Meyering <jim@meyering.net>
231 * src/stat.c (do_stat): Remove extra trailing newline from
232 default formats. Reported by Nelson H. F. Beebe.
234 Print actual fractional seconds in time stamps, not just `.00000000'.
235 * src/stat.c (human_time): Add and use new parameter, t_ns.
236 (print_stat): Update callers.
237 * src/ls.c (TIMESPEC_NS): Remove definition.
238 * src/system.h (TIMESPEC_NS): Define here, instead, now that stat.c
239 also uses this macro.
240 Nelson H. F. Beebe noticed that ls --full-time printed nonzero
241 fractional seconds for files on an XFS file system, but that stat's
242 fractional seconds were always zero.
244 2004-01-28 Paul Eggert <eggert@twinsun.com>
246 * src/seq.c (print_numbers): Use 'double' for loop index, not
247 'int', to avoid problems with integer overflow. On almost all
248 machines 'double' works in every case where 'int' works, and
249 it works on other cases besides.
251 2004-01-27 Jim Meyering <jim@meyering.net>
253 * src/seq.c (usage): Mention that if INCREMENT is omitted,
254 it defaults to 1, even when FIRST is larger than LAST.
255 Reword so as not to exclude the possibility that INCREMENT be zero.
257 2004-01-25 Jim Meyering <jim@meyering.net>
261 * Makefile.maint (signatures): Comment out definition.
263 2004-01-23 Jim Meyering <jim@meyering.net>
265 * Makefile.maint (header_regexp): Add exitfail.
267 * man/Makefile.am (EXTRA_DIST): Add help2man.
268 Reported by Nelson H. F. Beebe.
270 * man/Makefile.am (.x.1): Prefix help2man invocation with `$(PERL) --'
271 so it works on systems with Perl installed somewhere other than in
274 * src/paste.c (paste_parallel): Declare local, chr, to be of type
275 `int', not `char', since it must hold EOF. This bug would make
276 paste infloop on some systems. Test failures reported by
277 Nelson H. F. Beebe and Christian Krackowizer.
279 2004-01-22 Jim Meyering <jim@meyering.net>
281 * tests/rmdir/fail-perm: New file. Test for just-fixed rmdir bug.
282 * tests/rmdir/Makefile.am (TESTS): Add fail-perm.
284 * man/help2man: Fix it so using --info-page='coreutils PROG' works.
285 * man/Makefile.am (.x.1): Invoke our own (tweaked) copy of help2man.
286 Use --info-page='coreutils PROG' option.
287 Now, readlink.1 refers the user to `info coreutils readlink'
288 rather than to `info readlink'. Reported by Matt Swift.
290 2004-01-21 Paul Eggert <eggert@twinsun.com>
294 * src/basename.c (usage): Use EXIT_SUCCESS, not 0, for clarity.
295 * src/cat.c, src/chgrp.c, src/chmod.c, src/chown.c, src/chroot.c,
296 * src/cksum.c, src/comm.c, src/cp.c, src/csplit.c, src/cut.c,
297 * src/date.c, src/dd.c, src/df.c, src/dircolors.c, src/dirname.c,
298 * src/du.c, src/echo.c, src/env.c, src/expand.c, src/expr.c,
299 * src/factor.c, src/fmt.c, src/fold.c, src/head.c, src/hostid.c,
300 * src/hostname.c, src/id.c, src/install.c, src/join.c, src/kill.c,
301 * src/link.c, src/ln.c, src/logname.c, src/ls.c, src/md5sum.c,
302 * src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c,
303 * src/nl.c, src/nohup.c, src/od.c, src/paste.c, src/pathchk.c,
304 * src/pinky.c, src/pr.c, src/printenv.c, src/printf.c, src/pwd.c,
305 * src/rm.c, src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c,
306 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c,
307 * src/su.c, src/sum.c, src/sync.c, src/tac.c, src/tail.c, src/tee.c,
308 * src/test.c, src/touch.c, src/tr.c, src/tsort.c, src/tty.c,
309 * src/uname.c, src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c,
310 * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c: Likewise.
312 * src/cat.c (usage): Don't bother normalizing exit status
313 since the arg is already the correct exit status now.
314 * src/cksum.c, src/comm.c, src/csplit.c, src/cut.c,
315 * src/dircolors.c, src/expand.c, src/fmt.c, src/fold.c, src/head.c,
316 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c,
317 * src/pr.c, src/split.c, src/sum.c, src/tac.c, src/tail.c, src/tr.c,
318 * src/tsort.c, unexpand.c, src/src/uniq.c, src/src/wc.c: Likewise.
320 * src/chown.c (main): Removed unused local 'fail'.
322 * src/chroot.c (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE):
325 * src/chroot.c (main): Initialize exit_failure to EXIT_FAIL.
326 * src/env.c, src/nice.c, src/su.c: Likewise.
327 * src/nohup.c (main): Likewise, to NOHUP_FAILURE.
328 * src/setuidgid.c (main): Likewise, to SETUIDGID_FAILURE.
329 * src/expr.c (main): Use initialize_exit_failure rather than
330 setting exit_failure directly; this optimizes away redundant
332 * src/printenv.c, src/sort.c, src/test.c, src/tty.c: Likewise.
334 * src/chroot.c (main): Exit with status 1 rather than 127
335 if chroot itself fails, as per documentation.
337 * src/chroot.c (main): Use EXIT_ENOENT and EXIT_CANNOT_INVOKE
338 rather than roll-your-own symbols or integers.
339 * src/env.c (main): Likewise.
340 * src/nohup.c (main): Likewise.
341 * src/su.c (run_shell): Likewise.
343 * src/cp.c (exit_status): Remove static var....
344 (main): Making it local here instead. Use =, not |=, to set it.
346 * src/cut.c (FATAL_ERROR, main): Exit with status EXIT_FAILURE,
348 * src/date.c (batch_convert, main): Likewise.
349 * src/dd.c (dd_copy): Likewise.
350 * src/pr.c (first_last_page, main, getoptarg): Likewise.
351 * src/tr.c (main): Likewise.
352 * src/date.c (main): Don't assume EXIT_FAILURE == 1, as
353 POSIX doesn't require it.
354 * src/dd.c (write_output, skip, dd_copy): Likewise.
355 * src/df.c (main): Likewise.
356 * src/id.c (main): Likewise.
357 * src/install.c (main): Likewise.
358 * src/ln.c (main): Likewise.
359 * src/ls.c (main): Likewise.
360 * src/mv.c (main): Likewise.
361 * src/shred.c (main): Likewise.
363 * src/env.c (main): Exit with status 1, not 2, on errors detected
365 * src/hostname.c (main): Likewise.
366 * src/nl.c (main): Likewise.
367 * src/stty.c (main): Likewise.
369 * src/expr.c (EXPR_FAILURE): Renamed from EXPR_ERROR, for
370 consistency with the other programs' naming conventions.
373 * src/factor.c (main): Do not report a usage error simply
374 because stdin has bad numbers.
376 * src/id.c (problems): Now a boolean int, not a counter,
377 so that we don't have to worry about int overflow. All uses changed.
378 * src/touch.c (err): Likewise.
380 * src/md5sum.c (main): Use int, not size_t, to store boolean int.
382 * src/mkfifo.c (main): Exit with status 1, not 4, if not implemented.
383 * src/mknod.c: Likewise.
385 * src/nice.c (main): Exit with status EXIT_FAIL, not EXIT_FAILURE,
386 on error; this is in case EXIT_FAILURE is unusual.
387 * src/su.c (main): Likewise.
389 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE): Remove; all uses
390 changed to EXIT_CANNOT_INVOKE.
392 * src/printenv.c (PRINTENV_FAILURE): New constant.
393 (main): Exit with status PRINTENV_FAILURE, not EXIT_FAILURE, on
394 command-line syntax problems.
396 * src/rmdir.c (remove_parents): Don't set 'fail' to a negative number.
397 (main): Avoid integer overflow when seeing whether errors occurred.
399 * src/seq.c (print_numbers): Now returns void, not (zero) int.
401 (main): Remove unused local variable 'errs'. Always exit successfully
404 * src/setuidgid.c (SETUIDGID_FAILURE): Renamed from FAIL_STATUS,
405 for consistency with other programs here. All uses changed.
406 (main): Use 'error' to exit rather than invoking 'exit' here.
408 * src/sort.c: Don't include <assert.h>.
409 (SORT_OUT_OF_ORDER, SORT_FAILURE): Now enums, not macros.
410 (usage): Don't use 'assert'.
411 (main): Remove redundant assignment to exit_failure.
413 * src/system.h (EXIT_FAIL, EXIT_CANNOT_INVOKE, EXIT_ENOENT):
415 (initialize_exit_failure): New inline function.
416 Include exitfail.h here, since we refer to exit_failure.
417 All callers changed to not include exitfail.h.
419 * src/tty.c (TTY_FAILURE, TTY_WRITE_ERROR): New enum values;
420 substitute them for the corresponding integer constants.
422 * tests/help-version (expected_failure_status_date): Remove, as
423 'date' is now normal.
424 (expected_failure_status_nohup): New var.
426 2004-01-21 Jim Meyering <jim@meyering.net>
428 * tests/touch/relative: Remove `command' syntax.
429 Thanks to Nelson H. F. Beebe and Paul Eggert.
431 * tests/touch/relative: Test only year/month/day, not hours/min/sec,
432 so as to avoid problems with systems using TAI clocks.
433 Although it's no longer necessary, set TZ=UTC0 also for the
434 initial touch command. Reported by Paul Jarc here:
435 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/1504
437 2004-01-20 Diego Biurrun <diego@biurrun.de>
439 * src/dircolors.hin: Add .mov to the list of media files.
441 2004-01-19 Paul Eggert <eggert@twinsun.com>
443 * tests/touch/relative: Use TZ=UTC0, not TZ=utc (which isn't
444 portable). Problem reported by Christian Krackowizer. Also, use
445 +0000 rather than +0 to specify a time zone, as the documentation
446 requires four digits.
448 2004-01-19 Jim Meyering <jim@meyering.net>
450 * tests/mv/hard-4: Run envvar-check in case SIMPLE_BACKUP_SUFFIX is set.
451 * tests/mv/backup-is-src: Likewise.
452 Problem reported by Peter Horst
454 2004-01-17 Jim Meyering <jim@meyering.net>
456 * announce-gen (print_changelog_deltas): Use .sig suffix, not .asc.
460 2003-12-15 Paul Eggert <eggert@twinsun.com>
462 * NEWS, doc/coreutils.texi: touch -r and -d can now both be specified,
463 with -r specifying the origin for -d.
464 * src/touch.c (flexible_date): Remove static var.
465 (get_reldate): New function.
466 (main): Use it, to implement this new behavior.
468 2004-01-16 Jim Meyering <jim@meyering.net>
470 * tests/touch/relative: New test for the above.
471 * tests/touch/Makefile.am (TESTS): Add relative.
473 2004-01-13 Jim Meyering <jim@meyering.net>
475 * src/system.h: Include contents of sys2.h.
476 * src/sys2.h: Remove file.
477 * src/Makefile.am (noinst_HEADERS): Remove sys2.h.
479 * Use automake-1.8.2. Regenerate dependent files.
481 * Update to gettext-0.13.1.
482 * configure.ac: Use gettext-0.13.1.
483 * .x-sc_space_tab: Add m4/po.m4 to the list of exceptions.
485 2004-01-12 Jim Meyering <jim@meyering.net>
487 * Makefile.maint (%.sig): Use .sig suffix rather than .asc.
489 * Makefile.maint (po-check): Ensure that cvsu works before using it.
490 Reported by Alexandre Duret-Lutz.
492 * src/tail.c (main): Warn about following stdin only when it's a tty.
494 * configure.ac: Use gl_DEFAULT_POSIX2_VERSION.
496 2004-01-10 Jim Meyering <jim@meyering.net>
498 * tests/misc/stat-fmt: Use backticks, not `$()' notation.
500 2004-01-09 Jim Meyering <jim@meyering.net>
502 * configure.ac: Quote underquoted `jm_DUMMY_1' to avoid new warning.
504 2004-01-08 Jim Meyering <jim@meyering.net>
506 * src/stat.c (human_fstype): Use %lx, not %x format for `unsigned long'.
509 * tests/Makefile.am (TESTS_ENVIRONMENT): Remove `/vg' (prerelease test
510 remnant) from PATH component. That would cause tests in this directory
511 not to run the just-built binaries, but rather whatever happened
512 to be in one's PATH. Reported by Christian Krackowizer.
514 2004-01-04 Jim Meyering <jim@meyering.net>
516 * src/csplit.c (new_control_record): Use x2nrealloc
517 rather than xrealloc.
519 * src/cp.c (re_protect): Use ASSIGN_STRDUPA rather than
521 (make_path_private): Likewise.
523 2004-01-03 Jim Meyering <jim@meyering.net>
525 * src/paste.c: Use `bool' (not int) as the type for a few
527 (collapse_escapes): Rewrite to set globals rather than modifying
529 Use size_t (not int) for all counters and related index variables.
530 (paste_parallel): Remove needless complexity of
531 using xrealloc in the loop; just allocate the buffers up front.
532 Free the two temporary buffers.
533 Move declarations of locals `down' into scope where used.
534 (paste_serial): Remove `register' attributes.
535 (main): Simplify delim-related code.
536 Free `delims', now that it's malloc'd.
538 2004-01-02 Jim Meyering <jim@meyering.net>
540 * src/chroot.c: Include "quote.h".
541 (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): Define.
542 (main): Exit with status of 127, not 1, for too-few-args,
543 chroot failure, or chdir failure.
544 Give a better diagnostic upon execvp failure.
546 * src/du.c (usage): Mention that, with its current meaning,
549 * src/tail.c (main): Warn about following stdin when it's a tty.
550 Fail when following by name but no names are specified.
552 2003-12-30 Jim Meyering <jim@meyering.net>
554 * src/fold.c (main): Use memcpy, not strcpy.
556 * src/copy.c (copy_internal): Use ASSIGN_STRDUPA rather than
559 2003-12-28 Jim Meyering <jim@meyering.net>
561 * src/unexpand.c (n_tabs_allocated): New global.
562 (add_tabstop): Use x2nrealloc rather than xrealloc.
563 * src/expand.c: Likewise.
565 * tests/misc/expand: New file.
566 * tests/misc/Makefile.am (TESTS): Add expand.
568 * src/sort.c (add_temp_dir): Use x2nrealloc rather than xrealloc.
569 (fillbuf): Use x2nrealloc rather than xrealloc.
570 (sort): Use xnmalloc rather than xmalloc.
573 2003-12-27 Jim Meyering <jim@meyering.net>
575 * src/tee.c (tee): Use xnmalloc rather than xmalloc.
577 2003-12-29 Paul Eggert <eggert@twinsun.com>
579 * NEWS: Remove support for join -j1 FIELD, -j2 FIELD, and -o LIST1
580 LIST2 in POSIX 1003.1-2001 hosts, as required by POSIX.
582 * doc/coreutils.texi (join invocation): Remove documentation
583 accordingly. Document that -t makes all separators significant.
585 * src/join.c: Include posixver.h.
586 (obsolete_usage): New var.
587 (longopts): Put obsolete options first.
588 (OBSOLETE_LONG_OPTIONS): New constant.
589 (get_option, add_file_name): New functions.
590 (main): Use them to support new behavior.
591 (usage): Remove documentation for -j1 FIELD and -j2 FIELD.
592 Do not mark -j FIELD as obsolescent; it is longstanding
593 UNIX tradition and is a valid extension to POSIX.
595 * tests/join/Test.pm (tv): Avoid obsolete -o usage.
597 2003-12-28 Paul Eggert <eggert@twinsun.com>
599 * src/join.c (add_field_list): Don't use alloca with unbounded
600 size; just modify the argument, which is no longer const *.
602 Various other minor cleanups, mostly to avoid the need for casts.
604 (extract_field): Renamed from ADD_FIELD, as it's now a function.
606 (struct field.beg): Now char *, not unsigned char const *. All
607 uses changed. It shouldn't be const since xmemcoll writes on its
609 (extract_field): Likewise, for 2nd arg.
610 (keycmp): Remove now-unnecessary cast of xmemcoll args.
612 (is_blank): New function, to avoid need to cast arg to unsigned char.
613 (extract_field): Use it.
615 (xfields): Rewrite pretty much from scratch.
617 (hard_LC_COLLATE): Now bool, not int.
618 (get_line, getseq, add_field_list): Now returns bool, not int.
619 (decode_field_spec, add_field_list): Return true on success (not
620 false), for consistency with the rest of the code. All uses changed.
622 (tab): Now char, not unsigned char. This wasn't 100% necessary
623 but is slightly cleaner.
624 (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler.
626 (empty_filler): Now const *.
628 (make_blank): Remove; wasn't needed. Remove all calls.
629 (main): Don't set uni_blank.nfields; zero is fine.
631 2003-12-27 Jim Meyering <jim@meyering.net>
633 * src/join.c: Include "quote.h".
634 (min, max): Remove definitions.
635 Make a few function parameters and corresponding
636 locals `const'. Use bool for boolean variables.
637 Use size_t (not int) for all counters and related index variables.
638 (prjoin): Remove now-useless assertion.
639 (string_to_join_field): New function.
640 (main): Accept join fields as large as SIZE_MAX.
641 (keycmp): Rename `min' to MIN and max to MAX.
643 2003-12-26 Jim Meyering <jim@meyering.net>
645 fold -s didn't work on e.g., alpha-based systems.
646 * src/fold.c (fold_file): Adjust types (int->size_t) so that using
647 x2nrealloc works properly on systems with differing sizes for int
648 and size_t. Reported by Nelson Beebe.
650 * src/fold.c: Use `bool' (not int) as the type for a few
653 2003-12-23 Paul Eggert <eggert@twinsun.com>
655 * src/ls.c (length_of_file_names_and_frills):
656 Remove forward decl; not needed.
657 (print_file_name_and_frills, length_of_file_name_and_frills):
658 With -m, don't output spaces before inum or size.
659 (print_with_commas): Don't output space just before newline.
661 2003-12-24 Jim Meyering <jim@meyering.net>
663 * tests/ls/Makefile.am (TESTS): Add m-option.
664 * tests/ls/m-option: New file. Test for above fixes.
666 2003-12-20 Jim Meyering <jim@meyering.net>
670 * src/pr.c: Change type of global, buff_allocated, to size_t.
672 * src/join.c [struct seq]: Change types of members count and alloc
673 from `int' to `size_t'.
675 * tests/Makefile.am (root-hint): Tweak wording.
677 * src/du.c: Accept new option (-0, --null) that makes it so each
678 output line is NUL-terminated rather than newline-terminated.
680 * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync.
681 Reported by Volker Paul.
682 * tests/dd/Makefile.am (TESTS): Add unblock-sync.
683 * tests/dd/unblock-sync: New test for the above.
685 2003-12-19 Jim Meyering <jim@meyering.net>
687 * tests/misc/nohup: Double quote back-ticked expression,
688 in case it ends up having an unexpected value.
690 * tests/ls/no-arg: Use ls's -1 option in both runs.
692 * src/du.c (fts_debug): New global.
693 (FTS_CROSS_CHECK, DEBUG_OPT): Define.
694 (main): Make fts use FTS_TIGHT_CYCLE_CHECK.
695 (main) [DU_DEBUG]: Accept -d option.
697 2003-12-18 Jim Meyering <jim@meyering.net>
699 * src/ls.c (format_user): Increment dired_pos via two statements,
700 `dired_pos += width; dired_pos++;' rather than one,
701 `dired_pos += width + 1;' since the latter could conceivably overflow.
702 (format_group): Likewise.
705 * configure.ac: Require automake-1.8.
707 2003-12-12 Jim Meyering <jim@meyering.net>
709 * Use automake-1.8. Regenerate dependent files.
711 2003-12-08 Jim Meyering <jim@meyering.net>
713 * Makefile.maint (news-date-check): New rule.
714 (alpha beta major): Depend on it.
716 2003-12-03 Paul Eggert <eggert@twinsun.com>
718 * NEWS: ls -l (and similar options) now adjust all columns to
719 fit the data. Generalized from a suggestion by Leah Q for file sizes.
720 * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
721 (format_user_width, format_group_width, unsigned_file_size,
722 format_group): New functions.
723 (block_size_width): Renamed from block_size_size.
724 (inode_number_width, nlink_width, owner_width, group_width,
725 author_width, major_device_number_width, minor_device_number_width,
726 file_size_width): New vars.
727 (clear_files): Initialize them.
728 (gobble_file): Set them. Don't ceiling block_size_width to 7.
729 (print_long_file): Use them.
730 (gobble_file): Use a new local variable 'f' to make the code
731 smaller and more consistent with other functions.
732 (format_user): Output to stdout, not to a buffer, so that we
733 don't have to worry about buffer overrun. Update dired_pos.
734 (print_long_file): Don't put owner, group, author into buffer;
735 just print them directly. Don't assume link counts and
736 major and minor numbers fit into unsigned long int.
737 * tests/cp/same-file, tests/mv/part-symlink: Don't assume that
738 'ls' output is fixed-width.
740 2003-12-02 Jim Meyering <jim@meyering.net>
742 * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h.
744 2003-11-27 Jim Meyering <jim@meyering.net>
746 * Use automake-1.7f. Regenerate dependent files.
748 2003-11-24 Paul Eggert <eggert@twinsun.com>
750 Parse floating-point operands and options in the C locale.
751 POSIX requires this for printf, and we might as well be
752 consistent elsewhere (tail, sleep, seq).
754 * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer
755 needed now that we assume C89. Include "c-strtod.h".
756 (xstrtod): Call c_strtod, not strtod.
757 * src/sleep.c: Include "c-strtod.h".
758 (main): Update xstrtod call to include new argument, c_strtod.
759 * src/seq.c (scan_double_arg): Likewise.
760 * src/tail.c (parse_options): Likewise.
762 2003-11-24 Jim Meyering <jim@meyering.net>
764 * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM).
765 Reported by Mark Conty.
767 2003-11-22 Jim Meyering <jim@meyering.net>
769 * Makefile.maint (sc_xalloc_h_in_src): Remove rule. Subsumed by...
770 (sc_system_h_headers): Do this test only if sys2.h exists.
772 2003-11-20 Jim Meyering <jim@meyering.net>
774 * tests/help-version: Ensure that the bug-reporting address is
775 included in the --help output for every program.
776 * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.
778 * src/ptx.c (usage): Output bug-reporting address.
779 Reported by Dan Jacobson.
781 2003-11-19 Jim Meyering <jim@meyering.net>
783 * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted
784 on the join fields. Suggestion from Bruce Robertson.
786 2003-11-18 Jim Meyering <jim@meyering.net>
788 `od -c -w9999999' could segfault
789 * src/od.c (dump): Use xnmalloc/free, not alloca.
791 2003-11-16 Jim Meyering <jim@meyering.net>
793 * Use autoconf-2.59. Regenerate dependent files.
795 * tests/du/hard-link: Minor tweak: use mkdir -p.
797 Fix read-from-free'd-buffer error detected by valgrind.
798 * src/csplit.c (remove_line): Don't return a pointer to data in
799 a freed buffer. Instead, arrange to free the buffer on the
802 * tests/misc/csplit: New test for above fix.
804 2003-11-11 Jim Meyering <jim@meyering.net>
806 * src/ls.c (extract_dirs_from_files): Avoid useless copy operations.
807 This avoids a warning from valgrind about memcpy with overlapping
808 source and destination.
810 * configure.ac: Require automake-1.7.8.
812 2003-11-09 Jim Meyering <jim@meyering.net>
814 * Use automake-1.7.9. Regenerate dependent files.
816 * src/rm.c: Support new options: --preserve-root and --no-preserve-root.
817 * src/chown.c: Likewise.
819 * src/chown-core.c: Include "root-dev-ino.h".
820 (chopt_init): Initialize new member.
821 (change_file_owner): Support rm's new --preserve-root option.
823 * src/remove.c: Include "root-dev-ino.h".
824 (remove_cwd_entries): Remove now-obsolete FIXME comment.
825 (remove_dir): Support rm's new --preserve-root option.
827 * src/chown.c: Include "root-dev-ino.h".
828 Add new options: --preserve-root and --no-preserve-root.
830 * src/chmod.c: Include "root-dev-ino.h".
831 (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
832 ROOT_DEV_INO_WARN macros.
833 (get_root_dev_ino): Remove function definition, now that it's
834 been moved to a separate file.
835 (usage): Describe new options.
837 * src/mv.c (rm_option_init): Initialized new member.
839 * src/remove.h: Include "dev-ino.h".
840 (struct rm_options): Add new member: root_dev_ino.
841 * src/chown-core.h: Include "dev-ino.h".
842 (struct Chown_option): Add new member: root_dev_ino.
844 2003-11-06 Jim Meyering <jim@meyering.net>
846 * src/paste.c (paste_parallel): Use `sizeof *var' rather than
847 hard-coding `sizeof FILE*'.
849 2003-11-05 Dennis Smit <ds@nerds-incorporated.org>
851 * src/wc.c (main): Free `fstatus' so there is no confusion about
852 whether it's leaked or not.
853 * src/who.c (who): Likewise for `utmp_buf'.
855 2003-11-05 Paul Eggert <eggert@twinsun.com>
857 Fix 'cut' problems with size_t overflow and unsigned int.
858 More generally, resize integer variables to fit use more precisely.
859 * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens.
860 (struct range_pair): Make members to be of type size_t, not unsigned.
861 (max_range_endpoint, eol_range_start): Now size_t, not unsigned.
862 (suppress_non_delimited, output_delimiter_specified,
863 have_read_stdin, print_kth, set_fields): Now bool, nt int.
864 (delim): Now unsigned char, not int.
865 (mark_printable_field, is_printable_field, is_range_start_index,
866 set_fields, set_fields, cut_bytes, cut_fields):
867 Use size_t, not unsigned, for field and byte counts.
868 (hash_int): Use uintptr_t, not unsigned, for pointers converted
869 to integers. This squeezes more info out of them.
870 (set_fields, cut_bytes, cut_fields, main):
871 Use bool, not int, for booleans.
872 (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc.
874 2003-11-05 Paul Eggert <eggert@twinsun.com>
876 * man/Makefile.am (check-programs-vs-x):
877 Work even if $(programs) contains '$'.
878 Work even if 'missing=1' in environment.
879 Don't report an error simply because $(programs) outputs nothing.
881 2003-11-05 Jim Meyering <jim@meyering.net>
883 * Use autoconf-2.58. Regenerate dependent files.
885 * src/tr.c (spec_init): Fix typo in last change.
887 * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in
888 call to variadic version_etc function, so that it works even on systems
889 for which sizeof char* != sizeof int.
890 * src/true.c (main): Likewise.
891 * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c:
892 * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c:
893 * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c:
894 * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c:
895 Similarly, cast NULL to `(char *)' in call to variadic function,
896 parse_long_options, so that it works even on systems for which
897 sizeof char* != sizeof int.
898 A similar problem was reported by Harti Brandt in
899 http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html.
901 * src/users.c (users): Free `utmp_buf' explicitly so that people
902 don't mistake this for a real leak.
903 Patch by Dennis Smit <ds@nerds-incorporated.org.
905 2003-11-04 Paul Eggert <eggert@twinsun.com>
907 * README: Document _POSIX2_VERSION.
909 2003-11-04 Jim Meyering <jim@meyering.net>
911 * src/tac.c (memrchr): Remove #if-0'd function.
912 (tac_stdin_to_mem): Clean up #if-0'd code.
914 * src/od.c (decode_format_string): Remove unnecessary casts.
915 Use more maintainable `sizeof *var'.
916 (main): Call decode_format_string rather than decode_one_format,
917 now that `spec' may be NULL.
919 * src/chmod.c (AUTHORS): Add my name.
921 * src/split.c (next_file_name): Use `sizeof *var' rather than
922 hard-coding `sizeof size_t'.
924 * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...).
926 * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc,
927 to avoid potential overflow in pointer arithmetic.
928 (set_fields): Use not `1', but rather `sizeof *printable_field' as
929 second argument to xcalloc.
930 * src/od.c (decode_format_string, dump_strings): Use x2nrealloc
931 rather than xrealloc.
932 * src/date.c (show_date): Likewise.
933 * src/join.c (ADD_FIELD, initseq, getseq): Likewise.
934 * src/pr.c (store_char): Likewise.
935 * src/fold.c (fold_file): Likewise.
937 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
938 type changes (unsigned int -> size_t) in hash.c.
939 * src/cp-hash.c (src_to_dest_hash): Likewise.
940 * src/du.c (entry_hash): Likewise.
941 * src/ls.c (dev_ino_hash): Likewise.
942 * src/cut.c (hash_int): Likewise. Declare function as static.
944 2003-11-03 Jim Meyering <jim@meyering.net>
946 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
947 * tests/misc/fold: Fail the test immediately if we're not running
948 the expected version of fold.
950 2003-11-02 Jim Meyering <jim@meyering.net>
952 * src/tr.c (append_normal_char, append_range, append_char_class)
953 (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var'
954 rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable
956 * src/copy.c (copy_internal): Likewise.
957 * src/join.c (initseq, add_field, make_blank): Likewise.
958 * src/od.c (main): Likewise.
959 * src/cp.c (make_path_private): Likewise.
960 * src/tsort.c (new_item, record_relation): Likewise.
962 * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise.
963 (main): Also remove anachronistic cast of xmalloc return value.
964 * src/ptx.c (alloc_and_compile_regex, main): Likewise.
965 (main): Also remove anachronistic cast of xmalloc return value.
966 * src/sort.c (inittables): Likewise.
967 (sort): Also Split a long line.
969 2003-10-25 Jim Meyering <jim@meyering.net>
971 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
972 type changes (unsigned int -> size_t) in hash.c.
973 * src/cp-hash.c (src_to_dest_hash): Likewise.
974 * src/du.c (entry_hash): Likewise.
975 * src/ls.c (dev_ino_hash): Likewise.
976 * src/cut.c (hash_int): Likewise. Declare function as static.
978 2003-10-21 Jim Meyering <jim@meyering.net>
980 Don't fail when run with VERBOSE=yes.
981 * tests/chgrp/basic: Do `set +x' before starting the subshell
982 from which we invoke chgrp. Otherwise, the output from the
983 VERBOSE=yes-induced `set -x' would result in spurious differences.
984 Reported by Russel Coker via Michael Stone.
986 2003-10-19 Jim Meyering <jim@meyering.net>
988 chmod now uses fts to perform a directory traversal when -R is
989 specified. Before, it operated on full path names, and as such
990 would encounter the PATH_MAX (often 4096) limit.
992 * src/chmod.c: Include "xfts.h".
993 (process_file): Rename from change_file_mode.
994 Adapt to be used with fts.
995 (process_files): New function.
997 2003-10-18 Jim Meyering <jim@meyering.net>
999 * tests/du/deref-args: Ensure that du -D now dereferences all
1000 symlinks specified on the command line, not just those that
1001 reference directories.
1003 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1004 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1005 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1006 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1007 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1008 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1009 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1010 * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
1011 of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
1012 Update the call to parse_long_options so that `AUTHORS, NULL' are the
1014 * src/true.c (main): Append NULL to version_etc argument list.
1015 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
1017 2003-10-17 Andreas Schwab <schwab@suse.de>
1019 * tests/mk-script: Get $srcdir from first parameter instead of
1021 (main): Update usage.
1023 * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as
1024 first argument of mk-script.
1025 ($(srcdir)/Makefile.am): Likewise. Prepend $(srcdir) to target.
1027 2003-10-17 Jim Meyering <jim@meyering.net>
1029 * src/mv.c (usage): Tweak descriptions of -i and -f so that the
1030 generated `man' page is more readable. Suggestion from Dan Jacobson.
1032 * src/chown-core.c (change_file_owner): Handle the cases in
1033 which fts_info indicates an error with the given entry.
1035 * src/du.c (main): Simply assign to bit_flags.
1036 Don't bother with bit arithmetic.
1038 * tests/chmod/no-x: New file.
1039 * tests/chgrp/no-x: New file.
1040 * tests/chmod/Makefile.am (TESTS): Add no-x.
1041 * tests/chgrp/Makefile.am (TESTS): Likewise.
1043 * src/du.c: Include "xfts.h".
1044 (du_files): Use xfts_open, rather than fts_open.
1045 * src/chown-core.c (chown_files): Likewise.
1047 2003-10-16 Jim Meyering <jim@meyering.net>
1049 * src/chgrp.c (main): Simply assign to bit_flags.
1050 Don't bother with bit arithmetic.
1051 * src/chown.c (main): Likewise.
1052 Rename a couple of local variables.
1053 Remove unnecessary casts.
1055 * src/tail.c (start_bytes): Rename local, remainder, to avoid
1056 gcc's warning about shadowing a global.
1058 2003-10-15 Jim Meyering <jim@meyering.net>
1060 chown and chgrp now accept POSIX-mandated -H, -L, -P options and
1061 use fts to perform a directory traversal when -R is specified.
1062 Before, they operated on full path names, and as such would
1063 encounter the PATH_MAX (often 4096) limit.
1064 They are more efficient. For example, before, chgrp -R would
1065 take almost 5 seconds to change about 2000 directories and fail
1066 (with `File name too long'), while now it succeeds on a hierarchy
1067 of depth 20,000 in 1/10 the time.
1069 * src/chown.c: Include "userspec.h" and "fts_.h".
1070 (WRITTEN_BY): Add my name.
1071 (getpwnam, getgrnam, getgrgid): Remove declarations.
1072 (endpwent): Remove definition.
1074 (main): Handle new options.
1075 Call new function, chown_files rather than change_file_owner.
1077 * src/chgrp.c: Include "fts_.h".
1078 (WRITTEN_BY): Add my name.
1079 (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of
1082 (main): Handle new options.
1083 Call new function, chown_files rather than change_file_owner.
1085 Rewrite to iterate through hierarchies using fts rather than
1086 via explicit recursion.
1087 * src/chown-core.c: Include "fts_.h"
1088 (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
1089 on a single file at a time.
1090 (chown_files): New function.
1091 * src/chown-core.h [enum Dereference_symlink]: Remove declaration.
1092 [struct Chown_option] (recurse, force_silent): Change type to `bool'.
1093 [struct Chown_option] (dereference): Remove member with ambiguous name.
1094 [struct Chown_option] (affect_symlink_referent): New member.
1095 (chown_files): New prototype.
1097 * tests/chgrp/recurse: Update tests accordingly.
1098 * tests/chgrp/posix-H: New tests for the above.
1099 * tests/chgrp/Makefile.am (TESTS): Add posix-H.
1101 * src/ln.c (usage): Clarify that --directory, -d, -F probably won't
1102 work even for superuser. Suggestion from Dan Jacobson.
1104 2003-10-14 Paul Eggert <eggert@twinsun.com>
1106 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
1108 * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h,
1109 lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib.
1110 * src/sort.c (parse_field_count): Handle the case where overflow
1111 and invalid suffix char are both reported.
1113 2003-10-14 Jim Meyering <jim@meyering.net>
1115 * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the
1116 warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
1119 2003-10-13 Paul Eggert <eggert@twinsun.com>
1121 Fix to avoid a denial-of-service attack if the display width is
1122 enormous. Also, clean up the code a bit by removing duplicate code.
1124 * src/ls.c (init_column_info): Remove forward decl; no longer needed.
1125 (calculate_columns): New function, that contains code that used
1126 to be common to print_many_per_line and print_horizontal.
1127 (print_many_per_line, print_horizontal): Use it.
1128 (decode_switches): Set max_idx here, not in calculate_columns.
1129 (print_current_files): Don't call init_column_info; calculate_columns
1131 (init_column_info): Don't allocate a lot more space than is needed
1132 to represent the current set of files. Allocate all the new
1133 size_t cells in one call to xnmalloc, rather than a row at a time.
1135 2003-10-13 Jim Meyering <jim@meyering.net>
1137 * src/ls.c (init_column_info): Add another FIXME comment.
1139 2003-10-13 Paul Eggert <eggert@twinsun.com>
1141 Fix address-arithmetic bug in 'ls', reported by Georgi Guninski.
1142 Remove several arbitrary limits on hosts where int cannot represent
1145 * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent,
1146 nfiles, files_index, tabsize, line_length, struct column_info.line_len,
1147 struct column_info.col_arr[0], max_idx):
1148 Now size_t, not int.
1149 (get_funky_string): Return bool indicating success, instead of
1150 a negative count to indicate failure. Store number of columns
1151 through new parameter OUTPUT_COUNT; that way, they can never
1152 go negative. Change equals_end from int to bool. All uses
1154 (struct column_info.valid_len): Now bool, not int. All uses changed.
1155 (dired_dump_obstack, get_funky_string, clear_files,
1156 extract_dirs_from_files, print_current_files,
1157 print_many_per_line, print_horizontal, init_column_info,
1158 put_indicator, length_of_file_name_and_frills,
1159 print_with_commas): Use size_t, not int, for local variables
1161 (decode_switches): Decode sizes using xstrtoul, not xstrtol.
1162 Check for TIOCGWINSZ returing negative values (or values greater
1164 (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
1166 Use xmalloc and xnmalloc, not XMALLOC.
1167 (gobble_file): Use xnrealloc, not XREALLOC.
1168 (print_color_indicator): Remove now-unnecessary cast to size_t.
1170 2003-10-12 Paul Eggert <eggert@twinsun.com>
1172 * tests/du/no-x: Change wording of diagnostic to match latest du.c.
1173 * tests/sort/sort-tests: Remove from CVS; assume that people
1174 brave enough to check coreutils out from CVS can rebuild it.
1176 2003-10-12 Jim Meyering <jim@meyering.net>
1178 New options: --preserve-root and --no-preserve-root.
1179 * src/chmod.c (change_file_mode): Honor new option.
1180 (change_file_mode): Strip trailing slashes on directory
1181 argument passed to change_dir_mode.
1182 (get_root_dev_ino): New function.
1183 (main): Initialize global, root_dev_ino.
1185 * src/copy.c (copy_internal): Don't #ifdef-out simple uses of
1186 S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined
1188 * src/chmod.c (change_file_mode): Likewise.
1190 2003-10-08 Jim Meyering <jim@meyering.net>
1192 * src/csplit.c (main): Remove obsolete FIXME.
1194 2003-10-07 Jim Meyering <jim@meyering.net>
1196 * Use automake-1.7.8. Regenerate dependent files.
1198 2003-09-29 Paul Eggert <eggert@twinsun.com>
1202 * doc/coreutils.texi (csplit invocation):
1203 The regexp offset need not have a sign; POSIX requires support
1204 for signless offets.
1206 Be more careful about int widths. For example, remove some
1207 arbitrary limits by replacing 'unsigned' with 'size_t',
1208 'uintmax_t', etc. Use standard bool rather than a homegrown type.
1209 * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
1210 * src/csplit.c (FALSE, TRUE, boolean): Remove. All uses changed
1211 to <stdbool.h> usage.
1212 (struct control): offset is now intmax_t, not int.
1213 repeat_forever is now bool, not int.
1214 (struct cstring): len is now size_t, not unsigned int.
1215 (struct buffer_record): bytes_alloc, bytes_used, num_lines are now
1216 size_t, not unsigned. start_line, first_available are now
1217 uintmax_t, not unsigned.
1218 (hold_count, control_used): Now size_t, not unsigned.
1219 (last_line_number, current_line, bytes_written):
1220 Now uintmax_t, not unsigned.
1221 (save_to_hold_area, red_input, keep_new_line, record_line_starts,
1222 create_new_buffer, get_new_buffer, load_buffer, find_line,
1223 process_regexp, split_file, new_control_record, extract_regexp,
1224 get_format_width, get_format_prec, max_out):
1225 size args, locals, and returned values are now size_t, not unsigned
1227 (get_first_line_in_buffer, find_line, write_to_file,
1228 handle_line_error, process_line_count, regexp_error, process_regexp,
1230 File line, byte, and repetition counts are now uintmax_t, not unsigned.
1231 (check_for_offset): Don't require a sign before the offset.
1232 Use xstrtoimax to do the real work.
1233 (extract_regexp): Remove harmful cast of size to unsigned.
1234 256 -> 1<<CHAR_BIT, for clarity.
1235 (get_format_flags): Return at most 3, to avoid worries about overflow.
1237 (bytes_to_octal_digits): Remove.
1239 (cleanup): Don't check whether output_stream is NULL, since
1240 close_output_file does that for us.
1242 (new_line_control, create_new_buffer): Use "foo *p = xmalloc
1243 (sizeof *p);" instead of the more long-winded alternatives.
1245 (get_new_buffer): Use O(1) algorithm for resizing a buffer
1246 to a much larger size, instead of an O(N) algorithm.
1248 (process_regexp): Use plain NULL rather than casted 0.
1250 (make_filename): Use %u, not %d, to format unsigned file number.
1252 (new_control_record): Use xrealloc exclusively, since it handles
1255 (extract_regexp): Change misspelled word in diagnostic.
1257 (get_format_width): Even if a minimum field width is specified,
1258 allow room for enough octal digits to represent the value of
1259 the maximum representible integer. This fixes a potential
1260 buffer overrun. Calculate this room at compile-time, not
1261 at run-time; this removes the need for bytes_to_octal_digits.
1262 Check for overflow; this removes a FIXME.
1264 (get_format_prec): Don't allow precision to be signed; it's
1265 not ANSI. Check for overflow. Remove hardcoded "11" as
1266 default precision; this fixes a potential buffer overrun
1267 on hosts with wider size_t.
1269 (get_format_conv_type): Change local variable to be of type
1270 unsigned char, not int; this removes a potential subscript
1271 violation on hosts where char is signed.
1273 (max_out): Replace "for (;*p;)" with more-standard "while (*p)".
1274 Allow "%%" in format. Don't overflow when
1275 counting lots of percents.
1277 (usage): Default sprintf format is %02u, not %d.
1279 2003-10-05 Jim Meyering <jim@meyering.net>
1281 * src/chown-core.c (change_file_owner): Remove set-but-not-used local.
1283 * src/du.c (du_files): Mark diagnostic for translation.
1285 2003-10-04 Jim Meyering <jim@meyering.net>
1287 * src/du.c (du_files): Ignore any failure of fts_close.
1288 Give better diagnostics for failed fts_open.
1290 * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition.
1292 Deprecate existing use of -H (aka --si).
1293 * src/du.c (enum) [HUMAN_SI_OPTION]: New member.
1294 [long_options]: Use HUMAN_SI_OPTION, not 'H'.
1295 (main): Warn that the meaning of -H will soon change to be
1298 2003-10-03 Jim Meyering <jim@meyering.net>
1300 * src/du.c: Accept --no-dereference (-P).
1302 2003-10-02 Jim Meyering <jim@meyering.net>
1304 * tests/du/trailing-slash: Adjust for slightly different output.
1306 Rewrite du.c to use fts.
1307 * src/du.c: Include "fts_.h", not ftw.h.
1308 (opt_dereference_arguments, arg_length, suffix_length): Remove globals.
1309 (IS_FTW_DIR_TYPE): Remove definition.
1310 (IS_DIR_TYPE): Define.
1311 (is_symlink_to_dir): Remove now-unnecessary function.
1312 (process_file, du_files): Rewrite to use fts.
1314 * tests/du/inaccessible-cwd: Ensure that even when run from an
1315 inaccessible directory, du can still operate on accessible
1316 directories elsewhere.
1317 * tests/du/Makefile.am (TESTS): Add inaccessible-cwd.
1319 * tests/rm/deep-1: Ensure that du can process a hierarchy
1320 of depth 400 while using no more than 50KB of stack space.
1322 2003-10-01 Akim Demaille <akim@epita.fr>
1324 * announce-gen (print_news_deltas): New function, extracted from main.
1325 (main): Make `news_file' an array.
1326 Use '...=s' => \@var for --news and --url-directory specs.
1327 Before there were a couple of portability problems.
1329 2003-09-28 Jim Meyering <jim@meyering.net>
1331 * Makefile.maint (sc_cast_of_alloca_return_value): New rule.
1332 (syntax-check-rules): Add it.
1334 * src/copy.c: Remove unnecessary cast of alloca, since now it's
1335 guaranteed to be (void *).
1336 * src/cp.c: Likewise.
1337 * src/join.c: Likewise.
1338 * src/ln.c: Likewise.
1339 * src/ls.c: Likewise.
1340 * src/od.c: Likewise.
1341 * src/sys2.h (ASSIGN_STRDUPA): Likewise.
1343 2003-09-27 Jim Meyering <jim@meyering.net>
1345 Don't exhaust virtual memory when processing large inputs.
1346 Fix this by removing csplit's internal free-list management;
1347 instead rely on malloc for that.
1349 * src/csplit.c (free_list): Remove global.
1350 (clear_all_line_control): Remove function.
1351 (get_new_buffer): Always use create_new_buffer to obtain a
1352 new buffer, rather than searching free_list.
1353 (free_buffer): Just call free.
1354 Reported by Nikola Milutinovic.
1356 2003-09-26 Jim Meyering <jim@meyering.net>
1358 * man/rm.x: Also list `chattr' in SEE ALSO section.
1359 Suggestion from Mark Hubbart.
1361 2003-09-25 Jim Meyering <jim@meyering.net>
1363 * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now
1364 that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them.
1366 * Use autoconf-2.57d. Regenerate dependent files.
1368 2003-09-24 Jim Meyering <jim@meyering.net>
1370 Minor efficiency tweak.
1371 * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
1372 (do_link): Likewise.
1374 2003-09-23 Jim Meyering <jim@meyering.net>
1376 * src/paste.c (paste_serial): Save errno after input error,
1377 to report proper errno value.
1378 Based on a patch from Paul Eggert.
1380 * src/tee.c (tee): Adjust fwrite arguments so that the return
1381 value is the number of bytes written.
1383 2003-09-16 Paul Eggert <eggert@twinsun.com>
1385 Don't assume ferror sets errno. Bug reported by Bruno Haible.
1387 * src/comm.c (compare_files): Save errno after input error,
1388 to report proper errno value.
1389 * src/fold.c (fold_file): Likewise.
1390 * src/od.c (check_and_close, skip, read_char, read_block): Likewise.
1391 * src/unexpand.c (unexpand): Likewise.
1393 * src/csplit.c (close_output_file): Don't report bogus errno value
1394 after ferror discovers an output error. We don't know the proper
1395 errno value, since it might have been caused by any of a whole
1396 bunch of calls, and it might have been trashed in the meantime.
1397 Fixing this problem will require much more extensive changes;
1398 in the meantime just say "write error".
1399 * src/od.c (check_and_close, dump, dump_strings): Likewise.
1400 * src/uniq.c (check_file): Likewise.
1402 * src/join.c (get_line): Report error right away if I/O fails,
1403 so that the proper errno value is used.
1404 * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise.
1405 * src/tee.c (tee): Likewise.
1406 * src/uniq.c (check_file): Likewise.
1408 * src/od.c (skip): If a read fails, don't retry it later, so
1409 that we report the proper errno.
1411 * src/tac.c (tac_mem): Don't return a value; nobody uses it.
1413 * src/tee.c (tee): Once a write failure has occurred, don't bother
1414 writing anything more to that stream.
1416 * src/uniq.c (check_file): Check for ferror (stdout) even if
1419 * src/yes.c (UNROLL): Remove.
1420 (main): Exit immediately when write failure is detected.
1421 Simplify code by assigning to argv when argc == 1.
1423 2003-09-21 Paul Eggert <eggert@twinsun.com>
1425 * src/ptx.c: Switch encoding from Latin-1 to UTF-8.
1426 (WRITTEN_BY): Change "Franc,ois" (actually using
1427 c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
1430 2003-09-19 Jim Meyering <jim@meyering.net>
1432 `du -D symlink-to-dir' would mistakenly omit the slash in
1433 lines like this: 24 symlink-to-dir/subdir
1434 * src/du.c (process_file): Fix offset calculation.
1435 Reported by Jeff Sheinberg as Debian bug #211591;
1436 http://bugs.debian.org/205251
1438 * tests/du/deref-args: New file/test for the above.
1439 * tests/du/Makefile.am (TESTS): Add deref-args.
1441 * src/du.c (process_file): Remove useless disjunct.
1443 * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
1445 * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
1446 Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
1447 Mark each WRITTEN_BY string as translatable.
1449 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1450 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1451 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1452 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1453 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1454 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1455 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1456 * who.c, whoami.c, yes.c: Revert yesterday's changes.
1457 Instead, a subsequent change will embed `Written by ' in
1458 each string along with the author names.
1460 * src/true.c: Revert yesterday's changes.
1461 * src/sys2.h: Likewise.
1463 2003-09-18 Jim Meyering <jim@meyering.net>
1465 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
1466 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
1467 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
1468 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
1469 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
1470 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
1471 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
1472 * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
1473 comma-separated list of strings and/or update the call to
1474 parse_long_options so that `AUTHORS, NULL' are the last parameters.
1475 * src/true.c (main): Append NULL to version_etc argument list.
1476 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
1478 * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
1479 shadowing the math function name. Also rename loga to log_a.
1481 2003-09-14 Jim Meyering <jim@meyering.net>
1483 * src/factor.c (print_factors): Give a separate diagnostic
1484 for numbers that are too large, but otherwise valid.
1485 Reported by Dániel Varga.
1487 2003-09-10 Jim Meyering <jim@meyering.net>
1489 * Use automake-1.7.7. Regenerate dependent files.
1491 * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
1492 of `fmt -1'. Using the just-built tr is a little cleaner.
1493 Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
1494 * man/Makefile.am (programs, check-x-vs-1): Likewise.
1496 2003-09-09 Jim Meyering <jim@meyering.net>
1498 * src/copy.c: Alphabetize includes.
1499 Remove duplicate inclusion of "same.h".
1501 2003-09-08 Jim Meyering <jim@meyering.net>
1503 * Makefile.maint (GZIP_ENV): Remove --rsyncable.
1504 Didn't give enough of a benefit, mainly because it's not yet
1509 * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
1510 (check-programs-vs-x): Fail if $(programs) is empty.
1512 * src/remove.c: Add a comment.
1514 2003-09-07 Jim Meyering <jim@meyering.net>
1516 * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
1517 Don't define. These symbols are no longer used.
1519 * tests/misc/tty-eof: Write ^D as \cD.
1520 Complete the change of 2003-08-02.
1522 * Makefile.maint (po-check): Use cvsu, so that a temporary source
1523 file in lib/ or src/ doesn't induce an unwarranted failure.
1524 Add a kludge to filter out the sole generated source file that
1525 also has translatable messages: src/false.c.
1527 2003-09-06 Jim Meyering <jim@meyering.net>
1529 * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
1530 (parse_options): Give a diagnostic for (but still accept) the
1531 deprecated --allow-missing option.
1533 2003-09-04 Paul Eggert <eggert@twinsun.com>
1535 Don't ignore -S if input is a pipe. Bug report by Michael McFarland in
1536 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
1538 * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the
1539 size_bound ourselves. if an input file is a pipe and the user
1540 specified a size, use that size instead of trying to guess the
1541 pipe size. This has the beneficial side effect of avoiding the
1542 overhead of default_sort_size in that case. All callers changed.
1543 (sort): Remove static var size; now done by sort_buffer_size.
1545 2003-09-05 Jim Meyering <jim@meyering.net>
1547 * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files.
1549 * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
1550 to start, rather than just .1. Upon failure, print unexpected state.
1552 2003-09-04 Paul Eggert <eggert@twinsun.com>
1554 * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
1555 SAFE_READ_ERROR to tmp->nbytes.
1556 * src/tail.c (pipe_lines, pipe_bytes): Likewise.
1558 * src/head.c (struct linebuffer): Change nbytes and nlines
1559 from unsigned int to size_t. unsigned int is safe (after the
1560 2003-09-03 patch) but size_t is cleaner.
1561 * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
1562 (pipe_bytes): Likewise for local variable 'i', which was 'int'.
1564 Standardize on BUFSIZ as opposed to other macro names and values.
1565 * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ.
1566 * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
1567 stdio.h has always defined it,
1568 and other code already assumes it's defined.
1569 * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
1570 (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
1571 (io_buf): IO_BUF_SIZE -> BUFSIZ.
1573 2003-09-04 Paul Eggert <eggert@twinsun.com>
1575 * src/seq.c (step): Default to 1.
1576 (print_numbers): Allow the output to be empty.
1577 (main): The default step is 1, even if LAST < FIRST;
1578 as per documentation.
1579 * tests/seq/basic (onearg-2): Output should be empty.
1581 2003-09-05 Jim Meyering <jim@meyering.net>
1583 * Makefile.cfg (wget_files): Temporarily disable, until master
1584 versions are restored to ftp.gnu.org.
1586 * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
1588 Make seq's --width (-w) option work properly even when the
1589 endpoint requiring the larger width is negative and smaller than
1591 * src/seq.c (get_width_format): Include `-' in the set of bytes
1592 allowed in a `simple' number (no decimal point, no exponent).
1593 Reported by Patrick Mauritz.
1595 2003-09-02 Paul Eggert <eggert@twinsun.com>
1597 * NEWS: sort -t '\0' now uses a NUL tab.
1598 sort option order no longer matters, unless POSIX requires it.
1599 * src/sort.c (usage): Say "blanks" instead of "whitespace",
1600 Similar fixes for many comments.
1601 (TAB_DEFAULT): New constant, so that we can support NUL as
1602 the field separator.
1603 (tab): Now int, not char. Initialize to TAB_DEFAULT.
1604 (specify_sort_size): If multiple sizes are specified, use the largest.
1605 (begfield, limfield): Support NUL tab char.
1606 (set_ordering): Do not let -i override -d.
1607 (main): Report an error if incompatible -o or -t options are given.
1608 Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
1610 2003-09-05 Jim Meyering <jim@meyering.net>
1612 * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
1614 2003-09-03 Andreas Schwab <schwab@suse.de>
1616 Bug report and patch here:
1617 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
1618 * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
1619 * src/head.c (elide_tail_lines_pipe): Likewise.
1621 2003-09-03 Jim Meyering <jim@meyering.net>
1623 * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
1624 small amount of code from him was first moved to lib/human.c, and was
1625 subsequently rewritten entirely.
1626 * src/df.c (AUTHORS): Likewise.
1628 2003-08-22 Lawrence Teo <lcteo@uncc.edu>
1630 * src/md5sum.c (split_3): Accept the BSD format for generic
1631 message digest modes. Currently works with BSD's MD5 and SHA1
1632 formats since these are the two algorithms presently used in
1633 coreutils. Updated comments to reflect this change.
1634 (bsd_split_3): Updated comments.
1636 * tests/md5sum/basic-1: New test to make sure that
1637 `md5sum --check' doesn't accept the BSD SHA1 format (adapted
1638 from `check-bsd' test in tests/sha1sum/basic-1).
1640 * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
1641 --check exit status and BSD SHA1 format (adapted from tests
1642 in tests/md5sum/basic-1).
1644 2003-08-30 Jim Meyering <jim@meyering.net>
1646 * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
1648 When source and destination arguments refer to the same file, reside
1649 on a partition (e.g. VFAT) on which distinct names may refer to the
1650 same directory entry (often due to variations in case), and when the
1651 link count for the file is 1, mv no longer unlinks the file. Instead,
1652 it gives the expected diagnostic that the source and destination are
1653 the same. WARNING: this is an incomplete fix. If the file happens
1654 to have a link count of 2 or greater, such an erroneous mv command
1655 will still unlink it.
1656 Although that is not possible on vfat or umsdos, it is possible on
1657 other file system types, e.g., ntfs, and hpfs.
1658 * src/copy.c (same_file_ok): Invoke same_name (which might still
1659 return false for names that refer to the same directory entry)
1660 only if the link count is 2 or more.
1661 * tests/mv/vfat: Show how to demonstrate the above problem.
1662 This test is not run.
1663 * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
1665 2003-08-27 Jim Meyering <jim@meyering.net>
1667 * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
1668 who's -l option has been eliciting an unconditional warning about
1669 this impending change since sh-utils-2.0.12 (April 2002).
1671 * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
1672 This would happen for nonempty files not ending with a newline.
1673 Reported by Dan Jacobson.
1674 * tests/misc/paste-no-nl: New file. Test for above-fixed bug.
1675 * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
1677 * src/stat.c (print_it): Avoid buffer overrun that would
1678 occur when the user-specified format string ends with `%'.
1679 Patch by Tommi Kyntola.
1680 * tests/misc/stat-fmt: New file. Test for above-fixed bug.
1681 * tests/misc/Makefile.am (TESTS): Add stat-fmt.
1683 2003-08-26 Jim Meyering <jim@meyering.net>
1685 Apply changes from bison.
1686 * GNUmakefile (SHELL): Define to `sh', if necessary.
1688 * Makefile.maint (WGETFLAGS): Define to `-C off'.
1689 Update all uses of $(WGET).
1691 2003-08-22 Akim Demaille <akim@epita.fr>
1693 * Makefile.cfg (local-checks-to-skip): New.
1694 * Makefile.maint (local-check): Rename as...
1695 (local-checks-available): this.
1698 2003-08-26 Akim Demaille <akim@epita.fr>
1700 * announce-gen (print_changelog_deltas): Neutralize "<#" as
1701 "<\#" to avoid magic from Gnus when posting parts of this script.
1703 2003-08-25 Jim Meyering <jim@meyering.net>
1705 * src/stat.c (main): Warn about use of deprecated `-l' option.
1707 2003-08-22 Jim Meyering <jim@meyering.net>
1709 * src/stat.c (do_stat): For link count at end of line, use %h format,
1710 instead of %-5h. The latter would make stat emit trailing spaces.
1711 Reported by Dan Jacobson.
1713 2003-08-20 Jim Meyering <jim@meyering.net>
1715 * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
1717 2003-08-19 Jim Meyering <jim@meyering.net>
1719 * src/system.h: Include stdlib.h unconditionally,
1720 as we're now assuming that part of hosted C89.
1722 2003-08-18 Jim Meyering <jim@meyering.net>
1724 * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
1725 to avoid warnings from gcc.
1727 2003-08-17 Jim Meyering <jim@meyering.net>
1729 Avoid unnecessary and sometimes time-consuming hostname lookups.
1730 * src/who.c (print_user): Use strchr, not strrchr.
1731 * src/pinky.c (print_entry): Likewise.
1732 Patch by Michael Stone.
1733 This fixes a typo I introduced in who-users.c on 1996-02-23.
1735 * Makefile.maint (makefile-check): Add 0-9 to the range of characters
1736 disallowed between `@...@'.
1738 2003-08-16 Paul Eggert <eggert@twinsun.com>
1740 * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
1741 done by gnulib .m4 files.
1742 (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
1743 * src/sys2.h (strtoull): Remove unused declaration.
1745 2003-08-16 Jim Meyering <jim@meyering.net>
1747 * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
1750 * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
1751 race condition bug. The bug would be triggered when tailing a file
1752 with file pointer not at beginning of file, and where the file was
1753 truncated to have a length of less than the initial offset at just
1754 the right moment (between the two lseek calls in this function).
1756 An invalid initial value for *read_pos would result in
1757 `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
1758 busy-wait rather than sleeping between iterations. The bug manifests
1759 itself only when tailing regular files that are initially nonempty.
1760 * src/tail.c (tail_bytes): Set *read_pos to new file offset after
1762 (tail_lines): Likewise, after lseek calls.
1763 Reported by Nick Estes. See http://bugs.debian.org/205251 for details.
1764 * tests/tail-2/tail-n0f: New file. Test for above fix.
1765 * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
1767 2003-08-15 Jim Meyering <jim@meyering.net>
1769 * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
1770 (sc_sun_os_names): Likewise.
1771 * .x-sc_space_tab, .x-sc_sun_os_names: New files.
1773 * man/help2man: Remove some SPACEs before TAB.
1775 2003-08-14 Paul Eggert <eggert@twinsun.com>
1777 * Makefile.maint (LC_ALL): Set to C.
1778 * man/Makefile.am (ASSORT): New var.
1779 (check-x-vs-1, programs): Use it.
1780 * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
1781 * tests/Makefile.am (ASSORT, all_programs): Likewise.
1783 2003-08-11 Jim Meyering <jim@meyering.net>
1785 fold -s -wN would infloop for N < 8 with TABs in the input.
1786 E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
1787 * src/fold.c (fold_file): Move contents of `else'-block
1788 out of conditional so it's used also for --spaces (-s).
1789 * tests/misc/fold: Test for the above fix.
1790 * tests/misc/Makefile.am (TESTS): Add fold.
1792 2003-08-10 Jim Meyering <jim@meyering.net>
1794 * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
1795 system.h so the types from time.h and sys/time.h are available.
1796 It appears that this is necessary for OpenBSD, NetBSD, and
1797 Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
1799 2003-08-06 Paul Eggert <eggert@twinsun.com>
1801 * NEWS: Add support for setting file timestamps to microsecond
1802 resolution, on hosts that support this.
1803 * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
1804 * src/copy.c (copy_internal):
1805 Set file timestamps with utimens, not utime.
1806 * src/cp.c (re_protect): Likewise.
1807 * src/install.c (change_timestamps): Likewise.
1808 * src/touch.c (newtime, touch, main): Likewise.
1810 2003-08-09 Jim Meyering <jim@meyering.net>
1812 * Makefile.maint (sc_sun_os_names): New rule based on a regexp
1814 (syntax-check-rules): Add it.
1816 * src/tail.c (main): Tweak Solaris OS version number in comment.
1817 * src/wc.c (wc): Likewise
1818 * tests/tail-2/fflush: Likewise.
1820 * src/tail.c: Add new undocumented option, --presume-input-pipe.
1821 (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
1823 2003-08-08 Paul Eggert <eggert@twinsun.com>
1825 Use new gnulib 'extensions' module.
1826 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
1829 2003-08-08 Paul Eggert <eggert@twinsun.com>
1831 * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
1833 2003-08-09 Jim Meyering <jim@meyering.net>
1835 * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
1836 For tests of obsolete behavior, don't presume that unsetting
1837 _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
1839 2003-08-07 Paul Eggert <eggert@twinsun.com>
1841 * doc/coreutils.texi (split invocation):
1842 Add -d or --numeric-suffixes option to 'split'.
1843 From a suggestion by Jesse Kornblum.
1844 * src/split.c (suffix_alphabet): New var.
1845 (longopts, usage, next_file_name, main): Support -d.
1846 (next_file_name, main): Allow -a0, as POSIX requires.
1847 (next_file_name): Don't assume ASCII-like encoding;
1848 'a' through 'z' are not contiguous in EBCDIC.
1850 2003-08-05 Paul Eggert <eggert@twinsun.com>
1852 Merge getline from gnulib.
1853 * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
1854 * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
1855 New files, from gnulib.
1856 * lib/getdelim2.c, lib/getdelim2.h: Remove.
1857 * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
1858 getdelim2.h to getndelim2.c and getndelim2.h.
1859 * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
1860 checking for getdelim.
1861 (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
1862 than rolling our own.
1863 * src/cut.c: Include getndelim2.h rather than getdelim2.h.
1864 (cut_fields): Invoke getndelim2 rather than getdelim2.
1866 2003-08-04 Jim Meyering <jim@meyering.net>
1868 * src/sort.c (main): Use unsigned int instead of int for `nsigs'
1869 and for the indices to iterate through nsigs.
1871 2003-08-02 Paul Eggert <eggert@twinsun.com>
1873 * src/sort.c: Minor code cleanups, mostly to use more accurate
1874 types and to remove unnecessary casts.
1875 (min, max): Remove. All uses changed to MIN and MAX.
1876 (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
1877 keyfield.skipsblanks, struct keyfield.skipeblanks, struct
1878 keyfield.numeric, struct keyfield.general_numeric, struct
1879 keyfield.month, struct keyfield.reverse, reverse, unique,
1880 have_read_stdin): Now bool, not int. All uses changed.
1881 (eolchar): Now char, not int.
1882 (struct keyfield.ignore): Now bool const *, not int *.
1883 (struct keyfield.translate): Now char const *, not char *.
1884 (struct month.name): Likewise.
1885 (blanks, nonprinting, nondictionary): Now bool[], not int[].
1886 (cleanup, inittables, keycompare, check, mergefps, first_same_file,
1887 check, sort, main): Use const * pointers when possible.
1888 (month_cmp): Rewrite to avoid casts.
1889 (inittables): Initialize tables unconditionally, to avoid branches.
1890 (fillbuf): Return bool, not int. All uses changed.
1891 (fillbuf, keycompare, new_key, main):
1892 Use SIZE_MAX rather than (size_t) -1.
1893 (trailing_blanks): Renamed from trim_trailing_blanks.
1894 Return the number of blanks to trim. All uses changed.
1895 (getmonth): Use trailing_blanks rather than open code.
1896 (keycompare): Do not cast char * to unsigned char *; not needed.
1897 CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
1899 (compare, main): Use | rather than || to avoid jumps.
1900 Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
1902 (check, first_same_file, sort, main):
1903 Use bool instead of int local vars when possible.
1904 (check): Merge the old 'checkfp' and 'check' into a single function,
1905 that returns a boolean (true if the file was ordered).
1907 (main): Use int instead of unsigned for iterating through nsigs.
1908 Rename local var "posix_pedantic" to "posixly_correct".
1910 2003-08-02 Jim Meyering <jim@meyering.net>
1912 * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
1913 to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
1915 * src/cut.c (cut_fields): Don't read again after encountering an
1916 initial EOF. E.g., `cut -f2' would do so.
1917 * tests/misc/tty-eof: Add a test for the above fix.
1919 * src/sort.c (sortlines): Add description and references.
1922 * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
1923 the tests in help-version will use the just-built binaries.
1924 Reported by Christian Krackowizer.
1926 2003-07-31 Paul Eggert <eggert@twinsun.com>
1928 * NEWS: Add --rfc-2822 option to GNU date.
1929 * doc/coreutils.texi (Time directives, Options for date, Examples
1931 * src/date.c (long_options, usage, main): Likewise.
1932 * doc/getdate.texi (General date syntax): Likewise.
1933 * doc/coreutils.texi (Options for date): Fix a typo in format:
1934 it's now %d not %_d. Add URLs.
1936 2003-08-01 Jim Meyering <jim@meyering.net>
1938 * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
1939 Otherwise, with at least the /bin/sh from HPUX 10.20,
1940 the trap code would end up converting that to exit 1 and thus an
1941 unexpected test failure. Reported by Christian Krackowizer.
1943 2003-07-31 Paul Eggert <eggert@twinsun.com>
1945 * src/ptx.c: Do not include bumpalloc.h.
1946 (WORD_TABLE): New member alloc.
1947 (ALLOC_NEW_WORD): Remove.
1948 (occurs_alloc): New var.
1949 (digest_word_file, find_occurs_in_text): Check for arithmetic
1950 overflow when computing table size. Use xrealloc rather than
1951 bumpalloc primitives.
1953 2003-07-29 Jim Meyering <jim@meyering.net>
1957 * README: When running tests as root, suggest using
1958 sudo with NON_ROOT_USERNAME=$USER.
1960 * tests/Makefile.am (all_programs): Makefile is in ../src, not
1963 2003-07-28 Jim Meyering <jim@meyering.net>
1965 * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
1967 2003-07-28 Paul Eggert <eggert@twinsun.com>
1969 * lib/stdbool.hin (_Bool): Make it signed char, instead of
1970 an enum type, so that it's guaranteed to promote to int.
1971 * src/sort.c (sortlines_temp): Undo previous change.
1973 2003-07-28 Jim Meyering <jim@meyering.net>
1975 * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
1976 `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
1977 would cause lines[-1 - swap] (with swap = false) to evaluate to
1980 2003-07-27 Jim Meyering <jim@meyering.net>
1982 * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
1983 since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
1985 * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
1986 directories, as required by POSIX. Reported by Karl Berry.
1987 * tests/rm/dir-no-w: New file. Test for the above fix.
1988 * tests/rm/Makefile.am (TESTS): Add dir-no-w.
1990 * tests/mk-script: Emit `$xx', not its expansion.
1992 2003-07-27 Paul Eggert <eggert@twinsun.com>
1994 This change was inspired by a similar proposal by Stepan Kasal.
1995 * src/sort.c (mergelines, sortlines_temp): New functions.
1996 (sortlines): Use them, to reduce the number of times that
1997 we need to copy 'struct line' values. This improved CPU
1998 performance by about 30% on one 18 MB test.
1999 (sort): Don't invoke sortlines unless we have 2 or more lines.
2001 2003-07-26 Stepan Kasal <kasal@ucw.cz>
2003 * src/sort.c (sort): Don't require two `struct line's per text line,
2004 the new sort algorithm requires just 1.5.
2006 2003-07-27 Jim Meyering <jim@meyering.net>
2008 * src/pathchk.c (validate_path): Use %lu, not %ld.
2010 * src/cut.c (is_printable_field): Simplify bit arithmetic.
2012 * src/ls.c (sort_files): Put `volatile' in the right place.
2015 2003-07-26 Jim Meyering <jim@meyering.net>
2017 Use only one bit per field/offset in array, not one `int'.
2018 * src/cut.c (printable_field): Change type to `unsigned char'.
2019 (mark_printable_field, is_printable_field): New functions.
2020 Use them in place of all direct accesses of `printable_field'.
2022 * src/expand.c (parse_tabstops): Detect overflow properly.
2023 * src/cut.c (set_fields): Likewise.
2025 * src/rm.c: Include "dirname.h".
2026 (usage): Use base_name (program_name) in body of --help output.
2028 * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
2029 Idea from Brendan O'Dea, who suggested using
2030 `program_name = basename (argv[0]);' everywhere --
2031 can't do that, but using base_name works just fine here.
2033 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
2035 2003-07-24 Paul Eggert <eggert@twinsun.com>
2037 Fix some POSIX-compliance problems with 'test'. This makes
2038 'test' more compatible with Bash.
2040 * NEWS, doc/coreutils.texi: Document the following.
2041 * src/test.c: Include exitfail.h.
2042 (TEST_FAILURE): New constant, used for exit status if 'test' fails.
2043 (test-syntax_error): Use it.
2044 (binary_operator): Now takes bool arg specifying whether left operand
2045 is -l ARG, so that caller determines this rather than us.
2047 (term): Use posixtest to evaluate parenthesized subexpressions.
2048 (unary_operator, one_argument): Remove support for -t without operand.
2049 (one_argument): Take argument from argv[pos].
2050 (one_argument, two_arguments, three_arguments): Advance pos.
2051 All callers changed.
2052 (three_arguments): Look for binary ops before "!". Then look
2053 for parenthesized one_argument expressions, instead of trusting
2054 expr () to do the right thing.
2055 (posixtest): Now takes number of args. All callers changed.
2056 Treat "( A B )" like "A B".
2057 (main): Set exit_failure to TEST_FAILURE. Don't depend on
2058 POSIXLY_CORRECT, as we now conform to POSIX by default.
2059 (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
2060 * tests/test/Test.pm (test_vector): Add several tests to check
2061 the above. Syntax errors now exit with status 2, not 1.
2062 * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
2064 2003-07-26 Jim Meyering <jim@meyering.net>
2066 * tests/help-version: Adjust for above change in test behavior:
2067 `[' exits with 2, not 1, and test doesn't accept --help or --version.
2069 * Makefile.maint (ME): Don't use trick suggested in Make manual.
2070 It doesn't work for make-3.79.1. Reported by Christian Krackowizer.
2072 * Makefile.maint (sc_system_h_headers): Another syntax check.
2073 (syntax-check-rules): Add it to the list.
2075 * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
2076 so it matches `%ld' format even on 32-bit systems.
2078 * src/fmt.c (flush_paragraph): Cast field width to `int' to
2079 avoid warning on 64-bit systems.
2081 * src/ls.c (sort_files): Make `func' volatile, so it can't be
2082 clobbered by a `longjmp' into this function.
2084 2003-07-25 Jim Meyering <jim@meyering.net>
2086 * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
2089 * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
2090 because it'd evoke spurious failure on 64-bit systems.
2092 2003-07-24 Jim Meyering <jim@meyering.net>
2094 * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
2095 output its current record counts. Reported by Jurriaan.
2097 * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
2098 `wc' with no options. This goes along with the change of 2003-07-20.
2100 2003-07-23 Jim Meyering <jim@meyering.net>
2102 Don't include headers already included by system.h:
2103 * src/tr.c: Don't include errno.h.
2104 * src/true.c: Don't include version-etc.h.
2105 * src/test.c: Don't include limits.h or error.h.
2106 * src/stat.c: Don't include unistd.h or time.h.
2107 * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
2108 * src/pr.c: Don't include time.h.
2109 * src/pathchk.c: Don't include errno.h.
2110 * src/nice.c: Don't include sys/time.h.
2111 * src/ls.c: Don't include stdlib.h.
2113 * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
2114 * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
2115 * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
2116 * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
2117 * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
2118 * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
2119 * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
2120 * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
2121 Don't include closeout.h.
2123 * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
2124 can access the required version of rm.
2125 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
2127 * tests/cut/Test.pm (out-delim3a): New test.
2129 * man/help2man: Update to version 1.33.
2131 * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
2133 * src/dircolors.c: Include xstrndup.h.
2134 (xstrndup): Remove function, now that it's been factored out into
2137 2003-07-22 Paul Eggert <eggert@twinsun.com>
2139 * src/wc.c (wc): Fix typo in computation of file from file_x,
2140 which caused the former to be used uninitialized if file_x was
2143 2003-07-22 Jim Meyering <jim@meyering.net>
2145 * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
2147 * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
2148 help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by
2149 Thomas Luzat. See http://bugs.debian.org/202413 for details.
2151 * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
2153 * src/hostid.c: Don't include <unistd.h>. system.h already does that.
2155 * src/cut.c (set_fields): Mark all selected indices before trying to
2156 determine range endpoints.
2157 * tests/cut/Test.pm: New test for the above fix.
2159 Begin to address this comment: What if someone wants to
2160 extract the 1,000,000-th field of some huge input file?
2161 The first step is to rearrange things so that the values
2162 in the printable_field array are all 0/1 rather than 0/1/2.
2163 * src/cut.c (RANGE_START_SENTINEL): Remove.
2164 Store range-start indices in a hash table, rather than
2165 overloading the `printable_field' array.
2166 (range_start_ht): New global.
2167 (hash_int, hash_compare_ints, is_range_start_index): New functions.
2168 (print_kth): Use is_range_start_index; don't test printable_field.
2169 (set_fields): Detect overflow.
2170 (set_fields): Insert each range-start index into range_start_ht.
2171 (main): Call set_fields only once, and only after
2172 output_delimiter_specified and (if required) range_start_ht have
2175 2003-07-20 Paul Eggert <eggert@twinsun.com>
2177 * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
2178 invoked with a null pointer when there were no file arguments.
2180 2003-07-20 Jim Meyering <jim@meyering.net>
2182 * Makefile.maint (sc_changelog): Add another nit-picky check.
2184 * src/wc.c (write_counts): Add a comment.
2185 (wc): Rename `file' parameter.
2186 Set new local, `file', to be the file name, or (when it's NULL)
2187 _("standard output") so that all uses of `file' use the proper value.
2188 Use STREQ, not strcmp.
2190 2003-07-20 Paul Eggert <eggert@twinsun.com>
2192 wc count field widths now are heuristically adjusted depending
2193 on the input size, if known. If only one count is printed, it
2194 is guaranteed to be printed without leading spaces.
2196 Previously, wc did not align the count fields if
2197 POSIXLY_CORRECT was set, but POSIX did not actually require
2198 this undesirable behavior, so it has been removed.
2200 * NEWS: Document this.
2201 * doc/coreutils.texi (wc invocation): Likewise.
2203 * src/wc.c (number_width): New var.
2204 (posixly_correct): Remove.
2205 (struct fstatus): New struct.
2206 (write_counts): Output fields of width number_width.
2207 Do not worry about POSIXLY_CORRECT.
2208 Use null file, not empty-string file, to denote stdin,
2209 since "" is a valid file name on some hosts.
2210 (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
2212 (wc): Avoid problems if end_pos - current_pos overflows.
2213 Do not print odd message if stdin has a read error.
2214 (get_input_fstatus, compute_number_width): New functions.
2215 (main): Use them to implement the new behavior.
2216 Ignore POSIXLY_CORRECT.
2218 * tests/wc/Test.pm: Adjust to the new output widths.
2220 2003-07-19 Jim Meyering <jim@meyering.net>
2222 * tests/rm/fail-eperm: Don't create temporary directory --
2225 * tests/shred/remove: Don't open-code test for UID != 0.
2226 Use priv-check's require-non-root instead.
2227 Update to use newer framework.
2229 * tests/help-version (expected_failure_status_expr): Record that
2230 expr exits with status of 3 for e.g., a write error.
2232 * tests/priv-check: Use `id -u' to see if we're running as root,
2233 rather than trying go write to an write-protected file.
2234 When running as root, ensure $NON_ROOT_USERNAME is valid.
2235 When running as root with `require-non-root', ensure that `.'
2236 is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
2237 to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test.
2239 * src/printenv.c: Include "exitfail.h".
2240 (main): Set exit_failure rather than calling close_stdout_set_status.
2241 * src/date.c: Likewise.
2242 * src/sort.c: Likewise.
2243 * src/tty.c: Likewise.
2245 2003-07-18 Jim Meyering <jim@meyering.net>
2247 * tests/touch/not-owner: Update to use newer framework.
2249 * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
2250 directory, and remove Perl-coded `you may not run as root' test.
2251 * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
2252 hard-coding something not quite equivalent.
2253 Paul Jarc reported the inconsistent diagnostics.
2255 * src/sort.c (main): Use close_stdout via atexit.
2256 Now `sort --version' and `sort --help' fail, as they should
2257 when their output is redirected to /dev/full.
2259 * src/su.c (usage): Don't call close_stdout here.
2260 (main): Use close_stdout via atexit.
2261 Now `su --version > /dev/full' fails, as it should.
2262 Somehow, the change of 2000-05-07 that purports to fix this
2265 * tests/help-version (--help/--version vs. /dev/full): Special-case
2266 `[' to protect it from expected_failure_status-`eval'.
2268 * src/uniq.c (writeline): Use a SPACE, not a TAB between the
2269 count and the corresponding line, as required by POSIX.
2270 Reported by Clement Wang.
2271 * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
2273 * tests/expr/basic: Add tests for when exit status is 2.
2275 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
2276 Use an anonymous `enum', rather than #define.
2278 2003-07-17 Paul Eggert <eggert@twinsun.com>
2280 * src/expr.c: Include "exitfail.h", "quotearg.h".
2281 (EXPR_INVALID, EXPR_ERROR): New constants.
2282 (nomoreargs, null, toarith, nextarg): Return bool, not int.
2283 (syntax_error): New function, exiting with status 2. Use it
2284 insteading of printing "syntax error" ourselves.
2285 (main): Initialize exit_failure to EXPR_ERROR.
2286 Exit with EXPR_INVALID on syntax error (too few arguments).
2287 (nextarg): Use strcmp, not strcoll; strcoll might return
2288 an undesirable 0, or might fail.
2289 (docolon, eval4, eval3): Exit with status 3 on invalid argument type
2290 or other such error.
2291 (eval2): Report an error if strcoll fails in a string comparison.
2292 * src/sort.c: Include "exitfail.h".
2293 (main): Set exit_failure, not xalloc_exit_failure and
2294 xmemcoll_exit_failure.
2295 * tests/expr/basic: Invalid value exits with status 3, not 2.
2297 2003-07-16 Jim Meyering <jim@meyering.net>
2299 * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
2300 per GNU maintainer guidelines. The next non-beta release will be 5.1.
2302 This script would have caught at least two recent bugs:
2303 those in [ and kill.
2304 * tests/help-version: Revive this script.
2305 It wasn't doing anything useful, since $all_programs wasn't being
2306 defined by the invoking Makefile.am.
2307 Reflect that nohup is no longer a script, so don't exclude it.
2308 Add framework to handle the programs added since it was last run:
2309 kill, stat, unlink, [, link, readlink.
2310 Fix path-related problems deriving from the move of this script
2311 from src/ to its present location.
2312 * tests/Makefile.am (all_programs): Define.
2313 (TESTS_ENVIRONMENT): Use it.
2315 * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
2316 whereby kill would always attempt to operate on argv[0] and fail.
2318 * src/test.c (integer_expected_error): Improve diagnostic -- now,
2319 it also matches the one from bash's builtin test.
2320 (binary_operator): Add \n at end of diagnostic.
2322 * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ...
2323 * tests/priv-check: Move setuidgid-related and
2324 NON_ROOT_USERNAME-checking code to this file.
2326 * README: Update section on testing as `root'.
2327 Suggestion from Paul Jarc.
2329 * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
2330 names of authors that I just found in bash's builtins/test.def.
2332 Running `[' with no arguments would evoke a segfault.
2333 * src/test.c (main) [LBRACKET]: Move initialization of argv to
2334 precede potential use via test_syntax_error.
2336 * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
2337 warning from automake -Wall.
2339 2003-07-15 Jim Meyering <jim@meyering.net>
2343 * Makefile.maint (%.asc): Remove target first, so gpg doesn't
2346 * announce-gen (print_changelog_deltas): Relax tests for matching
2347 version-number line in NEWS.
2348 Change the .sig suffix to .asc here, too.
2350 2003-07-14 Jim Meyering <jim@meyering.net>
2352 * Makefile.maint (%.asc): Renamed from %.sig.
2353 Generate and use ascii-armored signatures.
2354 Use gpg's -o option.
2356 2003-07-13 Jim Meyering <jim@meyering.net>
2358 * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
2361 * Makefile.maint (syntax-check): Move each individual check into
2363 (syntax-check-rules): This is the list of syntax-check targets.
2364 (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
2365 (sc_cast_of_x_alloc_return_value, sc_space_tab):
2366 (sc_error_exit_success, sc_xalloc_h_in_src): New targets.
2368 2003-07-12 Jim Meyering <jim@meyering.net>
2370 * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
2371 traces of the nohup script.
2373 * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
2374 $(OPTIONAL_BIN_ZCRIPTS).
2376 * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
2377 target, not before the `>'.
2379 * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
2380 now that that function no longer calls `error'.
2382 * src/df.c (find_mount_point): Emit a diagnostic for each
2383 failed syscall, rather than relying on caller to do that.
2384 The caller couldn't do a good job, anyhow -- too many different
2385 ways to fail (each with a different referent).
2386 Give a diagnostic upon failed save_cwd, now that that function
2387 no longer calls `error'.
2388 (show_point): Don't diagnose find_mount_point's errors, now that
2389 it handles them itself.
2391 * src/df.c (find_mount_point): Don't let free clobber errno upon
2394 * src/sys2.h: Remove alloca-related block.
2395 * src/system.h: Include <alloca.h> here, instead.
2397 It appears that the `#pragma alloca' included via "system.h" is
2398 adequate, since join.c uses alloca, yet lacked an in-file #pragma.
2399 * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
2400 * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
2402 * src/chown-core.c (change_file_owner): Do not restore any special
2403 permission bits (e.g., set-user-ID, set-group-ID) that are reset
2404 by chown(2) on some systems. Suggestion and insistence :-) from
2407 * tests/input-tty: Also check `test -t 1'.
2408 This is necessary on linux-2.4.21. Otherwise, the stty/basic-1
2409 test would block when run in the background.
2411 2003-07-11 Jim Meyering <jim@meyering.net>
2413 * tests/sample-test: Also fail if cat-to-create-expected-output
2414 fails. Otherwise, if both `exp' and `out' were to end up empty
2415 because of e.g., a full disk, they would mistakenly compare equal.
2417 * src/nohup.c: New file. Rewrite of nohup.sh in C.
2418 This solves a portability problem: on at least Solaris systems,
2419 when nohup.sh used the vendor /bin/sh, it would exit with status
2420 of `1' rather than the required 126 or 127 upon failure to exec
2421 the specified program.
2423 * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
2424 (bin_PROGRAMS): Add nohup.
2425 (EXTRA_DIST): Remove nohup.sh.
2426 (all_programs): Remove use of $(EXTRA_SCRIPTS).
2427 * src/nohup.sh: Remove file.
2428 * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
2430 * tests/misc/nohup: Tests for the above.
2431 * tests/misc/Makefile.am (TESTS): Add nohup.
2433 * src/head.c (diagnose_copy_fd_failure): New function, renamed from
2434 the macro, COPY_FD_DIAGNOSE.
2435 (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
2436 (head_file): Likewise.
2438 * src/date.c: Include "quote.h".
2439 (batch_convert): Use the quote function rather than using literal `...'
2442 * src/setuidgid.c (main): Enclose diagnostic in _(...).
2443 * src/fmt.c (main): Likewise.
2444 * src/mknod.c (main): Likewise.
2445 * src/tac.c (tac_seekable): Likewise.
2446 * src/yes.c (main): Likewise.
2447 * src/od.c (main): Likewise.
2448 * src/install.c (change_attributes): Likewise.
2450 2003-07-10 Jim Meyering <jim@meyering.net>
2452 * src/head.c (usage): Use 1024*1024 in place of 1048576.
2453 * src/tail.c (usage): Likewise.
2455 * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
2456 place of the kludge in this test. Suggestion from Paul Jarc.
2458 * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
2459 * src/setuidgid.c: New program, solely for testing (not installed).
2461 * src/chown-core.c (change_file_owner): Don't leak file descriptors
2462 when dereferencing symlinks.
2464 2003-07-09 Jim Meyering <jim@meyering.net>
2466 * tests/du/slash: New file/test for today's lib/ftw.c fix.
2467 * tests/du/Makefile.am (TESTS): Add slash
2469 * src/tail.c (xlseek): Avoid warning about ``return without value
2470 from function returning non-void''.
2472 2003-07-08 Jim Meyering <jim@meyering.net>
2474 * man/help2man: Update to version 1.29.
2476 * man/help2man: Add END handler to close STDOUT and check for errors.
2478 2003-06-30 Paul Eggert <eggert@twinsun.com>
2480 Add support for a "[" that conforms to the GNU coding standards,
2481 i.e., that does not depend on its name.
2482 * src/lbracket.c: New file.
2484 * man/Makefile.am (programs): Ignore "[", since it doesn't have
2485 a separate man page.
2486 * src/Makefile.am (bin_PROGRAMS): Add "[".
2487 (__SOURCES): New var.
2488 * src/test.c (LBRACKET): Define to 0 if not defined.
2489 (main): Use LBRACKET rather than argv[0].
2491 * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
2492 Reported by Paul Jarc and Dan Jacobson.
2494 * src/test.c (main): Do not recognize --help or --version if
2495 POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
2496 Do not bother testing that margv[margc] is non-null.
2498 2003-07-04 Jim Meyering <jim@meyering.net>
2500 * src/who.c (print_line): Rewrite to use asprintf, in order to be
2501 able to avoid emitting trailing spaces. Reported by Dan Jacobson.
2503 * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
2504 option, and perform the +1600 invocations of head IFF the envvar
2505 RUN_EXPENSIVE_TESTS is set.
2507 2003-07-03 Jim Meyering <jim@meyering.net>
2509 * src/cp.c (do_copy): Give a better diagnostic when failing due
2510 to nonexistent destination directory. Reported by Dmitry Rutsky.
2511 See http://bugs.debian.org/199730 for details.
2513 2003-06-27 Jim Meyering <jim@meyering.net>
2515 split's --verbose option did nothing [broken in 4.5.10 and 5.0]
2516 * src/split.c (longopts): Use `1', not `0' as the value for
2517 for &verbose. Reported by Keith Thompson.
2519 Test for the above fix.
2520 * tests/misc/split-a: Also use --verbose and compare stderr
2521 output with what we'd expect.
2523 2003-06-20 Jim Meyering <jim@meyering.net>
2525 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2526 Use `error_t' (rather than int) as type for local `err'.
2527 From Alfred M. Szmidt.
2529 2003-06-19 Marcus Brinkmann <marcus@gnu.org>
2531 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
2532 Fix author preservation code.
2534 2003-06-19 Jim Meyering <jim@meyering.net>
2536 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
2537 (do_link): Don't warn about hard link to symlink.
2539 2003-06-18 Jim Meyering <jim@meyering.net>
2541 * src/cut.c: Include "getdelim2.h", not "getstr.h".
2542 Reflect renaming: getstr -> getdelim2.
2544 * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
2545 readline -> readlinebuffer.
2547 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2549 * src/readlink.c: Include <sys/types.h> before system.h (because
2550 the latter includes <sys/stat.h>). Required on Ultrix 4.3.
2552 2003-06-17 Jim Meyering <jim@meyering.net>
2554 * src/system.h (initialize_main): Define.
2555 Use it in every `main'. Applied via this:
2556 p='initialize_main (&argc, &argv);'
2557 perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \
2558 $(grep -l program_name.=.argv.0 *.c)
2559 test.c uses margc/margv, so I made the change manually for that file.
2560 Based on a patch from Bernard Giroud.
2562 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
2564 Fix for build failure on Ultrix 4.3.
2565 * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
2566 Include sys/param.h and sys/mount.h on ultrix.
2568 2003-06-16 Jim Meyering <jim@meyering.net>
2570 * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
2572 * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
2573 them here instead, but with one change: define EISDIR to -1, not 0.
2575 * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
2576 guaranteed to be defined.
2577 * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
2579 * README: Mention the CVS repository.
2580 Encourage addition of test cases.
2582 2003-06-12 Jim Meyering <jim@meyering.net>
2584 * src/touch.c (touch): Call close only if necessary.
2587 * src/wc.c (usage): Correct wording: wc prints counts in the order
2588 `newline, word, byte'. Reported by Keith M. Briggs.
2589 * man/wc.x: Fix it here, too. And change `lines' to `newlines'.
2591 2003-06-10 Jim Meyering <jim@meyering.net>
2593 * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
2595 2003-06-07 Jim Meyering <jim@meyering.net>
2597 * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
2600 2003-06-06 Jim Meyering <jim@meyering.net>
2602 * src/extract-magic (main): Avoid newer 3-arg form of open,
2603 so this script works also with e.g., perl5.005_03.
2604 Patch by John David Anglin.
2606 2003-06-04 Paul Eggert <eggert@twinsun.com>
2608 * src/system.h: Include <stdbool.h> unconditionally.
2610 2003-06-04 Jim Meyering <jim@meyering.net>
2612 * man/Makefile.am (check-programs-vs-x): Rename target
2613 from check-programs-vs-1. Adjust rule to check for the
2614 primary (.x) file, not the generated one (.1).
2616 2003-06-03 Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
2618 * man/kill.x: New file.
2619 * man/Makefile.am (dist_man_MANS): Add kill.1.
2622 2003-06-04 Jim Meyering <jim@meyering.net>
2624 Ensure that the .x file for a new program is never forgotten again.
2625 * man/Makefile.am (programs): Define.
2626 (check-programs-vs-1): New phony target.
2627 (check-local): Depend on it.
2629 2003-06-03 Jim Meyering <jim@meyering.net>
2631 Avoid unnecessary copying of environment.
2632 * src/env.c (main): Rather than clearing the environment and --
2633 unless told to ignore environment -- copying all settings from
2634 the saved, original environment, clear the environment only when
2635 that is requested. Suggested by Jens Elkner.
2637 2003-06-02 Jim Meyering <jim@meyering.net>
2639 * src/system.h: Always include <string.h>, since we assume C89.
2640 Include <limits.h> without checking for HAVE_LIMITS_H.
2642 * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
2643 (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
2645 2003-06-01 Jim Meyering <jim@meyering.net>
2647 Avoid a race condition in `tail -f' described by Ken Raeburn in
2648 http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
2649 * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
2650 (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
2651 (tail_bytes, tail_lines, tail): Likewise.
2652 (tail_file): Use the new `read_pos' value as the size,
2653 rather than stats.st_size from the fstat call.
2655 2003-05-28 Jim Meyering <jim@meyering.net>
2657 * src/extract-magic: Allow expansion of `$file' in the here-
2658 document corresponding to the comment at the top of fs.h.
2660 2003-05-26 Jim Meyering <jim@meyering.net>
2662 * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
2663 <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
2664 Use #if/#elif/... cascade so we get only one set of include files.
2665 Reported by Nelson Beebe.
2667 2003-05-24 Jim Meyering <jim@meyering.net>
2669 * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
2670 * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
2671 accept the BSD format.
2673 2003-03-28 Joe Orton <jorton@redhat.com>
2675 * src/md5sum.c (bsd_split_3): New function.
2676 (split_3): Detect checksums from BSD 'md5' command and handle them
2679 * tests/md5sum/basic-1: New tests for --check exit status, and for
2680 BSD-style checksum files.
2682 2003-05-21 Jim Meyering <jim@meyering.net>
2684 * src/head.c (elide_tail_lines_pipe): Fix a thinko.
2685 This sort of thing is why it'd be *Really Good* to factor
2686 out the common code used here and in tail.c.
2688 2003-05-14 Jim Meyering <jim@meyering.net>
2690 * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
2692 * tests/du/slink: Skip this test if `.' is on an XFS file system.
2694 * tests/du/fd-leak: New file. Test for the bug in du that
2695 was fixed by the 2003-05-12 change to lib/ftw.c.
2696 * tests/du/Makefile.am (TESTS): Add fd-leak.
2698 * src/head.c (AUTHORS): Enclose string in N_(...), now that it
2699 includes a translatable word, `and'.
2701 * src/dd.c (usage): Don't use `,' as the thousands separator
2702 in e.g. 1,000,000 and 1,048,576. Instead, do this:
2703 `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
2704 * src/df.c (usage): Likewise.
2705 * src/du.c (usage): Likewise.
2706 * src/ls.c (usage): Likewise.
2708 * Makefile.maint (syntax-check): Add another check.
2710 2003-05-13 Paul Eggert <eggert@twinsun.com>
2712 Fix uniq to conform to POSIX, which requires that "uniq -d -u"
2713 must output nothing. Problem reported by Josh Hyman.
2715 * src/uniq.c (enum output_mode, mode): Remove, replacing with:
2716 (output_unique, output_first_repeated, output_later_repeated):
2717 New vars. All uses of "mode" changed to use these variables,
2718 which are not mutually exclusive as "mode" was.
2719 (writeline): New arg "match", used to control whether to
2720 obey output_first_repeated or output_later_repeated.
2721 All callers changed.
2722 (check_file, main): Adjust to above changes.
2724 * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
2726 2003-05-14 Jim Meyering <jim@meyering.net>
2728 * tests/rm/rm3: Use tr's \n notation rather than \012.
2729 This package can afford to do that, since its tests are guaranteed use
2730 GNU tr, which has accepted the more modern notation for 10 years.
2731 * tests/rm/rm5: Likewise.
2732 * tests/cp/same-file: Likewise.
2733 * tests/stty/row-col-1: Likewise.
2734 * tests/stty/basic-1: Likewise.
2735 * tests/rm/deep-1: Likewise.
2736 * tests/mv/part-symlink: Likewise.
2737 * tests/mkdir/perm: Likewise.
2738 * tests/misc/nice: Likewise.
2740 2003-05-13 Jim Meyering <jim@meyering.net>
2742 * src/copy.c (struct F_triple) [name]: Remove const attribute.
2743 (triple_free): Don't apply cast to argument of free.
2744 (seen_file): Add cast here instead.
2746 * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
2747 (src_to_dest_free): Don't apply cast to argument of free.
2749 * src/sort.c (zaptemp): Don't apply cast to argument of free.
2750 * src/pr.c (init_fps, init_store_cols): Likewise.
2751 * src/join.c (delseq, freeline): Likewise.
2752 * src/expr.c (OLD): Likewise.
2753 * src/sort.c (sort): Likewise.
2754 * src/head.c (elide_tail_lines_pipe): Likewise.
2756 * src/tail.c: Include "quote.h".
2757 Use quote in diagnostics. Change many error format strings
2758 from just `%s' to e.g., `error reading %s'.
2759 (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
2760 Rewrite newline-counting loop to use memchr.
2762 * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
2763 Now that assert is no longer used, don't include <assert.h>.
2765 2003-05-12 Jim Meyering <jim@meyering.net>
2767 * src/head.c: Include <assert.h>.
2768 (AUTHORS): Add my name.
2769 (elide_tail_lines_pipe): New function.
2771 2003-05-10 Jim Meyering <jim@meyering.net>
2773 * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
2775 * src/readlink.c (main): Set program_name before first use.
2776 Remove that (redundant) first use.
2777 Don't exit successfully just because --verbose was specified.
2778 Pass 0, not EXIT_SUCCESS, as first argument to error; when that
2779 parameter is 0, error does not exit.
2781 * src/uname.c (main): When failing due to too many arguments, also say
2782 that, rather than just "Try `uname --help' for more information.".
2783 * src/comm.c (main): Likewise, but for too few arguments.
2784 * src/logname.c: Include error.h.
2785 (main): Say why we're failing.
2787 * src/uniq.c (main): Don't segfault when argc < optind.
2788 * src/who.c (main): Handle argc < optind.
2789 * src/df.c (main): Likewise.
2790 * src/install.c (main): Likewise.
2791 * src/mv.c (main): Likewise.
2792 * src/pwd.c (main): Likewise.
2793 * src/tty.c (main): Likewise.
2794 * src/chroot.c (main): Likewise.
2795 * src/hostname.c: Likewise.
2796 * src/du.c (main): Likewise.
2797 * src/expand.c (main): Likewise.
2798 * src/env.c (main): Likewise.
2799 * src/unexpand.c (main): Likewise.
2800 * src/printenv.c (main): Likewise.
2801 * src/sync.c (main): Handle argc == 0.
2802 * src/expr.c (main): Likewise.
2803 * src/printf.c (main): Likewise.
2804 * src/basename.c (main): Likewise.
2805 * src/ln.c (main): Test for `missing argument' before computing n_files.
2806 * src/tail.c (main): Test for the case of no arguments before
2809 * src/kill.c (send_signals): Don't check command line arguments here.
2810 (main): Check them here instead. Handle argc < optind.
2812 * src/logname.c (main): Use error, rather than fprintf, for the sake
2815 * src/rm.c (main): Don't overrun array bound if argc is 0.
2817 2003-05-09 Jim Meyering <jim@meyering.net>
2819 * src/sort.c (main): Don't overrun array bound if argc is 0.
2820 That would happen when invoked via: execl ("/usr/bin/sort", NULL);
2821 Reported by Wartan Hachaturow.
2823 2003-05-07 Jim Meyering <jim@meyering.net>
2825 Implement support so that `head --lines=-N' works on seekable files.
2826 * src/head.c (enum Copy_fd_status): Define.
2827 (COPY_FD_DIAGNOSE): New macro.
2828 (elide_tail_lines_seekable): New funtion.
2829 (elide_tail_lines_file): Call it here.
2831 2003-05-06 Jim Meyering <jim@meyering.net>
2833 * src/sys2.h (CHAR_BIT): Remove duplicate definition.
2835 2003-05-04 Jim Meyering <jim@meyering.net>
2837 * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
2838 caused the addition of thousands of small files to the tar archive.
2839 * tests/misc/head-elide-tail: New file. Add them here instead.
2840 * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
2842 2003-05-04 Paul Eggert <eggert@twinsun.com>
2844 * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
2845 (IF_READDIR_NEEDS_REWINDDIR): Remove.
2846 (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
2847 which was a bit weird because it couldn't be emulated by a function.
2849 2003-05-03 Jim Meyering <jim@meyering.net>
2851 Extend head to accept --lines=-N (--bytes=-N) and to print all
2852 but the N lines (bytes) at the end of the file.
2853 * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
2854 Use quote() in diagnostics, rather than literal `' marks.
2855 (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
2857 (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
2858 (head_file): Reorganize so as to call head from only one place.
2859 (main): Likewise, for head_file.
2860 Handle new, undocumented option, --presume-input-pipe.
2861 Handle negative line and byte counts.
2862 * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
2864 * tests/du/8gb: Skip test if the file system of `.' doesn't support
2865 sparse files -- otherwise it'd create a file of size 8GB.
2867 2003-05-02 Jim Meyering <jim@meyering.net>
2869 * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
2870 Instead explain about `-' and standard input.
2871 (main): Give a proper diagnostic for e.g., `fmt -c -72'.
2872 Reported by Keith Thompson.
2873 * tests/fmt/basic: Add test for the above fix.
2875 * src/fmt.c: Include "quote.h".
2876 Use quote() in diagnostics, rather than literal `' marks.
2877 (main): Exit nonzero when unable to open an input file.
2878 * tests/fmt/basic: Add test for the above fix.
2880 * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
2881 specifications like `-72x'.
2882 * tests/fmt/basic: Add test for the above fix.
2884 Work around nasty readdir bug on Darwin6.5.
2885 * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
2886 [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
2887 returned NULL and there has been at least one successful unlink or
2888 rmdir call since the opendir or previous rewinddir, then call
2889 rewinddir and reiterate the loop.
2891 Factor out common code.
2892 * src/remove.c (readdir_ignoring_dotdirs): New function.
2893 (is_empty_dir): Use it here.
2894 (remove_cwd_entries): Use it here.
2896 2003-05-01 Jim Meyering <jim@meyering.net>
2898 * tests/rm/r-3: Create 500 rather than just 300 files.
2899 There's a bug in Darwin6.5's readdir that shows up only with
2901 Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
2905 Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
2906 (dump_remainder): Move two declarations `down' into the scope
2907 where they are used.
2908 (xlseek): Return the resulting offset.
2909 (file_lines): Rename parameter, file_length, to end_pos.
2910 (pipe_lines): Don't coerce safe_read return value to `int'.
2911 Adapt tests accordingly.
2912 (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
2914 Change type of `total_bytes' from `int' to `size_t',
2915 since the former wouldn't always be wide enough.
2916 Don't coerce safe_read return value to `int',
2917 and adapt tests accordingly.
2918 Now that testing for a read error no longer involves
2919 using `tmp', handle that case *after* freeing `tmp'.
2920 (start_bytes): Clean up.
2921 (tail_bytes): Now that `n_bytes' may be larger than
2922 OFF_T_MAX, test for that condition and, if it's true, don't
2923 use lseek optimizations.
2924 (parse_options): Don't fail just because N_UNITS is larger than
2925 the maximum size of a file -- tail may be applied to an input
2926 stream (e.g., a pipe) with more data than that.
2928 * Makefile.maint (syntax-check): Rename from alloc-check.
2929 Also check for SPACE-TAB sequences.
2930 Also check for malloc/calloc/realloc casts.
2932 2003-05-01 Jim Meyering <jim@meyering.net>
2934 * src/tail.c (start_lines): Rewrite to use memchr. Clean up.
2936 2003-04-28 Jim Meyering <jim@meyering.net>
2938 * tests/misc/tty-eof: Send two tokens, not just one, so we don't
2939 make the now-more-picky tsort fail.
2941 2003-04-24 Jim Meyering <jim@meyering.net>
2943 * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
2944 (main): Minor syntactic clean-up.
2946 * src/tsort.c (tsort): Fail if the input contains an odd number of
2947 tokens. Reported by junkio@cox.net.
2949 * tests/tsort/basic-1: Test for the above fix.
2951 2003-04-21 Jim Meyering <jim@meyering.net>
2953 * tests/misc/printf: Add tests for the printf fixes below.
2955 * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
2957 2003-04-20 Paul Eggert <eggert@twinsun.com>
2959 Fix printf POSIX compatibility bug reported by Ben Harris in
2960 <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
2961 * doc/coreutils.texi (printf invocation): It's \NNN in the format,
2962 \0NNN in the %b operand.
2963 * src/printf.c (usage): Likewise.
2964 (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
2965 is desired. All uses changed. Behave like Bash printf if %b
2966 operand uses \NNN where the initial N is not 0.
2968 2003-04-17 Jim Meyering <jim@meyering.net>
2970 * src/stty.c: Remove uses of PROTOTYPE macro.
2972 2003-04-15 Jim Meyering <jim@meyering.net>
2974 * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
2975 each sequence of spaces before a TAB character.
2977 2003-04-13 Jim Meyering <jim@meyering.net>
2979 * src/remove.c (is_empty_dir): Don't closedir (NULL).
2981 2003-04-12 Jim Meyering <jim@meyering.net>
2983 Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
2984 --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
2985 FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
2986 * src/nl.c (main): Fix those problems and remove literal quote marks
2987 (e.g., "`%s'") from format string; instead use "%s" in each format
2988 string and `quote (optarg)' as the corresponding argument.
2989 Also, diagnose all invalid command line options before failing.
2991 * src/nl.c (proc_text): Fix a bug that would make nl output extra
2992 newlines in some cases. Details here: http://bugs.debian.org/177256.
2993 This bug was introduced on 2001-11-10 for textutils-2.0.17.
2994 * tests/misc/nl: Add test for the above-fixed bug.
2996 * tests/misc/readlink: New file. Test the --canonicalize option.
2997 * tests/misc/Makefile.am (TESTS): Add readlink.
2999 2003-04-11 Jim Meyering <jim@meyering.net>
3002 * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
3003 * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
3004 * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
3005 retain alignment) each sequence of spaces before a TAB character.
3007 * src/ls.c: Include <stdlib.h> unconditionally.
3009 * Makefile.maint (xalloc-check): Rename from header-check.
3011 * src/yes.c: Include error.h after system.h, not before.
3014 * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
3015 * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
3016 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
3017 * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
3018 * src/tr.c: * src/unexpand.c, src/users.c:
3019 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
3020 return values and of xrealloc's first argument.
3021 Fix the former with this:
3022 perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
3024 2003-04-10 Jim Meyering <jim@meyering.net>
3026 * src/stty.c (wrapf): Declare with format attribute.
3028 The S_MAGIC_... names shouldn't be maintained in two places (prior
3029 to this change, one would have to keep stat.c and fs.h in sync).
3030 This change makes it so those names and the corresponding
3031 hexadecimal constants all reside in stat.c. fs.h is now generated.
3032 * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
3033 (BUILT_SOURCES): Add fs.h, now that it's generated.
3034 (EXTRA_DIST): Add extract-magic.
3035 * src/extract-magic: New script to extract fs.h definitions from stat.c.
3036 * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
3037 fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
3039 * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
3040 file with nominal length > 4GB fails. Reported by Michael Deutschmann.
3042 * man/unexpand.x: Add `SEE ALSO' reference to expand.
3043 * man/expand.x: Add `SEE ALSO' reference to unexpand.
3044 Suggestion from Dan Jacobson.
3046 2003-04-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
3048 * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
3049 * src/stat.c (human_fstype): Handle Linux's devpts.
3051 2003-04-09 Paul Eggert <eggert@twinsun.com>
3053 * src/split.c (line_bytes_split): Arg is of type size_t, since
3054 that's all that is supported for now.
3055 (main): Check for overflow in obsolescent line count option.
3057 2003-04-09 Jim Meyering <jim@meyering.net>
3059 * tests/misc/split-fail: Add a new test for the above fix.
3061 * src/split.c (bytes_split): Use size_t temporary (rather than
3062 uintmax_t original) in remaining computations. From Paul Eggert.
3064 Handle command line option arguments larger than 2^31.
3065 This allows e.g., splitting into files of size 2GB and larger,
3066 and running split --lines=N with N=2^31 or more.
3067 But for --line-bytes=N, the restriction that N <= SIZE_MAX
3068 remains (for now), due to the way it is implemented.
3070 * src/split.c: Include "inttostr.h".
3071 (bytes_split, lines_split, line_bytes_split, main):
3072 Use uintmax_t, not size_t, for file sizes.
3073 (main): Give a better diagnostic for option arguments == 0.
3074 Use umaxtostr to print file sizes.
3075 Reported by Luke Hassell.
3077 2003-04-08 Jim Meyering <jim@meyering.net>
3079 * src/rm.c (usage): Mention that --directory (-d) works only
3080 on some systems. Suggestion from Samuel Tardieu.
3082 * tests/basename/basic: Run $PERL to see if it is available,
3083 rather than testing its value.
3084 * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
3085 * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
3086 * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
3087 * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
3088 * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
3089 * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
3090 * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
3091 * tests/sum/basic-1, tests/seq/basic: Likewise.
3093 * tests/misc/Makefile.am (TESTS): Add split-fail.
3094 * tests/misc/split-fail: New file.
3096 * src/split.c: Rename local variables: nchars -> n_bytes.
3097 (lines_split): Rename local, nlines -> n_lines.
3098 (main): Rename local variable: s/accum/n_units/.
3099 (main): Use STDIN_FILENO, not literal `0'.
3101 2003-04-07 Jim Meyering <jim@meyering.net>
3103 * src/stat.c: Add #include directives for Ultrix 4.4.
3104 Based on a suggested change from Bert Deknuydt.
3106 2003-04-06 Jim Meyering <jim@meyering.net>
3108 * Makefile.maint (makefile-check): New rule.
3109 (local-check): Add it.
3111 2003-04-05 Jim Meyering <jim@meyering.net>
3113 * Makefile.am (nearly all of them):
3114 Use $(VAR) rather than @VAR@, now that we can rely on automake to
3115 emit a definition for each substituted variable.
3116 * tests/Makefile.am.in: Likewise.
3118 * tests/rm/rm5: Add a comment explaining why this test fails when
3119 using Tru64's broken sed.
3120 * tests/rm/rm3: Likewise.
3122 Make `kill -t' output signal descriptions (not `?') on Tru64.
3123 * src/kill.c (sys_siglist): Also check for __sys_siglist.
3124 Patch by Tony Leneis.
3125 * configure.ac: Also check for declaration of __sys_siglist.
3126 Required for Tru64 4.0D, 4.0F, and 5.1.
3127 Reported by Tony Leneis.
3129 2003-04-04 Jim Meyering <jim@meyering.net>
3131 * src/Makefile.am (PERL): Remove unnecessary definition.
3133 Because of inappropriate (but POSIX-mandated) behavior of rename,
3134 `mv a b' would not remove `a' in some unusual cases. Work around
3135 this by unlinking `a' when necessary.
3137 * src/copy.c (same_file_ok): Add an output parameter.
3138 Set it in the offending case.
3139 (copy_internal): When necessary, unlink SRC_PATH and inform caller.
3140 Reported by Ed Avis.
3141 * tests/mv/hard-4: New test for the above.
3142 * tests/mv/Makefile.am (TESTS): Add hard-4.
3144 Clean up rules for automatically generated sources:
3145 * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
3146 Make each generated file be read-only.
3147 Add each file name to BUILT_SOURCES separately.
3148 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
3150 Put LOCALEDIR macro definition in new file: localedir.h.
3151 * src/Makefile.am (DEFS): Remove definition.
3152 (localedir.h): New rule.
3153 (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
3154 * src/system.h: Include "localedir.h".
3156 2003-04-02 Jim Meyering <jim@meyering.net>
3160 * tests/misc/Makefile.am (TESTS): Add false.
3162 * Makefile.maint (TMPDIR): Make sure it's defined.
3163 (my-distcheck): Build in $(TMPDIR), not `.'.
3165 * src/Makefile.am (false.c): Change all occurrences of
3166 `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
3167 unsuccessfully also with --help. Reported by Paul Jarc,
3168 * tests/misc/false: New test for the above.
3170 2003-03-30 Jim Meyering <jim@meyering.net>
3172 * NEWS: Note the location of older NEWS files.
3174 * src/remove.c (is_empty_dir): Don't let a failing closedir
3175 clobber errno. Spotted by Arnold Robbins.
3177 * src/env.c: Fix typo in comment. From Arnold Robbins.
3179 2003-03-29 Jim Meyering <jim@meyering.net>
3183 * README: Note to expect build problems for stat.c on Ultrix 4.3.
3184 Note that there are some harmless test failures when running
3185 `make check' as root on some systems.
3187 2003-03-28 Jim Meyering <jim@meyering.net>
3189 * tests/stty/row-col-1: Skip this test if stty can't get window size.
3190 This happens when connecting to sparc-solaris5.7 via ssh from within
3191 emacs. Reported by Karl Berry.
3193 * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
3194 Otherwise, on systems (DJGPP) that emulate pipes using files,
3195 this test would never complete, waiting for `yes' to terminate.
3196 * tests/du/slink: As above, use seq, not `yes' to generate link target.
3197 * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
3198 Reported by Rich Dawe.
3200 2003-03-27 Jim Meyering <jim@meyering.net>
3202 * src/id.c: Remove Arnold Robbins' obsolete e-mail address
3203 from `written by...' comment, at his request.
3205 2003-03-24 Paul Eggert <eggert@twinsun.com>
3207 Fix buffer overrun problem reported by TAKAI Kousuke, along
3208 with some other POSIX incompatibilities.
3210 * src/printf.c (print_esc): Do not treat \x specially if
3211 POSIXLY_CORRECT. Avoid buffer overrun if the format ends
3212 in backslash. Treat incomplete escape sequences as strings
3213 of characters, as POSIX requires.
3214 (print_formatted): Allow multiple flags. Avoid buffer overrun
3215 if the format is incomplete.
3217 2003-03-24 Jim Meyering <jim@meyering.net>
3219 * tests/misc/printf: Add tests for the above fixes and changes.
3221 2003-03-26 Jim Meyering <jim@meyering.net>
3223 * src/copy.h (struct cp_options): Add a comment.
3225 2003-03-23 Jim Meyering <jim@meyering.net>
3227 * README: Describe problem with 64-bit mode on HPUX 11.x,
3228 with patch for /usr/include/inttypes.h.
3229 * TODO: Plan to add an autoconf test to work around the bug.
3231 2003-03-22 Jim Meyering <jim@meyering.net>
3233 * src/stat.c: Don't include <sys/sysmacros.h>.
3234 That is already done via system.h. Otherwise, the multiple
3235 inclusion would evoke redefinition warnings from Cray's /bin/cc,
3236 aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28.
3237 (human_fstype): Factor some directives `up', out of this function.
3238 Cast away `const' to avoid error from Cray's /bin/cc.
3240 2003-03-20 Jim Meyering <jim@meyering.net>
3242 * announce-gen (print_changelog_deltas): Ensure that a newline
3243 precedes each row of `*'s.
3245 2003-03-20 Jim Meyering <jim@meyering.net>
3249 * src/seq.c (valid_format): Also accept ` ' and `'' as valid
3250 format flag characters.
3251 Do not require that a field width be specified.
3252 Do not fail when given a field width of `0'.
3253 Reported by Dan Jacobson.
3254 * tests/seq/basic: Add new tests for the above-fixed bug.
3256 * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
3257 (install-root): Likewise.
3258 (install-exec-local): Likewise.
3259 Based on a patch from Richard Dawe.
3261 2003-03-19 Jim Meyering <jim@meyering.net>
3263 * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
3264 because the DJGPP 2.03 port of 'ln -s' doesn't work.
3265 Include $(EXEEXT) in program names.
3266 Since $(LN_S) may degenerate to `cp -p', be careful
3267 to invoke it from the destination directory.
3268 Mostly from Richard Dawe.
3269 * configure.ac: Use AC_PROG_LN_S.
3271 * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the
3272 CDPATH shell variable set could cause this test to fail.
3273 Reported by Karl Berry.
3275 2003-03-18 Jim Meyering <jim@meyering.net>
3277 * src/fmt.c [struct Word] (paren, period, punct, final): Change the
3278 type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
3279 AIX 5.1's xlc could not compile the former.
3280 Patch by Petter Reinholdtsen. Also reported by Mike Jetzer.
3282 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
3284 * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
3285 program names, since automake only adds $(EXEEXT) to programs
3288 2003-03-16 Jim Meyering <jim@meyering.net>
3290 * src/remove.c (rm): Put two local variables in static storage,
3291 so they can't be clobbered by the potential longjmp.
3293 2003-03-15 Jim Meyering <jim@meyering.net>
3295 * Makefile.cfg (gnu_rel_host): Fix code to match the comment
3296 so that a version number with a two-digit component can still count
3297 as an alpha release. Reported by Richard A Downing.
3298 (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
3300 2003-03-14 Jim Meyering <jim@meyering.net>
3302 * src/ansi2knr.c: Remove no-longer-used file.
3303 * src/ansi2knr.1: Likewise.
3305 * Makefile.maint (prev_version_file): Don't use ?= for this particular
3306 assignment, since it causes trouble with old versions of GNU make
3307 (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here.
3308 http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
3309 Patch from Alexandre Duret-Lutz.
3311 * Use patched automake-1.7.3. Regenerate Makefile.in files in
3312 subdirectories so that each includes a definition of ACLOCAL_M4.
3314 * announce-gen (main): Label the compressed source URLs.
3318 * tests/du/slink: Relax the test for the `local'ness of a file system,
3319 so that now it works also for tmpfs.
3321 * tests/du/hard-link: Transform output from first du, so that this
3322 test doesn't fail on file systems like tmpfs that order directory
3323 entries differently.
3325 2003-03-13 Jim Meyering <jim@meyering.net>
3327 * tests/du/8gb: Work around what appears to be an NFS failure that
3328 would make this test fail on some systems.
3330 2003-03-11 Jim Meyering <jim@meyering.net>
3332 * tests/du/basic: Make the test file exactly 4k bytes long.
3334 * src/split.c (longopts): Don't hard-code `2' here.
3335 Instead, just specify `&verbose', and ...
3336 (main): ... remove the `case 2:' block for --verbose.
3338 * tests/du/basic: Make the test file larger than 64 bytes, so that
3339 we don't immediately disqualify file systems (e.g., NetApp) on which
3340 smaller files take up zero disk blocks. Reported by Vin Shelton.
3342 2003-03-10 Jim Meyering <jim@meyering.net>
3344 Don't segfault for a negative field width or precision in format string.
3345 Note that this is just a stopgap fix. The longer term solution may
3346 involve adapting bash's builtins/printf.def.
3348 * src/printf.c: (UNSPECIFIED): Define.
3349 (print_direc): Use the special value, UNSPECIFIED, to indicate
3350 that field_width or precision has not been specified.
3351 (print_formatted): Fail if field_width or precision is the
3352 special value, UNSPECIFIED.
3353 Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
3355 * src/sys2.h (INT_MIN): Define, if necessary.
3356 * tests/misc/printf: Add a test for the above-fixed bug.
3358 2003-03-09 Jim Meyering <jim@meyering.net>
3360 * src/remove.c (AD_stack_pop): Cast sizeof... to int before
3361 changing its sign. This avoids a warning from gcc on 64-bit systems.
3362 Reported by Bob Proulx.
3363 (pop_dir): Reverse order of sign change and cast, to be consistent
3366 2003-03-08 Jim Meyering <jim@meyering.net>
3368 * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
3369 shell variable, but only in the environment. With /bin/sh->bash, the
3370 shell variable is set to `y', and that would cause a spurious warning.
3371 Reported by Bob Proulx.
3373 * tests/Makefile.am (check-root): Remove touch/fifo.
3374 It doesn't appear to have to be run as root.
3376 * tests/rm/fail-2eperm: Rather than simply using the first non-root
3377 user name, make sure that the selected user name has a usable shell.
3378 Reported by Paul Jarc.
3380 Before, when using shred on a device, one had to specify --exact,
3381 or be careful to choose a size that would not be rounded up and
3382 exceed the maximum value; that could result in a failure of
3384 * src/shred.c (do_wipefd): --exact is now the default for non-regular
3385 files. Suggestion from Ben Elliston.
3388 * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
3389 Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
3390 Patch by Bob Proulx.
3392 * src/Makefile.am (check-misc): Check for use of `defined' in
3394 Change to $(srcdir) before running grep.
3396 * src/sleep.c: Remove now-unused #include and #define directives.
3398 * src/du.c (process_file): If a file's size is not being counted
3399 e.g., because it's a hard link to a file we've already counted,
3400 then don't print a line for it.
3402 * tests/du/hard-link: New test for the above-fixed bug.
3403 * tests/du/Makefile.am (TESTS): Add hard-link.
3406 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
3407 and make the two-array approach work.
3409 * tests/du/basic: Correct/add tests for the above fix.
3410 Set LC_ALL, etc., now that we use sort.
3411 Check the block/size of a small file, too.
3412 Correct expected results for simple dir1/dir2/file case.
3413 Add another test of du -S.
3415 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
3417 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
3418 middle-end/9986). As one of GCC's optimizations, it transforms a
3419 fputs_unlocked call to a fputc_unlocked call when the string is
3420 one character long. However, hpux doesn't have fputc_unlocked.
3422 * expr.c (usage): Use putchar, not fputs, to output a single character.
3423 * ls.c (dired_dump_obstack): Likewise.
3424 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
3425 * stat.c (print_it): Likewise.
3427 2003-03-07 Jim Meyering <jim@meyering.net>
3429 * src/cp.c: Remove everything associated with mmap-stack.c.
3430 This reverts the two changes of 2003-02-21.
3431 * src/du.c: Remove everything associated with mmap-stack.c.
3432 This reverts the change of 2003-02-19.
3434 2003-03-06 Jim Meyering <jim@meyering.net>
3436 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
3437 CDPATH shell variable set could cause this test to fail.
3438 Reported by Karl Berry.
3440 2003-03-05 Jim Meyering <jim@meyering.net>
3444 * src/printf.c (print_esc): Remove pointless comparison of unsigned
3445 integer with zero, to avoid a warning from Intel's ecc.
3446 Reported by Nelson Beebe.
3448 * src/du.c (process_file): Sizes must all be of type uintmax_t.
3449 Otherwise, for files or totals that are too big, numbers would
3450 be truncated. Patch mostly by Michael Stone.
3451 Reported by Ingo Saitz as Debian bug #183210.
3453 * tests/du/8gb: New test for the above-fixed bug.
3454 * tests/du/Makefile.am (TESTS): Add 8gb.
3456 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
3457 rather than UTILS_OPEN_MAX - 10.
3459 2003-03-04 Jim Meyering <jim@meyering.net>
3461 * README: Refer new feature discussion to bug-coreutils@gnu.org,
3462 rather than bug-gnu-utils, now that the former is better known.
3463 Suggestion from Göran Uddeborg.
3465 * src/stat.c (usage): Capitalize consistently.
3466 Reported by Göran Uddeborg.
3468 * Makefile.maint (rel-files): Include $(signatures), so that
3469 those files are also copied into $(release_archive_dir).
3471 * src/df.c (find_mount_point): Call error here, now that restore_cwd
3473 * src/remove.c (AD_pop_and_chdir): Likewise.
3475 * tests/Makefile.am (check-root): Add fail-2eperm.
3477 2003-03-03 Jim Meyering <jim@meyering.net>
3479 * src/remove.c (remove_cwd_entries): Include the full filename of
3480 the offending file, not just the basename.
3482 * tests/misc/tty-eof: Set $ME properly.
3484 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
3485 Remove now-unused variables.
3486 (tag-prev-version, prev-cvs-tag): Likewise.
3488 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
3489 accurate diagnostic when failing to remove a file owned by some other
3490 user. Reported by Ivo Timmermans via Michael Stone.
3491 This fixes Debian bug# 178471.
3493 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
3494 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
3495 Based on a report from Ivo Timmermans.
3497 2003-03-02 Jim Meyering <jim@meyering.net>
3499 * src/copy.c (copy_internal) [un_backup]: When recovering from a
3500 failure to create a hard link, do not remove the entry associating
3501 the source dev/ino with the destination file name.
3502 * tests/mv/Makefile.am (TESTS): Add hard-3.
3503 * tests/mv/hard-3: New test, for the above-fixed bug.
3504 Inspired by a report from Iida Yosiaki.
3506 2003-03-01 Jim Meyering <jim@meyering.net>
3508 * src/df.c (print_header): Don't embed spaces in a separate `Type'
3509 header string. Instead, put `Filesystem' and `Type' headers in the
3510 same string, so translators can use horizontal space as needed.
3511 Reported by Jean Charles Delepine.
3513 2003-02-28 Jim Meyering <jim@meyering.net>
3515 * src/copy.c (copy_internal): When link fails because of an
3516 existing destination file, unlink that file and try again.
3517 Reported by Iida Yosiaki.
3519 * tests/mv/Makefile.am (TESTS): Add hard-2.
3520 * tests/mv/hard-2: New test for the above-fixed bug.
3521 Based on a test case from Iida Yosiaki.
3523 2003-02-26 Jim Meyering <jim@meyering.net>
3525 * tests/du/basic: Don't test du's -b option here. Directory byte
3526 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
3527 and IBM AIX 4.2. Reported by Nelson Beebe.
3529 2003-02-25 Jim Meyering <jim@meyering.net>
3531 * Makefile.maint (announcement): Now that ChangeLog entries
3532 are output by announce-gen, don't do it here.
3533 * announce-gen (print_changelog_deltas): New function.
3536 2003-02-22 Jim Meyering <jim@meyering.net>
3538 * announce-gen: New option: --release-type=TYPE
3539 * Makefile.maint (beta, major): New targets. Remove `release'.
3540 Put them all together on a line.
3541 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
3542 invocation of `announcement'.
3543 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
3545 * announce-gen: New option: --news=NEWS_FILE.
3546 Extract NEWS entries here, not via rules in Makefile.maint.
3547 * Makefile.maint (announcement): Now that NEWS entries are
3548 extracted by announce-gen, don't do it here.
3549 (news-r1, news-r2): Remove now-unused definitions.
3551 2003-02-21 Jim Meyering <jim@meyering.net>
3555 Merge in changes from autoconf's version of this file.
3556 * Makefile.maint (www-gnu): Define.
3557 (standards.texi-url_prefix): Use $(www-gnu).
3558 (make-stds.texi-url_prefix): Likewise.
3560 * src/cp.c: Include "mmap-stack.h".
3561 (main): Invoke `run' through a macro that (when possible) runs it
3562 with a large, mmap'd stack.
3564 * src/cp.c (run): New function, preparing for the above.
3565 Exit from this function, not from main
3568 * src/du.c: New option: --apparent-size.
3569 (enum) [APPARENT_SIZE_OPTION]: New member.
3570 (long_options): Add it.
3571 (usage): Describe it.
3573 ['b']: Set apparent_size.
3574 David Eisner reported that the behavior of --bytes had changed.
3575 Paul Eggert proposed the use of a new option, --apparent-size.
3577 * src/du.c (apparent_size): New global.
3578 (print_only_size): Reflect the fact that we're printing byte counts,
3579 not ST_NBLOCKSIZE-byte-block counts.
3580 (print_size): Call print_only_size rather than duplicating its code.
3581 (process_file): Accumulate byte counts, rather than block counts.
3583 * src/du.c (process_file): Always reset size_to_propagate_to_parent
3584 for --separate-dirs (-S).
3586 2003-02-20 Jim Meyering <jim@meyering.net>
3588 * Use automake-1.7.3. Regenerate dependent files.
3590 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
3591 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
3592 (usage) [%B]: Describe it.
3595 * src/du.c (process_file): Reorganize the code to use only
3596 one `sum' array, and change how -S works back to the way it was
3597 before 2003-01-31. Patch by Bruno Haible.
3599 * tests/du/basic: New test.
3600 * tests/du/Makefile.am (TESTS): Add basic.
3602 * tests/envvar-check: Add checks for the following:
3603 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
3605 * tests/Makefile.am: Rename phony target envvar-check to evar-check
3606 so as not to conflict with the distributed file by the same name.
3608 * src/du.c (process_file): Set info->skip before any possible return.
3610 Report correct usage for directories, not 0.
3611 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
3612 _before_ recording the dev/ino of a directory.
3613 Reported by Bruno Haible.
3615 Now, df always displays the device file name corresponding to the
3616 listed mount point under `Filesystem'. Before, for an unmounted
3617 block- or character-special file argument, it would display the
3618 command-line argument instead.
3619 * src/df.c (show_disk): Return a value indicating whether
3620 there was a match. Don't try to find a mount point here.
3621 (show_entry): If show_disk doesn't find a match, call show_point.
3623 2003-02-19 Jim Meyering <jim@meyering.net>
3625 * src/du.c: Include "mmap-stack.h".
3626 (du_files): Add prototype with ATTRIBUTE_NORETURN.
3627 Exit from this function, not from...
3629 Instead, if possible, invoke du_files through a macro that
3630 runs it with a large, mmap'd stack.
3632 * src/join.c (usage): Change wording in --help output:
3633 use FILENUM instead of `SIDE' and say what FILENUM means.
3634 Reported by Bernhard Gabler.
3636 * src/df.c (print_header): Rather than using a hard-coded literal
3637 string of spaces matching the length of the English `...Type' header,
3638 output the right number of spaces to match the selected translation.
3639 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
3641 * src/split.c (bytes_split): Remove unnecessary `else' after break.
3642 (lines_split): Likewise. and correct misleading indentation.
3644 * src/split.c: Include "full-read.h".
3645 (bytes_split, lines_split, line_bytes_split): Use full_read,
3646 not safe_read. The way split was using the latter, a short read
3647 could cause split to terminate before EOF.
3649 * tests/misc/tty-eof: Test all programs that can read stdin,
3650 requiring no arguments and that write to standard output.
3652 * tests/misc/tty-eof: New file. Renamed from ...
3653 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
3654 * tests/misc/Makefile.am (TESTS): Reflect renaming.
3656 2003-02-18 Jim Meyering <jim@meyering.net>
3658 cksum would perform an extra read after encountering EOF
3659 * src/cksum.c (cksum): Exit the loop upon EOF, too.
3660 Patch by Michael Bacarella.
3662 Test for the bug fixed today in cksum, md5sum, and sha1sum.
3663 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
3664 cat, cksum, md5sum, and sha1sum all in the same loop.
3666 2003-02-14 Jim Meyering <jim@meyering.net>
3668 * src/remove.c: Include "euidaccess.h".
3669 Remove declaration of euidaccess.
3671 2003-02-12 Jim Meyering <jim@meyering.net>
3673 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
3674 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
3676 2003-02-10 Jim Meyering <jim@meyering.net>
3678 * src/test.c: Don't include group-member.h.
3679 Include euidaccess.h.
3680 (eaccess): Rewrite function to set the real uid and gid temporarily
3681 to the effective uid and gid, then invoke 'access', and then set the
3682 real uid and gid back. On systems that lack setreuid or setregid,
3683 fall back on the kludges in euidaccess. Before, it would not work
3684 for e.g., files with ACLs, files that were marked immutable,
3685 or on file systems mounted read-only. Nelson Beebe raised the issue.
3686 Paul Eggert suggested the new implementation.
3688 2003-02-09 Jim Meyering <jim@meyering.net>
3690 * src/test.c (test_stat): Remove function. It's job is done (only
3691 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
3693 2003-02-08 Jim Meyering <jim@meyering.net>
3697 * tests/mv/part-symlink: Don't assume that the file owner username
3698 length is less than 9 in ls output: instead, omit that field
3699 altogether. Reported by, and suggested fix from, Ferdinand.
3701 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
3702 * tests/du/Makefile.am (TESTS): Add restore-wd.
3704 * src/rm.c: Correct now-invalid comment about cycle-detection.
3706 2003-02-06 Jim Meyering <jim@meyering.net>
3708 * NEWS: Add entries from old/*/NEWS
3709 from fileutils-4.1 through 4.1.11 and
3710 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
3714 * src/du.c (process_file): Don't return early for excluded files
3715 or for files whose dev/inode we've already seen.
3717 2003-02-05 Jim Meyering <jim@meyering.net>
3719 * tests/du/exclude: New file.
3720 * tests/du/Makefile.am (TESTS): Add exclude.
3722 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
3724 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
3725 Fix memory allocation arithmetic.
3727 2003-02-04 Jim Meyering <jim@meyering.net>
3729 `df /dev/block-or-char-device-file--not-mounted' now reports
3730 the name of the file system on which the file resides, usually `/'.
3731 Before, it would leave the `Mounted on' field blank.
3732 * src/df.c (show_disk): Move function to precede find_mount_point.
3733 (show_disk): Add parameter: STATP.
3734 If we don't find a matching device name, then resort to calling
3735 find_mount_point. Reported by Bob Proulx.
3737 2003-02-03 Andreas Schwab <schwab@suse.de>
3739 * tests/rm/cycle: Require non-root.
3740 * tests/rm/isatty: Likewise.
3742 2003-02-02 Jim Meyering <jim@meyering.net>
3746 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
3748 Ensure that there are no offending uses of `:'.
3749 * Makefile.maint (makefile_path_separator_check): New rule.
3750 (local-check): Add it to the list.
3752 2003-02-01 Jim Meyering <jim@meyering.net>
3754 * src/du.c (MAX_N_DESCRIPTORS): Define.
3756 * src/stat.c (G_fail): New global.
3757 (human_time): Diagnose failed localtime, not failed nstrftime.
3758 (main): Fail if G_fail is set.
3760 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3762 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
3763 hard-coding the path-separator. Also double-quote the new PATH,
3764 to avoid problems when the path-separator is a semi-colon or when
3765 `pwd` contains e.g. a space.
3766 * tests/chgrp/Makefile.am: Likewise.
3767 * tests/chmod/Makefile.am: Likewise.
3768 * tests/chown/Makefile.am: Likewise.
3769 * tests/cp/Makefile.am: Likewise.
3770 * tests/dd/Makefile.am: Likewise.
3771 * tests/dircolors/Makefile.am: Likewise.
3772 * tests/du/Makefile.am: Likewise.
3773 * tests/expr/Makefile.am: Likewise.
3774 * tests/factor/Makefile.am: Likewise.
3775 * tests/fmt/Makefile.am: Likewise.
3776 * tests/install/Makefile.am: Likewise.
3777 * tests/ln/Makefile.am: Likewise.
3778 * tests/ls/Makefile.am: Likewise.
3779 * tests/ls-2/Makefile.am: Likewise.
3780 * tests/md5sum/Makefile.am: Likewise.
3781 * tests/misc/Makefile.am: Likewise.
3782 * tests/mkdir/Makefile.am: Likewise.
3783 * tests/mv/Makefile.am: Likewise.
3784 * tests/od/Makefile.am: Likewise.
3785 * tests/rm/Makefile.am: Likewise.
3786 * tests/rmdir/Makefile.am: Likewise.
3787 * tests/seq/Makefile.am: Likewise.
3788 * tests/sha1sum/Makefile.am: Likewise.
3789 * tests/shred/Makefile.am: Likewise.
3790 * tests/stty/Makefile.am: Likewise.
3791 * tests/sum/Makefile.am: Likewise.
3792 * tests/tail-2/Makefile.am: Likewise.
3793 * tests/touch/Makefile.am: Likewise.
3794 * tests/tsort/Makefile.am: Likewise.
3795 * tests/unexpand/Makefile.am: Likewise.
3797 2003-01-31 Jim Meyering <jim@meyering.net>
3799 * src/stat.c: Include "file-type.h"
3800 (print_human_type): Remove function.
3801 (human_access): Rename from print_human_access. Return a string.
3802 (human_time): Rename from print_human_time. Return a string.
3803 (print_stat): Arrange so that field width and an alignment specifier
3804 are honored for the %A, %F, %x, %y, and %z formats.
3805 [%F]: Use file_type; this gives slightly different file type strings,
3806 e.g., `directory' instead of `Directory' and `regular file' or
3807 `regular empty file' instead of `Regular file'.
3808 Prompted by a report from Richard Dawe that the uses of
3809 S_IFSOCK and S_IFIFO in print_human_time were not portable
3810 to systems using e.g., DJGPP.
3812 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
3814 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
3815 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
3817 2003-01-31 Jim Meyering <jim@meyering.net>
3819 * src/du.c (main): Upon processing an invalid option or an invalid
3820 --exclude-from or --max-depth option argument, don't exit right away,
3821 in case there are others. Rather record the failure and exit after
3822 processing other options.
3824 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
3825 tar archive easier to reproduce.
3827 Rewrite to perform directory traversal using nftw.
3829 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
3830 (AUTHORS): Add self.
3831 (opt_one_file_system): Move global into `main'.
3832 (path, xstat, exit_status): Remove declarations.
3833 (arg_length, suffix_length): New globals.
3834 (G_fail): New global, sort of like the old `exit_status'.
3835 (IS_FTW_DIR_TYPE): Define.
3836 (print_only_size): New function.
3837 (process_file): New function.
3838 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
3839 (str_trunc, pop_dir, count_entry): Likewise.
3840 (du_files): Rewrite to use nftw.
3842 2003-01-30 Jim Meyering <jim@meyering.net>
3844 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
3845 symlink-to-directory with -L, even without the trailing slash.
3847 2003-01-27 Jim Meyering <jim@meyering.net>
3849 * src/Makefile.am (check-misc): Check for st_blocks, too.
3851 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
3852 Reported by Richard Dawe.
3854 2003-01-27 Andreas Schwab <schwab@suse.de>
3856 * src/ls.c (quote_name): Add fourth parameter, width, into which to
3857 store the screen columns, and return the number of bytes instead.
3858 (print_dir): Pass NULL as fourth parameter of quote_name.
3859 (print_name_with_quoting): Likewise.
3860 (length_of_file_name_and_frills): Get the width from the fourth
3861 parameter of quote_name instead of return value.
3863 2003-01-27 Jim Meyering <jim@meyering.net>
3865 * src/ls.c (decode_switches): If `dired' is set without
3866 `format == long_format', then silently reset dired. This doesn't
3867 change the behavior of ls (all prior uses of dired were protected
3868 by `&& format == long_format'), and lets us...
3869 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
3870 (PUSH_CURRENT_DIRED_POS): Likewise.
3873 2003-01-22 Jim Meyering <jim@meyering.net>
3875 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
3876 * tests/du/Makefile.am (TESTS): Add no-x.
3878 2003-01-21 Jim Meyering <jim@meyering.net>
3880 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
3881 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
3882 it may still be a directory -- or not (e.g., with FreeBSD on an
3883 NFS-mounted file system), so resort to calling lstat to find out.
3884 Based on a patch by Michael van Elst.
3886 * tests/cp/same-file: Don't assume that the file owner username
3887 length is less than 9 in ls output: instead, omit that field
3888 altogether. Reported by, and suggested fix from, Ferdinand.
3890 2003-01-20 Jim Meyering <jim@meyering.net>
3892 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
3893 large format widths no longer cause strftime to infloop.
3895 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
3897 2003-01-19 Jim Meyering <jim@meyering.net>
3899 * src/readlink.c: Include "canonicalize.h".
3901 2003-01-18 Jim Meyering <jim@meyering.net>
3903 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
3905 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
3906 (long_options): Add option --dereference-command-line-symlink-to-dir.
3907 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
3908 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
3909 -d, -F, -l options is specified.
3910 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
3911 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
3912 Change --dereference-command-line (-H) to dereference *all*
3913 command line arguments, including broken symlinks.
3915 2003-01-15 Paul Eggert <eggert@twinsun.com>
3917 Change ls -H back to the way it was yesterday, since this is
3918 compatible with FreeBSD and the POSIX spec is confusing
3919 and somewhat contradictory.
3921 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
3922 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
3923 (long_options): Change the long option name back.
3924 (usage): Change the usage back.
3925 (gobble_file): When -H is specified, dereference a top-level
3926 arg even if it points to a non-directory.
3928 2003-01-15 Jim Meyering <jim@meyering.net>
3930 * src/ls.c (gobble_file): Fall back on using lstat when required:
3931 when --dereference (-L) is not specified, and
3932 - when operating on a dangling symlink
3933 - when operating on command-line-symlink-to-directories
3934 This fixes numerous problems. Here are examples:
3935 - `ls dangling-symlink' would fail with `no such file...'
3936 Now it prints `dangling-symlink'.
3937 - `ls -i symlink' would mistakenly print the inode of the referent.
3938 Now it prints the inode of the symlink. Likewise for --size (-s).
3939 Based on a patch from Michael Stone.
3940 Reported by Deepak Goel as Debian bug #173793.
3942 Rename ls's --dereference-command-line (-H)
3943 option to --dereference-command-line-symlink-to-dir.
3944 * src/ls.c [enum Dereference_symlink]
3945 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
3946 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
3947 (long_options): Rename the long option.
3948 (usage): Say that --dereference-... changes how ls treats
3949 only symlinks to directories specified on the command line.
3951 2003-01-14 Jim Meyering <jim@meyering.net>
3953 * tests/ls/dangle: New file/test, for the above fix.
3954 * tests/ls/inode: Another new file/test, for the above fix.
3955 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
3957 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
3958 so that ls --color would no longer highlight the names of files with
3959 the execute bit set when not specified on the command line.
3960 Patch by Michael Stone. Reported by Stephen Depooter as
3963 * tests/ls-2/tests (color-exe): New test, for the above fix.
3965 2003-01-13 Jim Meyering <jim@meyering.net>
3967 * tests/shred/exact: Also test for just fixed bug with --zero.
3969 * src/shred.c (long_opts): --zero does not require an argument.
3970 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
3972 2003-01-12 Jim Meyering <jim@meyering.net>
3974 * Makefile.maint (cvs-update): Skip any file with local modifications.
3976 * src/unexpand.c (usage): Document --first-only and mention that
3977 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
3979 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
3981 * src/df.c: Include "canonicalize.h".
3982 Use canonicalize_file_name unconditionally.
3984 2003-01-09 Jim Meyering <jim@meyering.net>
3986 * README: Add readlink.
3988 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3990 * src/df.c: Include "xgetcwd.h".
3991 * src/pwd.c: Likewise.
3993 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
3995 * src/shred.c: Remove declaration of xstrdup.
3996 We already get it via xalloc.h which is included via system.h.
3998 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
4000 New program: readlink.
4002 * src/Makefile.am (bin_PROGRAMS): Add readlink.
4003 * src/readlink.c: New file.
4005 * man/readlink.x: New file.
4006 * man/Makefile.am (dist_man_MANS): Add readlink.1.
4007 (readlink.1): New rule.
4009 2003-01-09 Jim Meyering <jim@meyering.net>
4011 When selecting ranges of byte offsets (as opposed to ranges of fields)
4012 and when --output-delimiter=STRING is specified, output STRING between
4013 ranges of selected bytes.
4014 * src/cut.c (RANGE_START_SENTINEL): Define.
4015 (output_delimiter_specified): New global.
4016 (print_kth): Add parameter. Adjust all callers.
4017 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
4018 (cut_bytes): When requested, output STRING between ranges of
4020 (main): Make a diagnostic a little clearer.
4021 Based on a patch from Jan Nieuwenhuizen.
4023 * tests/cut/Test.pm: New tests for the above.
4025 * src/cut.c (set_fields): Make code agree with comment:
4026 Don't merge abutting ranges like 4- and 2-3. This makes no
4027 difference currently, but is required to support an upcoming change.
4029 2003-01-07 Jim Meyering <jim@meyering.net>
4031 * src/cut.c (set_fields): Fix typo in comment.
4033 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
4034 * tests/touch/Makefile.am (TESTS): Add not-owner.
4035 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
4036 Now, this tests only the nonexistent-directory diagnostic.
4037 Suggestion from Michael Stone.
4039 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
4041 2003-01-04 Jim Meyering <jim@meyering.net>
4043 * src/copy.h: Remove use of PARAMS.
4044 * src/remove.h: Likewise.
4045 * src/chown-core.h: Likewise.
4047 rm could be tricked into mistakenly reporting a cycle.
4048 * src/remove.c: [cycle_check_state]: New global.
4049 (remove_cwd_entries): Adapt to new semantics of cycle_check.
4050 (rm): Call cycle_check_init and cycle_check_free for each file.
4051 * tests/rm/cycle (rm): New test, for the above fix.
4052 * tests/rm/Makefile.am (TESTS): Add cycle.
4054 When rm detects a cycle, don't abort the entire command,
4055 but rather just the affected command line argument.
4056 * src/remove.c: Include <setjmp.h>
4057 (struct dirstack_state) [current_arg_jumpbuf]: New member.
4058 (remove_cwd_entries): Call longjmp if we detect a cycle.
4059 (rm): Call setjmp here.
4061 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
4062 Instead, include cycle-check.h and use it.
4064 * src/remove.h (struct dev_ino): Remove declaration.
4066 * src/remove.c (remove_cwd_entries): Fix typos in comment.
4068 Don't include trailing /. in diagnostics about directories.
4069 * src/remove.c (full_filename_): When FILENAME is just `.'
4070 and there is a nonempty directory-name part, don't append `/.'.
4071 * tests/rm/unread2: Remove trailing /. from diagnostic.
4072 * tests/rm/rm2: Likewise.
4074 * src/remove.c (struct dirstack_state): Define.
4075 To be used in place of these file-scoped globals ...
4076 (dir_stack, len_stack, Active_dir): Remove globals.
4077 (ds_init, ds_free): New functions.
4078 (full_filename): Define.
4079 (full_filename_): Rename from full_filename.
4081 Begin to make AD_* functions more generic.
4082 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
4083 (AD_push): Likewise.
4084 (AD_INIT_OTHER_MEMBERS): Define.
4085 (remove_dir): Define the `status' member manually after each
4086 call to AD_push or AD_push_initial.
4088 * src/Makefile.am (check-misc): New rule, to ensure that no more
4089 S_IS* macro definitions sneak into the code.
4090 (check): Depend on check-misc.
4092 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
4093 * src/du.c (count_entry) [S_ISLNK]: Don't define.
4094 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
4096 2003-01-03 Jim Meyering <jim@meyering.net>
4098 * src/true.c: Add copyright.
4099 (AUTHORS): I suppose I've written it.
4101 * src/Makefile.am (false.c): Make the generated file be read-only.
4103 2003-01-04 Jim Meyering <jim@meyering.net>
4105 * src/ls.c: Include "dev-ino.h".
4106 [struct dev_ino]: Remove declaration.
4108 2003-01-02 Jim Meyering <jim@meyering.net>
4110 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
4111 from mv: s/missing file arguments/missing file argument/.
4112 With --target-directory=DIR, cp and mv work with a single file argument.
4113 Reported by Karl Berry.
4115 * tests/rm/isatty: Enable this test.
4117 2002-12-31 Jim Meyering <jim@meyering.net>
4119 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
4120 (AD_push): Likewise.
4121 (AD_INIT_OTHER_MEMBERS): Define.
4122 (remove_dir): Define the `status' member manually after each
4123 call to AD_push or AD_push_initial.
4125 * src/ls.c [struct dev_ino]: Remove definition.
4126 Include "dev-ino.h" instead.
4128 2002-12-28 Jim Meyering <jim@meyering.net>
4130 * tests/du/Makefile.am (TESTS): Add no-deref.
4131 * tests/du/no-deref: New script.
4133 2002-12-23 Jim Meyering <jim@meyering.net>
4135 * src/remove.c (remove_cwd_entries): Fix typo in comment.
4137 2002-12-21 Jim Meyering <jim@meyering.net>
4139 * announce-gen: Generate MML-formatted announcement.
4140 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
4142 2002-12-20 Jim Meyering <jim@meyering.net>
4144 * src/touch.c (touch): Change the wording of a diagnostic so
4145 that it makes sense both when the file exists and when it doesn't.
4146 Suggestion from Michael Stone.
4148 2002-12-18 Jim Meyering <jim@meyering.net>
4150 * src/stty.c (valid_options): Declare to be static.
4152 2002-12-15 Jim Meyering <jim@meyering.net>
4154 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
4156 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
4157 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
4158 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
4159 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
4160 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
4162 * src/remove.c (PARAMS): Remove definition.
4163 * src/sys2.h: Likewise.
4165 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
4166 Include strftime.h instead.
4168 2002-12-14 Jim Meyering <jim@meyering.net>
4170 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
4172 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
4173 This is necessary at least for Irix6.5 when using c89.
4174 Reported by Nelson Beebe.
4176 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
4178 * tests/misc/cat-tty-eof: New test.
4180 * src/mknod.c (usage): Specify how major and minor mode numbers
4181 are interpreted. Report forwarded by Kristin E Thomas.
4182 * src/mknod.c: Remove now-redundant usage-specifying comment.
4184 2002-12-13 Jim Meyering <jim@meyering.net>
4188 * tests/du/trailing-slash: Allow for a directory of size `0'.
4189 That happens at least on file systems of type tmpfs on linux-2.4.18.
4191 * announce-gen: New script to begin replacing the commands
4192 associated with the rule here...
4193 * Makefile.maint (announcement): Invoke announce-gen.
4194 * Makefile.am (EXTRA_DIST): Add announce-gen.
4196 * tests/cp/preserve-2: New file/test, for latest fix.
4197 * tests/cp/Makefile.am (TESTS): Add preserve-2.
4199 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
4201 Fix a bug whereby cp would fail to parse an option like
4202 --preserve=mode,ownership.
4203 * src/cp.c (decode_preserve_arg): Advance `comma' to
4204 point the character following the comma.
4206 2002-12-11 Jim Meyering <jim@meyering.net>
4208 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
4209 in case it's already defined.
4211 2002-12-09 Jim Meyering <jim@meyering.net>
4213 * tests/touch/fail-diag: Don't get a test failure if /no exists.
4214 Instead, evoke a framework failure if /no-$$ exists.
4215 Reported by Michael Stone.
4217 2002-12-08 Jim Meyering <jim@meyering.net>
4219 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
4220 Define to rpl_lstat, so that even on systems like Solaris 5.8,
4221 du honors (per POSIX) the trailing slash on an argument referring
4222 to a symlink-to-directory.
4224 2002-12-06 Jim Meyering <jim@meyering.net>
4226 * Use autoconf-2.57. Regenerate dependent files.
4227 * Use automake-1.7.2. Regenerate dependent files.
4229 * src/ls.c (gobble_file): Also stat the file if it's a
4230 regular file and --indicator-style=classify (aka -F).
4231 Thanks to Ed Santiago for opening my eyes.
4233 * tests/ls/file-type: New file. Test for the above.
4234 A test to contrast ls -F and ls --indicator-style=file-type.
4235 * tests/ls/Makefile.am (TESTS): Add file-type.
4237 2002-12-04 Jim Meyering <jim@meyering.net>
4239 * tests/ls/follow-slink: Make sure the symlink was created.
4240 Richard Dawe reported that `ln -s link link' succeeds, but creates
4241 no file on systems running some version of the DJGPP libc.
4243 2002-12-03 Jim Meyering <jim@meyering.net>
4245 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
4246 since this package no longer panders to K&R compilers.
4248 2002-12-02 Jim Meyering <jim@meyering.net>
4250 * tests/du/slink: Skip this test if `.' is on a non-local file system.
4252 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
4253 something to replace.
4255 2002-12-01 Jim Meyering <jim@meyering.net>
4257 * src/stat.c: Don't include <string.h> or <ctype.h>.
4258 That's already done via system.h.
4259 * src/dircolors.c: Don't include <ctype.h>.
4261 2002-11-30 Jim Meyering <jim@meyering.net>
4263 * ls.c (gobble_file): Remove the block of code that caused
4264 `ls --color -F symlink-to-dir' to list the files in
4265 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
4266 like `ls -F symlink-to-dir') but with the addition of highlighting.
4267 Similarly, `ls --color -dF symlink-to-dir' would print
4268 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
4269 Reported by Jeff Sheinberg as Debian bug #168203.
4270 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
4272 ls is now more efficient: with certain options, it no longer needs
4273 to stat each directory entry on systems with valid dirent.d_type.
4274 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
4275 (main): Make --recursive set format_needs_type, not format_needs_stat.
4276 (gobble_file): Remove a FIXME comment, now that it's fixed.
4278 2002-11-24 Jim Meyering <jim@meyering.net>
4280 * src/du.c (du_files): Don't strip any trailing slash.
4281 Rewrite so that `/' is no longer represented internally as
4283 (count_entry): When appending a file name component,
4284 account for the fact that the current path may end in `/'.
4285 François Pinard reported that `du symlink-to-dir/' was not
4286 equivalent to `du symlink-to-dir/.'. Now it is.
4287 * tests/du/trailing-slash: New file/test, for the above fix.
4288 * tests/du/Makefile.am (TESTS): Add trailing-slash.
4290 2002-11-23 Jim Meyering <jim@meyering.net>
4292 * src/tac.c (output): Declare some local variables to be of type size_t,
4293 rather than `int' to avoid warnings from gcc.
4295 2002-11-21 Paul Eggert <eggert@twinsun.com>
4297 * src/ls.c (decode_switches): Use case-sensitive matching to
4298 decode the QUOTING_STYLE environment variable. This is more
4299 consistent with the documentation, and with --quoting-style.
4301 2002-11-21 Martin Buck <martin.buck@ascom.ch
4303 * src/stty.c (struct speeds): Add support for all baud rates defined
4306 2002-11-19 Jim Meyering <jim@meyering.net>
4308 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
4309 run in a UTF locale. Report and suggested fix by Bruno Haible.
4310 * tests/fmt/basic: Likewise.
4312 2002-11-17 Jim Meyering <jim@meyering.net>
4314 * configure.ac: Update via autoupdate.
4315 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
4317 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
4318 Reported by Hans Ginzel.
4320 2002-11-15 Jim Meyering <jim@meyering.net>
4322 * Makefile.cfg (gnu_rel_host): Define.
4323 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
4324 on whether $(VERSION) looks like a major release number.
4326 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
4327 (release): Rename from `alpha'.
4328 (alpha): Depend on release.
4330 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
4332 2002-11-14 Jim Meyering <jim@meyering.net>
4334 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
4335 (announcement): Use the new variable.
4337 * Makefile.maint: Sync with Bison, i.e.:
4338 (po-check): Scan .l and .y files instead of the
4339 .c and the .h files that they generate. This fixes the bug
4340 reported by Tim Van Holder in:
4341 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
4342 Look for N_ as well as for _. Try to avoid matching #define for
4346 2002-11-12 Jim Meyering <jim@meyering.net>
4348 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
4349 Replace sole use with equivalent `#ifdef S_ISLNK'.
4350 Inconsistency reported by Dmitry V. Levin.
4352 2002-11-11 Jim Meyering <jim@meyering.net>
4354 * src/stat.c (usage): Transform --help items output via s/ - / /,
4355 so that help2man produces properly formatted man pages.
4356 Reported by Herbert Xu as Debian bug #168400.
4358 2002-11-10 Jim Meyering <jim@meyering.net>
4360 * src/ls.c (sighandler): Handle SIGTSTP specially.
4361 Based on suggestions from Solar Designer and Dmitry V. Levin.
4364 * Makefile.cfg (cvs_files): Define. From autoconf.
4365 (local_updates): Likewise.
4367 * src/ls.c (restore_default_color_handler, sigtstp_handler):
4369 (sighandler): New function, based on the one in sort.c.
4370 (main): Use sigaction, if possible; otherwise signal.
4371 Handle these signals:
4372 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
4373 Don't register our handler if the signal is already being ignored.
4375 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
4376 * src/csplit.c (interrupt_handler): Likewise.
4377 * src/sort.c (sighandler): Likewise.
4378 (main): Declare `i' and `nsigs' to be unsigned, not int.
4380 2002-11-09 Jim Meyering <jim@meyering.net>
4382 ls --color: restore terminal text color upon signal.
4383 * src/ls.c: Include "full-write.h" and <signal.h>.
4384 (restore_default_color, restore_default_color_handler): New functions.
4385 (sigtstp_handler, put_indicator_direct): New functions.
4386 (main) [print_with_color]: Register signal handlers.
4387 Patch mostly by Solar Designer and Stanislav Ievlev.
4389 Update from autoconf.
4390 * Makefile.maint (AMTAR): Remove definition.
4391 (update, cvs-update, po-update, do-po-update): New rules.
4392 (wget-update): Update (thus renaming to cvs-update).
4393 (automake_repo): Use anoncvs@sources.redhat.com.
4395 2002-11-06 Jim Meyering <jim@meyering.net>
4397 * tests/misc/Makefile.am (TESTS): Add printf-hex.
4399 * tests/misc/printf: Be careful to test the code in this package,
4400 not the shell built-in function.
4402 * src/printf.c (print_esc): A hexadecimal escape sequence has
4403 at most two hex. digits, not three. Reported by Padraig Brady.
4404 (usage): Update description.
4405 * tests/misc/printf-hex: New file/test, for the above fix.
4407 2002-10-07 Paul Eggert <eggert@twinsun.com>
4409 Add support for locale-specific size indications (e.g.,
4410 thousands-separators) and for explicit size suffixes on output.
4412 * doc/coreutils.texi (Block size): Say that:
4413 This affects display format as well as block size.
4414 Fractional block counts are rounded up.
4415 ls file size blocksize defaults to 1.
4416 A block size spec preceded by ' generates thousands separators.
4417 A suffix without a preceding integer generates suffixes.
4418 (tail invocation): 32k -> 32 KiB.
4419 (What information is listed): ls -h is now equivalent to
4420 ls --block-size=human, and ls -H is now equivalent to
4421 ls --block-size=si. Displayed file size is now always affected by
4424 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
4425 lib/umaxtostr.c: New files, taken from GNU tar.
4427 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
4429 (EXTRA_DIST): Add inttostr.c.
4431 * lib/human.c, lib/human.h: Rewrite to support locale-specific
4432 notations like thousands separators.
4433 Specify what includer of include.h must include beforehand.
4434 (human_group_digits, human_suppress_point_zero, human_autoscale,
4435 human_base_1024, human_SI, human_B): New enum values.
4436 (human_readable): Rename from human_readable_inexact; put the
4437 options before the sizes. All uses changed. The old human_readable
4438 function has been removed; use inttostr.h instead.
4439 (human_options): Renamed from human_block_size, with new signature
4440 that allows block sizes up to UINTMAX_MAX. All callers changed.
4442 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
4443 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
4444 freestanding C89. No need to check for stdlib.h or string.h since
4445 autoconf does this now.
4447 * src/cksum.c (cksum): Use primitives from inttostr.h, not
4448 human.h, to print large numbers simply.
4449 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
4450 * src/dd.c (print_stats, main): Likewise.
4451 * src/df.c (print_header): Likewise.
4452 * src/factor.c (print_factors): Likewise.
4453 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
4454 * src/shred.c (dopass): Likewise.
4455 * src/sort.c (checkfp): Likewise.
4456 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
4457 * src/tail.c (xlseek): Likewise.
4458 * src/wc.c (write_counts, wc): Likewise.
4460 * src/df.c (human_output_opts): New var.
4461 (output_block_size): Now uintmax_t, not int, to handle larger
4462 block sizes. All uses changed.
4463 * src/du.c: Likewise.
4464 * src/ls.c: Likewise.
4466 * src/df.c (print_header): In the header line, prefer SI to human
4467 representation if it's shorter; if neither is shorter, try to
4468 intuit what the user would prefer.
4470 * src/expr.c (inttostr): Remove; use new imaxtostr library
4473 * src/ls.c (file_output_block_size): New var, to distinguish
4474 file sizes from other sizes.
4475 (decode_switches): Set it.
4477 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
4478 (dopass): When printing progress, use floor for what has been done
4479 so far (since we should be conservative there), and ceiling for
4480 what needs to be done (since that's what other programs use).
4482 2002-10-19 Jim Meyering <jim@meyering.net>
4484 * src/pinky.c (print_heading): Align TTY and Name headings.
4485 Reported by Karl Eichwalder.
4487 2002-10-18 Jim Meyering <jim@meyering.net>
4489 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
4490 Remove now-useless cast.
4491 (stdread): Remove function.
4492 (bytes_split): Use size_t instead of int.
4493 Use safe_read, not stdread.
4494 (lines_split): Likewise.
4495 Use memchr rather than a `while' loop.
4496 (line_bytes_split): Use size_t instead of int.
4497 Use safe_read, not stdread.
4498 (main): Add some FIXME comments to remind me to remove casts.
4500 * src/system.h (ST_BLKSIZE): Correct comment describing how to
4501 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
4503 2002-10-17 Jim Meyering <jim@meyering.net>
4505 Fix a problem that could make e.g., `cat' misbehave on systems which
4506 give invalid (unreasonably large) values for stat.st_blksize.
4507 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
4508 Reported by Petter Reinholdtsen.
4510 2002-10-14 Jim Meyering <jim@meyering.net>
4512 Specifying a printf conversion specifer as nl's separator string
4513 could cause nl to segfault.
4514 * src/nl.c (build_print_fmt): Don't include separator string
4515 in the printf format; it might contain `%'.
4516 Use a better bound on the length of the print_fmt buffer.
4517 (print_lineno): Print the separator here instead.
4518 Reported by Doug Coleman.
4520 * tests/misc/nl: New file/tests, including a test for the above.
4521 * tests/misc/Makefile.am (TESTS): Add nl.
4523 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
4524 * tests/misc/Makefile.am (TESTS): Add split-l.
4526 2002-10-13 Jim Meyering <jim@meyering.net>
4530 * src/du.c (usage): Tweak description of --dereference-args/-D.
4532 * src/du.c (count_entry): Also save cwd when dereferencing (via
4533 --dereference-args, -D) a command-line argument.
4534 Reported by Michal Svec. Based on a patch by Andreas Schwab.
4536 * src/Makefile.am (../AUTHORS): New target/rule.
4538 2002-10-12 Jim Meyering <jim@meyering.net>
4540 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
4541 of type size_t, since that's the way it's used and avoids a warning.
4543 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
4544 since that's how it's always used and avoids a new warning from gcc.
4545 (read_input): Adapt to new safe_read ABI.
4547 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
4550 * src/pinky.c (print_long_entry): fread returns size_t.
4551 Declare local `bytes' accordingly, to avoid warning.
4553 tail -c +N would perform an extra read after encountering EOF
4554 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
4555 * src/tail.c (start_bytes): Detect EOF, inform caller.
4556 (tail_bytes): Upon EOF in start_bytes, return immediately.
4557 (file_lines): Reorganize to use memrchr rather than an explicit loop.
4558 Adapt to new safe_read ABI.
4560 2002-10-11 Jim Meyering <jim@meyering.net>
4562 * tests/du/deref: New file/test, for the above fix.
4563 * tests/du/Makefile.am (TESTS): Add deref.
4565 2002-10-10 Jim Meyering <jim@meyering.net>
4567 * tests/ln/Makefile.am (TESTS): Add target-1.
4568 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
4570 2002-10-09 Jim Meyering <jim@meyering.net>
4572 * tests/cp/backup-is-src: Ensure that certain environment variables
4573 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
4575 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
4576 consume 4GB of disk space on systems without support for sparse files.
4577 Fix a logic error that'd make it `cat err' even though dd didn't fail.
4579 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
4580 Patch by steven@magelico.net, forwarded by Michael Stone.
4582 * tests/ls/dired: Ensure that ls produces English messages.
4583 Patch by Alexey Vyskubov, forwarded by Michael Stone.
4585 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
4587 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
4589 2002-10-08 Jim Meyering <jim@meyering.net>
4591 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
4592 Fix syntax in test: use =, not ==.
4593 Reported by Bob Proulx.
4594 Change all the rest like this: grep -lR "testing framework'" .\
4595 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
4597 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
4598 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
4599 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
4600 * src/wc.c (wc): Likewise.
4602 2002-10-07 Paul Eggert <eggert@twinsun.com>
4605 Don't advance the write pointer past the end of the write buffer.
4606 * src/sort.c (begfield, limfield): Likewise.
4608 2002-10-07 Jim Meyering <jim@meyering.net>
4610 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
4611 * src/head.c (head_bytes, head_lines): Likewise.
4613 2002-10-06 Jim Meyering <jim@meyering.net>
4615 * src/dd.c (scanargs): Ensure that specified block sizes (specified
4616 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
4617 (skip, dd_copy): Adapt to new safe_read ABI.
4619 * Makefile.maint (signatures): Define.
4621 (announcement): Depend on $(signatures).
4623 * Makefile.maint (announcement): Output all URLs for detached
4624 signatures, not just the last one from the previous loop.
4626 2002-10-05 Jim Meyering <jim@meyering.net>
4630 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
4631 don't recurse into directory, DIR. Prompted by a report from
4634 * tests/rm/i-no-r: New file/test, for the above fix.
4635 * tests/rm/Makefile.am (TESTS): Add i-no-r.
4637 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
4638 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
4640 2002-10-03 Jim Meyering <jim@meyering.net>
4642 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
4643 * src/df.c (AUTHORS): Likewise.
4644 * src/du.c (AUTHORS): Likewise.
4645 * src/tail.c (AUTHORS): Likewise.
4646 * src/touch.c (AUTHORS): Likewise.
4648 2002-10-02 Jim Meyering <jim@meyering.net>
4650 * Makefile.am (SUBDIRS): Remove `old'.
4651 (EXTRA_DIST): List the files in old/.
4652 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
4653 Suggestion from Akim Demaille.
4655 2002-10-01 Jim Meyering <jim@meyering.net>
4657 * src/sys2.h (SSIZE_MAX): Define.
4659 2002-09-30 Jim Meyering <jim@meyering.net>
4661 * src/csplit.c: Don't include stdlib.h here. It's already included
4664 2002-09-29 Jim Meyering <jim@meyering.net>
4666 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
4667 expression to avoid bogus warning from gcc.
4669 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
4670 (cat): Declare insize and outsize to be of type size_t, not int.
4671 Rearrange pointer/integer expressions to avoid bogus warnings.
4672 (main): Declare insize and outsize to be of type size_t, not int.
4674 * src/tail.c (parse_options): Give a sensible diagnostic for
4675 an invalid byte or line count. Reported by Mikko Tuumanen.
4677 * src/touch.c (main): Split a long line.
4679 * tests/du/Makefile.am (TESTS): Add slink.
4680 * tests/du/slink: New test for system.h change of 2002-08-31.
4682 In move mode, always first try to rename. Before, upon failure to
4683 rename a directory, this code would never attempt to rename any
4684 other file in that directory, but would thenceforth always copy.
4685 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
4686 may fail with EXDEV, yet renaming files within that directory to
4687 a newly-created destination directory succeeds.
4688 * src/copy.c (copy_internal): Remove local, move_mode;
4689 use x->move_mode instead. Based on a patch from Tom Haynes.
4691 2002-09-28 Jim Meyering <jim@meyering.net>
4693 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
4694 Factor out some duplication.
4696 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
4698 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
4700 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
4701 to avoid compiler warnings.
4703 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
4706 Fix things so `mkdir -p' can create very deep directories, e.g.,
4707 mkdir -p $(perl -e 'print "a/" x 40000') now works.
4708 * src/mkdir.c (main): For --parents (-p), call make_path with the
4709 entire directory name, so we don't ever require that file operations
4710 like stat or chmod be performed on the entire command line argument.
4711 * makepath.c (make_path): Restore umask *before* creating the final
4714 2002-09-27 Andreas Schwab <schwab@suse.de>
4716 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
4717 to avoid overflow. Reported by Hans Lermen.
4719 2002-09-26 Jim Meyering <jim@meyering.net>
4721 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
4723 2002-09-25 Jim Meyering <jim@meyering.net>
4725 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
4726 and add a cast, to avoid a warning about `signed and unsigned type in
4727 conditional expression'.
4729 2002-09-22 Jim Meyering <jim@meyering.net>
4731 * src/rmdir.c: Include "dirname.h", for declaration of
4732 strip_trailing_slashes.
4734 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
4735 Now they're defined through system.h.
4737 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
4738 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
4739 since it's already included from sys2.h via system.h.
4741 * Use automake-1.6f. Regenerate dependent files.
4743 * src/Makefile.am (PERL): Remove duplicate definition.
4745 fmt's -s, -t, -c options didn't work properly for long lines.
4746 Since get_line may end up calling put_paragraph (for long lines),
4747 be sure to set global, `other_indent', before it is used there.
4749 * src/fmt.c (set_other_indent): New function, factored out of...
4750 (get_paragraph): ... here. Call it.
4751 (get_line): Call set_other_indent before calling flush_paragraph,
4752 which calls fmt_paragraph, which in turn calls put_paragraph,
4753 which uses other_indent.
4755 * tests/fmt/Makefile.am (TESTS): Add long-line.
4756 * tests/fmt/long-line: New file/test, for the above fix.
4758 2002-09-21 Jim Meyering <jim@meyering.net>
4760 * src/od.c: No longer include deprecated <values.h>.
4761 It was required solely for now-removed reference to BITSPERBYTE.
4762 * src/install.c: Likewise.
4763 Suggestion from Bruno Haible.
4765 2002-09-06 Andreas Schwab <schwab@suse.de>
4767 `rmdir -p dir-specified-with-trailing-slash/' would fail.
4768 * src/rmdir.c (remove_parents): Strip trailing slashes.
4770 2002-09-20 Jim Meyering <jim@meyering.net>
4772 * tests/rmdir/t-slash: New file/test, for the above fix.
4773 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
4775 * Makefile.maint (announcement): Arrange to gpg-sign the message.
4776 Add a URL for each detached signature file.
4778 2002-09-07 Bruno Haible <bruno@clisp.org>
4780 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
4782 2002-09-18 Jim Meyering <jim@meyering.net>
4784 `od -t x8' used the wrong (`l'-prefixed) printf format.
4785 Likewise for the o8 and u8 formats.
4786 * src/od.c (ISPEC_TO_FORMAT): Define macro.
4787 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
4788 Reported by Arun Sharma.
4790 2002-09-17 Jim Meyering <jim@meyering.net>
4792 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
4793 From gettext's intl/loadmsgcat.c.
4795 * tests/od/x8: New file/test, for the above fix.
4796 * tests/od/Makefile.am (TESTS): Add x8.
4798 2002-09-15 Jim Meyering <jim@meyering.net>
4800 * Use autoconf-2.54. Regenerate dependent files.
4802 * src/csplit.c (get_format_width): Add cast to avoid
4803 warning about `signed and unsigned type in conditional expression'.
4805 2002-09-14 Jim Meyering <jim@meyering.net>
4807 * src/who.c (print_user): Change type of local to size_t
4808 to avoid warnings about `comparison between signed and unsigned'.
4809 * src/ptx.c (generate_all_output): Likewise.
4811 * src/dd.c (main, skip): Add casts to avoid warnings about
4812 `comparison between signed and unsigned'.
4814 * src/id.c (print_full_info, print_group_list): Add casts to avoid
4815 warnings about `signed and unsigned type in conditional expression'.
4817 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
4818 to avoid warnings about `comparison between signed and unsigned'.
4819 (split_3): Change parameter names to be readable and add comment.
4820 Clean up the test for whether a line may be ignored.
4822 2002-09-13 Jim Meyering <jim@meyering.net>
4824 * src/printf.c (main): Handle leading command line argument of `--'.
4825 Reported by Raul: DervishD <raul@pleyades.net>
4826 * tests/misc/printf: New file: test for the above.
4827 * tests/misc/Makefile.am (TESTS): Add printf.
4829 * src/date.c (usage): Explain that %S's range of [0..60] is required --
4830 rather than 0..59 -- to accommodate the occasional positive leap second.
4831 Reported by Richard Neill.
4833 2002-09-12 Jim Meyering <jim@meyering.net>
4835 * src/Makefile.am (nanosec_libs): Define.
4836 (sleep_LDADD, tail_LDADD): Use it here.
4838 Factor nanosleep-related code into ../lib/xnanosleep.c.
4839 * src/sleep.c: Include xnanosleep.h.
4840 Factor out fenv.h-related code.
4841 (timespec_subtract): Remove function.
4842 (main): Remove code that deals with computing start and stop times
4843 as well as the loop around nanosleep. Now that's in xnanosleep.c.
4845 Allow S (in --sleep-interval=S) to be a floating point value.
4846 * src/tail.c: Include xnanosleep.h and xstrtod.h.
4847 Move declaration of global variable, sleep_interval, to ...
4849 (usage): Update description of --sleep-interval option.
4850 (tail_forever): New parameter, sleep_interval. Update caller.
4851 Use xnanosleep, rather than sleep.
4852 (parse_options): New parameter, sleep_interval. Update caller.
4853 Use xstrtod, now that we accept floating point values.
4854 Prompted by a patch from Augey Mikus.
4856 2002-09-06 Jim Meyering <jim@meyering.net>
4858 * src/remove.c (prompt): Change comment to give a better note to
4859 translators. From Michael Piefel.
4861 2002-09-02 Jim Meyering <jim@meyering.net>
4863 * README: A good problem report/patch includes diffs against
4864 the most recent test release.
4866 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
4867 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
4869 * src/kill.c (print_table_row): Use an unsigned type for widths
4870 to avoid warning about comparison between signed and unsigned.
4871 (list_signals): Likewise.
4873 * src/od.c (skip): Add a cast to avoid warning about comparison
4874 between signed and unsigned.
4875 * src/install.c (get_ids): Likewise. Also rearrange range-checking
4876 comparisons to make them more readable.
4878 2002-09-01 Jim Meyering <jim@meyering.net>
4882 2002-08-31 Jim Meyering <jim@meyering.net>
4884 Symlinks were always reported as using 0 blocks.
4885 * src/system.h (ST_NBLOCKS): Don't depend on file type.
4886 This reverts the change of 2000-01-30.
4887 Based on a report and patch from Neil Brown via Michael Stone.
4888 This fixes Debian Bug#156358.
4890 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
4891 `exit (1)' to `exit (EXIT_FAILURE)', and
4892 `usage (1)' to `usage (EXIT_FAILURE)'.
4894 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
4895 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
4896 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
4897 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
4898 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
4899 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
4900 error never exits successfully.
4902 2002-08-29 Jim Meyering <jim@meyering.net>
4904 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
4905 when ignoring any return value.
4907 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
4908 failures. On some systems (at least EMC Celerra and Solaris5.8),
4909 this appears to be necessary.
4910 (is_empty_dir): Likewise. Also, always close directory handle.
4911 * src/ls.c (print_dir): Likewise.
4912 (print_dir): Rename local variable: reading -> dirp.
4913 Reported by Mike Coleman.
4915 2002-08-28 Jim Meyering <jim@meyering.net>
4917 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
4918 Give a diagnostic and fail if closedir fails.
4920 2002-08-26 Jim Meyering <jim@meyering.net>
4922 * Makefile.am (THANKS-to-translators): New rule.
4923 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
4924 * THANKStt.in: New file.
4926 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
4928 (main): Register it with atexit.
4929 Close STDOUT_FILENO, to avoid a problem when writing to
4930 /dev/audio on at least Solaris 5.7 and 5.8 systems.
4931 Reported by Shing-Shong Shei.
4933 2002-08-25 Jim Meyering <jim@meyering.net>
4935 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
4936 * src/tac.c (main): Likewise.
4937 * src/tail.c (main): Likewise.
4938 * src/tee.c (main): Likewise.
4939 * src/tr.c (main): Likewise.
4940 * src/wc.c (main): Likewise.
4942 2002-08-20 Jim Meyering <jim@meyering.net>
4944 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
4946 2002-08-10 Paul Eggert <eggert@twinsun.com>
4948 * src/nohup.sh: Don't use "exec --"; it's not portable and
4949 shouldn't be needed.
4951 2002-08-09 Jim Meyering <jim@meyering.net>
4953 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
4954 (usage): Clarify help text for the -COLUMN option.
4955 Patch by Padraig Brady.
4956 * tests/pr/Test.pm [col-last]: New test for the above.
4958 * configure.ac: Start with version 4.5.1, chosen so that it's larger
4959 than the latest version numbers of the component packages.
4961 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
4964 2002-08-08 Jim Meyering <jim@meyering.net>
4966 * src/date.c: Guard inclusion of <langinfo.h> with
4967 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
4968 * src/sort.c: Likewise.
4969 Patch by GOTO Masanori.
4971 2002-08-05 Paul Eggert <eggert@twinsun.com>
4973 Fix some minor time-related bugs with POSIX time arguments.
4974 Some valid time stamps were being rejected (notably -1, and
4975 time stamps before 1900 on 64-bit hosts). And some invalid
4976 time stamps were being accepted, e.g. September 31.
4978 * src/date.c (main): Adjust to posixtime signature change.
4979 * src/touch.c (main): Likewise. Remove unnecessary initialization.
4980 Use localtime, not posixtm, to warn about obsolete "touch".
4982 2002-08-05 Jim Meyering <jim@meyering.net>
4984 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
4986 2002-08-04 Jim Meyering <jim@meyering.net>
4988 * src/Makefile.am (check-README): New target/rule.
4989 (check): Depend on it.
4991 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
4993 2002-08-03 Jim Meyering <jim@meyering.net>
4995 * Makefile.am (SUBDIRS): Add old.
4996 * old/: New directory, containing legacy ChangeLog* and NEWS files
4997 from the fileutils, sh-utils, and textutils packages.
4999 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
5001 2002-08-02 Paul Eggert <eggert@twinsun.com>
5003 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
5005 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
5006 (hard_LC_COLLATE): New var.
5007 (different): Args are now char *, not const char *.
5008 Use xmemcoll instead of memcmp to compare lines, so that
5009 LC_COLLATE has effect. However, use memcmp if it is an
5011 (check_file): Do not include newline in comparison, so that
5012 xmemcoll has a byte to stomp on temporarily.
5013 (main): Set hard_LC_COLLATE.
5015 2002-07-29 Jim Meyering <jim@meyering.net>
5017 * Makefile.am (SUBDIRS): Remove djgpp, for now.
5019 2002-07-20 Jim Meyering <jim@meyering.net>
5021 * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
5022 into EXIT_FAILURE. Otherwise, false --help and false --version
5025 2002-07-08 Jim Meyering <jim@meyering.net>
5027 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
5028 rather than the hard-coded `sh-utils'.
5030 2002-07-01 Jim Meyering <jim@meyering.net>
5032 * configure.ac: Merge the three files from fileutils,
5033 textutils, and sh-utils.
5034 * Makefile.am: Likewise.
5035 * src/Makefile.am: Likewise.