1 2003-03-05 Jim Meyering <jim@meyering.net>
5 * src/printf.c (print_esc): Remove pointless comparison of unsigned
6 integer with zero, to avoid a warning from Intel's ecc.
7 Reported by Nelson Beebe.
9 * src/du.c (process_file): Sizes must all be of type uintmax_t.
10 Otherwise, for files or totals that are too big, numbers would
11 be truncated. Patch mostly by Michael Stone.
12 Reported by Ingo Saitz as Debian bug #183210.
14 * tests/du/8gb: New test for the above-fixed bug.
15 * tests/du/Makefile.am (TESTS): Add 8gb.
17 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
18 rather than UTILS_OPEN_MAX - 10.
20 2003-03-04 Jim Meyering <jim@meyering.net>
22 * README: Refer new feature discussion to bug-coreutils@gnu.org,
23 rather than bug-gnu-utils, now that the former is better known.
24 Suggestion from Göran Uddeborg.
26 * src/stat.c (usage): Capitalize consistently.
27 Reported by Göran Uddeborg.
29 * Makefile.maint (rel-files): Include $(signatures), so that
30 those files are also copied into $(release_archive_dir).
32 * src/df.c (find_mount_point): Call error here, now that restore_cwd
34 * src/remove.c (AD_pop_and_chdir): Likewise.
36 * tests/Makefile.am (check-root): Add fail-2eperm.
38 2003-03-03 Jim Meyering <jim@meyering.net>
40 * src/remove.c (remove_cwd_entries): Include the full filename of
41 the offending file, not just the basename.
43 * tests/misc/tty-eof: Set $ME properly.
45 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
46 Remove now-unused variables.
47 (tag-prev-version, prev-cvs-tag): Likewise.
49 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
50 accurate diagnostic when failing to remove a file owned by some other
51 user. Reported by Ivo Timmermans via Michael Stone.
52 This fixes Debian bug# 178471.
54 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
55 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
56 Based on a report from Ivo Timmermans.
58 2003-03-02 Jim Meyering <jim@meyering.net>
60 * src/copy.c (copy_internal) [un_backup]: When recovering from a
61 failure to create a hard link, do not remove the entry associating
62 the source dev/ino with the destination file name.
63 * tests/mv/Makefile.am (TESTS): Add hard-3.
64 * tests/mv/hard-3: New test, for the above-fixed bug.
65 Inspired by a report from Iida Yosiaki.
67 2003-03-01 Jim Meyering <jim@meyering.net>
69 * src/df.c (print_header): Don't embed spaces in a separate `Type'
70 header string. Instead, put `Filesystem' and `Type' headers in the
71 same string, so translators can use horizontal space as needed.
72 Reported by Jean Charles Delepine.
74 2003-02-28 Jim Meyering <jim@meyering.net>
76 * src/copy.c (copy_internal): When link fails because of an
77 existing destination file, unlink that file and try again.
78 Reported by Iida Yosiaki.
80 * tests/mv/Makefile.am (TESTS): Add hard-2.
81 * tests/mv/hard-2: New test for the above-fixed bug.
82 Based on a test case from Iida Yosiaki.
84 2003-02-26 Jim Meyering <jim@meyering.net>
86 * tests/du/basic: Don't test du's -b option here. Directory byte
87 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
88 and IBM AIX 4.2. Reported by Nelson Beebe.
90 2003-02-25 Jim Meyering <jim@meyering.net>
92 * Makefile.maint (announcement): Now that ChangeLog entries
93 are output by announce-gen, don't do it here.
94 * announce-gen (print_changelog_deltas): New function.
97 2003-02-22 Jim Meyering <jim@meyering.net>
99 * announce-gen: New option: --release-type=TYPE
100 * Makefile.maint (beta, major): New targets. Remove `release'.
101 Put them all together on a line.
102 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
103 invocation of `announcement'.
104 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
106 * announce-gen: New option: --news=NEWS_FILE.
107 Extract NEWS entries here, not via rules in Makefile.maint.
108 * Makefile.maint (announcement): Now that NEWS entries are
109 extracted by announce-gen, don't do it here.
110 (news-r1, news-r2): Remove now-unused definitions.
112 2003-02-21 Jim Meyering <jim@meyering.net>
116 Merge in changes from autoconf's version of this file.
117 * Makefile.maint (www-gnu): Define.
118 (standards.texi-url_prefix): Use $(www-gnu).
119 (make-stds.texi-url_prefix): Likewise.
121 * src/cp.c: Include "mmap-stack.h".
122 (main): Invoke `run' through a macro that (when possible) runs it
123 with a large, mmap'd stack.
125 * src/cp.c (run): New function, preparing for the above.
126 Exit from this function, not from main
129 * src/du.c: New option: --apparent-size.
130 (enum) [APPARENT_SIZE_OPTION]: New member.
131 (long_options): Add it.
132 (usage): Describe it.
134 ['b']: Set apparent_size.
135 David Eisner reported that the behavior of --bytes had changed.
136 Paul Eggert proposed the use of a new option, --apparent-size.
138 * src/du.c (apparent_size): New global.
139 (print_only_size): Reflect the fact that we're printing byte counts,
140 not ST_NBLOCKSIZE-byte-block counts.
141 (print_size): Call print_only_size rather than duplicating its code.
142 (process_file): Accumulate byte counts, rather than block counts.
144 * src/du.c (process_file): Always reset size_to_propagate_to_parent
145 for --separate-dirs (-S).
147 2003-02-20 Jim Meyering <jim@meyering.net>
149 * Use automake-1.7.3. Regenerate dependent files.
151 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
152 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
153 (usage) [%B]: Describe it.
156 * src/du.c (process_file): Reorganize the code to use only
157 one `sum' array, and change how -S works back to the way it was
158 before 2003-01-31. Patch by Bruno Haible.
160 * tests/du/basic: New test.
161 * tests/du/Makefile.am (TESTS): Add basic.
163 * tests/envvar-check: Add checks for the following:
164 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
166 * tests/Makefile.am: Rename phony target envvar-check to evar-check
167 so as not to conflict with the distributed file by the same name.
169 * src/du.c (process_file): Set info->skip before any possible return.
171 Report correct usage for directories, not 0.
172 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
173 _before_ recording the dev/ino of a directory.
174 Reported by Bruno Haible.
176 Now, df always displays the device file name corresponding to the
177 listed mount point under `Filesystem'. Before, for an unmounted
178 block- or character-special file argument, it would display the
179 command-line argument instead.
180 * src/df.c (show_disk): Return a value indicating whether
181 there was a match. Don't try to find a mount point here.
182 (show_entry): If show_disk doesn't find a match, call show_point.
184 2003-02-19 Jim Meyering <jim@meyering.net>
186 * src/du.c: Include "mmap-stack.h".
187 (du_files): Add prototype with ATTRIBUTE_NORETURN.
188 Exit from this function, not from...
190 Instead, if possible, invoke du_files through a macro that
191 runs it with a large, mmap'd stack.
193 * src/join.c (usage): Change wording in --help output:
194 use FILENUM instead of `SIDE' and say what FILENUM means.
195 Reported by Bernhard Gabler.
197 * src/df.c (print_header): Rather than using a hard-coded literal
198 string of spaces matching the length of the English `...Type' header,
199 output the right number of spaces to match the selected translation.
200 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
202 * src/split.c (bytes_split): Remove unnecessary `else' after break.
203 (lines_split): Likewise. and correct misleading indentation.
205 * src/split.c: Include "full-read.h".
206 (bytes_split, lines_split, line_bytes_split): Use full_read,
207 not safe_read. The way split was using the latter, a short read
208 could cause split to terminate before EOF.
210 * tests/misc/tty-eof: Test all programs that can read stdin,
211 requiring no arguments and that write to standard output.
213 * tests/misc/tty-eof: New file. Renamed from ...
214 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
215 * tests/misc/Makefile.am (TESTS): Reflect renaming.
217 2003-02-18 Jim Meyering <jim@meyering.net>
219 cksum would perform an extra read after encountering EOF
220 * src/cksum.c (cksum): Exit the loop upon EOF, too.
221 Patch by Michael Bacarella.
223 Test for the bug fixed today in cksum, md5sum, and sha1sum.
224 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
225 cat, cksum, md5sum, and sha1sum all in the same loop.
227 2003-02-14 Jim Meyering <jim@meyering.net>
229 * src/remove.c: Include "euidaccess.h".
230 Remove declaration of euidaccess.
232 2003-02-12 Jim Meyering <jim@meyering.net>
234 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
235 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
237 2003-02-10 Jim Meyering <jim@meyering.net>
239 * src/test.c: Don't include group-member.h.
240 Include euidaccess.h.
241 (eaccess): Rewrite function to set the real uid and gid temporarily
242 to the effective uid and gid, then invoke 'access', and then set the
243 real uid and gid back. On systems that lack setreuid or setregid,
244 fall back on the kludges in euidaccess. Before, it would not work
245 for e.g., files with ACLs, files that were marked immutable,
246 or on file systems mounted read-only. Nelson Beebe raised the issue.
247 Paul Eggert suggested the new implementation.
249 2003-02-09 Jim Meyering <jim@meyering.net>
251 * src/test.c (test_stat): Remove function. It's job is done (only
252 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
254 2003-02-08 Jim Meyering <jim@meyering.net>
258 * tests/mv/part-symlink: Don't assume that the file owner username
259 length is less than 9 in ls output: instead, omit that field
260 altogether. Reported by, and suggested fix from, Ferdinand.
262 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
263 * tests/du/Makefile.am (TESTS): Add restore-wd.
265 * src/rm.c: Correct now-invalid comment about cycle-detection.
267 2003-02-06 Jim Meyering <jim@meyering.net>
269 * NEWS: Add entries from old/*/NEWS
270 from fileutils-4.1 through 4.1.11 and
271 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
275 * src/du.c (process_file): Don't return early for excluded files
276 or for files whose dev/inode we've already seen.
278 2003-02-05 Jim Meyering <jim@meyering.net>
280 * tests/du/exclude: New file.
281 * tests/du/Makefile.am (TESTS): Add exclude.
283 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
285 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
286 Fix memory allocation arithmetic.
288 2003-02-04 Jim Meyering <jim@meyering.net>
290 `df /dev/block-or-char-device-file--not-mounted' now reports
291 the name of the file system on which the file resides, usually `/'.
292 Before, it would leave the `Mounted on' field blank.
293 * src/df.c (show_disk): Move function to precede find_mount_point.
294 (show_disk): Add parameter: STATP.
295 If we don't find a matching device name, then resort to calling
296 find_mount_point. Reported by Bob Proulx.
298 2003-02-03 Andreas Schwab <schwab@suse.de>
300 * tests/rm/cycle: Require non-root.
301 * tests/rm/isatty: Likewise.
303 2003-02-02 Jim Meyering <jim@meyering.net>
307 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
309 Ensure that there are no offending uses of `:'.
310 * Makefile.maint (makefile_path_separator_check): New rule.
311 (local-check): Add it to the list.
313 2003-02-01 Jim Meyering <jim@meyering.net>
315 * src/du.c (MAX_N_DESCRIPTORS): Define.
317 * src/stat.c (G_fail): New global.
318 (human_time): Diagnose failed localtime, not failed nstrftime.
319 (main): Fail if G_fail is set.
321 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
323 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
324 hard-coding the path-separator. Also double-quote the new PATH,
325 to avoid problems when the path-separator is a semi-colon or when
326 `pwd` contains e.g. a space.
327 * tests/chgrp/Makefile.am: Likewise.
328 * tests/chmod/Makefile.am: Likewise.
329 * tests/chown/Makefile.am: Likewise.
330 * tests/cp/Makefile.am: Likewise.
331 * tests/dd/Makefile.am: Likewise.
332 * tests/dircolors/Makefile.am: Likewise.
333 * tests/du/Makefile.am: Likewise.
334 * tests/expr/Makefile.am: Likewise.
335 * tests/factor/Makefile.am: Likewise.
336 * tests/fmt/Makefile.am: Likewise.
337 * tests/install/Makefile.am: Likewise.
338 * tests/ln/Makefile.am: Likewise.
339 * tests/ls/Makefile.am: Likewise.
340 * tests/ls-2/Makefile.am: Likewise.
341 * tests/md5sum/Makefile.am: Likewise.
342 * tests/misc/Makefile.am: Likewise.
343 * tests/mkdir/Makefile.am: Likewise.
344 * tests/mv/Makefile.am: Likewise.
345 * tests/od/Makefile.am: Likewise.
346 * tests/rm/Makefile.am: Likewise.
347 * tests/rmdir/Makefile.am: Likewise.
348 * tests/seq/Makefile.am: Likewise.
349 * tests/sha1sum/Makefile.am: Likewise.
350 * tests/shred/Makefile.am: Likewise.
351 * tests/stty/Makefile.am: Likewise.
352 * tests/sum/Makefile.am: Likewise.
353 * tests/tail-2/Makefile.am: Likewise.
354 * tests/touch/Makefile.am: Likewise.
355 * tests/tsort/Makefile.am: Likewise.
356 * tests/unexpand/Makefile.am: Likewise.
358 2003-01-31 Jim Meyering <jim@meyering.net>
360 * src/stat.c: Include "file-type.h"
361 (print_human_type): Remove function.
362 (human_access): Rename from print_human_access. Return a string.
363 (human_time): Rename from print_human_time. Return a string.
364 (print_stat): Arrange so that field width and an alignment specifier
365 are honored for the %A, %F, %x, %y, and %z formats.
366 [%F]: Use file_type; this gives slightly different file type strings,
367 e.g., `directory' instead of `Directory' and `regular file' or
368 `regular empty file' instead of `Regular file'.
369 Prompted by a report from Richard Dawe that the uses of
370 S_IFSOCK and S_IFIFO in print_human_time were not portable
371 to systems using e.g., DJGPP.
373 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
375 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
376 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
378 2003-01-31 Jim Meyering <jim@meyering.net>
380 * src/du.c (main): Upon processing an invalid option or an invalid
381 --exclude-from or --max-depth option argument, don't exit right away,
382 in case there are others. Rather record the failure and exit after
383 processing other options.
385 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
386 tar archive easier to reproduce.
388 Rewrite to perform directory traversal using nftw.
390 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
392 (opt_one_file_system): Move global into `main'.
393 (path, xstat, exit_status): Remove declarations.
394 (arg_length, suffix_length): New globals.
395 (G_fail): New global, sort of like the old `exit_status'.
396 (IS_FTW_DIR_TYPE): Define.
397 (print_only_size): New function.
398 (process_file): New function.
399 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
400 (str_trunc, pop_dir, count_entry): Likewise.
401 (du_files): Rewrite to use nftw.
403 2003-01-30 Jim Meyering <jim@meyering.net>
405 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
406 symlink-to-directory with -L, even without the trailing slash.
408 2003-01-27 Jim Meyering <jim@meyering.net>
410 * src/Makefile.am (check-misc): Check for st_blocks, too.
412 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
413 Reported by Richard Dawe.
415 2003-01-27 Andreas Schwab <schwab@suse.de>
417 * src/ls.c (quote_name): Add fourth parameter, width, into which to
418 store the screen columns, and return the number of bytes instead.
419 (print_dir): Pass NULL as fourth parameter of quote_name.
420 (print_name_with_quoting): Likewise.
421 (length_of_file_name_and_frills): Get the width from the fourth
422 parameter of quote_name instead of return value.
424 2003-01-27 Jim Meyering <jim@meyering.net>
426 * src/ls.c (decode_switches): If `dired' is set without
427 `format == long_format', then silently reset dired. This doesn't
428 change the behavior of ls (all prior uses of dired were protected
429 by `&& format == long_format'), and lets us...
430 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
431 (PUSH_CURRENT_DIRED_POS): Likewise.
434 2003-01-22 Jim Meyering <jim@meyering.net>
436 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
437 * tests/du/Makefile.am (TESTS): Add no-x.
439 2003-01-21 Jim Meyering <jim@meyering.net>
441 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
442 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
443 it may still be a directory -- or not (e.g., with FreeBSD on an
444 NFS-mounted file system), so resort to calling lstat to find out.
445 Based on a patch by Michael van Elst.
447 * tests/cp/same-file: Don't assume that the file owner username
448 length is less than 9 in ls output: instead, omit that field
449 altogether. Reported by, and suggested fix from, Ferdinand.
451 2003-01-20 Jim Meyering <jim@meyering.net>
453 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
454 large format widths no longer cause strftime to infloop.
456 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
458 2003-01-19 Jim Meyering <jim@meyering.net>
460 * src/readlink.c: Include "canonicalize.h".
462 2003-01-18 Jim Meyering <jim@meyering.net>
464 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
466 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
467 (long_options): Add option --dereference-command-line-symlink-to-dir.
468 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
469 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
470 -d, -F, -l options is specified.
471 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
472 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
473 Change --dereference-command-line (-H) to dereference *all*
474 command line arguments, including broken symlinks.
476 2003-01-15 Paul Eggert <eggert@twinsun.com>
478 Change ls -H back to the way it was yesterday, since this is
479 compatible with FreeBSD and the POSIX spec is confusing
480 and somewhat contradictory.
482 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
483 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
484 (long_options): Change the long option name back.
485 (usage): Change the usage back.
486 (gobble_file): When -H is specified, dereference a top-level
487 arg even if it points to a non-directory.
489 2003-01-15 Jim Meyering <jim@meyering.net>
491 * src/ls.c (gobble_file): Fall back on using lstat when required:
492 when --dereference (-L) is not specified, and
493 - when operating on a dangling symlink
494 - when operating on command-line-symlink-to-directories
495 This fixes numerous problems. Here are examples:
496 - `ls dangling-symlink' would fail with `no such file...'
497 Now it prints `dangling-symlink'.
498 - `ls -i symlink' would mistakenly print the inode of the referent.
499 Now it prints the inode of the symlink. Likewise for --size (-s).
500 Based on a patch from Michael Stone.
501 Reported by Deepak Goel as Debian bug #173793.
503 Rename ls's --dereference-command-line (-H)
504 option to --dereference-command-line-symlink-to-dir.
505 * src/ls.c [enum Dereference_symlink]
506 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
507 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
508 (long_options): Rename the long option.
509 (usage): Say that --dereference-... changes how ls treats
510 only symlinks to directories specified on the command line.
512 2003-01-14 Jim Meyering <jim@meyering.net>
514 * tests/ls/dangle: New file/test, for the above fix.
515 * tests/ls/inode: Another new file/test, for the above fix.
516 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
518 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
519 so that ls --color would no longer highlight the names of files with
520 the execute bit set when not specified on the command line.
521 Patch by Michael Stone. Reported by Stephen Depooter as
524 * tests/ls-2/tests (color-exe): New test, for the above fix.
526 2003-01-13 Jim Meyering <jim@meyering.net>
528 * tests/shred/exact: Also test for just fixed bug with --zero.
530 * src/shred.c (long_opts): --zero does not require an argument.
531 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
533 2003-01-12 Jim Meyering <jim@meyering.net>
535 * Makefile.maint (cvs-update): Skip any file with local modifications.
537 * src/unexpand.c (usage): Document --first-only and mention that
538 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
540 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
542 * src/df.c: Include "canonicalize.h".
543 Use canonicalize_file_name unconditionally.
545 2003-01-09 Jim Meyering <jim@meyering.net>
547 * README: Add readlink.
549 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
551 * src/df.c: Include "xgetcwd.h".
552 * src/pwd.c: Likewise.
554 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
556 * src/shred.c: Remove declaration of xstrdup.
557 We already get it via xalloc.h which is included via system.h.
559 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
561 New program: readlink.
563 * src/Makefile.am (bin_PROGRAMS): Add readlink.
564 * src/readlink.c: New file.
566 * man/readlink.x: New file.
567 * man/Makefile.am (dist_man_MANS): Add readlink.1.
568 (readlink.1): New rule.
570 2003-01-09 Jim Meyering <jim@meyering.net>
572 When selecting ranges of byte offsets (as opposed to ranges of fields)
573 and when --output-delimiter=STRING is specified, output STRING between
574 ranges of selected bytes.
575 * src/cut.c (RANGE_START_SENTINEL): Define.
576 (output_delimiter_specified): New global.
577 (print_kth): Add parameter. Adjust all callers.
578 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
579 (cut_bytes): When requested, output STRING between ranges of
581 (main): Make a diagnostic a little clearer.
582 Based on a patch from Jan Nieuwenhuizen.
584 * tests/cut/Test.pm: New tests for the above.
586 * src/cut.c (set_fields): Make code agree with comment:
587 Don't merge abutting ranges like 4- and 2-3. This makes no
588 difference currently, but is required to support an upcoming change.
590 2003-01-07 Jim Meyering <jim@meyering.net>
592 * src/cut.c (set_fields): Fix typo in comment.
594 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
595 * tests/touch/Makefile.am (TESTS): Add not-owner.
596 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
597 Now, this tests only the nonexistent-directory diagnostic.
598 Suggestion from Michael Stone.
600 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
602 2003-01-04 Jim Meyering <jim@meyering.net>
604 * src/copy.h: Remove use of PARAMS.
605 * src/remove.h: Likewise.
606 * src/chown-core.h: Likewise.
608 rm could be tricked into mistakenly reporting a cycle.
609 * src/remove.c: [cycle_check_state]: New global.
610 (remove_cwd_entries): Adapt to new semantics of cycle_check.
611 (rm): Call cycle_check_init and cycle_check_free for each file.
612 * tests/rm/cycle (rm): New test, for the above fix.
613 * tests/rm/Makefile.am (TESTS): Add cycle.
615 When rm detects a cycle, don't abort the entire command,
616 but rather just the affected command line argument.
617 * src/remove.c: Include <setjmp.h>
618 (struct dirstack_state) [current_arg_jumpbuf]: New member.
619 (remove_cwd_entries): Call longjmp if we detect a cycle.
620 (rm): Call setjmp here.
622 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
623 Instead, include cycle-check.h and use it.
625 * src/remove.h (struct dev_ino): Remove declaration.
627 * src/remove.c (remove_cwd_entries): Fix typos in comment.
629 Don't include trailing /. in diagnostics about directories.
630 * src/remove.c (full_filename_): When FILENAME is just `.'
631 and there is a nonempty directory-name part, don't append `/.'.
632 * tests/rm/unread2: Remove trailing /. from diagnostic.
633 * tests/rm/rm2: Likewise.
635 * src/remove.c (struct dirstack_state): Define.
636 To be used in place of these file-scoped globals ...
637 (dir_stack, len_stack, Active_dir): Remove globals.
638 (ds_init, ds_free): New functions.
639 (full_filename): Define.
640 (full_filename_): Rename from full_filename.
642 Begin to make AD_* functions more generic.
643 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
645 (AD_INIT_OTHER_MEMBERS): Define.
646 (remove_dir): Define the `status' member manually after each
647 call to AD_push or AD_push_initial.
649 * src/Makefile.am (check-misc): New rule, to ensure that no more
650 S_IS* macro definitions sneak into the code.
651 (check): Depend on check-misc.
653 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
654 * src/du.c (count_entry) [S_ISLNK]: Don't define.
655 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
657 2003-01-03 Jim Meyering <jim@meyering.net>
659 * src/true.c: Add copyright.
660 (AUTHORS): I suppose I've written it.
662 * src/Makefile.am (false.c): Make the generated file be read-only.
664 2003-01-04 Jim Meyering <meyering@lucent.com>
666 * src/ls.c: Include "dev-ino.h".
667 [struct dev_ino]: Remove declaration.
669 2003-01-02 Jim Meyering <meyering@lucent.com>
671 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
672 from mv: s/missing file arguments/missing file argument/.
673 With --target-directory=DIR, cp and mv work with a single file argument.
674 Reported by Karl Berry.
676 * tests/rm/isatty: Enable this test.
678 2002-12-31 Jim Meyering <meyering@lucent.com>
680 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
682 (AD_INIT_OTHER_MEMBERS): Define.
683 (remove_dir): Define the `status' member manually after each
684 call to AD_push or AD_push_initial.
686 * src/ls.c [struct dev_ino]: Remove definition.
687 Include "dev-ino.h" instead.
689 2002-12-28 Jim Meyering <meyering@lucent.com>
691 * tests/du/Makefile.am (TESTS): Add no-deref.
692 * tests/du/no-deref: New script.
694 2002-12-23 Jim Meyering <meyering@lucent.com>
696 * src/remove.c (remove_cwd_entries): Fix typo in comment.
698 2002-12-21 Jim Meyering <jim@meyering.net>
700 * announce-gen: Generate MML-formatted announcement.
701 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
703 2002-12-20 Jim Meyering <jim@meyering.net>
705 * src/touch.c (touch): Change the wording of a diagnostic so
706 that it makes sense both when the file exists and when it doesn't.
707 Suggestion from Michael Stone.
709 2002-12-18 Jim Meyering <jim@meyering.net>
711 * src/stty.c (valid_options): Declare to be static.
713 2002-12-15 Jim Meyering <jim@meyering.net>
715 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
717 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
718 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
719 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
720 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
721 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
723 * src/remove.c (PARAMS): Remove definition.
724 * src/sys2.h: Likewise.
726 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
727 Include strftime.h instead.
729 2002-12-14 Jim Meyering <jim@meyering.net>
731 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
733 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
734 This is necessary at least for Irix6.5 when using c89.
735 Reported by Nelson Beebe.
737 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
739 * tests/misc/cat-tty-eof: New test.
741 * src/mknod.c (usage): Specify how major and minor mode numbers
742 are interpreted. Report forwarded by Kristin E Thomas.
743 * src/mknod.c: Remove now-redundant usage-specifying comment.
745 2002-12-13 Jim Meyering <jim@meyering.net>
749 * tests/du/trailing-slash: Allow for a directory of size `0'.
750 That happens at least on file systems of type tmpfs on linux-2.4.18.
752 * announce-gen: New script to begin replacing the commands
753 associated with the rule here...
754 * Makefile.maint (announcement): Invoke announce-gen.
755 * Makefile.am (EXTRA_DIST): Add announce-gen.
757 * tests/cp/preserve-2: New file/test, for latest fix.
758 * tests/cp/Makefile.am (TESTS): Add preserve-2.
760 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
762 Fix a bug whereby cp would fail to parse an option like
763 --preserve=mode,ownership.
764 * src/cp.c (decode_preserve_arg): Advance `comma' to
765 point the character following the comma.
767 2002-12-11 Jim Meyering <jim@meyering.net>
769 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
770 in case it's already defined.
772 2002-12-09 Jim Meyering <jim@meyering.net>
774 * tests/touch/fail-diag: Don't get a test failure if /no exists.
775 Instead, evoke a framework failure if /no-$$ exists.
776 Reported by Michael Stone.
778 2002-12-08 Jim Meyering <jim@meyering.net>
780 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
781 Define to rpl_lstat, so that even on systems like Solaris 2.8,
782 du honors (per POSIX) the trailing slash on an argument referring
783 to a symlink-to-directory.
785 2002-12-06 Jim Meyering <jim@meyering.net>
787 * Use autoconf-2.57. Regenerate dependent files.
788 * Use automake-1.7.2. Regenerate dependent files.
790 * src/ls.c (gobble_file): Also stat the file if it's a
791 regular file and --indicator-style=classify (aka -F).
792 Thanks to Ed Santiago for opening my eyes.
794 * tests/ls/file-type: New file. Test for the above.
795 A test to contrast ls -F and ls --indicator-style=file-type.
796 * tests/ls/Makefile.am (TESTS): Add file-type.
798 2002-12-04 Jim Meyering <jim@meyering.net>
800 * tests/ls/follow-slink: Make sure the symlink was created.
801 Richard Dawe reported that `ln -s link link' succeeds, but creates
802 no file on systems running some version of the DJGPP libc.
804 2002-12-03 Jim Meyering <jim@meyering.net>
806 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
807 since this package no longer panders to K&R compilers.
809 2002-12-02 Jim Meyering <jim@meyering.net>
811 * tests/du/slink: Skip this test if `.' is on a non-local file system.
813 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
814 something to replace.
816 2002-12-01 Jim Meyering <jim@meyering.net>
818 * src/stat.c: Don't include <string.h> or <ctype.h>.
819 That's already done via system.h.
820 * src/dircolors.c: Don't include <ctype.h>.
822 2002-11-30 Jim Meyering <jim@meyering.net>
824 * ls.c (gobble_file): Remove the block of code that caused
825 `ls --color -F symlink-to-dir' to list the files in
826 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
827 like `ls -F symlink-to-dir') but with the addition of highlighting.
828 Similarly, `ls --color -dF symlink-to-dir' would print
829 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
830 Reported by Jeff Sheinberg as Debian bug #168203.
831 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
833 ls is now more efficient: with certain options, it no longer needs
834 to stat each directory entry on systems with valid dirent.d_type.
835 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
836 (main): Make --recursive set format_needs_type, not format_needs_stat.
837 (gobble_file): Remove a FIXME comment, now that it's fixed.
839 2002-11-24 Jim Meyering <jim@meyering.net>
841 * src/du.c (du_files): Don't strip any trailing slash.
842 Rewrite so that `/' is no longer represented internally as
844 (count_entry): When appending a file name component,
845 account for the fact that the current path may end in `/'.
846 François Pinard reported that `du symlink-to-dir/' was not
847 equivalent to `du symlink-to-dir/.'. Now it is.
848 * tests/du/trailing-slash: New file/test, for the above fix.
849 * tests/du/Makefile.am (TESTS): Add trailing-slash.
851 2002-11-23 Jim Meyering <jim@meyering.net>
853 * src/tac.c (output): Declare some local variables to be of type size_t,
854 rather than `int' to avoid warnings from gcc.
856 2002-11-21 Paul Eggert <eggert@twinsun.com>
858 * src/ls.c (decode_switches): Use case-sensitive matching to
859 decode the QUOTING_STYLE environment variable. This is more
860 consistent with the documentation, and with --quoting-style.
862 2002-11-21 Martin Buck <martin.buck@ascom.ch
864 * src/stty.c (struct speeds): Add support for all baud rates defined
867 2002-11-19 Jim Meyering <jim@meyering.net>
869 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
870 run in a UTF locale. Report and suggested fix by Bruno Haible.
871 * tests/fmt/basic: Likewise.
873 2002-11-17 Jim Meyering <jim@meyering.net>
875 * configure.ac: Update via autoupdate.
876 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
878 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
879 Reported by Hans Ginzel.
881 2002-11-15 Jim Meyering <jim@meyering.net>
883 * Makefile.cfg (gnu_rel_host): Define.
884 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
885 on whether $(VERSION) looks like a major release number.
887 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
888 (release): Rename from `alpha'.
889 (alpha): Depend on release.
891 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
893 2002-11-14 Jim Meyering <jim@meyering.net>
895 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
896 (announcement): Use the new variable.
898 * Makefile.maint: Sync with Bison, i.e.:
899 (po-check): Scan .l and .y files instead of the
900 .c and the .h files that they generate. This fixes the bug
901 reported by Tim Van Holder in:
902 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
903 Look for N_ as well as for _. Try to avoid matching #define for
907 2002-11-12 Jim Meyering <jim@meyering.net>
909 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
910 Replace sole use with equivalent `#ifdef S_ISLNK'.
911 Inconsistency reported by Dmitry V. Levin.
913 2002-11-11 Jim Meyering <jim@meyering.net>
915 * src/stat.c (usage): Transform --help items output via s/ - / /,
916 so that help2man produces properly formatted man pages.
917 Reported by Herbert Xu as Debian bug #168400.
919 2002-11-10 Jim Meyering <jim@meyering.net>
921 * src/ls.c (sighandler): Handle SIGTSTP specially.
922 Based on suggestions from Solar Designer and Dmitry V. Levin.
925 * Makefile.cfg (cvs_files): Define. From autoconf.
926 (local_updates): Likewise.
928 * src/ls.c (restore_default_color_handler, sigtstp_handler):
930 (sighandler): New function, based on the one in sort.c.
931 (main): Use sigaction, if possible; otherwise signal.
932 Handle these signals:
933 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
934 Don't register our handler if the signal is already being ignored.
936 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
937 * src/csplit.c (interrupt_handler): Likewise.
938 * src/sort.c (sighandler): Likewise.
939 (main): Declare `i' and `nsigs' to be unsigned, not int.
941 2002-11-09 Jim Meyering <jim@meyering.net>
943 ls --color: restore terminal text color upon signal.
944 * src/ls.c: Include "full-write.h" and <signal.h>.
945 (restore_default_color, restore_default_color_handler): New functions.
946 (sigtstp_handler, put_indicator_direct): New functions.
947 (main) [print_with_color]: Register signal handlers.
948 Patch mostly by Solar Designer and Stanislav Ievlev.
950 Update from autoconf.
951 * Makefile.maint (AMTAR): Remove definition.
952 (update, cvs-update, po-update, do-po-update): New rules.
953 (wget-update): Update (thus renaming to cvs-update).
954 (automake_repo): Use anoncvs@sources.redhat.com.
956 2002-11-06 Jim Meyering <jim@meyering.net>
958 * tests/misc/Makefile.am (TESTS): Add printf-hex.
960 * tests/misc/printf: Be careful to test the code in this package,
961 not the shell built-in function.
963 * src/printf.c (print_esc): A hexadecimal escape sequence has
964 at most two hex. digits, not three. Reported by Padraig Brady.
965 (usage): Update description.
966 * tests/misc/printf-hex: New file/test, for the above fix.
968 2002-10-07 Paul Eggert <eggert@twinsun.com>
970 Add support for locale-specific size indications (e.g.,
971 thousands-separators) and for explicit size suffixes on output.
973 * doc/coreutils.texi (Block size): Say that:
974 This affects display format as well as block size.
975 Fractional block counts are rounded up.
976 ls file size blocksize defaults to 1.
977 A block size spec preceded by ' generates thousands separators.
978 A suffix without a preceding integer generates suffixes.
979 (tail invocation): 32k -> 32 KiB.
980 (What information is listed): ls -h is now equivalent to
981 ls --block-size=human, and ls -H is now equivalent to
982 ls --block-size=si. Displayed file size is now always affected by
985 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
986 lib/umaxtostr.c: New files, taken from GNU tar.
988 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
990 (EXTRA_DIST): Add inttostr.c.
992 * lib/human.c, lib/human.h: Rewrite to support locale-specific
993 notations like thousands separators.
994 Specify what includer of include.h must include beforehand.
995 (human_group_digits, human_suppress_point_zero, human_autoscale,
996 human_base_1024, human_SI, human_B): New enum values.
997 (human_readable): Rename from human_readable_inexact; put the
998 options before the sizes. All uses changed. The old human_readable
999 function has been removed; use inttostr.h instead.
1000 (human_options): Renamed from human_block_size, with new signature
1001 that allows block sizes up to UINTMAX_MAX. All callers changed.
1003 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
1004 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
1005 freestanding C89. No need to check for stdlib.h or string.h since
1006 autoconf does this now.
1008 * src/cksum.c (cksum): Use primitives from inttostr.h, not
1009 human.h, to print large numbers simply.
1010 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
1011 * src/dd.c (print_stats, main): Likewise.
1012 * src/df.c (print_header): Likewise.
1013 * src/factor.c (print_factors): Likewise.
1014 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
1015 * src/shred.c (dopass): Likewise.
1016 * src/sort.c (checkfp): Likewise.
1017 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
1018 * src/tail.c (xlseek): Likewise.
1019 * src/wc.c (write_counts, wc): Likewise.
1021 * src/df.c (human_output_opts): New var.
1022 (output_block_size): Now uintmax_t, not int, to handle larger
1023 block sizes. All uses changed.
1024 * src/du.c: Likewise.
1025 * src/ls.c: Likewise.
1027 * src/df.c (print_header): In the header line, prefer SI to human
1028 representation if it's shorter; if neither is shorter, try to
1029 intuit what the user would prefer.
1031 * src/expr.c (inttostr): Remove; use new imaxtostr library
1034 * src/ls.c (file_output_block_size): New var, to distinguish
1035 file sizes from other sizes.
1036 (decode_switches): Set it.
1038 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
1039 (dopass): When printing progress, use floor for what has been done
1040 so far (since we should be conservative there), and ceiling for
1041 what needs to be done (since that's what other programs use).
1043 2002-10-19 Jim Meyering <jim@meyering.net>
1045 * src/pinky.c (print_heading): Align TTY and Name headings.
1046 Reported by Karl Eichwalder.
1048 2002-10-18 Jim Meyering <jim@meyering.net>
1050 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
1051 Remove now-useless cast.
1052 (stdread): Remove function.
1053 (bytes_split): Use size_t instead of int.
1054 Use safe_read, not stdread.
1055 (lines_split): Likewise.
1056 Use memchr rather than a `while' loop.
1057 (line_bytes_split): Use size_t instead of int.
1058 Use safe_read, not stdread.
1059 (main): Add some FIXME comments to remind me to remove casts.
1061 * src/system.h (ST_BLKSIZE): Correct comment describing how to
1062 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
1064 2002-10-17 Jim Meyering <jim@meyering.net>
1066 Fix a problem that could make e.g., `cat' misbehave on systems which
1067 give invalid (unreasonably large) values for stat.st_blksize.
1068 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
1069 Reported by Petter Reinholdtsen.
1071 2002-10-14 Jim Meyering <jim@meyering.net>
1073 Specifying a printf conversion specifer as nl's separator string
1074 could cause nl to segfault.
1075 * src/nl.c (build_print_fmt): Don't include separator string
1076 in the printf format; it might contain `%'.
1077 Use a better bound on the length of the print_fmt buffer.
1078 (print_lineno): Print the separator here instead.
1079 Reported by Doug Coleman.
1081 * tests/misc/nl: New file/tests, including a test for the above.
1082 * tests/misc/Makefile.am (TESTS): Add nl.
1084 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
1085 * tests/misc/Makefile.am (TESTS): Add split-l.
1087 2002-10-13 Jim Meyering <jim@meyering.net>
1091 * src/du.c (usage): Tweak description of --dereference-args/-D.
1093 * src/du.c (count_entry): Also save cwd when dereferencing (via
1094 --dereference-args, -D) a command-line argument.
1095 Reported by Michal Svec. Based on a patch by Andreas Schwab.
1097 * src/Makefile.am (../AUTHORS): New target/rule.
1099 2002-10-12 Jim Meyering <jim@meyering.net>
1101 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
1102 of type size_t, since that's the way it's used and avoids a warning.
1104 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
1105 since that's how it's always used and avoids a new warning from gcc.
1106 (read_input): Adapt to new safe_read ABI.
1108 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
1111 * src/pinky.c (print_long_entry): fread returns size_t.
1112 Declare local `bytes' accordingly, to avoid warning.
1114 tail -c +N would perform an extra read after encountering EOF
1115 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
1116 * src/tail.c (start_bytes): Detect EOF, inform caller.
1117 (tail_bytes): Upon EOF in start_bytes, return immediately.
1118 (file_lines): Reorganize to use memrchr rather than an explicit loop.
1119 Adapt to new safe_read ABI.
1121 2002-10-11 Jim Meyering <jim@meyering.net>
1123 * tests/du/deref: New file/test, for the above fix.
1124 * tests/du/Makefile.am (TESTS): Add deref.
1126 2002-10-10 Jim Meyering <jim@meyering.net>
1128 * tests/ln/Makefile.am (TESTS): Add target-1.
1129 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
1131 2002-10-09 Jim Meyering <jim@meyering.net>
1133 * tests/cp/backup-is-src: Ensure that certain environment variables
1134 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
1136 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
1137 consume 4GB of disk space on systems without support for sparse files.
1138 Fix a logic error that'd make it `cat err' even though dd didn't fail.
1140 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
1141 Patch by steven@magelico.net, forwarded by Michael Stone.
1143 * tests/ls/dired: Ensure that ls produces English messages.
1144 Patch by Alexey Vyskubov, forwarded by Michael Stone.
1146 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
1148 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
1150 2002-10-08 Jim Meyering <jim@meyering.net>
1152 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
1153 Fix syntax in test: use =, not ==.
1154 Reported by Bob Proulx.
1155 Change all the rest like this: grep -lR "testing framework'" .\
1156 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
1158 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
1159 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
1160 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
1161 * src/wc.c (wc): Likewise.
1163 2002-10-07 Paul Eggert <eggert@twinsun.com>
1166 Don't advance the write pointer past the end of the write buffer.
1167 * src/sort.c (begfield, limfield): Likewise.
1169 2002-10-07 Jim Meyering <jim@meyering.net>
1171 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
1172 * src/head.c (head_bytes, head_lines): Likewise.
1174 2002-10-06 Jim Meyering <jim@meyering.net>
1176 * src/dd.c (scanargs): Ensure that specified block sizes (specified
1177 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
1178 (skip, dd_copy): Adapt to new safe_read ABI.
1180 * Makefile.maint (signatures): Define.
1182 (announcement): Depend on $(signatures).
1184 * Makefile.maint (announcement): Output all URLs for detached
1185 signatures, not just the last one from the previous loop.
1187 2002-10-05 Jim Meyering <jim@meyering.net>
1191 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
1192 don't recurse into directory, DIR. Prompted by a report from
1195 * tests/rm/i-no-r: New file/test, for the above fix.
1196 * tests/rm/Makefile.am (TESTS): Add i-no-r.
1198 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
1199 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
1201 2002-10-03 Jim Meyering <jim@meyering.net>
1203 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
1204 * src/df.c (AUTHORS): Likewise.
1205 * src/du.c (AUTHORS): Likewise.
1206 * src/tail.c (AUTHORS): Likewise.
1207 * src/touch.c (AUTHORS): Likewise.
1209 2002-10-02 Jim Meyering <jim@meyering.net>
1211 * Makefile.am (SUBDIRS): Remove `old'.
1212 (EXTRA_DIST): List the files in old/.
1213 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
1214 Suggestion from Akim Demaille.
1216 2002-10-01 Jim Meyering <jim@meyering.net>
1218 * src/sys2.h (SSIZE_MAX): Define.
1220 2002-09-30 Jim Meyering <jim@meyering.net>
1222 * src/csplit.c: Don't include stdlib.h here. It's already included
1225 2002-09-29 Jim Meyering <jim@meyering.net>
1227 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
1228 expression to avoid bogus warning from gcc.
1230 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
1231 (cat): Declare insize and outsize to be of type size_t, not int.
1232 Rearrange pointer/integer expressions to avoid bogus warnings.
1233 (main): Declare insize and outsize to be of type size_t, not int.
1235 * src/tail.c (parse_options): Give a sensible diagnostic for
1236 an invalid byte or line count. Reported by Mikko Tuumanen.
1238 * src/touch.c (main): Split a long line.
1240 * tests/du/Makefile.am (TESTS): Add slink.
1241 * tests/du/slink: New test for system.h change of 2002-08-31.
1243 In move mode, always first try to rename. Before, upon failure to
1244 rename a directory, this code would never attempt to rename any
1245 other file in that directory, but would thenceforth always copy.
1246 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
1247 may fail with EXDEV, yet renaming files within that directory to
1248 a newly-created destination directory succeeds.
1249 * src/copy.c (copy_internal): Remove local, move_mode;
1250 use x->move_mode instead. Based on a patch from Tom Haynes.
1252 2002-09-28 Jim Meyering <jim@meyering.net>
1254 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
1255 Factor out some duplication.
1257 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
1259 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
1261 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
1262 to avoid compiler warnings.
1264 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
1267 Fix things so `mkdir -p' can create very deep directories, e.g.,
1268 mkdir -p $(perl -e 'print "a/" x 40000') now works.
1269 * src/mkdir.c (main): For --parents (-p), call make_path with the
1270 entire directory name, so we don't ever require that file operations
1271 like stat or chmod be performed on the entire command line argument.
1272 * makepath.c (make_path): Restore umask *before* creating the final
1275 2002-09-27 Andreas Schwab <schwab@suse.de>
1277 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
1278 to avoid overflow. Reported by Hans Lermen.
1280 2002-09-26 Jim Meyering <jim@meyering.net>
1282 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
1284 2002-09-25 Jim Meyering <jim@meyering.net>
1286 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
1287 and add a cast, to avoid a warning about `signed and unsigned type in
1288 conditional expression'.
1290 2002-09-22 Jim Meyering <jim@meyering.net>
1292 * src/rmdir.c: Include "dirname.h", for declaration of
1293 strip_trailing_slashes.
1295 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
1296 Now they're defined through system.h.
1298 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
1299 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
1300 since it's already included from sys2.h via system.h.
1302 * Use automake-1.6f. Regenerate dependent files.
1304 * src/Makefile.am (PERL): Remove duplicate definition.
1306 fmt's -s, -t, -c options didn't work properly for long lines.
1307 Since get_line may end up calling put_paragraph (for long lines),
1308 be sure to set global, `other_indent', before it is used there.
1310 * src/fmt.c (set_other_indent): New function, factored out of...
1311 (get_paragraph): ... here. Call it.
1312 (get_line): Call set_other_indent before calling flush_paragraph,
1313 which calls fmt_paragraph, which in turn calls put_paragraph,
1314 which uses other_indent.
1316 * tests/fmt/Makefile.am (TESTS): Add long-line.
1317 * tests/fmt/long-line: New file/test, for the above fix.
1319 2002-09-21 Jim Meyering <jim@meyering.net>
1321 * src/od.c: No longer include deprecated <values.h>.
1322 It was required solely for now-removed reference to BITSPERBYTE.
1323 * src/install.c: Likewise.
1324 Suggestion from Bruno Haible.
1326 2002-09-06 Andreas Schwab <schwab@suse.de>
1328 `rmdir -p dir-specified-with-trailing-slash/' would fail.
1329 * src/rmdir.c (remove_parents): Strip trailing slashes.
1331 2002-09-20 Jim Meyering <jim@meyering.net>
1333 * tests/rmdir/t-slash: New file/test, for the above fix.
1334 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
1336 * Makefile.maint (announcement): Arrange to gpg-sign the message.
1337 Add a URL for each detached signature file.
1339 2002-09-07 Bruno Haible <bruno@clisp.org>
1341 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
1343 2002-09-18 Jim Meyering <jim@meyering.net>
1345 `od -t x8' used the wrong (`l'-prefixed) printf format.
1346 Likewise for the o8 and u8 formats.
1347 * src/od.c (ISPEC_TO_FORMAT): Define macro.
1348 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
1349 Reported by Arun Sharma.
1351 2002-09-17 Jim Meyering <jim@meyering.net>
1353 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
1354 From gettext's intl/loadmsgcat.c.
1356 * tests/od/x8: New file/test, for the above fix.
1357 * tests/od/Makefile.am (TESTS): Add x8.
1359 2002-09-15 Jim Meyering <jim@meyering.net>
1361 * Use autoconf-2.54. Regenerate dependent files.
1363 * src/csplit.c (get_format_width): Add cast to avoid
1364 warning about `signed and unsigned type in conditional expression'.
1366 2002-09-14 Jim Meyering <jim@meyering.net>
1368 * src/who.c (print_user): Change type of local to size_t
1369 to avoid warnings about `comparison between signed and unsigned'.
1370 * src/ptx.c (generate_all_output): Likewise.
1372 * src/dd.c (main, skip): Add casts to avoid warnings about
1373 `comparison between signed and unsigned'.
1375 * src/id.c (print_full_info, print_group_list): Add casts to avoid
1376 warnings about `signed and unsigned type in conditional expression'.
1378 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
1379 to avoid warnings about `comparison between signed and unsigned'.
1380 (split_3): Change parameter names to be readable and add comment.
1381 Clean up the test for whether a line may be ignored.
1383 2002-09-13 Jim Meyering <jim@meyering.net>
1385 * src/printf.c (main): Handle leading command line argument of `--'.
1386 Reported by Raul: DervishD <raul@pleyades.net>
1387 * tests/misc/printf: New file: test for the above.
1388 * tests/misc/Makefile.am (TESTS): Add printf.
1390 * src/date.c (usage): Explain that %S's range of [0..60] is required --
1391 rather than 0..59 -- to accommodate the occasional positive leap second.
1392 Reported by Richard Neill.
1394 2002-09-12 Jim Meyering <jim@meyering.net>
1396 * src/Makefile.am (nanosec_libs): Define.
1397 (sleep_LDADD, tail_LDADD): Use it here.
1399 Factor nanosleep-related code into ../lib/xnanosleep.c.
1400 * src/sleep.c: Include xnanosleep.h.
1401 Factor out fenv.h-related code.
1402 (timespec_subtract): Remove function.
1403 (main): Remove code that deals with computing start and stop times
1404 as well as the loop around nanosleep. Now that's in xnanosleep.c.
1406 Allow S (in --sleep-interval=S) to be a floating point value.
1407 * src/tail.c: Include xnanosleep.h and xstrtod.h.
1408 Move declaration of global variable, sleep_interval, to ...
1410 (usage): Update description of --sleep-interval option.
1411 (tail_forever): New parameter, sleep_interval. Update caller.
1412 Use xnanosleep, rather than sleep.
1413 (parse_options): New parameter, sleep_interval. Update caller.
1414 Use xstrtod, now that we accept floating point values.
1415 Prompted by a patch from Augey Mikus.
1417 2002-09-06 Jim Meyering <jim@meyering.net>
1419 * src/remove.c (prompt): Change comment to give a better note to
1420 translators. From Michael Piefel.
1422 2002-09-02 Jim Meyering <jim@meyering.net>
1424 * README: A good problem report/patch includes diffs against
1425 the most recent test release.
1427 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
1428 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
1430 * src/kill.c (print_table_row): Use an unsigned type for widths
1431 to avoid warning about comparison between signed and unsigned.
1432 (list_signals): Likewise.
1434 * src/od.c (skip): Add a cast to avoid warning about comparison
1435 between signed and unsigned.
1436 * src/install.c (get_ids): Likewise. Also rearrange range-checking
1437 comparisons to make them more readable.
1439 2002-09-01 Jim Meyering <jim@meyering.net>
1443 2002-08-31 Jim Meyering <jim@meyering.net>
1445 Symlinks were always reported as using 0 blocks.
1446 * src/system.h (ST_NBLOCKS): Don't depend on file type.
1447 This reverts the change of 2000-01-30.
1448 Based on a report and patch from Neil Brown via Michael Stone.
1449 This fixes Debian Bug#156358.
1451 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
1452 `exit (1)' to `exit (EXIT_FAILURE)', and
1453 `usage (1)' to `usage (EXIT_FAILURE)'.
1455 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
1456 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
1457 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
1458 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
1459 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
1460 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
1461 error never exits successfully.
1463 2002-08-29 Jim Meyering <jim@meyering.net>
1465 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
1466 when ignoring any return value.
1468 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
1469 failures. On some systems (at least EMC Celerra and Solaris5.8),
1470 this appears to be necessary.
1471 (is_empty_dir): Likewise. Also, always close directory handle.
1472 * src/ls.c (print_dir): Likewise.
1473 (print_dir): Rename local variable: reading -> dirp.
1474 Reported by Mike Coleman.
1476 2002-08-28 Jim Meyering <jim@meyering.net>
1478 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
1479 Give a diagnostic and fail if closedir fails.
1481 2002-08-26 Jim Meyering <jim@meyering.net>
1483 * Makefile.am (THANKS-to-translators): New rule.
1484 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
1485 * THANKStt.in: New file.
1487 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
1489 (main): Register it with atexit.
1490 Close STDOUT_FILENO, to avoid a problem when writing to
1491 /dev/audio on at least Solaris 2.7 and 2.8 systems.
1492 Reported by Shing-Shong Shei.
1494 2002-08-25 Jim Meyering <jim@meyering.net>
1496 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
1497 * src/tac.c (main): Likewise.
1498 * src/tail.c (main): Likewise.
1499 * src/tee.c (main): Likewise.
1500 * src/tr.c (main): Likewise.
1501 * src/wc.c (main): Likewise.
1503 2002-08-20 Jim Meyering <jim@meyering.net>
1505 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
1507 2002-08-10 Paul Eggert <eggert@twinsun.com>
1509 * src/nohup.sh: Don't use "exec --"; it's not portable and
1510 shouldn't be needed.
1512 2002-08-09 Jim Meyering <jim@meyering.net>
1514 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
1515 (usage): Clarify help text for the -COLUMN option.
1516 Patch by Padraig Brady.
1517 * tests/pr/Test.pm [col-last]: New test for the above.
1519 * configure.ac: Start with version 4.5.1, chosen so that it's larger
1520 than the latest version numbers of the component packages.
1522 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
1525 2002-08-08 Jim Meyering <jim@meyering.net>
1527 * src/date.c: Guard inclusion of <langinfo.h> with
1528 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
1529 * src/sort.c: Likewise.
1530 Patch by GOTO Masanori.
1532 2002-08-05 Paul Eggert <eggert@twinsun.com>
1534 Fix some minor time-related bugs with POSIX time arguments.
1535 Some valid time stamps were being rejected (notably -1, and
1536 time stamps before 1900 on 64-bit hosts). And some invalid
1537 time stamps were being accepted, e.g. September 31.
1539 * src/date.c (main): Adjust to posixtime signature change.
1540 * src/touch.c (main): Likewise. Remove unnecessary initialization.
1541 Use localtime, not posixtm, to warn about obsolete "touch".
1543 2002-08-05 Jim Meyering <jim@meyering.net>
1545 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
1547 2002-08-04 Jim Meyering <jim@meyering.net>
1549 * src/Makefile.am (check-README): New target/rule.
1550 (check): Depend on it.
1552 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
1554 2002-08-03 Jim Meyering <jim@meyering.net>
1556 * Makefile.am (SUBDIRS): Add old.
1557 * old/: New directory, containing legacy ChangeLog* and NEWS files
1558 from the fileutils, sh-utils, and textutils packages.
1560 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
1562 2002-08-02 Paul Eggert <eggert@twinsun.com>
1564 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
1566 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
1567 (hard_LC_COLLATE): New var.
1568 (different): Args are now char *, not const char *.
1569 Use xmemcoll instead of memcmp to compare lines, so that
1570 LC_COLLATE has effect. However, use memcmp if it is an
1572 (check_file): Do not include newline in comparison, so that
1573 xmemcoll has a byte to stomp on temporarily.
1574 (main): Set hard_LC_COLLATE.
1576 2002-07-29 Jim Meyering <jim@meyering.net>
1578 * Makefile.am (SUBDIRS): Remove djgpp, for now.
1580 2002-07-08 Jim Meyering <jim@meyering.net>
1582 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
1583 rather than the hard-coded `sh-utils'.
1585 2002-07-01 Jim Meyering <jim@meyering.net>
1587 * configure.ac: Merge the three files from fileutils,
1588 textutils, and sh-utils.
1589 * Makefile.am: Likewise.
1590 * src/Makefile.am: Likewise.
1593 version-control: never