1 2003-01-22 Jim Meyering <jim@meyering.net>
5 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
6 * tests/du/Makefile.am (TESTS): Add no-x.
8 2003-01-21 Jim Meyering <jim@meyering.net>
10 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
11 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
12 it may still be a directory -- or not (e.g., with FreeBSD on an
13 NFS-mounted file system), so resort to calling lstat to find out.
14 Based on a patch by Michael van Elst.
16 * tests/cp/same-file: Don't assume that the file owner username
17 length is less than 9 in ls output: instead, omit that field
18 altogether. Reported by, and suggested fix from, Ferdinand.
20 2003-01-20 Jim Meyering <jim@meyering.net>
22 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
23 large format widths no longer cause strftime to infloop.
25 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
27 2003-01-19 Jim Meyering <jim@meyering.net>
29 * src/readlink.c: Include "canonicalize.h".
31 2003-01-18 Jim Meyering <jim@meyering.net>
33 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
35 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
36 (long_options): Add option --dereference-command-line-symlink-to-dir.
37 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
38 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
39 -d, -F, -l options is specified.
40 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
41 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
42 Change --dereference-command-line (-H) to dereference *all*
43 command line arguments, including broken symlinks.
45 2003-01-15 Paul Eggert <eggert@twinsun.com>
47 Change ls -H back to the way it was yesterday, since this is
48 compatible with FreeBSD and the POSIX spec is confusing
49 and somewhat contradictory.
51 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
52 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
53 (long_options): Change the long option name back.
54 (usage): Change the usage back.
55 (gobble_file): When -H is specified, dereference a top-level
56 arg even if it points to a non-directory.
58 2003-01-15 Jim Meyering <jim@meyering.net>
60 * src/ls.c (gobble_file): Fall back on using lstat when required:
61 when --dereference (-L) is not specified, and
62 - when operating on a dangling symlink
63 - when operating on command-line-symlink-to-directories
64 This fixes numerous problems. Here are examples:
65 - `ls dangling-symlink' would fail with `no such file...'
66 Now it prints `dangling-symlink'.
67 - `ls -i symlink' would mistakenly print the inode of the referent.
68 Now it prints the inode of the symlink. Likewise for --size (-s).
69 Based on a patch from Michael Stone.
70 Reported by Deepak Goel as Debian bug #173793.
72 Rename ls's --dereference-command-line (-H)
73 option to --dereference-command-line-symlink-to-dir.
74 * src/ls.c [enum Dereference_symlink]
75 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
76 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
77 (long_options): Rename the long option.
78 (usage): Say that --dereference-... changes how ls treats
79 only symlinks to directories specified on the command line.
81 2003-01-14 Jim Meyering <jim@meyering.net>
83 * tests/ls/dangle: New file/test, for the above fix.
84 * tests/ls/inode: Another new file/test, for the above fix.
85 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
87 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
88 so that ls --color would no longer highlight the names of files with
89 the execute bit set when not specified on the command line.
90 Patch by Michael Stone. Reported by Stephen Depooter as
93 * tests/ls-2/tests (color-exe): New test, for the above fix.
95 2003-01-13 Jim Meyering <jim@meyering.net>
97 * tests/shred/exact: Also test for just fixed bug with --zero.
99 * src/shred.c (long_opts): --zero does not require an argument.
100 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
102 2003-01-12 Jim Meyering <jim@meyering.net>
104 * Makefile.maint (cvs-update): Skip any file with local modifications.
106 * src/unexpand.c (usage): Document --first-only and mention that
107 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
109 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
111 * src/df.c: Include "canonicalize.h".
112 Use canonicalize_file_name unconditionally.
114 2003-01-09 Jim Meyering <jim@meyering.net>
116 * README: Add readlink.
118 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
120 * src/df.c: Include "xgetcwd.h".
121 * src/pwd.c: Likewise.
123 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
125 * src/shred.c: Remove declaration of xstrdup.
126 We already get it via xalloc.h which is included via system.h.
128 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
130 New program: readlink.
132 * src/Makefile.am (bin_PROGRAMS): Add readlink.
133 * src/readlink.c: New file.
135 * man/readlink.x: New file.
136 * man/Makefile.am (dist_man_MANS): Add readlink.1.
137 (readlink.1): New rule.
139 2003-01-09 Jim Meyering <jim@meyering.net>
141 When selecting ranges of byte offsets (as opposed to ranges of fields)
142 and when --output-delimiter=STRING is specified, output STRING between
143 ranges of selected bytes.
144 * src/cut.c (RANGE_START_SENTINEL): Define.
145 (output_delimiter_specified): New global.
146 (print_kth): Add parameter. Adjust all callers.
147 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
148 (cut_bytes): When requested, output STRING between ranges of
150 (main): Make a diagnostic a little clearer.
151 Based on a patch from Jan Nieuwenhuizen.
153 * tests/cut/Test.pm: New tests for the above.
155 * src/cut.c (set_fields): Make code agree with comment:
156 Don't merge abutting ranges like 4- and 2-3. This makes no
157 difference currently, but is required to support an upcoming change.
159 2003-01-07 Jim Meyering <jim@meyering.net>
161 * src/cut.c (set_fields): Fix typo in comment.
163 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
164 * tests/touch/Makefile.am (TESTS): Add not-owner.
165 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
166 Now, this tests only the nonexistent-directory diagnostic.
167 Suggestion from Michael Stone.
169 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
171 2003-01-04 Jim Meyering <jim@meyering.net>
173 * src/copy.h: Remove use of PARAMS.
174 * src/remove.h: Likewise.
175 * src/chown-core.h: Likewise.
177 rm could be tricked into mistakenly reporting a cycle.
178 * src/remove.c: [cycle_check_state]: New global.
179 (remove_cwd_entries): Adapt to new semantics of cycle_check.
180 (rm): Call cycle_check_init and cycle_check_free for each file.
181 * tests/rm/cycle (rm): New test, for the above fix.
182 * tests/rm/Makefile.am (TESTS): Add cycle.
184 When rm detects a cycle, don't abort the entire command,
185 but rather just the affected command line argument.
186 * src/remove.c: Include <setjmp.h>
187 (struct dirstack_state) [current_arg_jumpbuf]: New member.
188 (remove_cwd_entries): Call longjmp if we detect a cycle.
189 (rm): Call setjmp here.
191 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
192 Instead, include cycle-check.h and use it.
194 * src/remove.h (struct dev_ino): Remove declaration.
196 * src/remove.c (remove_cwd_entries): Fix typos in comment.
198 Don't include trailing /. in diagnostics about directories.
199 * src/remove.c (full_filename_): When FILENAME is just `.'
200 and there is a nonempty directory-name part, don't append `/.'.
201 * tests/rm/unread2: Remove trailing /. from diagnostic.
202 * tests/rm/rm2: Likewise.
204 * src/remove.c (struct dirstack_state): Define.
205 To be used in place of these file-scoped globals ...
206 (dir_stack, len_stack, Active_dir): Remove globals.
207 (ds_init, ds_free): New functions.
208 (full_filename): Define.
209 (full_filename_): Rename from full_filename.
211 Begin to make AD_* functions more generic.
212 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
214 (AD_INIT_OTHER_MEMBERS): Define.
215 (remove_dir): Define the `status' member manually after each
216 call to AD_push or AD_push_initial.
218 * src/Makefile.am (check-misc): New rule, to ensure that no more
219 S_IS* macro definitions sneak into the code.
220 (check): Depend on check-misc.
222 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
223 * src/du.c (count_entry) [S_ISLNK]: Don't define.
224 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
226 2003-01-03 Jim Meyering <jim@meyering.net>
228 * src/true.c: Add copyright.
229 (AUTHORS): I suppose I've written it.
231 * src/Makefile.am (false.c): Make the generated file be read-only.
233 2003-01-04 Jim Meyering <meyering@lucent.com>
235 * src/ls.c: Include "dev-ino.h".
236 [struct dev_ino]: Remove declaration.
238 2003-01-02 Jim Meyering <meyering@lucent.com>
240 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
241 from mv: s/missing file arguments/missing file argument/.
242 With --target-directory=DIR, cp and mv work with a single file argument.
243 Reported by Karl Berry.
245 * tests/rm/isatty: Enable this test.
247 2002-12-31 Jim Meyering <meyering@lucent.com>
249 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
251 (AD_INIT_OTHER_MEMBERS): Define.
252 (remove_dir): Define the `status' member manually after each
253 call to AD_push or AD_push_initial.
255 * src/ls.c [struct dev_ino]: Remove definition.
256 Include "dev-ino.h" instead.
258 2002-12-28 Jim Meyering <meyering@lucent.com>
260 * tests/du/Makefile.am (TESTS): Add no-deref.
261 * tests/du/no-deref: New script.
263 2002-12-23 Jim Meyering <meyering@lucent.com>
265 * src/remove.c (remove_cwd_entries): Fix typo in comment.
267 2002-12-21 Jim Meyering <jim@meyering.net>
269 * announce-gen: Generate MML-formatted announcement.
270 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
272 2002-12-20 Jim Meyering <jim@meyering.net>
274 * src/touch.c (touch): Change the wording of a diagnostic so
275 that it makes sense both when the file exists and when it doesn't.
276 Suggestion from Michael Stone.
278 2002-12-18 Jim Meyering <jim@meyering.net>
280 * src/stty.c (valid_options): Declare to be static.
282 2002-12-15 Jim Meyering <jim@meyering.net>
284 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
286 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
287 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
288 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
289 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
290 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
292 * src/remove.c (PARAMS): Remove definition.
293 * src/sys2.h: Likewise.
295 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
296 Include strftime.h instead.
298 2002-12-14 Jim Meyering <jim@meyering.net>
300 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
302 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
303 This is necessary at least for Irix6.5 when using c89.
304 Reported by Nelson Beebe.
306 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
308 * tests/misc/cat-tty-eof: New test.
310 * src/mknod.c (usage): Specify how major and minor mode numbers
311 are interpreted. Report forwarded by Kristin E Thomas.
312 * src/mknod.c: Remove now-redundant usage-specifying comment.
314 2002-12-13 Jim Meyering <jim@meyering.net>
318 * tests/du/trailing-slash: Allow for a directory of size `0'.
319 That happens at least on file systems of type tmpfs on linux-2.4.18.
321 * announce-gen: New script to begin replacing the commands
322 associated with the rule here...
323 * Makefile.maint (announcement): Invoke announce-gen.
324 * Makefile.am (EXTRA_DIST): Add announce-gen.
326 * tests/cp/preserve-2: New file/test, for latest fix.
327 * tests/cp/Makefile.am (TESTS): Add preserve-2.
329 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
331 Fix a bug whereby cp would fail to parse an option like
332 --preserve=mode,ownership.
333 * src/cp.c (decode_preserve_arg): Advance `comma' to
334 point the character following the comma.
336 2002-12-11 Jim Meyering <jim@meyering.net>
338 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
339 in case it's already defined.
341 2002-12-09 Jim Meyering <jim@meyering.net>
343 * tests/touch/fail-diag: Don't get a test failure if /no exists.
344 Instead, evoke a framework failure if /no-$$ exists.
345 Reported by Michael Stone.
347 2002-12-08 Jim Meyering <jim@meyering.net>
349 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
350 Define to rpl_lstat, so that even on systems like Solaris 2.8,
351 du honors (per POSIX) the trailing slash on an argument referring
352 to a symlink-to-directory.
354 2002-12-06 Jim Meyering <jim@meyering.net>
356 * Use autoconf-2.57. Regenerate dependent files.
357 * Use automake-1.7.2. Regenerate dependent files.
359 * src/ls.c (gobble_file): Also stat the file if it's a
360 regular file and --indicator-style=classify (aka -F).
361 Thanks to Ed Santiago for opening my eyes.
363 * tests/ls/file-type: New file. Test for the above.
364 A test to contrast ls -F and ls --indicator-style=file-type.
365 * tests/ls/Makefile.am (TESTS): Add file-type.
367 2002-12-04 Jim Meyering <jim@meyering.net>
369 * tests/ls/follow-slink: Make sure the symlink was created.
370 Richard Dawe reported that `ln -s link link' succeeds, but creates
371 no file on systems running some version of the DJGPP libc.
373 2002-12-03 Jim Meyering <jim@meyering.net>
375 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
376 since this package no longer panders to K&R compilers.
378 2002-12-02 Jim Meyering <jim@meyering.net>
380 * tests/du/slink: Skip this test if `.' is on a non-local file system.
382 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
383 something to replace.
385 2002-12-01 Jim Meyering <jim@meyering.net>
387 * src/stat.c: Don't include <string.h> or <ctype.h>.
388 That's already done via system.h.
389 * src/dircolors.c: Don't include <ctype.h>.
391 2002-11-30 Jim Meyering <jim@meyering.net>
393 * ls.c (gobble_file): Remove the block of code that caused
394 `ls --color -F symlink-to-dir' to list the files in
395 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
396 like `ls -F symlink-to-dir') but with the addition of highlighting.
397 Similarly, `ls --color -dF symlink-to-dir' would print
398 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
399 Reported by Jeff Sheinberg as Debian bug #168203.
400 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
402 ls is now more efficient: with certain options, it no longer needs
403 to stat each directory entry on systems with valid dirent.d_type.
404 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
405 (main): Make --recursive set format_needs_type, not format_needs_stat.
406 (gobble_file): Remove a FIXME comment, now that it's fixed.
408 2002-11-24 Jim Meyering <jim@meyering.net>
410 * src/du.c (du_files): Don't strip any trailing slash.
411 Rewrite so that `/' is no longer represented internally as
413 (count_entry): When appending a file name component,
414 account for the fact that the current path may end in `/'.
415 François Pinard reported that `du symlink-to-dir/' was not
416 equivalent to `du symlink-to-dir/.'. Now it is.
417 * tests/du/trailing-slash: New file/test, for the above fix.
418 * tests/du/Makefile.am (TESTS): Add trailing-slash.
420 2002-11-23 Jim Meyering <jim@meyering.net>
422 * src/tac.c (output): Declare some local variables to be of type size_t,
423 rather than `int' to avoid warnings from gcc.
425 2002-11-21 Paul Eggert <eggert@twinsun.com>
427 * src/ls.c (decode_switches): Use case-sensitive matching to
428 decode the QUOTING_STYLE environment variable. This is more
429 consistent with the documentation, and with --quoting-style.
431 2002-11-21 Martin Buck <martin.buck@ascom.ch
433 * src/stty.c (struct speeds): Add support for all baud rates defined
436 2002-11-19 Jim Meyering <jim@meyering.net>
438 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
439 run in a UTF locale. Report and suggested fix by Bruno Haible.
440 * tests/fmt/basic: Likewise.
442 2002-11-17 Jim Meyering <jim@meyering.net>
444 * configure.ac: Update via autoupdate.
445 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
447 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
448 Reported by Hans Ginzel.
450 2002-11-15 Jim Meyering <jim@meyering.net>
452 * Makefile.cfg (gnu_rel_host): Define.
453 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
454 on whether $(VERSION) looks like a major release number.
456 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
457 (release): Rename from `alpha'.
458 (alpha): Depend on release.
460 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
462 2002-11-14 Jim Meyering <jim@meyering.net>
464 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
465 (announcement): Use the new variable.
467 * Makefile.maint: Sync with Bison, i.e.:
468 (po-check): Scan .l and .y files instead of the
469 .c and the .h files that they generate. This fixes the bug
470 reported by Tim Van Holder in:
471 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
472 Look for N_ as well as for _. Try to avoid matching #define for
476 2002-11-12 Jim Meyering <jim@meyering.net>
478 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
479 Replace sole use with equivalent `#ifdef S_ISLNK'.
480 Inconsistency reported by Dmitry V. Levin.
482 2002-11-11 Jim Meyering <jim@meyering.net>
484 * src/stat.c (usage): Transform --help items output via s/ - / /,
485 so that help2man produces properly formatted man pages.
486 Reported by Herbert Xu as Debian bug #168400.
488 2002-11-10 Jim Meyering <jim@meyering.net>
490 * src/ls.c (sighandler): Handle SIGTSTP specially.
491 Based on suggestions from Solar Designer and Dmitry V. Levin.
494 * Makefile.cfg (cvs_files): Define. From autoconf.
495 (local_updates): Likewise.
497 * src/ls.c (restore_default_color_handler, sigtstp_handler):
499 (sighandler): New function, based on the one in sort.c.
500 (main): Use sigaction, if possible; otherwise signal.
501 Handle these signals:
502 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
503 Don't register our handler if the signal is already being ignored.
505 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
506 * src/csplit.c (interrupt_handler): Likewise.
507 * src/sort.c (sighandler): Likewise.
508 (main): Declare `i' and `nsigs' to be unsigned, not int.
510 2002-11-09 Jim Meyering <jim@meyering.net>
512 ls --color: restore terminal text color upon signal.
513 * src/ls.c: Include "full-write.h" and <signal.h>.
514 (restore_default_color, restore_default_color_handler): New functions.
515 (sigtstp_handler, put_indicator_direct): New functions.
516 (main) [print_with_color]: Register signal handlers.
517 Patch mostly by Solar Designer and Stanislav Ievlev.
519 Update from autoconf.
520 * Makefile.maint (AMTAR): Remove definition.
521 (update, cvs-update, po-update, do-po-update): New rules.
522 (wget-update): Update (thus renaming to cvs-update).
523 (automake_repo): Use anoncvs@sources.redhat.com.
525 2002-11-06 Jim Meyering <jim@meyering.net>
527 * tests/misc/Makefile.am (TESTS): Add printf-hex.
529 * tests/misc/printf: Be careful to test the code in this package,
530 not the shell built-in function.
532 * src/printf.c (print_esc): A hexadecimal escape sequence has
533 at most two hex. digits, not three. Reported by Padraig Brady.
534 (usage): Update description.
535 * tests/misc/printf-hex: New file/test, for the above fix.
537 2002-10-07 Paul Eggert <eggert@twinsun.com>
539 Add support for locale-specific size indications (e.g.,
540 thousands-separators) and for explicit size suffixes on output.
542 * doc/coreutils.texi (Block size): Say that:
543 This affects display format as well as block size.
544 Fractional block counts are rounded up.
545 ls file size blocksize defaults to 1.
546 A block size spec preceded by ' generates thousands separators.
547 A suffix without a preceding integer generates suffixes.
548 (tail invocation): 32k -> 32 KiB.
549 (What information is listed): ls -h is now equivalent to
550 ls --block-size=human, and ls -H is now equivalent to
551 ls --block-size=si. Displayed file size is now always affected by
554 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
555 lib/umaxtostr.c: New files, taken from GNU tar.
557 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
559 (EXTRA_DIST): Add inttostr.c.
561 * lib/human.c, lib/human.h: Rewrite to support locale-specific
562 notations like thousands separators.
563 Specify what includer of include.h must include beforehand.
564 (human_group_digits, human_suppress_point_zero, human_autoscale,
565 human_base_1024, human_SI, human_B): New enum values.
566 (human_readable): Rename from human_readable_inexact; put the
567 options before the sizes. All uses changed. The old human_readable
568 function has been removed; use inttostr.h instead.
569 (human_options): Renamed from human_block_size, with new signature
570 that allows block sizes up to UINTMAX_MAX. All callers changed.
572 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
573 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
574 freestanding C89. No need to check for stdlib.h or string.h since
575 autoconf does this now.
577 * src/cksum.c (cksum): Use primitives from inttostr.h, not
578 human.h, to print large numbers simply.
579 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
580 * src/dd.c (print_stats, main): Likewise.
581 * src/df.c (print_header): Likewise.
582 * src/factor.c (print_factors): Likewise.
583 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
584 * src/shred.c (dopass): Likewise.
585 * src/sort.c (checkfp): Likewise.
586 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
587 * src/tail.c (xlseek): Likewise.
588 * src/wc.c (write_counts, wc): Likewise.
590 * src/df.c (human_output_opts): New var.
591 (output_block_size): Now uintmax_t, not int, to handle larger
592 block sizes. All uses changed.
593 * src/du.c: Likewise.
594 * src/ls.c: Likewise.
596 * src/df.c (print_header): In the header line, prefer SI to human
597 representation if it's shorter; if neither is shorter, try to
598 intuit what the user would prefer.
600 * src/expr.c (inttostr): Remove; use new imaxtostr library
603 * src/ls.c (file_output_block_size): New var, to distinguish
604 file sizes from other sizes.
605 (decode_switches): Set it.
607 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
608 (dopass): When printing progress, use floor for what has been done
609 so far (since we should be conservative there), and ceiling for
610 what needs to be done (since that's what other programs use).
612 2002-10-19 Jim Meyering <jim@meyering.net>
614 * src/pinky.c (print_heading): Align TTY and Name headings.
615 Reported by Karl Eichwalder.
617 2002-10-18 Jim Meyering <jim@meyering.net>
619 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
620 Remove now-useless cast.
621 (stdread): Remove function.
622 (bytes_split): Use size_t instead of int.
623 Use safe_read, not stdread.
624 (lines_split): Likewise.
625 Use memchr rather than a `while' loop.
626 (line_bytes_split): Use size_t instead of int.
627 Use safe_read, not stdread.
628 (main): Add some FIXME comments to remind me to remove casts.
630 * src/system.h (ST_BLKSIZE): Correct comment describing how to
631 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
633 2002-10-17 Jim Meyering <jim@meyering.net>
635 Fix a problem that could make e.g., `cat' misbehave on systems which
636 give invalid (unreasonably large) values for stat.st_blksize.
637 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
638 Reported by Petter Reinholdtsen.
640 2002-10-14 Jim Meyering <jim@meyering.net>
642 Specifying a printf conversion specifer as nl's separator string
643 could cause nl to segfault.
644 * src/nl.c (build_print_fmt): Don't include separator string
645 in the printf format; it might contain `%'.
646 Use a better bound on the length of the print_fmt buffer.
647 (print_lineno): Print the separator here instead.
648 Reported by Doug Coleman.
650 * tests/misc/nl: New file/tests, including a test for the above.
651 * tests/misc/Makefile.am (TESTS): Add nl.
653 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
654 * tests/misc/Makefile.am (TESTS): Add split-l.
656 2002-10-13 Jim Meyering <jim@meyering.net>
660 * src/du.c (usage): Tweak description of --dereference-args/-D.
662 * src/du.c (count_entry): Also save cwd when dereferencing (via
663 --dereference-args, -D) a command-line argument.
664 Reported by Michal Svec. Based on a patch by Andreas Schwab.
666 * src/Makefile.am (../AUTHORS): New target/rule.
668 2002-10-12 Jim Meyering <jim@meyering.net>
670 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
671 of type size_t, since that's the way it's used and avoids a warning.
673 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
674 since that's how it's always used and avoids a new warning from gcc.
675 (read_input): Adapt to new safe_read ABI.
677 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
680 * src/pinky.cdereference-command-line-symlink-to-dir (print_long_entry): fread returns size_t.
681 Declare local `bytes' accordingly, to avoid warning.
683 tail -c +N would perform an extra read after encountering EOF
684 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
685 * src/tail.c (start_bytes): Detect EOF, inform caller.
686 (tail_bytes): Upon EOF in start_bytes, return immediately.
687 (file_lines): Reorganize to use memrchr rather than an explicit loop.
688 Adapt to new safe_read ABI.
690 2002-10-11 Jim Meyering <jim@meyering.net>
692 * tests/du/deref: New file/test, for the above fix.
693 * tests/du/Makefile.am (TESTS): Add deref.
695 2002-10-10 Jim Meyering <jim@meyering.net>
697 * tests/ln/Makefile.am (TESTS): Add target-1.
698 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
700 2002-10-09 Jim Meyering <jim@meyering.net>
702 * tests/cp/backup-is-src: Ensure that certain environment variables
703 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
705 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
706 consume 4GB of disk space on systems without support for sparse files.
707 Fix a logic error that'd make it `cat err' even though dd didn't fail.
709 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
710 Patch by steven@magelico.net, forwarded by Michael Stone.
712 * tests/ls/dired: Ensure that ls produces English messages.
713 Patch by Alexey Vyskubov, forwarded by Michael Stone.
715 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
717 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
719 2002-10-08 Jim Meyering <jim@meyering.net>
721 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
722 Fix syntax in test: use =, not ==.
723 Reported by Bob Proulx.
724 Change all the rest like this: grep -lR "testing framework'" .\
725 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
727 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
728 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
729 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
730 * src/wc.c (wc): Likewise.
732 2002-10-07 Paul Eggert <eggert@twinsun.com>
735 Don't advance the write pointer past the end of the write buffer.
736 * src/sort.c (begfield, limfield): Likewise.
738 2002-10-07 Jim Meyering <jim@meyering.net>
740 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
741 * src/head.c (head_bytes, head_lines): Likewise.
743 2002-10-06 Jim Meyering <jim@meyering.net>
745 * src/dd.c (scanargs): Ensure that specified block sizes (specified
746 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
747 (skip, dd_copy): Adapt to new safe_read ABI.
749 * Makefile.maint (signatures): Define.
751 (announcement): Depend on $(signatures).
753 * Makefile.maint (announcement): Output all URLs for detached
754 signatures, not just the last one from the previous loop.
756 2002-10-05 Jim Meyering <jim@meyering.net>
760 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
761 don't recurse into directory, DIR. Prompted by a report from
764 * tests/rm/i-no-r: New file/test, for the above fix.
765 * tests/rm/Makefile.am (TESTS): Add i-no-r.
767 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
768 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
770 2002-10-03 Jim Meyering <jim@meyering.net>
772 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
773 * src/df.c (AUTHORS): Likewise.
774 * src/du.c (AUTHORS): Likewise.
775 * src/tail.c (AUTHORS): Likewise.
776 * src/touch.c (AUTHORS): Likewise.
778 2002-10-02 Jim Meyering <jim@meyering.net>
780 * Makefile.am (SUBDIRS): Remove `old'.
781 (EXTRA_DIST): List the files in old/.
782 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
783 Suggestion from Akim Demaille.
785 2002-10-01 Jim Meyering <jim@meyering.net>
787 * src/sys2.h (SSIZE_MAX): Define.
789 2002-09-30 Jim Meyering <jim@meyering.net>
791 * src/csplit.c: Don't include stdlib.h here. It's already included
794 2002-09-29 Jim Meyering <jim@meyering.net>
796 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
797 expression to avoid bogus warning from gcc.
799 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
800 (cat): Declare insize and outsize to be of type size_t, not int.
801 Rearrange pointer/integer expressions to avoid bogus warnings.
802 (main): Declare insize and outsize to be of type size_t, not int.
804 * src/tail.c (parse_options): Give a sensible diagnostic for
805 an invalid byte or line count. Reported by Mikko Tuumanen.
807 * src/touch.c (main): Split a long line.
809 * tests/du/Makefile.am (TESTS): Add slink.
810 * tests/du/slink: New test for system.h change of 2002-08-31.
812 In move mode, always first try to rename. Before, upon failure to
813 rename a directory, this code would never attempt to rename any
814 other file in that directory, but would thenceforth always copy.
815 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
816 may fail with EXDEV, yet renaming files within that directory to
817 a newly-created destination directory succeeds.
818 * src/copy.c (copy_internal): Remove local, move_mode;
819 use x->move_mode instead. Based on a patch from Tom Haynes.
821 2002-09-28 Jim Meyering <jim@meyering.net>
823 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
824 Factor out some duplication.
826 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
828 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
830 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
831 to avoid compiler warnings.
833 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
836 Fix things so `mkdir -p' can create very deep directories, e.g.,
837 mkdir -p $(perl -e 'print "a/" x 40000') now works.
838 * src/mkdir.c (main): For --parents (-p), call make_path with the
839 entire directory name, so we don't ever require that file operations
840 like stat or chmod be performed on the entire command line argument.
841 * makepath.c (make_path): Restore umask *before* creating the final
844 2002-09-27 Andreas Schwab <schwab@suse.de>
846 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
847 to avoid overflow. Reported by Hans Lermen.
849 2002-09-26 Jim Meyering <jim@meyering.net>
851 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
853 2002-09-25 Jim Meyering <jim@meyering.net>
855 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
856 and add a cast, to avoid a warning about `signed and unsigned type in
857 conditional expression'.
859 2002-09-22 Jim Meyering <jim@meyering.net>
861 * src/rmdir.c: Include "dirname.h", for declaration of
862 strip_trailing_slashes.
864 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
865 Now they're defined through system.h.
867 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
868 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
869 since it's already included from sys2.h via system.h.
871 * Use automake-1.6f. Regenerate dependent files.
873 * src/Makefile.am (PERL): Remove duplicate definition.
875 fmt's -s, -t, -c options didn't work properly for long lines.
876 Since get_line may end up calling put_paragraph (for long lines),
877 be sure to set global, `other_indent', before it is used there.
879 * src/fmt.c (set_other_indent): New function, factored out of...
880 (get_paragraph): ... here. Call it.
881 (get_line): Call set_other_indent before calling flush_paragraph,
882 which calls fmt_paragraph, which in turn calls put_paragraph,
883 which uses other_indent.
885 * tests/fmt/Makefile.am (TESTS): Add long-line.
886 * tests/fmt/long-line: New file/test, for the above fix.
888 2002-09-21 Jim Meyering <jim@meyering.net>
890 * src/od.c: No longer include deprecated <values.h>.
891 It was required solely for now-removed reference to BITSPERBYTE.
892 * src/install.c: Likewise.
893 Suggestion from Bruno Haible.
895 2002-09-06 Andreas Schwab <schwab@suse.de>
897 `rmdir -p dir-specified-with-trailing-slash/' would fail.
898 * src/rmdir.c (remove_parents): Strip trailing slashes.
900 2002-09-20 Jim Meyering <jim@meyering.net>
902 * tests/rmdir/t-slash: New file/test, for the above fix.
903 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
905 * Makefile.maint (announcement): Arrange to gpg-sign the message.
906 Add a URL for each detached signature file.
908 2002-09-07 Bruno Haible <bruno@clisp.org>
910 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
912 2002-09-18 Jim Meyering <jim@meyering.net>
914 `od -t x8' used the wrong (`l'-prefixed) printf format.
915 Likewise for the o8 and u8 formats.
916 * src/od.c (ISPEC_TO_FORMAT): Define macro.
917 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
918 Reported by Arun Sharma.
920 2002-09-17 Jim Meyering <jim@meyering.net>
922 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
923 From gettext's intl/loadmsgcat.c.
925 * tests/od/x8: New file/test, for the above fix.
926 * tests/od/Makefile.am (TESTS): Add x8.
928 2002-09-15 Jim Meyering <jim@meyering.net>
930 * Use autoconf-2.54. Regenerate dependent files.
932 * src/csplit.c (get_format_width): Add cast to avoid
933 warning about `signed and unsigned type in conditional expression'.
935 2002-09-14 Jim Meyering <jim@meyering.net>
937 * src/who.c (print_user): Change type of local to size_t
938 to avoid warnings about `comparison between signed and unsigned'.
939 * src/ptx.c (generate_all_output): Likewise.
941 * src/dd.c (main, skip): Add casts to avoid warnings about
942 `comparison between signed and unsigned'.
944 * src/id.c (print_full_info, print_group_list): Add casts to avoid
945 warnings about `signed and unsigned type in conditional expression'.
947 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
948 to avoid warnings about `comparison between signed and unsigned'.
949 (split_3): Change parameter names to be readable and add comment.
950 Clean up the test for whether a line may be ignored.
952 2002-09-13 Jim Meyering <jim@meyering.net>
954 * src/printf.c (main): Handle leading command line argument of `--'.
955 Reported by Raul: DervishD <raul@pleyades.net>
956 * tests/misc/printf: New file: test for the above.
957 * tests/misc/Makefile.am (TESTS): Add printf.
959 * src/date.c (usage): Explain that %S's range of [0..60] is required --
960 rather than 0..59 -- to accommodate the occasional positive leap second.
961 Reported by Richard Neill.
963 2002-09-12 Jim Meyering <jim@meyering.net>
965 * src/Makefile.am (nanosec_libs): Define.
966 (sleep_LDADD, tail_LDADD): Use it here.
968 Factor nanosleep-related code into ../lib/xnanosleep.c.
969 * src/sleep.c: Include xnanosleep.h.
970 Factor out fenv.h-related code.
971 (timespec_subtract): Remove function.
972 (main): Remove code that deals with computing start and stop times
973 as well as the loop around nanosleep. Now that's in xnanosleep.c.
975 Allow S (in --sleep-interval=S) to be a floating point value.
976 * src/tail.c: Include xnanosleep.h and xstrtod.h.
977 Move declaration of global variable, sleep_interval, to ...
979 (usage): Update description of --sleep-interval option.
980 (tail_forever): New parameter, sleep_interval. Update caller.
981 Use xnanosleep, rather than sleep.
982 (parse_options): New parameter, sleep_interval. Update caller.
983 Use xstrtod, now that we accept floating point values.
984 Prompted by a patch from Augey Mikus.
986 2002-09-06 Jim Meyering <jim@meyering.net>
988 * src/remove.c (prompt): Change comment to give a better note to
989 translators. From Michael Piefel.
991 2002-09-02 Jim Meyering <jim@meyering.net>
993 * README: A good problem report/patch includes diffs against
994 the most recent test release.
996 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
997 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
999 * src/kill.c (print_table_row): Use an unsigned type for widths
1000 to avoid warning about comparison between signed and unsigned.
1001 (list_signals): Likewise.
1003 * src/od.c (skip): Add a cast to avoid warning about comparison
1004 between signed and unsigned.
1005 * src/install.c (get_ids): Likewise. Also rearrange range-checking
1006 comparisons to make them more readable.
1008 2002-09-01 Jim Meyering <jim@meyering.net>
1012 2002-08-31 Jim Meyering <jim@meyering.net>
1014 Symlinks were always reported as using 0 blocks.
1015 * src/system.h (ST_NBLOCKS): Don't depend on file type.
1016 This reverts the change of 2000-01-30.
1017 Based on a report and patch from Neil Brown via Michael Stone.
1018 This fixes Debian Bug#156358.
1020 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
1021 `exit (1)' to `exit (EXIT_FAILURE)', and
1022 `usage (1)' to `usage (EXIT_FAILURE)'.
1024 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
1025 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
1026 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
1027 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
1028 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
1029 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
1030 error never exits successfully.
1032 2002-08-29 Jim Meyering <jim@meyering.net>
1034 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
1035 when ignoring any return value.
1037 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
1038 failures. On some systems (at least EMC Celerra and Solaris5.8),
1039 this appears to be necessary.
1040 (is_empty_dir): Likewise. Also, always close directory handle.
1041 * src/ls.c (print_dir): Likewise.
1042 (print_dir): Rename local variable: reading -> dirp.
1043 Reported by Mike Coleman.
1045 2002-08-28 Jim Meyering <jim@meyering.net>
1047 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
1048 Give a diagnostic and fail if closedir fails.
1050 2002-08-26 Jim Meyering <jim@meyering.net>
1052 * Makefile.am (THANKS-to-translators): New rule.
1053 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
1054 * THANKStt.in: New file.
1056 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
1058 (main): Register it with atexit.
1059 Close STDOUT_FILENO, to avoid a problem when writing to
1060 /dev/audio on at least Solaris 2.7 and 2.8 systems.
1061 Reported by Shing-Shong Shei.
1063 2002-08-25 Jim Meyering <jim@meyering.net>
1065 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
1066 * src/tac.c (main): Likewise.
1067 * src/tail.c (main): Likewise.
1068 * src/tee.c (main): Likewise.
1069 * src/tr.c (main): Likewise.
1070 * src/wc.c (main): Likewise.
1072 2002-08-20 Jim Meyering <jim@meyering.net>
1074 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
1076 2002-08-10 Paul Eggert <eggert@twinsun.com>
1078 * src/nohup.sh: Don't use "exec --"; it's not portable and
1079 shouldn't be needed.
1081 2002-08-09 Jim Meyering <jim@meyering.net>
1083 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
1084 (usage): Clarify help text for the -COLUMN option.
1085 Patch by Padraig Brady.
1086 * tests/pr/Test.pm [col-last]: New test for the above.
1088 * configure.ac: Start with version 4.5.1, chosen so that it's larger
1089 than the latest version numbers of the component packages.
1091 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
1094 2002-08-08 Jim Meyering <jim@meyering.net>
1096 * src/date.c: Guard inclusion of <langinfo.h> with
1097 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
1098 * src/sort.c: Likewise.
1099 Patch by GOTO Masanori.
1101 2002-08-05 Paul Eggert <eggert@twinsun.com>
1103 Fix some minor time-related bugs with POSIX time arguments.
1104 Some valid time stamps were being rejected (notably -1, and
1105 time stamps before 1900 on 64-bit hosts). And some invalid
1106 time stamps were being accepted, e.g. September 31.
1108 * src/date.c (main): Adjust to posixtime signature change.
1109 * src/touch.c (main): Likewise. Remove unnecessary initialization.
1110 Use localtime, not posixtm, to warn about obsolete "touch".
1112 2002-08-05 Jim Meyering <jim@meyering.net>
1114 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
1116 2002-08-04 Jim Meyering <jim@meyering.net>
1118 * src/Makefile.am (check-README): New target/rule.
1119 (check): Depend on it.
1121 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
1123 2002-08-03 Jim Meyering <jim@meyering.net>
1125 * Makefile.am (SUBDIRS): Add old.
1126 * old/: New directory, containing legacy ChangeLog* and NEWS files
1127 from the fileutils, sh-utils, and textutils packages.
1129 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
1131 2002-08-02 Paul Eggert <eggert@twinsun.com>
1133 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
1135 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
1136 (hard_LC_COLLATE): New var.
1137 (different): Args are now char *, not const char *.
1138 Use xmemcoll instead of memcmp to compare lines, so that
1139 LC_COLLATE has effect. However, use memcmp if it is an
1141 (check_file): Do not include newline in comparison, so that
1142 xmemcoll has a byte to stomp on temporarily.
1143 (main): Set hard_LC_COLLATE.
1145 2002-07-29 Jim Meyering <jim@meyering.net>
1147 * Makefile.am (SUBDIRS): Remove djgpp, for now.
1149 2002-07-08 Jim Meyering <jim@meyering.net>
1151 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
1152 rather than the hard-coded `sh-utils'.
1154 2002-07-01 Jim Meyering <jim@meyering.net>
1156 * configure.ac: Merge the three files from fileutils,
1157 textutils, and sh-utils.
1158 * Makefile.am: Likewise.
1159 * src/Makefile.am: Likewise.
1162 version-control: never