1 2003-03-08 Jim Meyering <jim@meyering.net>
5 * src/Makefile.am (check-misc): Check for use of `defined' in
7 Change to $(srcdir) before running grep.
9 * src/sleep.c: Remove now-unused #include and #define directives.
11 * src/du.c (process_file): If a file's size is not being counted
12 e.g., because it's a hard link to a file we've already counted,
13 then don't print a line for it.
15 * tests/du/hard-link: New test for the above-fixed bug.
16 * tests/du/Makefile.am (TESTS): Add hard-link.
19 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
20 and make the two-array approach work.
22 * tests/du/basic: Correct/add tests for the above fix.
23 Set LC_ALL, etc., now that we use sort.
24 Check the block/size of a small file, too.
25 Correct expected results for simple dir1/dir2/file case.
26 Add another test of du -S.
28 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
30 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
31 middle-end/9986). As one of GCC's optimizations, it transforms a
32 fputs_unlocked call to a fputc_unlocked call when the string is
33 one character long. However, hpux doesn't have fputc_unlocked.
35 * expr.c (usage): Use putchar, not fputs, to output a single character.
36 * ls.c (dired_dump_obstack): Likewise.
37 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
38 * stat.c (print_it): Likewise.
40 2003-03-07 Jim Meyering <jim@meyering.net>
42 * src/cp.c: Remove everything associated with mmap-stack.c.
43 This reverts the two changes of 2003-02-21.
44 * src/du.c: Remove everything associated with mmap-stack.c.
45 This reverts the change of 2003-02-19.
47 2003-03-06 Jim Meyering <jim@meyering.net>
49 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
50 CDPATH shell variable set could cause this test to fail.
51 Reported by Karl Berry.
53 2003-03-05 Jim Meyering <jim@meyering.net>
57 * src/printf.c (print_esc): Remove pointless comparison of unsigned
58 integer with zero, to avoid a warning from Intel's ecc.
59 Reported by Nelson Beebe.
61 * src/du.c (process_file): Sizes must all be of type uintmax_t.
62 Otherwise, for files or totals that are too big, numbers would
63 be truncated. Patch mostly by Michael Stone.
64 Reported by Ingo Saitz as Debian bug #183210.
66 * tests/du/8gb: New test for the above-fixed bug.
67 * tests/du/Makefile.am (TESTS): Add 8gb.
69 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
70 rather than UTILS_OPEN_MAX - 10.
72 2003-03-04 Jim Meyering <jim@meyering.net>
74 * README: Refer new feature discussion to bug-coreutils@gnu.org,
75 rather than bug-gnu-utils, now that the former is better known.
76 Suggestion from Göran Uddeborg.
78 * src/stat.c (usage): Capitalize consistently.
79 Reported by Göran Uddeborg.
81 * Makefile.maint (rel-files): Include $(signatures), so that
82 those files are also copied into $(release_archive_dir).
84 * src/df.c (find_mount_point): Call error here, now that restore_cwd
86 * src/remove.c (AD_pop_and_chdir): Likewise.
88 * tests/Makefile.am (check-root): Add fail-2eperm.
90 2003-03-03 Jim Meyering <jim@meyering.net>
92 * src/remove.c (remove_cwd_entries): Include the full filename of
93 the offending file, not just the basename.
95 * tests/misc/tty-eof: Set $ME properly.
97 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
98 Remove now-unused variables.
99 (tag-prev-version, prev-cvs-tag): Likewise.
101 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
102 accurate diagnostic when failing to remove a file owned by some other
103 user. Reported by Ivo Timmermans via Michael Stone.
104 This fixes Debian bug# 178471.
106 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
107 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
108 Based on a report from Ivo Timmermans.
110 2003-03-02 Jim Meyering <jim@meyering.net>
112 * src/copy.c (copy_internal) [un_backup]: When recovering from a
113 failure to create a hard link, do not remove the entry associating
114 the source dev/ino with the destination file name.
115 * tests/mv/Makefile.am (TESTS): Add hard-3.
116 * tests/mv/hard-3: New test, for the above-fixed bug.
117 Inspired by a report from Iida Yosiaki.
119 2003-03-01 Jim Meyering <jim@meyering.net>
121 * src/df.c (print_header): Don't embed spaces in a separate `Type'
122 header string. Instead, put `Filesystem' and `Type' headers in the
123 same string, so translators can use horizontal space as needed.
124 Reported by Jean Charles Delepine.
126 2003-02-28 Jim Meyering <jim@meyering.net>
128 * src/copy.c (copy_internal): When link fails because of an
129 existing destination file, unlink that file and try again.
130 Reported by Iida Yosiaki.
132 * tests/mv/Makefile.am (TESTS): Add hard-2.
133 * tests/mv/hard-2: New test for the above-fixed bug.
134 Based on a test case from Iida Yosiaki.
136 2003-02-26 Jim Meyering <jim@meyering.net>
138 * tests/du/basic: Don't test du's -b option here. Directory byte
139 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
140 and IBM AIX 4.2. Reported by Nelson Beebe.
142 2003-02-25 Jim Meyering <jim@meyering.net>
144 * Makefile.maint (announcement): Now that ChangeLog entries
145 are output by announce-gen, don't do it here.
146 * announce-gen (print_changelog_deltas): New function.
149 2003-02-22 Jim Meyering <jim@meyering.net>
151 * announce-gen: New option: --release-type=TYPE
152 * Makefile.maint (beta, major): New targets. Remove `release'.
153 Put them all together on a line.
154 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
155 invocation of `announcement'.
156 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
158 * announce-gen: New option: --news=NEWS_FILE.
159 Extract NEWS entries here, not via rules in Makefile.maint.
160 * Makefile.maint (announcement): Now that NEWS entries are
161 extracted by announce-gen, don't do it here.
162 (news-r1, news-r2): Remove now-unused definitions.
164 2003-02-21 Jim Meyering <jim@meyering.net>
168 Merge in changes from autoconf's version of this file.
169 * Makefile.maint (www-gnu): Define.
170 (standards.texi-url_prefix): Use $(www-gnu).
171 (make-stds.texi-url_prefix): Likewise.
173 * src/cp.c: Include "mmap-stack.h".
174 (main): Invoke `run' through a macro that (when possible) runs it
175 with a large, mmap'd stack.
177 * src/cp.c (run): New function, preparing for the above.
178 Exit from this function, not from main
181 * src/du.c: New option: --apparent-size.
182 (enum) [APPARENT_SIZE_OPTION]: New member.
183 (long_options): Add it.
184 (usage): Describe it.
186 ['b']: Set apparent_size.
187 David Eisner reported that the behavior of --bytes had changed.
188 Paul Eggert proposed the use of a new option, --apparent-size.
190 * src/du.c (apparent_size): New global.
191 (print_only_size): Reflect the fact that we're printing byte counts,
192 not ST_NBLOCKSIZE-byte-block counts.
193 (print_size): Call print_only_size rather than duplicating its code.
194 (process_file): Accumulate byte counts, rather than block counts.
196 * src/du.c (process_file): Always reset size_to_propagate_to_parent
197 for --separate-dirs (-S).
199 2003-02-20 Jim Meyering <jim@meyering.net>
201 * Use automake-1.7.3. Regenerate dependent files.
203 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
204 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
205 (usage) [%B]: Describe it.
208 * src/du.c (process_file): Reorganize the code to use only
209 one `sum' array, and change how -S works back to the way it was
210 before 2003-01-31. Patch by Bruno Haible.
212 * tests/du/basic: New test.
213 * tests/du/Makefile.am (TESTS): Add basic.
215 * tests/envvar-check: Add checks for the following:
216 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
218 * tests/Makefile.am: Rename phony target envvar-check to evar-check
219 so as not to conflict with the distributed file by the same name.
221 * src/du.c (process_file): Set info->skip before any possible return.
223 Report correct usage for directories, not 0.
224 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
225 _before_ recording the dev/ino of a directory.
226 Reported by Bruno Haible.
228 Now, df always displays the device file name corresponding to the
229 listed mount point under `Filesystem'. Before, for an unmounted
230 block- or character-special file argument, it would display the
231 command-line argument instead.
232 * src/df.c (show_disk): Return a value indicating whether
233 there was a match. Don't try to find a mount point here.
234 (show_entry): If show_disk doesn't find a match, call show_point.
236 2003-02-19 Jim Meyering <jim@meyering.net>
238 * src/du.c: Include "mmap-stack.h".
239 (du_files): Add prototype with ATTRIBUTE_NORETURN.
240 Exit from this function, not from...
242 Instead, if possible, invoke du_files through a macro that
243 runs it with a large, mmap'd stack.
245 * src/join.c (usage): Change wording in --help output:
246 use FILENUM instead of `SIDE' and say what FILENUM means.
247 Reported by Bernhard Gabler.
249 * src/df.c (print_header): Rather than using a hard-coded literal
250 string of spaces matching the length of the English `...Type' header,
251 output the right number of spaces to match the selected translation.
252 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
254 * src/split.c (bytes_split): Remove unnecessary `else' after break.
255 (lines_split): Likewise. and correct misleading indentation.
257 * src/split.c: Include "full-read.h".
258 (bytes_split, lines_split, line_bytes_split): Use full_read,
259 not safe_read. The way split was using the latter, a short read
260 could cause split to terminate before EOF.
262 * tests/misc/tty-eof: Test all programs that can read stdin,
263 requiring no arguments and that write to standard output.
265 * tests/misc/tty-eof: New file. Renamed from ...
266 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
267 * tests/misc/Makefile.am (TESTS): Reflect renaming.
269 2003-02-18 Jim Meyering <jim@meyering.net>
271 cksum would perform an extra read after encountering EOF
272 * src/cksum.c (cksum): Exit the loop upon EOF, too.
273 Patch by Michael Bacarella.
275 Test for the bug fixed today in cksum, md5sum, and sha1sum.
276 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
277 cat, cksum, md5sum, and sha1sum all in the same loop.
279 2003-02-14 Jim Meyering <jim@meyering.net>
281 * src/remove.c: Include "euidaccess.h".
282 Remove declaration of euidaccess.
284 2003-02-12 Jim Meyering <jim@meyering.net>
286 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
287 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
289 2003-02-10 Jim Meyering <jim@meyering.net>
291 * src/test.c: Don't include group-member.h.
292 Include euidaccess.h.
293 (eaccess): Rewrite function to set the real uid and gid temporarily
294 to the effective uid and gid, then invoke 'access', and then set the
295 real uid and gid back. On systems that lack setreuid or setregid,
296 fall back on the kludges in euidaccess. Before, it would not work
297 for e.g., files with ACLs, files that were marked immutable,
298 or on file systems mounted read-only. Nelson Beebe raised the issue.
299 Paul Eggert suggested the new implementation.
301 2003-02-09 Jim Meyering <jim@meyering.net>
303 * src/test.c (test_stat): Remove function. It's job is done (only
304 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
306 2003-02-08 Jim Meyering <jim@meyering.net>
310 * tests/mv/part-symlink: Don't assume that the file owner username
311 length is less than 9 in ls output: instead, omit that field
312 altogether. Reported by, and suggested fix from, Ferdinand.
314 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
315 * tests/du/Makefile.am (TESTS): Add restore-wd.
317 * src/rm.c: Correct now-invalid comment about cycle-detection.
319 2003-02-06 Jim Meyering <jim@meyering.net>
321 * NEWS: Add entries from old/*/NEWS
322 from fileutils-4.1 through 4.1.11 and
323 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
327 * src/du.c (process_file): Don't return early for excluded files
328 or for files whose dev/inode we've already seen.
330 2003-02-05 Jim Meyering <jim@meyering.net>
332 * tests/du/exclude: New file.
333 * tests/du/Makefile.am (TESTS): Add exclude.
335 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
337 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
338 Fix memory allocation arithmetic.
340 2003-02-04 Jim Meyering <jim@meyering.net>
342 `df /dev/block-or-char-device-file--not-mounted' now reports
343 the name of the file system on which the file resides, usually `/'.
344 Before, it would leave the `Mounted on' field blank.
345 * src/df.c (show_disk): Move function to precede find_mount_point.
346 (show_disk): Add parameter: STATP.
347 If we don't find a matching device name, then resort to calling
348 find_mount_point. Reported by Bob Proulx.
350 2003-02-03 Andreas Schwab <schwab@suse.de>
352 * tests/rm/cycle: Require non-root.
353 * tests/rm/isatty: Likewise.
355 2003-02-02 Jim Meyering <jim@meyering.net>
359 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
361 Ensure that there are no offending uses of `:'.
362 * Makefile.maint (makefile_path_separator_check): New rule.
363 (local-check): Add it to the list.
365 2003-02-01 Jim Meyering <jim@meyering.net>
367 * src/du.c (MAX_N_DESCRIPTORS): Define.
369 * src/stat.c (G_fail): New global.
370 (human_time): Diagnose failed localtime, not failed nstrftime.
371 (main): Fail if G_fail is set.
373 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
375 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
376 hard-coding the path-separator. Also double-quote the new PATH,
377 to avoid problems when the path-separator is a semi-colon or when
378 `pwd` contains e.g. a space.
379 * tests/chgrp/Makefile.am: Likewise.
380 * tests/chmod/Makefile.am: Likewise.
381 * tests/chown/Makefile.am: Likewise.
382 * tests/cp/Makefile.am: Likewise.
383 * tests/dd/Makefile.am: Likewise.
384 * tests/dircolors/Makefile.am: Likewise.
385 * tests/du/Makefile.am: Likewise.
386 * tests/expr/Makefile.am: Likewise.
387 * tests/factor/Makefile.am: Likewise.
388 * tests/fmt/Makefile.am: Likewise.
389 * tests/install/Makefile.am: Likewise.
390 * tests/ln/Makefile.am: Likewise.
391 * tests/ls/Makefile.am: Likewise.
392 * tests/ls-2/Makefile.am: Likewise.
393 * tests/md5sum/Makefile.am: Likewise.
394 * tests/misc/Makefile.am: Likewise.
395 * tests/mkdir/Makefile.am: Likewise.
396 * tests/mv/Makefile.am: Likewise.
397 * tests/od/Makefile.am: Likewise.
398 * tests/rm/Makefile.am: Likewise.
399 * tests/rmdir/Makefile.am: Likewise.
400 * tests/seq/Makefile.am: Likewise.
401 * tests/sha1sum/Makefile.am: Likewise.
402 * tests/shred/Makefile.am: Likewise.
403 * tests/stty/Makefile.am: Likewise.
404 * tests/sum/Makefile.am: Likewise.
405 * tests/tail-2/Makefile.am: Likewise.
406 * tests/touch/Makefile.am: Likewise.
407 * tests/tsort/Makefile.am: Likewise.
408 * tests/unexpand/Makefile.am: Likewise.
410 2003-01-31 Jim Meyering <jim@meyering.net>
412 * src/stat.c: Include "file-type.h"
413 (print_human_type): Remove function.
414 (human_access): Rename from print_human_access. Return a string.
415 (human_time): Rename from print_human_time. Return a string.
416 (print_stat): Arrange so that field width and an alignment specifier
417 are honored for the %A, %F, %x, %y, and %z formats.
418 [%F]: Use file_type; this gives slightly different file type strings,
419 e.g., `directory' instead of `Directory' and `regular file' or
420 `regular empty file' instead of `Regular file'.
421 Prompted by a report from Richard Dawe that the uses of
422 S_IFSOCK and S_IFIFO in print_human_time were not portable
423 to systems using e.g., DJGPP.
425 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
427 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
428 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
430 2003-01-31 Jim Meyering <jim@meyering.net>
432 * src/du.c (main): Upon processing an invalid option or an invalid
433 --exclude-from or --max-depth option argument, don't exit right away,
434 in case there are others. Rather record the failure and exit after
435 processing other options.
437 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
438 tar archive easier to reproduce.
440 Rewrite to perform directory traversal using nftw.
442 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
444 (opt_one_file_system): Move global into `main'.
445 (path, xstat, exit_status): Remove declarations.
446 (arg_length, suffix_length): New globals.
447 (G_fail): New global, sort of like the old `exit_status'.
448 (IS_FTW_DIR_TYPE): Define.
449 (print_only_size): New function.
450 (process_file): New function.
451 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
452 (str_trunc, pop_dir, count_entry): Likewise.
453 (du_files): Rewrite to use nftw.
455 2003-01-30 Jim Meyering <jim@meyering.net>
457 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
458 symlink-to-directory with -L, even without the trailing slash.
460 2003-01-27 Jim Meyering <jim@meyering.net>
462 * src/Makefile.am (check-misc): Check for st_blocks, too.
464 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
465 Reported by Richard Dawe.
467 2003-01-27 Andreas Schwab <schwab@suse.de>
469 * src/ls.c (quote_name): Add fourth parameter, width, into which to
470 store the screen columns, and return the number of bytes instead.
471 (print_dir): Pass NULL as fourth parameter of quote_name.
472 (print_name_with_quoting): Likewise.
473 (length_of_file_name_and_frills): Get the width from the fourth
474 parameter of quote_name instead of return value.
476 2003-01-27 Jim Meyering <jim@meyering.net>
478 * src/ls.c (decode_switches): If `dired' is set without
479 `format == long_format', then silently reset dired. This doesn't
480 change the behavior of ls (all prior uses of dired were protected
481 by `&& format == long_format'), and lets us...
482 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
483 (PUSH_CURRENT_DIRED_POS): Likewise.
486 2003-01-22 Jim Meyering <jim@meyering.net>
488 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
489 * tests/du/Makefile.am (TESTS): Add no-x.
491 2003-01-21 Jim Meyering <jim@meyering.net>
493 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
494 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
495 it may still be a directory -- or not (e.g., with FreeBSD on an
496 NFS-mounted file system), so resort to calling lstat to find out.
497 Based on a patch by Michael van Elst.
499 * tests/cp/same-file: Don't assume that the file owner username
500 length is less than 9 in ls output: instead, omit that field
501 altogether. Reported by, and suggested fix from, Ferdinand.
503 2003-01-20 Jim Meyering <jim@meyering.net>
505 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
506 large format widths no longer cause strftime to infloop.
508 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
510 2003-01-19 Jim Meyering <jim@meyering.net>
512 * src/readlink.c: Include "canonicalize.h".
514 2003-01-18 Jim Meyering <jim@meyering.net>
516 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
518 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
519 (long_options): Add option --dereference-command-line-symlink-to-dir.
520 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
521 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
522 -d, -F, -l options is specified.
523 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
524 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
525 Change --dereference-command-line (-H) to dereference *all*
526 command line arguments, including broken symlinks.
528 2003-01-15 Paul Eggert <eggert@twinsun.com>
530 Change ls -H back to the way it was yesterday, since this is
531 compatible with FreeBSD and the POSIX spec is confusing
532 and somewhat contradictory.
534 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
535 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
536 (long_options): Change the long option name back.
537 (usage): Change the usage back.
538 (gobble_file): When -H is specified, dereference a top-level
539 arg even if it points to a non-directory.
541 2003-01-15 Jim Meyering <jim@meyering.net>
543 * src/ls.c (gobble_file): Fall back on using lstat when required:
544 when --dereference (-L) is not specified, and
545 - when operating on a dangling symlink
546 - when operating on command-line-symlink-to-directories
547 This fixes numerous problems. Here are examples:
548 - `ls dangling-symlink' would fail with `no such file...'
549 Now it prints `dangling-symlink'.
550 - `ls -i symlink' would mistakenly print the inode of the referent.
551 Now it prints the inode of the symlink. Likewise for --size (-s).
552 Based on a patch from Michael Stone.
553 Reported by Deepak Goel as Debian bug #173793.
555 Rename ls's --dereference-command-line (-H)
556 option to --dereference-command-line-symlink-to-dir.
557 * src/ls.c [enum Dereference_symlink]
558 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
559 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
560 (long_options): Rename the long option.
561 (usage): Say that --dereference-... changes how ls treats
562 only symlinks to directories specified on the command line.
564 2003-01-14 Jim Meyering <jim@meyering.net>
566 * tests/ls/dangle: New file/test, for the above fix.
567 * tests/ls/inode: Another new file/test, for the above fix.
568 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
570 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
571 so that ls --color would no longer highlight the names of files with
572 the execute bit set when not specified on the command line.
573 Patch by Michael Stone. Reported by Stephen Depooter as
576 * tests/ls-2/tests (color-exe): New test, for the above fix.
578 2003-01-13 Jim Meyering <jim@meyering.net>
580 * tests/shred/exact: Also test for just fixed bug with --zero.
582 * src/shred.c (long_opts): --zero does not require an argument.
583 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
585 2003-01-12 Jim Meyering <jim@meyering.net>
587 * Makefile.maint (cvs-update): Skip any file with local modifications.
589 * src/unexpand.c (usage): Document --first-only and mention that
590 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
592 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
594 * src/df.c: Include "canonicalize.h".
595 Use canonicalize_file_name unconditionally.
597 2003-01-09 Jim Meyering <jim@meyering.net>
599 * README: Add readlink.
601 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
603 * src/df.c: Include "xgetcwd.h".
604 * src/pwd.c: Likewise.
606 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
608 * src/shred.c: Remove declaration of xstrdup.
609 We already get it via xalloc.h which is included via system.h.
611 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
613 New program: readlink.
615 * src/Makefile.am (bin_PROGRAMS): Add readlink.
616 * src/readlink.c: New file.
618 * man/readlink.x: New file.
619 * man/Makefile.am (dist_man_MANS): Add readlink.1.
620 (readlink.1): New rule.
622 2003-01-09 Jim Meyering <jim@meyering.net>
624 When selecting ranges of byte offsets (as opposed to ranges of fields)
625 and when --output-delimiter=STRING is specified, output STRING between
626 ranges of selected bytes.
627 * src/cut.c (RANGE_START_SENTINEL): Define.
628 (output_delimiter_specified): New global.
629 (print_kth): Add parameter. Adjust all callers.
630 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
631 (cut_bytes): When requested, output STRING between ranges of
633 (main): Make a diagnostic a little clearer.
634 Based on a patch from Jan Nieuwenhuizen.
636 * tests/cut/Test.pm: New tests for the above.
638 * src/cut.c (set_fields): Make code agree with comment:
639 Don't merge abutting ranges like 4- and 2-3. This makes no
640 difference currently, but is required to support an upcoming change.
642 2003-01-07 Jim Meyering <jim@meyering.net>
644 * src/cut.c (set_fields): Fix typo in comment.
646 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
647 * tests/touch/Makefile.am (TESTS): Add not-owner.
648 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
649 Now, this tests only the nonexistent-directory diagnostic.
650 Suggestion from Michael Stone.
652 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
654 2003-01-04 Jim Meyering <jim@meyering.net>
656 * src/copy.h: Remove use of PARAMS.
657 * src/remove.h: Likewise.
658 * src/chown-core.h: Likewise.
660 rm could be tricked into mistakenly reporting a cycle.
661 * src/remove.c: [cycle_check_state]: New global.
662 (remove_cwd_entries): Adapt to new semantics of cycle_check.
663 (rm): Call cycle_check_init and cycle_check_free for each file.
664 * tests/rm/cycle (rm): New test, for the above fix.
665 * tests/rm/Makefile.am (TESTS): Add cycle.
667 When rm detects a cycle, don't abort the entire command,
668 but rather just the affected command line argument.
669 * src/remove.c: Include <setjmp.h>
670 (struct dirstack_state) [current_arg_jumpbuf]: New member.
671 (remove_cwd_entries): Call longjmp if we detect a cycle.
672 (rm): Call setjmp here.
674 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
675 Instead, include cycle-check.h and use it.
677 * src/remove.h (struct dev_ino): Remove declaration.
679 * src/remove.c (remove_cwd_entries): Fix typos in comment.
681 Don't include trailing /. in diagnostics about directories.
682 * src/remove.c (full_filename_): When FILENAME is just `.'
683 and there is a nonempty directory-name part, don't append `/.'.
684 * tests/rm/unread2: Remove trailing /. from diagnostic.
685 * tests/rm/rm2: Likewise.
687 * src/remove.c (struct dirstack_state): Define.
688 To be used in place of these file-scoped globals ...
689 (dir_stack, len_stack, Active_dir): Remove globals.
690 (ds_init, ds_free): New functions.
691 (full_filename): Define.
692 (full_filename_): Rename from full_filename.
694 Begin to make AD_* functions more generic.
695 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
697 (AD_INIT_OTHER_MEMBERS): Define.
698 (remove_dir): Define the `status' member manually after each
699 call to AD_push or AD_push_initial.
701 * src/Makefile.am (check-misc): New rule, to ensure that no more
702 S_IS* macro definitions sneak into the code.
703 (check): Depend on check-misc.
705 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
706 * src/du.c (count_entry) [S_ISLNK]: Don't define.
707 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
709 2003-01-03 Jim Meyering <jim@meyering.net>
711 * src/true.c: Add copyright.
712 (AUTHORS): I suppose I've written it.
714 * src/Makefile.am (false.c): Make the generated file be read-only.
716 2003-01-04 Jim Meyering <meyering@lucent.com>
718 * src/ls.c: Include "dev-ino.h".
719 [struct dev_ino]: Remove declaration.
721 2003-01-02 Jim Meyering <meyering@lucent.com>
723 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
724 from mv: s/missing file arguments/missing file argument/.
725 With --target-directory=DIR, cp and mv work with a single file argument.
726 Reported by Karl Berry.
728 * tests/rm/isatty: Enable this test.
730 2002-12-31 Jim Meyering <meyering@lucent.com>
732 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
734 (AD_INIT_OTHER_MEMBERS): Define.
735 (remove_dir): Define the `status' member manually after each
736 call to AD_push or AD_push_initial.
738 * src/ls.c [struct dev_ino]: Remove definition.
739 Include "dev-ino.h" instead.
741 2002-12-28 Jim Meyering <meyering@lucent.com>
743 * tests/du/Makefile.am (TESTS): Add no-deref.
744 * tests/du/no-deref: New script.
746 2002-12-23 Jim Meyering <meyering@lucent.com>
748 * src/remove.c (remove_cwd_entries): Fix typo in comment.
750 2002-12-21 Jim Meyering <jim@meyering.net>
752 * announce-gen: Generate MML-formatted announcement.
753 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
755 2002-12-20 Jim Meyering <jim@meyering.net>
757 * src/touch.c (touch): Change the wording of a diagnostic so
758 that it makes sense both when the file exists and when it doesn't.
759 Suggestion from Michael Stone.
761 2002-12-18 Jim Meyering <jim@meyering.net>
763 * src/stty.c (valid_options): Declare to be static.
765 2002-12-15 Jim Meyering <jim@meyering.net>
767 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
769 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
770 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
771 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
772 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
773 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
775 * src/remove.c (PARAMS): Remove definition.
776 * src/sys2.h: Likewise.
778 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
779 Include strftime.h instead.
781 2002-12-14 Jim Meyering <jim@meyering.net>
783 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
785 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
786 This is necessary at least for Irix6.5 when using c89.
787 Reported by Nelson Beebe.
789 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
791 * tests/misc/cat-tty-eof: New test.
793 * src/mknod.c (usage): Specify how major and minor mode numbers
794 are interpreted. Report forwarded by Kristin E Thomas.
795 * src/mknod.c: Remove now-redundant usage-specifying comment.
797 2002-12-13 Jim Meyering <jim@meyering.net>
801 * tests/du/trailing-slash: Allow for a directory of size `0'.
802 That happens at least on file systems of type tmpfs on linux-2.4.18.
804 * announce-gen: New script to begin replacing the commands
805 associated with the rule here...
806 * Makefile.maint (announcement): Invoke announce-gen.
807 * Makefile.am (EXTRA_DIST): Add announce-gen.
809 * tests/cp/preserve-2: New file/test, for latest fix.
810 * tests/cp/Makefile.am (TESTS): Add preserve-2.
812 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
814 Fix a bug whereby cp would fail to parse an option like
815 --preserve=mode,ownership.
816 * src/cp.c (decode_preserve_arg): Advance `comma' to
817 point the character following the comma.
819 2002-12-11 Jim Meyering <jim@meyering.net>
821 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
822 in case it's already defined.
824 2002-12-09 Jim Meyering <jim@meyering.net>
826 * tests/touch/fail-diag: Don't get a test failure if /no exists.
827 Instead, evoke a framework failure if /no-$$ exists.
828 Reported by Michael Stone.
830 2002-12-08 Jim Meyering <jim@meyering.net>
832 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
833 Define to rpl_lstat, so that even on systems like Solaris 2.8,
834 du honors (per POSIX) the trailing slash on an argument referring
835 to a symlink-to-directory.
837 2002-12-06 Jim Meyering <jim@meyering.net>
839 * Use autoconf-2.57. Regenerate dependent files.
840 * Use automake-1.7.2. Regenerate dependent files.
842 * src/ls.c (gobble_file): Also stat the file if it's a
843 regular file and --indicator-style=classify (aka -F).
844 Thanks to Ed Santiago for opening my eyes.
846 * tests/ls/file-type: New file. Test for the above.
847 A test to contrast ls -F and ls --indicator-style=file-type.
848 * tests/ls/Makefile.am (TESTS): Add file-type.
850 2002-12-04 Jim Meyering <jim@meyering.net>
852 * tests/ls/follow-slink: Make sure the symlink was created.
853 Richard Dawe reported that `ln -s link link' succeeds, but creates
854 no file on systems running some version of the DJGPP libc.
856 2002-12-03 Jim Meyering <jim@meyering.net>
858 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
859 since this package no longer panders to K&R compilers.
861 2002-12-02 Jim Meyering <jim@meyering.net>
863 * tests/du/slink: Skip this test if `.' is on a non-local file system.
865 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
866 something to replace.
868 2002-12-01 Jim Meyering <jim@meyering.net>
870 * src/stat.c: Don't include <string.h> or <ctype.h>.
871 That's already done via system.h.
872 * src/dircolors.c: Don't include <ctype.h>.
874 2002-11-30 Jim Meyering <jim@meyering.net>
876 * ls.c (gobble_file): Remove the block of code that caused
877 `ls --color -F symlink-to-dir' to list the files in
878 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
879 like `ls -F symlink-to-dir') but with the addition of highlighting.
880 Similarly, `ls --color -dF symlink-to-dir' would print
881 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
882 Reported by Jeff Sheinberg as Debian bug #168203.
883 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
885 ls is now more efficient: with certain options, it no longer needs
886 to stat each directory entry on systems with valid dirent.d_type.
887 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
888 (main): Make --recursive set format_needs_type, not format_needs_stat.
889 (gobble_file): Remove a FIXME comment, now that it's fixed.
891 2002-11-24 Jim Meyering <jim@meyering.net>
893 * src/du.c (du_files): Don't strip any trailing slash.
894 Rewrite so that `/' is no longer represented internally as
896 (count_entry): When appending a file name component,
897 account for the fact that the current path may end in `/'.
898 François Pinard reported that `du symlink-to-dir/' was not
899 equivalent to `du symlink-to-dir/.'. Now it is.
900 * tests/du/trailing-slash: New file/test, for the above fix.
901 * tests/du/Makefile.am (TESTS): Add trailing-slash.
903 2002-11-23 Jim Meyering <jim@meyering.net>
905 * src/tac.c (output): Declare some local variables to be of type size_t,
906 rather than `int' to avoid warnings from gcc.
908 2002-11-21 Paul Eggert <eggert@twinsun.com>
910 * src/ls.c (decode_switches): Use case-sensitive matching to
911 decode the QUOTING_STYLE environment variable. This is more
912 consistent with the documentation, and with --quoting-style.
914 2002-11-21 Martin Buck <martin.buck@ascom.ch
916 * src/stty.c (struct speeds): Add support for all baud rates defined
919 2002-11-19 Jim Meyering <jim@meyering.net>
921 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
922 run in a UTF locale. Report and suggested fix by Bruno Haible.
923 * tests/fmt/basic: Likewise.
925 2002-11-17 Jim Meyering <jim@meyering.net>
927 * configure.ac: Update via autoupdate.
928 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
930 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
931 Reported by Hans Ginzel.
933 2002-11-15 Jim Meyering <jim@meyering.net>
935 * Makefile.cfg (gnu_rel_host): Define.
936 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
937 on whether $(VERSION) looks like a major release number.
939 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
940 (release): Rename from `alpha'.
941 (alpha): Depend on release.
943 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
945 2002-11-14 Jim Meyering <jim@meyering.net>
947 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
948 (announcement): Use the new variable.
950 * Makefile.maint: Sync with Bison, i.e.:
951 (po-check): Scan .l and .y files instead of the
952 .c and the .h files that they generate. This fixes the bug
953 reported by Tim Van Holder in:
954 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
955 Look for N_ as well as for _. Try to avoid matching #define for
959 2002-11-12 Jim Meyering <jim@meyering.net>
961 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
962 Replace sole use with equivalent `#ifdef S_ISLNK'.
963 Inconsistency reported by Dmitry V. Levin.
965 2002-11-11 Jim Meyering <jim@meyering.net>
967 * src/stat.c (usage): Transform --help items output via s/ - / /,
968 so that help2man produces properly formatted man pages.
969 Reported by Herbert Xu as Debian bug #168400.
971 2002-11-10 Jim Meyering <jim@meyering.net>
973 * src/ls.c (sighandler): Handle SIGTSTP specially.
974 Based on suggestions from Solar Designer and Dmitry V. Levin.
977 * Makefile.cfg (cvs_files): Define. From autoconf.
978 (local_updates): Likewise.
980 * src/ls.c (restore_default_color_handler, sigtstp_handler):
982 (sighandler): New function, based on the one in sort.c.
983 (main): Use sigaction, if possible; otherwise signal.
984 Handle these signals:
985 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
986 Don't register our handler if the signal is already being ignored.
988 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
989 * src/csplit.c (interrupt_handler): Likewise.
990 * src/sort.c (sighandler): Likewise.
991 (main): Declare `i' and `nsigs' to be unsigned, not int.
993 2002-11-09 Jim Meyering <jim@meyering.net>
995 ls --color: restore terminal text color upon signal.
996 * src/ls.c: Include "full-write.h" and <signal.h>.
997 (restore_default_color, restore_default_color_handler): New functions.
998 (sigtstp_handler, put_indicator_direct): New functions.
999 (main) [print_with_color]: Register signal handlers.
1000 Patch mostly by Solar Designer and Stanislav Ievlev.
1002 Update from autoconf.
1003 * Makefile.maint (AMTAR): Remove definition.
1004 (update, cvs-update, po-update, do-po-update): New rules.
1005 (wget-update): Update (thus renaming to cvs-update).
1006 (automake_repo): Use anoncvs@sources.redhat.com.
1008 2002-11-06 Jim Meyering <jim@meyering.net>
1010 * tests/misc/Makefile.am (TESTS): Add printf-hex.
1012 * tests/misc/printf: Be careful to test the code in this package,
1013 not the shell built-in function.
1015 * src/printf.c (print_esc): A hexadecimal escape sequence has
1016 at most two hex. digits, not three. Reported by Padraig Brady.
1017 (usage): Update description.
1018 * tests/misc/printf-hex: New file/test, for the above fix.
1020 2002-10-07 Paul Eggert <eggert@twinsun.com>
1022 Add support for locale-specific size indications (e.g.,
1023 thousands-separators) and for explicit size suffixes on output.
1025 * doc/coreutils.texi (Block size): Say that:
1026 This affects display format as well as block size.
1027 Fractional block counts are rounded up.
1028 ls file size blocksize defaults to 1.
1029 A block size spec preceded by ' generates thousands separators.
1030 A suffix without a preceding integer generates suffixes.
1031 (tail invocation): 32k -> 32 KiB.
1032 (What information is listed): ls -h is now equivalent to
1033 ls --block-size=human, and ls -H is now equivalent to
1034 ls --block-size=si. Displayed file size is now always affected by
1037 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
1038 lib/umaxtostr.c: New files, taken from GNU tar.
1040 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
1042 (EXTRA_DIST): Add inttostr.c.
1044 * lib/human.c, lib/human.h: Rewrite to support locale-specific
1045 notations like thousands separators.
1046 Specify what includer of include.h must include beforehand.
1047 (human_group_digits, human_suppress_point_zero, human_autoscale,
1048 human_base_1024, human_SI, human_B): New enum values.
1049 (human_readable): Rename from human_readable_inexact; put the
1050 options before the sizes. All uses changed. The old human_readable
1051 function has been removed; use inttostr.h instead.
1052 (human_options): Renamed from human_block_size, with new signature
1053 that allows block sizes up to UINTMAX_MAX. All callers changed.
1055 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
1056 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
1057 freestanding C89. No need to check for stdlib.h or string.h since
1058 autoconf does this now.
1060 * src/cksum.c (cksum): Use primitives from inttostr.h, not
1061 human.h, to print large numbers simply.
1062 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
1063 * src/dd.c (print_stats, main): Likewise.
1064 * src/df.c (print_header): Likewise.
1065 * src/factor.c (print_factors): Likewise.
1066 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
1067 * src/shred.c (dopass): Likewise.
1068 * src/sort.c (checkfp): Likewise.
1069 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
1070 * src/tail.c (xlseek): Likewise.
1071 * src/wc.c (write_counts, wc): Likewise.
1073 * src/df.c (human_output_opts): New var.
1074 (output_block_size): Now uintmax_t, not int, to handle larger
1075 block sizes. All uses changed.
1076 * src/du.c: Likewise.
1077 * src/ls.c: Likewise.
1079 * src/df.c (print_header): In the header line, prefer SI to human
1080 representation if it's shorter; if neither is shorter, try to
1081 intuit what the user would prefer.
1083 * src/expr.c (inttostr): Remove; use new imaxtostr library
1086 * src/ls.c (file_output_block_size): New var, to distinguish
1087 file sizes from other sizes.
1088 (decode_switches): Set it.
1090 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
1091 (dopass): When printing progress, use floor for what has been done
1092 so far (since we should be conservative there), and ceiling for
1093 what needs to be done (since that's what other programs use).
1095 2002-10-19 Jim Meyering <jim@meyering.net>
1097 * src/pinky.c (print_heading): Align TTY and Name headings.
1098 Reported by Karl Eichwalder.
1100 2002-10-18 Jim Meyering <jim@meyering.net>
1102 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
1103 Remove now-useless cast.
1104 (stdread): Remove function.
1105 (bytes_split): Use size_t instead of int.
1106 Use safe_read, not stdread.
1107 (lines_split): Likewise.
1108 Use memchr rather than a `while' loop.
1109 (line_bytes_split): Use size_t instead of int.
1110 Use safe_read, not stdread.
1111 (main): Add some FIXME comments to remind me to remove casts.
1113 * src/system.h (ST_BLKSIZE): Correct comment describing how to
1114 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
1116 2002-10-17 Jim Meyering <jim@meyering.net>
1118 Fix a problem that could make e.g., `cat' misbehave on systems which
1119 give invalid (unreasonably large) values for stat.st_blksize.
1120 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
1121 Reported by Petter Reinholdtsen.
1123 2002-10-14 Jim Meyering <jim@meyering.net>
1125 Specifying a printf conversion specifer as nl's separator string
1126 could cause nl to segfault.
1127 * src/nl.c (build_print_fmt): Don't include separator string
1128 in the printf format; it might contain `%'.
1129 Use a better bound on the length of the print_fmt buffer.
1130 (print_lineno): Print the separator here instead.
1131 Reported by Doug Coleman.
1133 * tests/misc/nl: New file/tests, including a test for the above.
1134 * tests/misc/Makefile.am (TESTS): Add nl.
1136 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
1137 * tests/misc/Makefile.am (TESTS): Add split-l.
1139 2002-10-13 Jim Meyering <jim@meyering.net>
1143 * src/du.c (usage): Tweak description of --dereference-args/-D.
1145 * src/du.c (count_entry): Also save cwd when dereferencing (via
1146 --dereference-args, -D) a command-line argument.
1147 Reported by Michal Svec. Based on a patch by Andreas Schwab.
1149 * src/Makefile.am (../AUTHORS): New target/rule.
1151 2002-10-12 Jim Meyering <jim@meyering.net>
1153 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
1154 of type size_t, since that's the way it's used and avoids a warning.
1156 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
1157 since that's how it's always used and avoids a new warning from gcc.
1158 (read_input): Adapt to new safe_read ABI.
1160 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
1163 * src/pinky.c (print_long_entry): fread returns size_t.
1164 Declare local `bytes' accordingly, to avoid warning.
1166 tail -c +N would perform an extra read after encountering EOF
1167 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
1168 * src/tail.c (start_bytes): Detect EOF, inform caller.
1169 (tail_bytes): Upon EOF in start_bytes, return immediately.
1170 (file_lines): Reorganize to use memrchr rather than an explicit loop.
1171 Adapt to new safe_read ABI.
1173 2002-10-11 Jim Meyering <jim@meyering.net>
1175 * tests/du/deref: New file/test, for the above fix.
1176 * tests/du/Makefile.am (TESTS): Add deref.
1178 2002-10-10 Jim Meyering <jim@meyering.net>
1180 * tests/ln/Makefile.am (TESTS): Add target-1.
1181 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
1183 2002-10-09 Jim Meyering <jim@meyering.net>
1185 * tests/cp/backup-is-src: Ensure that certain environment variables
1186 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
1188 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
1189 consume 4GB of disk space on systems without support for sparse files.
1190 Fix a logic error that'd make it `cat err' even though dd didn't fail.
1192 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
1193 Patch by steven@magelico.net, forwarded by Michael Stone.
1195 * tests/ls/dired: Ensure that ls produces English messages.
1196 Patch by Alexey Vyskubov, forwarded by Michael Stone.
1198 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
1200 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
1202 2002-10-08 Jim Meyering <jim@meyering.net>
1204 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
1205 Fix syntax in test: use =, not ==.
1206 Reported by Bob Proulx.
1207 Change all the rest like this: grep -lR "testing framework'" .\
1208 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
1210 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
1211 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
1212 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
1213 * src/wc.c (wc): Likewise.
1215 2002-10-07 Paul Eggert <eggert@twinsun.com>
1218 Don't advance the write pointer past the end of the write buffer.
1219 * src/sort.c (begfield, limfield): Likewise.
1221 2002-10-07 Jim Meyering <jim@meyering.net>
1223 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
1224 * src/head.c (head_bytes, head_lines): Likewise.
1226 2002-10-06 Jim Meyering <jim@meyering.net>
1228 * src/dd.c (scanargs): Ensure that specified block sizes (specified
1229 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
1230 (skip, dd_copy): Adapt to new safe_read ABI.
1232 * Makefile.maint (signatures): Define.
1234 (announcement): Depend on $(signatures).
1236 * Makefile.maint (announcement): Output all URLs for detached
1237 signatures, not just the last one from the previous loop.
1239 2002-10-05 Jim Meyering <jim@meyering.net>
1243 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
1244 don't recurse into directory, DIR. Prompted by a report from
1247 * tests/rm/i-no-r: New file/test, for the above fix.
1248 * tests/rm/Makefile.am (TESTS): Add i-no-r.
1250 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
1251 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
1253 2002-10-03 Jim Meyering <jim@meyering.net>
1255 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
1256 * src/df.c (AUTHORS): Likewise.
1257 * src/du.c (AUTHORS): Likewise.
1258 * src/tail.c (AUTHORS): Likewise.
1259 * src/touch.c (AUTHORS): Likewise.
1261 2002-10-02 Jim Meyering <jim@meyering.net>
1263 * Makefile.am (SUBDIRS): Remove `old'.
1264 (EXTRA_DIST): List the files in old/.
1265 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
1266 Suggestion from Akim Demaille.
1268 2002-10-01 Jim Meyering <jim@meyering.net>
1270 * src/sys2.h (SSIZE_MAX): Define.
1272 2002-09-30 Jim Meyering <jim@meyering.net>
1274 * src/csplit.c: Don't include stdlib.h here. It's already included
1277 2002-09-29 Jim Meyering <jim@meyering.net>
1279 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
1280 expression to avoid bogus warning from gcc.
1282 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
1283 (cat): Declare insize and outsize to be of type size_t, not int.
1284 Rearrange pointer/integer expressions to avoid bogus warnings.
1285 (main): Declare insize and outsize to be of type size_t, not int.
1287 * src/tail.c (parse_options): Give a sensible diagnostic for
1288 an invalid byte or line count. Reported by Mikko Tuumanen.
1290 * src/touch.c (main): Split a long line.
1292 * tests/du/Makefile.am (TESTS): Add slink.
1293 * tests/du/slink: New test for system.h change of 2002-08-31.
1295 In move mode, always first try to rename. Before, upon failure to
1296 rename a directory, this code would never attempt to rename any
1297 other file in that directory, but would thenceforth always copy.
1298 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
1299 may fail with EXDEV, yet renaming files within that directory to
1300 a newly-created destination directory succeeds.
1301 * src/copy.c (copy_internal): Remove local, move_mode;
1302 use x->move_mode instead. Based on a patch from Tom Haynes.
1304 2002-09-28 Jim Meyering <jim@meyering.net>
1306 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
1307 Factor out some duplication.
1309 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
1311 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
1313 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
1314 to avoid compiler warnings.
1316 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
1319 Fix things so `mkdir -p' can create very deep directories, e.g.,
1320 mkdir -p $(perl -e 'print "a/" x 40000') now works.
1321 * src/mkdir.c (main): For --parents (-p), call make_path with the
1322 entire directory name, so we don't ever require that file operations
1323 like stat or chmod be performed on the entire command line argument.
1324 * makepath.c (make_path): Restore umask *before* creating the final
1327 2002-09-27 Andreas Schwab <schwab@suse.de>
1329 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
1330 to avoid overflow. Reported by Hans Lermen.
1332 2002-09-26 Jim Meyering <jim@meyering.net>
1334 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
1336 2002-09-25 Jim Meyering <jim@meyering.net>
1338 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
1339 and add a cast, to avoid a warning about `signed and unsigned type in
1340 conditional expression'.
1342 2002-09-22 Jim Meyering <jim@meyering.net>
1344 * src/rmdir.c: Include "dirname.h", for declaration of
1345 strip_trailing_slashes.
1347 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
1348 Now they're defined through system.h.
1350 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
1351 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
1352 since it's already included from sys2.h via system.h.
1354 * Use automake-1.6f. Regenerate dependent files.
1356 * src/Makefile.am (PERL): Remove duplicate definition.
1358 fmt's -s, -t, -c options didn't work properly for long lines.
1359 Since get_line may end up calling put_paragraph (for long lines),
1360 be sure to set global, `other_indent', before it is used there.
1362 * src/fmt.c (set_other_indent): New function, factored out of...
1363 (get_paragraph): ... here. Call it.
1364 (get_line): Call set_other_indent before calling flush_paragraph,
1365 which calls fmt_paragraph, which in turn calls put_paragraph,
1366 which uses other_indent.
1368 * tests/fmt/Makefile.am (TESTS): Add long-line.
1369 * tests/fmt/long-line: New file/test, for the above fix.
1371 2002-09-21 Jim Meyering <jim@meyering.net>
1373 * src/od.c: No longer include deprecated <values.h>.
1374 It was required solely for now-removed reference to BITSPERBYTE.
1375 * src/install.c: Likewise.
1376 Suggestion from Bruno Haible.
1378 2002-09-06 Andreas Schwab <schwab@suse.de>
1380 `rmdir -p dir-specified-with-trailing-slash/' would fail.
1381 * src/rmdir.c (remove_parents): Strip trailing slashes.
1383 2002-09-20 Jim Meyering <jim@meyering.net>
1385 * tests/rmdir/t-slash: New file/test, for the above fix.
1386 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
1388 * Makefile.maint (announcement): Arrange to gpg-sign the message.
1389 Add a URL for each detached signature file.
1391 2002-09-07 Bruno Haible <bruno@clisp.org>
1393 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
1395 2002-09-18 Jim Meyering <jim@meyering.net>
1397 `od -t x8' used the wrong (`l'-prefixed) printf format.
1398 Likewise for the o8 and u8 formats.
1399 * src/od.c (ISPEC_TO_FORMAT): Define macro.
1400 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
1401 Reported by Arun Sharma.
1403 2002-09-17 Jim Meyering <jim@meyering.net>
1405 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
1406 From gettext's intl/loadmsgcat.c.
1408 * tests/od/x8: New file/test, for the above fix.
1409 * tests/od/Makefile.am (TESTS): Add x8.
1411 2002-09-15 Jim Meyering <jim@meyering.net>
1413 * Use autoconf-2.54. Regenerate dependent files.
1415 * src/csplit.c (get_format_width): Add cast to avoid
1416 warning about `signed and unsigned type in conditional expression'.
1418 2002-09-14 Jim Meyering <jim@meyering.net>
1420 * src/who.c (print_user): Change type of local to size_t
1421 to avoid warnings about `comparison between signed and unsigned'.
1422 * src/ptx.c (generate_all_output): Likewise.
1424 * src/dd.c (main, skip): Add casts to avoid warnings about
1425 `comparison between signed and unsigned'.
1427 * src/id.c (print_full_info, print_group_list): Add casts to avoid
1428 warnings about `signed and unsigned type in conditional expression'.
1430 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
1431 to avoid warnings about `comparison between signed and unsigned'.
1432 (split_3): Change parameter names to be readable and add comment.
1433 Clean up the test for whether a line may be ignored.
1435 2002-09-13 Jim Meyering <jim@meyering.net>
1437 * src/printf.c (main): Handle leading command line argument of `--'.
1438 Reported by Raul: DervishD <raul@pleyades.net>
1439 * tests/misc/printf: New file: test for the above.
1440 * tests/misc/Makefile.am (TESTS): Add printf.
1442 * src/date.c (usage): Explain that %S's range of [0..60] is required --
1443 rather than 0..59 -- to accommodate the occasional positive leap second.
1444 Reported by Richard Neill.
1446 2002-09-12 Jim Meyering <jim@meyering.net>
1448 * src/Makefile.am (nanosec_libs): Define.
1449 (sleep_LDADD, tail_LDADD): Use it here.
1451 Factor nanosleep-related code into ../lib/xnanosleep.c.
1452 * src/sleep.c: Include xnanosleep.h.
1453 Factor out fenv.h-related code.
1454 (timespec_subtract): Remove function.
1455 (main): Remove code that deals with computing start and stop times
1456 as well as the loop around nanosleep. Now that's in xnanosleep.c.
1458 Allow S (in --sleep-interval=S) to be a floating point value.
1459 * src/tail.c: Include xnanosleep.h and xstrtod.h.
1460 Move declaration of global variable, sleep_interval, to ...
1462 (usage): Update description of --sleep-interval option.
1463 (tail_forever): New parameter, sleep_interval. Update caller.
1464 Use xnanosleep, rather than sleep.
1465 (parse_options): New parameter, sleep_interval. Update caller.
1466 Use xstrtod, now that we accept floating point values.
1467 Prompted by a patch from Augey Mikus.
1469 2002-09-06 Jim Meyering <jim@meyering.net>
1471 * src/remove.c (prompt): Change comment to give a better note to
1472 translators. From Michael Piefel.
1474 2002-09-02 Jim Meyering <jim@meyering.net>
1476 * README: A good problem report/patch includes diffs against
1477 the most recent test release.
1479 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
1480 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
1482 * src/kill.c (print_table_row): Use an unsigned type for widths
1483 to avoid warning about comparison between signed and unsigned.
1484 (list_signals): Likewise.
1486 * src/od.c (skip): Add a cast to avoid warning about comparison
1487 between signed and unsigned.
1488 * src/install.c (get_ids): Likewise. Also rearrange range-checking
1489 comparisons to make them more readable.
1491 2002-09-01 Jim Meyering <jim@meyering.net>
1495 2002-08-31 Jim Meyering <jim@meyering.net>
1497 Symlinks were always reported as using 0 blocks.
1498 * src/system.h (ST_NBLOCKS): Don't depend on file type.
1499 This reverts the change of 2000-01-30.
1500 Based on a report and patch from Neil Brown via Michael Stone.
1501 This fixes Debian Bug#156358.
1503 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
1504 `exit (1)' to `exit (EXIT_FAILURE)', and
1505 `usage (1)' to `usage (EXIT_FAILURE)'.
1507 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
1508 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
1509 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
1510 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
1511 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
1512 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
1513 error never exits successfully.
1515 2002-08-29 Jim Meyering <jim@meyering.net>
1517 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
1518 when ignoring any return value.
1520 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
1521 failures. On some systems (at least EMC Celerra and Solaris5.8),
1522 this appears to be necessary.
1523 (is_empty_dir): Likewise. Also, always close directory handle.
1524 * src/ls.c (print_dir): Likewise.
1525 (print_dir): Rename local variable: reading -> dirp.
1526 Reported by Mike Coleman.
1528 2002-08-28 Jim Meyering <jim@meyering.net>
1530 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
1531 Give a diagnostic and fail if closedir fails.
1533 2002-08-26 Jim Meyering <jim@meyering.net>
1535 * Makefile.am (THANKS-to-translators): New rule.
1536 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
1537 * THANKStt.in: New file.
1539 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
1541 (main): Register it with atexit.
1542 Close STDOUT_FILENO, to avoid a problem when writing to
1543 /dev/audio on at least Solaris 2.7 and 2.8 systems.
1544 Reported by Shing-Shong Shei.
1546 2002-08-25 Jim Meyering <jim@meyering.net>
1548 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
1549 * src/tac.c (main): Likewise.
1550 * src/tail.c (main): Likewise.
1551 * src/tee.c (main): Likewise.
1552 * src/tr.c (main): Likewise.
1553 * src/wc.c (main): Likewise.
1555 2002-08-20 Jim Meyering <jim@meyering.net>
1557 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
1559 2002-08-10 Paul Eggert <eggert@twinsun.com>
1561 * src/nohup.sh: Don't use "exec --"; it's not portable and
1562 shouldn't be needed.
1564 2002-08-09 Jim Meyering <jim@meyering.net>
1566 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
1567 (usage): Clarify help text for the -COLUMN option.
1568 Patch by Padraig Brady.
1569 * tests/pr/Test.pm [col-last]: New test for the above.
1571 * configure.ac: Start with version 4.5.1, chosen so that it's larger
1572 than the latest version numbers of the component packages.
1574 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
1577 2002-08-08 Jim Meyering <jim@meyering.net>
1579 * src/date.c: Guard inclusion of <langinfo.h> with
1580 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
1581 * src/sort.c: Likewise.
1582 Patch by GOTO Masanori.
1584 2002-08-05 Paul Eggert <eggert@twinsun.com>
1586 Fix some minor time-related bugs with POSIX time arguments.
1587 Some valid time stamps were being rejected (notably -1, and
1588 time stamps before 1900 on 64-bit hosts). And some invalid
1589 time stamps were being accepted, e.g. September 31.
1591 * src/date.c (main): Adjust to posixtime signature change.
1592 * src/touch.c (main): Likewise. Remove unnecessary initialization.
1593 Use localtime, not posixtm, to warn about obsolete "touch".
1595 2002-08-05 Jim Meyering <jim@meyering.net>
1597 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
1599 2002-08-04 Jim Meyering <jim@meyering.net>
1601 * src/Makefile.am (check-README): New target/rule.
1602 (check): Depend on it.
1604 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
1606 2002-08-03 Jim Meyering <jim@meyering.net>
1608 * Makefile.am (SUBDIRS): Add old.
1609 * old/: New directory, containing legacy ChangeLog* and NEWS files
1610 from the fileutils, sh-utils, and textutils packages.
1612 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
1614 2002-08-02 Paul Eggert <eggert@twinsun.com>
1616 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
1618 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
1619 (hard_LC_COLLATE): New var.
1620 (different): Args are now char *, not const char *.
1621 Use xmemcoll instead of memcmp to compare lines, so that
1622 LC_COLLATE has effect. However, use memcmp if it is an
1624 (check_file): Do not include newline in comparison, so that
1625 xmemcoll has a byte to stomp on temporarily.
1626 (main): Set hard_LC_COLLATE.
1628 2002-07-29 Jim Meyering <jim@meyering.net>
1630 * Makefile.am (SUBDIRS): Remove djgpp, for now.
1632 2002-07-08 Jim Meyering <jim@meyering.net>
1634 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
1635 rather than the hard-coded `sh-utils'.
1637 2002-07-01 Jim Meyering <jim@meyering.net>
1639 * configure.ac: Merge the three files from fileutils,
1640 textutils, and sh-utils.
1641 * Makefile.am: Likewise.
1642 * src/Makefile.am: Likewise.
1645 version-control: never