1 2005-09-28 Jim Meyering <jim@meyering.net>
4 * configure.ac: Use 5.90-cvs as the version string, not 5.3.1-cvs.
5 * NEWS: Adjust accordingly.
7 * README: Remove note about FreeBSD make test failure.
9 2005-09-28 Paul Eggert <eggert@cs.ucla.edu>
11 * tests/install/trap: Work around a bug in FreeBSD 5.0.
13 2005-09-28 Jim Meyering <jim@meyering.net>
15 * README: Warn about a (now-)known problem on FreeBSD 5.0:
17 2005-09-26 Paul Eggert <eggert@cs.ucla.edu>
19 * src/touch.c (touch): Handle "touch -c - >&-" by checking for EBADF
21 Do not pass "-" to futimens; pass NULL instead.
22 If close (STDIN_FILENO) fails, report the error separately instead
23 of letting the 'close' pollute errno.
24 * tests/touch/empty-file: Test "touch -" too.
25 * tests/touch/no-create-missing: Likewise.
26 * tests/touch/read-only: Likewise.
28 2005-09-26 Jim Meyering <jim@meyering.net>
30 * tests/touch/read-only: New test, for root of chmod/usage failure.
31 * tests/touch/Makefile.am (TESTS): Add read-only.
33 Work around the root cause of alpha-linux-1.sf.net test failure.
34 * tests/chmod/usage: Remove *all* files before each inner loop
35 iteration. Otherwise, with a touch program that fails on unwritable
36 files, (this happens at least on linux-2.2.20) a -w file left behind
37 from a previous iteration could cause a spurious test failure.
39 2005-09-25 Paul Eggert <eggert@cs.ucla.edu>
41 * tests/chmod/usage: Undo the s/files/file/ change, but add
42 comments about why the old version was desired.
44 2005-09-25 Jim Meyering <jim@meyering.net>
46 * tests/ls-2/tests (setuid-etc): Work around output mismatch when
47 a just-created test file cannot be made set-group-ID.
49 Avoid test failures on alpha-linux-1.sf.net.
50 * tests/chmod/usage: Use newer trap and tmpdir-creation framework.
51 Fix apparent typos (s/files/file/) in inner loop.
53 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
55 * NEWS: "touch -" now touches standard output.
56 * src/touch.c (touch): Implement this.
57 (usage): Document this.
59 * src/copy.c (HAVE_FCHMOD, HAVE_FCHOWN): Define to 0 if not defined.
60 (copy_reg): New args CHOWN_SUCCEDED and DST_SB. All callers changed.
61 Add a "goto close_src_and_dst_desc;" that was missing in the
63 (copy_reg) [HAVE_FCHOWN]: Prefer fchown to chown.
64 (copy_reg) [HAVE_FCHMOD]: Prefer fchmod to chmod.
65 (copy_internal): Don't invoke chown if fchown worked,
66 and likewise for chmod and fchmod.
68 2005-09-24 Jim Meyering <jim@meyering.net>
70 * src/shred.c: Use `#ifdef HAVE_CONFIG_H', not `#if HAVE_CONFIG_H',
71 for consistency with gnulib.
72 * src/dircolors.c: Likewise.
74 * Makefile.maint (sc_no_if_have_config_h): New rule.
75 (syntax-check-rules): Add it.
76 .x-sc_no_if_have_config_h: New file.
77 * Makefile.am (EXTRA_DIST): Add it.
79 * tests/seq/basic (eq-wid-1, eq-wid-2): Disable these tests for now.
80 They fail with non-gcc compilers and some combinations
81 of options and libraries on Solaris systems.
83 * tests/misc/date (uninit-64): Restore this test.
84 Add start-up code to detect, and work around, the cases in
85 which the test might fail.
87 2005-09-24 Paul Eggert <eggert@cs.ucla.edu>
89 * tests/misc/date (uninit-64): Remove this test. It wasn't
90 portable in theory (it doesn't work on hosts where 'int' is 64
91 bits, example) or in practice (Solaris 8 localtime returns garbage
92 in tm_year for the specified date, but that's not coreutils's
95 2005-09-23 Paul Eggert <eggert@cs.ucla.edu>
97 * src/copy.c (copy_reg): Preserve time stamps if
98 x->preserve_timestamps is set, using futimens so that
99 we needn't resolve the path again.
100 (copy_internal): Don't preserve time stamps if copy_reg did it
102 * src/install.c (change_timestamps): First arg is source
103 struct stat, not file name. All uses changed.
104 (install_file_in_file): Stat the source file.
105 Don't try to change time stamps if copy_file did it.
106 * src/system.h: Don't include utime.h; not needed.
107 (struct utimbuf) [!defined HAVE_STRUCT_UTIMBUF]: Remove; not needed.
109 2005-09-23 Jim Meyering <jim@meyering.net>
111 * src/od.c: Use `verify' to ensure that our hard-coded
112 bytes_to_*_digits arrays are long enough. Of course, 17+-byte
113 integral types aren't on the near horizon, but just in case...
114 (MAX_INTEGRAL_TYPE_SIZE): Move definition to precede new first use.
115 (bytes_to_oct_digits, bytes_to_signed_dec_digits):
116 (bytes_to_unsigned_dec_digits, bytes_to_hex_digits): Change base
117 type from `char' to the clearer `unsigned int'.
119 2005-09-21 Paul Eggert <eggert@cs.ucla.edu>
121 * src/rmdir.c (EEXIST, ENOTEMPTY): Remove unused macros.
125 * src/dircolors.c: Include strcase.h.
126 * src/pinky.c: Include canon-host.h rather than declaring
127 canon_host ourselves.
128 * src/who.c: Likewise.
130 * src/system.h (X2NREALLOC, X2REALLOC): Moved here from
131 ../lib/xalloc.h, with args properly parenthesized, and using
132 verify_expr rather than the old VERIFY_EXPR.
134 2005-09-21 Jim Meyering <jim@meyering.net>
136 * tests/install/basic-1: Require that this test be run as non-root.
137 Otherwise, it fails due to the fact that the chmod 0 . doesn't
140 2005-09-20 Jim Meyering <jim@meyering.net>
142 * src/remove.c (write_protected_non_symlink): Change comment to
145 2005-09-19 Jim Meyering <jim@meyering.net>
147 * src/remove.c (remove_dir): Return RM_ERROR, not `1',
148 when attempting to remove `/' with --preserve-root.
150 * src/remove.c (remove_cwd_entries): Syntactic tweak: move an
151 assignment out of an if-expression.
153 2005-09-17 Jim Meyering <jim@meyering.net>
155 * src/extract-magic (usage): Request that additions be sent to
156 bug-coreutils@gnu.org, too.
158 2005-09-16 Jim Meyering <jim@meyering.net>
160 * tests/misc/date (rfc822-1): Compensate for Solaris 5.9's /bin/sh,
161 which emits a diagnostic to stderr when this test's LC_ALL=de_DE
162 setting cannot be honored.
164 * tests/misc/date (subfmt-up1): Put quotes around format string
165 to protect `^' from interpretation by some shells.
166 Add a use of OUT_SUBST to compensate for Solaris strftime's slightly
167 different formatting of %c.
169 * src/dd.c (main): When failing to truncate, mention both the seek
170 block count and the block size, in case the block size is very large.
171 Now `make distcheck' should pass, once again.
173 2005-09-16 Paul Eggert <eggert@cs.ucla.edu>
175 * src/copy.c: Include stat-time.h.
176 (copy_internal): Use its functions instead of the obsolete
178 * src/cp.c (re_protect): Likewise.
179 * src/date.c (main): Likewise.
180 * src/du.c (struct duinfo, duinfo_init, duinfo_set, duinfo_add):
181 (show_date, print_size, process_file): Likewise.
182 * src/install.c (change_timestamps): Likewise.
183 * src/ls.c (cmp_ctime, cmp_mtime, cmp_atime, print_long_format):
185 * src/pr.c (init_header): Likewise.
186 * src/stat.c (human_time, print_stat): Likewise.
187 * src/tail.c (record_open_fd, tail_forever): Likewise.
188 * src/test.c (get_mtime, binary_operator): Likewise.
189 * src/touch.c (touch, main): Likewise.
190 * src/test.c (get_mtime): Renamed from age_of. All uses changed.
192 2005-09-16 Jim Meyering <jim@meyering.net>
194 Date no longer needs to allocate virtual memory to do its job,
195 so it can no longer fail due to an out-of-memory condition.
197 * src/date.c: Include fprintftime.h.
198 Don't include strftime.h or xanstrftime.h -- no longer needed.
199 (show_date): Use new fprintftime function rather than xanstrftime.
200 Correct comment: this function no longer handles a NULL format string.
201 * src/du.c: Likewise.
202 * NEWS: Mention this.
204 * tests/misc/date (subfmt-up1): Test the combination of the
205 to-upper-case modifier (^) and a conversion specifier that
206 expands to a string containing lower case characters.
208 2005-09-15 Paul Eggert <eggert@cs.ucla.edu>
210 * NEWS: uname -a no longer generates the -p and -i outputs if they
212 * src/uname.c (usage): Document this.
213 (main): Implement this.
215 2005-09-14 Jim Meyering <jim@meyering.net>
217 * tests/misc/date (tz-5w, tz-5wf): Test new %:z format with
220 2005-09-13 Paul Eggert <eggert@cs.ucla.edu>
222 * src/dd.c: Detect some very unlikely buffer overflows.
223 (INPUT_BLOCK_SLOP, OUTPUT_BLOCK_SLOP): New macros.
224 (MAX_BLOCKSIZE): Now accepts an arg. All uses changed.
225 (page_size): New var.
226 (scanargs, skip, main): Use more-straightforward way to detect overflow.
227 (dd_copy): Use page_size rather than invoking getpagesize.
228 Use INPUT_BLOCK_SLOP, OUTPUT_BLOCK_SLOP.
229 (main): Set page_size.
230 Avoid a call to stat in the usual case where ftruncate succeeds.
232 * src/expr.c (docolon): Add IF_LINT check to avoid GCC warning.
234 * configure.ac: Don't invoke AC_CONFIGURE_HOST directly; AB_INIT
235 does it for us, and our invocation evokes a diagnostic from
238 * NEWS: date has a new --rfc-3339 option, and the old --iso-8601
239 option is deprecated. date, du, ls, and pr also have new time format
240 specifiers %:z, %::z, %:::z.
241 * src/date.c (TIME_SPEC_DATE): No longer needs to be nonzero, so
243 (TIME_SPEC_HOURS, TIME_SPEC_MINUTES): Must be at end now, so put
245 (time_spec_string, time_spec): Hours and minutes must be at
246 start now, so put them there.
247 (rfc_2822_format): Now a string constant, not a boolean. All uses
249 (iso_8601_format, rfc_format): Remove.
250 (RFC_3339_OPTION): New constant.
251 (long_options): Add --rfc-3339.
252 (usage): Add --rfc-3339. Don't mention --iso-8601.
253 Mention %:z, %::z, %:::z.
254 (main): Simplify calculation of 'format'; it was getting too hairy
255 to follow. Add --rfc-3339.
256 (show_date): Assume format arg is not NULL, which is the case
257 now. The default code is moved to 'main'. This simplifies things
258 and allows the default to be calculated just once.
259 * tests/misc/date: Add tests for --rfc-3339, %:z, %::z, %:::z.
261 2005-09-13 Jim Meyering <jim@meyering.net>
263 * Makefile.maint (GZIP_ENV): Add --rsyncable option.
264 (makefile-check): Escape a `$' in a diagnostic.
266 * configure.ac: Use AB_INIT (from autobuild).
268 2005-09-11 Jim Meyering <jim@meyering.net>
270 * src/factor.c (usage): Remove leading spaces in 2-line
271 description, so that help2man doesn't mangle it.
272 Reported by Justin Pryzby.
274 2005-09-10 Jim Meyering <jim@meyering.net>
276 csplit could produce corrupt output, given input lines longer than 8KB
278 * src/csplit.c (load_buffer): Don't read from free'd memory
279 when handling lines longer than the initial buffer length.
280 (save_to_hold_area): Don't leak the previous hold_area buffer.
281 Reported by Tristan Miller and Luke Kendall.
282 * NEWS: Mention this.
283 * tests/misc/csplit: New test for this.
285 * src/csplit.c (load_buffer): Avoid integer overflow in buffer
286 size calculations for very long lines.
288 2005-09-09 Paul Eggert <eggert@cs.ucla.edu>
290 Support regular expressions in 64-bit code correctly, by
291 importing the latest gnulib regexp code, and not assuming
292 that sizes fit in 32 bits.
293 * src/csplit.c (process_regexp): Store match length in regoff_t,
294 not int. Assume that negative return values less than -2
295 represent regoff_t overflow.
296 * src/expr.c (docolon): Likewise.
297 * src/nl.c (proc_text): Likewise.
298 * src/ptx.c (SKIP_SOMETHING, find_occurs_in_text): Likewise.
299 * src/tac.c (tac_seekable): Likewise.
300 * src/expr.c (docolon) Check for size calculation overflow.
301 * src/nl.c (build_type_arg): Likewise.
302 * src/ptx.c (matcher_error): New function.
303 (SKIP_SOMETHING): Use it to report matcher errors.
304 (alloc_and_compile_regex): No longer any need to worry about
305 int versus size_t mismatch.
307 * NEWS: Document "niceness" vs "nice value".
308 * configure.ac (utils_cv_func_setpriority): Simplify the tests.
309 Define HAVE_NICE rather than NICE_PRIORITY (since a niceness is
310 not a priority); all uses changed.
311 * src/nice.c (main): Hoist errno=0 outside the ifdef.
313 2005-09-09 Jim Meyering <jim@meyering.net>
315 * tests/misc/date (neg-secs2, fill-1, fill-2): Add new tests.
317 2005-09-07 Paul Eggert <eggert@cs.ucla.edu>
319 Use the phrase "niceness" instead of "nice value" to describe
320 the biased nice value that can go negative. This corrects
321 a discrepancy with POSIX, which states that nice values are
323 * src/nice.c (GET_NICENESS): Renamed from GET_NICE_VALUE.
325 (usage): Say "niceness" rather than "nice value".
326 (main): Say "niceness" rather than "priority" (which is something else
329 2005-09-07 Jim Meyering <jim@meyering.net>
331 * src/du.c (time_args): Use NULL in place of 0.
333 2005-09-05 Jim Meyering <jim@meyering.net>
335 * src/dcgen: Don't omit comments until there is better documentation.
337 Colorize set-user-ID and set-group-ID files and sticky,
338 other-writable, and sticky-and-other-writable directories.
339 * src/dircolors.c (slack_codes): Add new dircolors mode names.
340 (ls_codes): Add corresponding two-letter ls mode strings.
341 * src/ls.c (indicator_no[]): Add new symbols.
342 (indicator_name[]): Add corresponding mode strings.
343 (color_indicator[]): Add an entry for each new mode string.
344 (print_color_indicator): Honor new types.
345 * src/dircolors.hin: Document the default colors for the new strings.
346 From Mike Frysinger, based on a patch from Fedora.
347 * tests/ls-2/tests (setuid-etc): New test, for the above.
349 2005-08-29 Paul Eggert <eggert@cs.ucla.edu>
351 * NEWS: "rm -FOO" now suggests "rm ./-FOO" if the file "-FOO"
352 exists and "-FOO" is not a valid option.
353 * src/rm.c: Include lstat.h, quotearg.h.
354 (diagnose_leading_hyphen): New function.
357 2005-08-27 Jim Meyering <jim@meyering.net>
359 * src/du.c: Go ahead and leave the patch in (i.e., revert
360 today's change). It doesn't cause a problem after all, since
361 --exclude-from=- is always handled before --files0-from=F.
363 * src/du.c: Revert the du.c part of the change from 2005-07-02:
364 That change (to reopen stdin on F for --files0-from=F) made it so
365 --exclude-from=- and --files0-from=F would not work together.
367 2005-08-23 Jim Meyering <jim@meyering.net>
369 * configure.ac: Use `5.3.1-cvs' as the version string.
370 * NEWS: Adjust accordingly.
372 * Makefile.maint (sc_useless_cpp_parens): New rule.
373 (syntax-check-rules): Add it.
374 * .x-sc_useless_cpp_parens: New file.
375 * Makefile.am (EXTRA_DIST): Add it.
377 * src/od.c: Include <float.h> unconditionally.
378 * src/uptime.c (print_uptime): Remove unnecessary parens in
379 `#if defined (SYMBOL)' expressions.
380 * src/system.h: Likewise.
381 * src/hostname.c: Likewise.
382 * src/su.c: Likewise.
383 * src/test.c: Likewise.
385 2005-08-22 Jim Meyering <jim@meyering.net>
387 * src/tail.c (xwrite_stdout): Rename from xwrite. Remove always-
388 equal-to-STDOUT_FILENO parameter and associated assertion.
391 2005-08-21 Jim Meyering <jim@meyering.net>
393 * src/ln.c (do_link): If ln is invoked with --interactive (-i),
394 encounters an existing destination file, and gets an affirmative
395 response, then first try to unlink the destination file rather
396 than simply failing. Suggestion from Karl Berry.
397 FIXME: add test for this
399 * src/ln.c (main): Declare `target_directory' with const attribute.
400 * src/du.c (time_style): Add `const' attribute.
401 (tot_dui): Remove unnecessary (and too-short) initializer list.
403 2005-08-19 Jim Meyering <jim@meyering.net>
405 * src/sort.c (usage) [-b,-t]: Ensure that there are at least two
406 spaces between each option and the corresponding description -- this
407 lets help2man format entries properly. Reported by Edward Welbourne.
409 2005-08-17 Jim Meyering <jim@meyering.net>
411 * src/sort.c (usage): Fix typo s/POS 2/POS2/.
412 Reported by Edward Welbourne.
414 * tests/misc/date [neg-secs]: New test for today's strftime.c bug fix.
415 * tests/misc/date: Remove terminating "\n"s once again.
416 Automatically add them whenever EXIT != 0.
418 2005-08-16 Paul Eggert <eggert@cs.ucla.edu>
420 * src/df.c (show_dev): New arg STAT_FILE. All uses changed.
421 This sometimes gives better results on networked file systems
422 that do not respect POSIX semantics. Problem reported by
425 2005-08-15 Jim Meyering <jim@meyering.net>
427 Don't print uninitialized data (or anything else) to stdout
428 upon localtime failure.
429 * src/date.c (show_date): Remove stray `puts (buf);' (debugging?)
430 from the 2004-02-02 change.
431 * tests/misc/date (uninit-64): New test for the above.
432 Rewrite all other OUT strings to include the terminating "\n".
434 2005-08-14 Jim Meyering <jim@meyering.net>
436 * src/md5sum.c (usage): Fix typo s/formated/formatted/ reported
439 Use one fewer file descriptor in a common case.
440 * src/touch.c: Include "fd-reopen.h", rather than "fcntl--.h".
441 Use fd_reopen rather than open.
443 2005-08-14 James Youngman <jay@gnu.org>
445 * src/test.c (age_of): Return the nanoseconds part of the timestamp,
447 (binary_operator) [-nt, -ot]: Use nanosecond values to break ties.
449 2005-08-14 Jim Meyering <jim@meyering.net>
451 * src/ls.c (long_time_expected_width): Revert last change, just to
452 be paranoid, and add a comment explaining why. Paul Eggert mentioned
455 * src/wc.c: Don't define mbrtowc at all.
456 If mbstate_t is not defined, then AC_TYPE_MBSTATE_T will define
457 it to `int' for us. Now wc.c really does compile on HP-UX 11.23.
459 2005-08-13 Jim Meyering <jim@meyering.net>
461 * tests/date: Remove directory
462 * tests/Makefile.am (SUBDIRS): Remove date.
463 * configure.ac (AC_CONFIG_FILES): Remove tests/date/Makefile.
465 * tests/Coreutils.pm: New keywords, ENV and ENV_DEL, to support
468 With todays additions, the generated shell script,
469 tests/date/date-tests had becoming far too large (over 350KB),
470 so use the superior-but-perl-requiring framework instead.
471 * tests/date/Test.pm: Move all tests from here...
472 * tests/misc/date: ...to this new file.
473 * tests/misc/Makefile.am (TESTS): Add date.
475 * tests/date/Test.pm (test_vector) [cross-dst]: New test for
476 just-fixed getdate.y bug.
477 * tests/date/Test.pm (test_vector): Add 364 more tests like the above.
478 Remove unused $sunos4 variable.
480 2005-08-12 Jim Meyering <jim@meyering.net>
482 * src/nohup.c (main): Explain why we reopen stdin for write-only access.
484 * src/ls.c (long_time_expected_width): Don't test for failed localtime.
485 That cannot happen when the result date's year is in range.
486 Add an assertion instead.
488 * src/ls.c (sort_files): Use cleaner `sizeof *VAR_NAME'
489 rather than `sizeof (TYPE_NAME)'.
490 * src/ptx.c (sort_found_occurs, digest_word_file): Likewise.
491 (alloc_and_compile_regex): Likewise.
493 * src/wc.c: Test `!defined HAVE_MBSTATE_T' rather than
494 `defined mbstate_t' to detect missing support for mbstate_t.
495 The latter didn't work for HP-UX 11.23.
497 Add bulletproofing in case stdin is closed.
498 * src/dircolors.c (have_read_stdin): Remove global variable.
499 (dc_parse_stream): Always use stdin (freopen, if needed) rather
500 than sometimes using fopen to get a new file descriptor.
501 Call fclose unconditionally.
502 (main): Don't close stdin here. If needed, now it's already done
505 * src/dircolors.c (dc_parse_file): Remove comment about
506 now-removed OPENOPTS.
508 * src/fold.c (fold_file): Cosmetic: use X2REALLOC rather than x2realloc.
509 * src/pr.c (main): Likewise.
511 * src/csplit.c (new_control_record): Cosmetic: use X2NREALLOC (only
512 two arguments) rather than x2nrealloc (with three).
513 * src/cut.c (ADD_RANGE_PAIR): Likewise.
514 * src/expand.c (add_tab_stop): Likewise.
515 * src/join.c (extract_field, getseq): Likewise.
516 * src/od.c (decode_format_string): Likewise.
517 * src/sort.c (add_temp_dir): Likewise.
518 * src/unexpand.c (add_tab_stop): Likewise.
520 * src/pr.c (main): Cosmetic: use '\0' in place of 0.
522 2005-08-02 Jim Meyering <jim@meyering.net>
524 * src/date.c: Include "xanstrftime.h".
525 (show_date): Use xanstrftime instead of open-coding it.
526 * src/du.c: Likewise.
528 2005-07-29 Jim Meyering <jim@meyering.net>
530 * src/date.c (show_date): Remove now-unnecessary code that
531 treated an empty format string as a special case.
532 * tests/date/Test.pm (empty-format): New test, for this case.
534 2005-07-19 Jim Meyering <jim@meyering.net>
536 * src/md5sum.c (usage): Adjust printf argument list to match
539 2005-07-19 Paul Eggert <eggert@cs.ucla.edu>
541 * NEWS: md5sum --check now accepts multiple input files, and
542 similarly for sha1sum. Extension suggested by Chris Girling.
543 * src/md5sum.c (usage, main): Support this new usage.
545 2005-07-18 Paul Eggert <eggert@cs.ucla.edu>
547 Fix a problem noted by James Youngman: VPATH-style builds don't
548 work because of po file problems.
549 * src/Makefile.am (BUILT_SOURCES): Remove false.c.
550 (false.c): Remove; it's now a source file.
551 * src/false.c: New file.
552 * src/true.c (EXIT_STATUS): New macro.
553 (PROGRAM_NAME, usage): Behave like "false" if EXIT_STATUS indicates.
554 (usage): Remove "These option names may not be abbreviated."
556 2005-07-15 Paul Eggert <eggert@cs.ucla.edu>
558 * src/nohup.c (main): Don't worry about POSIXLY_CORRECT. Today's
559 Austin Group Minutes says that the GNU behavior will be put
560 forward as proposed text for a future revision.
562 2005-07-13 Paul Eggert <eggert@cs.ucla.edu>
564 * src/Makefile.am (nanosec_libs): Remove $(FESETROUND_LIBM); no longer
565 needed. Problem reported by Jeff Bailey.
567 2005-07-12 Jim Meyering <jim@meyering.net>
569 * Makefile.maint (copyright-check): Reflect rearrangement in
572 2005-07-11 Paul Eggert <eggert@cs.ucla.edu>
574 * NEWS: Binary input and output are now implemented more consistently.
575 These changes affect only platforms like MS-DOS that distinguish
576 between binary and text files.
577 * src/cat.c (usage, main, long_options) [O_BINARY]:
578 Remove support for -B. Use same rules as other programs to decide
579 whether to use binary I/O, except that the -bensAE options always
581 * src/cat.c (main): Avoid setmode; use POSIX-specified routines instead.
582 * src/cksum.c (cksum): Likewise.
583 * src/head.c (head_lines, head_file): Likewise.
584 * src/od.c (open_next_file): Likewise.
585 * src/split.c (main): Likewise.
586 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
587 * src/tac.c (copy_to_temp, tac_file, main): Likewise.
588 * src/tail.c (tail_bytes, tail_lines, tail_file, main): Likewise.
589 * src/tee.c (tee): Likewise.
590 * src/tr.c (main): Likewise.
591 * src/wc.c (wc): Likewise.
592 * src/copy.c (copy_reg): Always copy in binary mode.
593 * src/expand.c (expand): Always copy in text mode. POSIX says
594 the input and output must be text.
595 * src/unexpand.c (unexpand): Likewise.
596 * src/head.c (elide_tail_bytes_file, elide_tail_lines_file, head_bytes):
597 (head_lines, head_file): Always use binary mode except for std tty.
598 * src/md5sum.c (usage): Clarify whether text or binary is the default.
599 (split_3, main): BINARY is now a 3-way value. All uses changed.
600 (digest_file): Likewise. Clear *BINARY if we determine the file
601 to be text. All uses changed.
602 (main): Don't report a file to be binary if we actually read it
603 as text in MS-DOS, because it was a terminal.
604 * src/shred.c (wipefile): Always use binary mode. Clearly this
605 never worked right on DOS!
606 * src/system.h (setmode, fileno): Remove; no longer needed, we think.
607 (SET_MODE, SET_BINARY, SET_BINARY2): Remove.
608 [defined __DJGPP__]: Don't include <io.h> or <sys/exceptn.h>.
609 * src/wc.c (wc_file): FILE might be null now.
610 (main): Simplify code a bit, so that fewer places need the
613 2005-07-09 Paul Eggert <eggert@cs.ucla.edu>
615 * src/comm.c, src/csplit.c, src/dd.c, src/join.c, src/md5sum.c:
616 * src/pr.c, src/sort.c, src/tee.c:
617 Don't include stdio.h; no longer needed.
619 2005-07-08 Paul Eggert <eggert@cs.ucla.edu>
621 Fix porting problems reported by Eric Blake.
623 * configure.ac: Remove check for AC_HEADER_TIOCGWINSZ.
624 * src/cat.c, src/ls.c, src/stty.c: Include stropts.h if available,
625 because POSIX says that's where ioctl is declared.
626 * src/cat.c: Use HAVE_SYS_IOCTL_H instead of _POSIX_SOURCE
627 to decide whether to include <sys/ioctl.h>.
628 * src/stty.c: Use only HAVE_SYS_IOCTL_H to decide whether
629 to include <sys/ioctl.h>.
631 * src/id.c (print_user): Don't assume uid fits in unsigned int.
632 (print_group): Likewise, for gid.
634 2005-07-05 Paul Eggert <eggert@cs.ucla.edu>
636 * src/system.h (DECIMAL_DIGIT_ACCUMULATE): Generate a hard error
637 (not just a warning) if GCC is used and the types don't match.
639 2005-07-04 Paul Eggert <eggert@cs.ucla.edu>
641 * src/system.h (VERIFY_W_TYPEOF): Remove; no longer needed.
642 (DECIMAL_DIGIT_ACCUMULATE): Change last arg from T's maximum value
643 to T itself. All callers changed. Check that T is unsigned, and
644 that Accum is of type T. This fixes a bug in the unlikely case
645 where SIZE_MAX <= INT_MAX, and it no longer requires typeof to do
646 the proper validity checks.
648 * src/od.c: Adjust to verify.h change.
649 * src/system.h (VERIFY_W_TYPEOF): Likewise.
651 2005-07-04 Jim Meyering <jim@meyering.net>
653 * src/system.h: Include "verify.h".
655 * src/system.h (verify): Rename from VERIFY_EXPR, to be lower case,
656 like assert. Use sizeof, rather than equivalent ((...)0), for
657 it's slightly simpler syntax. Suggestions from Paul Eggert.
658 (verify_decl): Rename from VERIFY.
659 * src/od.c: Reflect name change.
661 2005-07-03 Jim Meyering <jim@meyering.net>
663 * NEWS: cp and mv: the --reply=X option is deprecated
664 Suggested by Bob Proulx, after numerous user complaints
665 about how --reply=no appeared not to work.
666 * src/mv.c (main): Using --reply now evokes a warning.
667 (usage): Remove description of --reply.
668 * src/cp.c (main): Using --reply now evokes a warning.
669 (usage): Remove description of --reply.
670 * tests/mv/i-link-no: Adjust for new diagnostic.
671 * tests/mv/reply-no: Likewise.
673 * src/printf.c (verify_numeric): Rename from verify.
676 2005-07-03 Paul Eggert <eggert@cs.ucla.edu>
678 * src/copy.h: Include "lstat.h" rather than rolling our own.
679 * src/ls.c: Likewise.
680 * src/remove.c: Likewise.
682 2005-07-02 Paul Eggert <eggert@cs.ucla.edu>
684 Cleanup to isolate "safer" functions to a small part of the code.
685 * src/comm.c: Include stdio--.h, not stdio-safer.h.
686 (compare_files): Use fopen, not fopen_safer.
687 * src/copy.c: Include fcntl--.h, not unistd-safer.h.
688 (copy_reg): Don't call fd_safer; no longer needed
689 now that we include fcntl--.h.
690 * src/csplit.c: Include fd-reopen.h.
691 Include stdio--.h, not stdio-safer.h.
692 (input_desc): Remove. All uses changed to STDIN_FILENO.
693 (set_input_file): Reopen stdin, to simplify code.
694 (create_output_file): Use fopen, not fopen_safer.
695 * src/dd.c: Include fd-reopen.h.
696 (open_fd): Remove. All callers changed to use fd_reopen instead.
697 * src/join.c: Include stdio--.h, not stdio-safer.h.
698 (main): Use fopen, not fopen_safer.
699 * src/md5sum.c: Include stdio--.h.
700 (digest_check): Don't try to read both checksums and data from stdin.
701 * src/nohup.c: Include fd-reopen.h.
702 Include unistd--.h, not unistd-safer.h.
703 (main): Use fd_reopen to simplify code. When replacing stdin,
704 use "/dev/null" not "/", as that's less likely to go wrong these days.
705 (main): Use dup, not dup_safer.
706 * src/pr.c: Include stdio--.h, not stdio-safer.h.
707 (open_file): Invoke fopen, not fopen_safer.
708 * src/shred.c: Include fcntl--.h, not unistd-safer.h.
709 (wipename, wipe_file): Don't use fd_safer; no longer needed
710 now that we include fcntl--.h.
711 * src/sort.c: Include stdio--.h rather than stdio-safer.h.
712 Include stdlib--.h. Do not include unistd-safer.h.
713 (create_temp_file): Don't call fd_safer; no longer needed
714 now that we include *--.h files.
715 (xfopen): Don't call fopen_safer, for similar reasons.
716 * src/split.c: Include fcntl--.h rather than unistd-safer.h.
718 (input_desc): Remove. All uses replaced by STDIN_FILENO.
719 (cwrite): Don't call fd_safer; no longer needed now that
720 we include fcntl--.h.
721 (main): Reuse stdin rather than opening a new one. This
722 saves a file descriptor.
723 * src/stty.c: Include fd-reopen.h.
724 (display_all, display_settings, display_window_size, set_window_size):
725 Remove fd arg, since we now assume stdin. All callers changed.
726 (main): Reuse stdin rather than opening a new one. This
727 saves a file descriptor.
728 * src/tac.c: Include stdlib--.h rather than unistd-safer.h.
729 (copy_to_temp): Don't call fd_safer; no longer needed now
730 that we include stdlib--.h.
731 * src/tail.c: Include fcntl--.h, not unistd-safer.h.
732 (recheck, tail_file): Don't call fd_safer; no longer needed
733 now that we include fcntl--.h.
734 * src/tee.c: Include stdio--.h, not stdio-safer.h.
735 (tee): Don't call fopen_safer; no longer needed now that we
737 * src/touch.c: Include fcntl--.h, not unistd-safer.h.
738 (touch): Don't call fd_safer; no longer needed now that
739 we include fcntl--.h.
741 * src/du.c (main): Reuse stdin rather than opening a new stream.
742 This saves a file descriptor.
743 * src/uniq.c: Don't include stdio-safer.h; no longer needed.
744 (writeline): Remove stream arg; we now always output to stdout.
746 (check_file): Reuse stdout rather than opening a new stream.
747 This saves a file descriptor.
749 2005-07-02 Jim Meyering <jim@meyering.net>
751 * Makefile.maint (sc_obsolete_symbols): New rule.
752 (syntax-check-rules): Add it to the list.
753 * Makefile.am (EXTRA_DIST): Add .x-sc_obsolete_symbols.
754 * .x-sc_obsolete_symbols: New file.
756 2005-07-01 Jim Meyering <jim@meyering.net>
758 * src/system.h: Assume HAVE_FCNTL_H (i.e., include <fcntl.h>
759 unconditionally, and don't include <sys/file.h>).
760 * src/system.h: Likewise for HAVE_UNISTD_H.
762 2005-06-30 Jim Meyering <jim@meyering.net>
764 * src/cp.c: Add uses of ARGMATCH_VERIFY to ensure that
765 corresponding option string and value arrays are consistent.
766 * src/date.c: Likewise.
767 * src/du.c: Likewise.
768 * src/ls.c: Likewise.
769 cp.c and date.c each had a harmless trailing `, 0' (now-removed)
772 * src/system.h (VERIFY): Guard definition with #ifndef.
773 (VERIFY_EXPR): Undef before defining.
775 2005-06-29 Jim Meyering <jim@meyering.net>
777 * src/pr.c (main, store_char): Use X2REALLOC rather than x2realloc.
778 * src/du.c (show_date): Likewise.
779 * src/date.c (show_date): Likewise.
780 * src/od.c (dump_strings): Likewise.
781 * src/sort.c (fillbuf): Likewise.
782 * src/chmod.c (main): Likewise.
784 * src/system.h (VERIFY): Rewrite to use string-concatenation
785 and __LINE__ so as not to require a struct name parameter.
786 (GL_CONCAT, GL_CONCAT2): Define helper macros.
787 * src/od.c: Update sole use.
789 * src/ls.c (gobble_file): Use stat.st_author, not stat.st_uid
790 when computing the --author column width. This bug might have
791 resulted in misaligned columns when using the --author option
792 on the Hurd. Spotted by Arnold Robbins.
794 2005-06-28 Jim Meyering <jim@meyering.net>
796 * src/pr.c (main, store_char): Use x2realloc on 1-byte base types,
797 not x2nrealloc. The former is a little more concise and readable.
798 N.B. this sort of transformation is ok only when the base type is
799 unlikely ever to change to a multibyte type.
800 * src/du.c (show_date): Likewise.
801 * src/date.c (show_date): Likewise.
802 * src/od.c (dump_strings): Likewise.
803 * src/sort.c (fillbuf): Likewise.
805 2005-06-24 Jim Meyering <jim@meyering.net>
807 * src/mv.c (usage): Clarify how --reply=no works.
809 2005-06-23 Paul Eggert <eggert@cs.ucla.edu>
811 Address the following "du" issues:
813 - The option name "--last-time=TYPE" is different from the ls's option
814 "--time=TYPE" with a similar meaning. I assume this wasn't intended.
816 - --time-style implies --time, but this is not true for "ls". It's
817 better to be consistent.
819 - Since we don't have POSIX compatibility concerns, there's no need
820 for the "posix-" styles, or for support of styles with newlines, or
821 for the "locale" style, except for parsing the TIME_STYLE
822 environment variable.
824 - It's cleaner (and these days, no less efficient) to use functions
825 rather than macros when possible.
827 - struct duinfo doesn't need a 'valid' flag; you can simply use a time
828 stamp that is less than all valid time stamps.
830 - The code needs a bit of reformatting to fit the usual GNU style.
832 * NEWS: du's --last-time option is now --time.
833 * doc/coreutils.texi (ls invocation): Fix typo: --time=use is
834 equivalent to --time=atime, not --time=ctime.
835 (ls invocation, du invocation): Fix typo: --time-style=long-iso
836 is equivalent to a time style with a leading "+".
837 (du invocation): --last-time is now --time.
838 --time-style no longer implies --time.
839 The locale and posix- stuff now works only for TIME_STYLE, not
840 for --time-style. Give equivalent format for --time-style=iso.
841 * src/du.c: Do not include hard-locale.h.
842 (struct duinfo): Remove 'valid' member. All uses changed to use
843 negative nsec instead.
844 (DUIINFO_INI, DUINFO_SET, DUINFO_ADD): Remove.
845 (duinfo_init, duinfo_set, duinfo_add): New functions, taking the
846 role of the removed macros.
847 (opt_time): Renamed from opt_last_time. All uses changed.
848 (TIME_OPTION): Renamed from LAST_TIME_OPTION. All uses changed.
849 (long_options, usage): Rename --last-time to --time.
850 (locale_time_style): Remove.
851 (time_style_args, time_style_types, usage): Remove support for
853 (show_date): Now returns void, since nobody looked at the result.
854 Assume FORMAT is not null. An empty FORMAT now outputs an empty time.
855 Simplify nstrftime invocation.
856 (main): Put in ls compatibility workarounds only for TIME_STYLE,
857 not for --time-style. Omit unnecessary space in iso time style.
859 2005-06-23 Jim Meyering <jim@meyering.net>
861 * src/du.c (time_format): Add `const' attribute.
863 * src/date.c (show_date): Use puts rather than printf ("%s\n",.
865 * src/du.c (show_date): Rename local `time_format' so as not to
866 shadow the file-scoped global by that name.
867 (show_date): Add a FIXME comment.
869 * src/du.c: Include hard-locale.h and strftime.h.
870 (DUINFO_INI, DUINFO_SET, DUINFO_ADD):
871 Enclose body in `do {...} while (0)', not just `{...}'.
872 Adjust uses (add semicolons).
873 Adjust formatting, indentation.
874 (usage): Tweak formatting to maintain more or less constant indentation.
876 2005-06-14 William Brendling <wbrendling@gmail.com>
878 * src/du.c: Add --last-time and --time-style options.
880 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
882 * tests/umask-check: New file.
883 * tests/Makefile.am (EXTRA_DIST): Add umask-check.
884 * tests/mkdir/perm: Use umask-check.
885 * tests/cp/cp-parents: Likewise, instead of using chmod
886 as described below. Problem reported by Kevin Mudrick.
888 2005-06-22 Jim Meyering <jim@meyering.net>
890 Make rmdir produce diagnostics like this:
891 rmdir: /tmp: Permission denied
893 rmdir: `/tmp': Permission denied
895 * src/rmdir.c: Include "quotearg.h", not "quote.h".
896 (remove_parents, main): Use quotearg_colon, not quote.
898 2005-06-22 Paul Eggert <eggert@cs.ucla.edu>
900 * tests/cp/cp-parents: Use chmod to work around some hosts with
901 ACL problems. Problem reported by Kevin Mudrick.
903 2005-06-21 Jim Meyering <jim@meyering.net>
905 * tests/du/deref-args: Use --apparent-size to avoid the vagaries
906 of counting blocks. Kevin Mudrick reported that this test would
907 fail on an nfs-mounted directory where attribute-caching is
910 2005-06-19 Jim Meyering <jim@meyering.net>
912 * src/tac.c (tac_mem, tac_stdin_to_mem): Remove #if-0'd functions.
914 * src/shred.c (usage): Use `file system', not `filesystem'.
916 2005-06-18 Jim Meyering <jim@meyering.net>
918 * src/tr.c (unquote): Remove unnecessary `' quotes from a diagnostic.
920 2005-06-17 Jim Meyering <jim@meyering.net>
922 * src/shred.c (usage): Clarify that shred works on an ext3 file
923 system as long as it's not in data=journal mode.
924 Tiny change by Mark Melahn.
926 2005-06-16 Paul Eggert <eggert@cs.ucla.edu>
928 * src/hostid.c (main): Don't print fewer than 8 digits, or spurious
929 leading "f"s. "f" problem reported by Tim Waugh.
930 * NEWS: Document this.
932 2005-06-16 Jim Meyering <jim@meyering.net>
934 Don't embed `this'-style quotes in format strings.
935 * src/tr.c: Rather than this: error (..., "...`%s'...", arg);
936 do this: error (..., "...%s...", quote (arg));
937 * src/od.c, src/tr.c, src/csplit.c, src/date.c, src/hostname.c:
938 * src/join.c, src/ptx.c, src/seq.c, src/sort.c, src/split.c:
939 * src/split.c, src/tail.c: Likewise.
941 * src/sleep.c: Include "quote.h". Remove hard-coded quotes, as above.
942 * src/nice.c, src/printf.c, src/fold.c, src/pr.c: Likewise.
943 * src/factor.c, src/cat.c, src/expr.c, src/stty.c: Likewise.
945 * src/mv.c: Finally remove support for --version-control=S (-V).
946 It was deprecated nearly 6 years ago and has been warning
947 users to switch to --backup=S since fileutils-4.0j.
948 * src/cp.c, src/install.c, src/ln.c: Likewise.
950 2005-06-15 Jim Meyering <jim@meyering.net>
952 * src/install.c (main): Fix my typo: s/argv[optind]/file[i]/.
953 * tests/install/basic-1: Ensure that each `-d'-specified directory
954 is created. Ensure that rel-named dirs are not created when
957 * tests/mkdir/p-3: Add a test for just-fixed bug in mkdir-p.c.
959 2005-06-14 Paul Eggert <eggert@cs.ucla.edu>
961 Improve diagnostics for restore_cwd failure.
962 * src/install.c (main): Standardize on a diagnostic for
963 restore_cwd failure, and report errno.
964 (install_file_in_file_parents): Fail if restore_cwd fails and
965 one of the files is relative. This fixes a bug (albeit unlikely).
966 * src/mkdir.c (create_parents): Remove static var (now local to 'main').
967 (main): Standardize on a diagnostic for restore_cwd failure,
969 Don't bother to check cwd_errno unless create_parents.
970 Use mkdir rather than make_dir; it's simpler.
972 * src/install.c (main): Adjust to new make_dir_parents convention.
973 * src/mkdir.c (main): Likewise.
975 2005-06-14 Jim Meyering <jim@meyering.net>
977 * tests/mkdir/p-3: Ensure mkdir succeeds if the following argument
978 is an absolute directory name.
980 * Makefile.maint (my-distcheck): Add -Wall to the list of options that
981 are used with -Werror. This target is not intended for general use.
983 2005-06-13 Jim Meyering <jim@meyering.net>
985 * src/mkdir.c (main): Give a diagnostic for -- and skip -- each
986 relative directory name after make_dir_parents fails to restore
987 the working directory. Before, `mkdir -p' could create directories
988 in the wrong place in unusual circumstances.
989 * src/install.c (main): Likewise.
990 (install_file_in_file_parents): Update make_dir_parents caller.
991 * tests/mkdir/p-3: New test for today's mkdir.c/mkdir-p.c bug fixes.
992 * tests/mkdir/Makefile.am (TESTS): Add p-3.
994 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
996 Act on the Austin Group's response yesterday to XCU ERN 63; see
997 <http://www.opengroup.org/austin/docs/austin_260.txt>.
998 * NEWS: ls no longer outputs an extra space between mode and link count.
999 * doc/coreutils.texi: Remove the extra spaces in "ls -l" output.
1000 * src/ls.c (any_has_acl): New var.
1001 (clear_files): Clear it.
1002 (gobble_file): Set it if a file has an ACL.
1003 (print_long_format): Omit needless space unless some file has an ACL.
1005 2005-06-10 Jim Meyering <jim@meyering.net>
1007 * src/system.h (VERIFY_W_TYPEOF): Add parentheses.
1009 2005-06-02 Jim Meyering <jim@meyering.net>
1011 * src/sort.c (usage): Put `Ordering options:' line where it belongs.
1013 2005-06-01 Paul Eggert <eggert@cs.ucla.edu>
1015 Use "file name" when talking about file names, instead of "filename"
1016 or "path", as per the GNU coding standards.
1017 * src/basename.c: Don't use "path" or "filename".
1018 * src/copy.c: Likewise.
1019 * src/copy.h: Likewise.
1020 * src/cp-hash.c: Likewise.
1021 * src/cp.c: Likewise.
1022 * src/df.c: Likewise.
1023 * src/install.c: Likewise.
1024 * src/ls.c: Likewise.
1025 * src/pinky.c: Likewise.
1026 * src/pr.c: Likewise.
1027 * src/pwd.c: Likewise.
1028 * src/remove.c: Likewise.
1029 * src/rmdir.c: Likewise.
1030 * src/sort.c: Likewise.
1031 * src/system.h: Likewise.
1032 * src/tty.c: Likewise.
1033 * src/who.c: Likewise.
1034 * src/cp.c (parents_option): Renamed from flag_path. All uses changed.
1035 (make_dir_parents_private): Renamed from make_path_private.
1037 * src/cp.c (usage): Don't use "path" to describe a file name.
1038 * src/readlink.c (usage): Likewise.
1039 * src/rmdir.c (usage): Likewise.
1040 * src/df.c: Don't include "path-concat.h"; not needed.
1041 * src/install.c (install_file_in_file_parents): Renamed from
1042 install_file_to_path. All uses changed.
1043 * src/ln.c (FILE_BASENAME_CONCAT): Renamed from PATH_BASENAME_CONCAT.
1045 * src/ls.c (make_link_name): Renamed from make_link_path.
1047 * src/pwd.c (struct file_name): Renamed from struct Path.
1049 (file_name_free): Renamed from path_free. All uses changed.
1050 (file_name_init): Renamed from path_init. All uses changed.
1051 (file_name_prepend): Renamed from path_prepend. All uses changed.
1052 * src/rmdir.c (remove_empty_parents): Renamed from empty_paths.
1054 (longopts): Add comment that --path is deprecated.
1056 2005-05-31 Jim Meyering <jim@meyering.net>
1058 * src/copy.c (chown_privileges, chown_failure_ok): Mark as `extern'.
1059 This is a crutch so that `make distcheck's sc_tight_scope rule
1060 knows that they really are deliberately declared that way.
1062 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
1064 Port to Solaris 10's rules for whether programs can chown files.
1065 * src/copy.c [HAVE_PRIV_H]: Include <priv.h>.
1066 (DO_CHOWN): Remove. Replaced by chown_failure_ok. All callers
1068 (copy_internal): If chown failed, don't worry about what happened
1069 to the mode bits; they can't have changed.
1070 (chown_privileges, chown_failure_ok): New functions.
1071 * src/copy.h: Add copyright notice.
1072 (struct cp_options): Remove myeuid member. Add chown_privileges
1074 (chown_privileges, chown_failure_ok): New function decls.
1075 * src/cp.c (re_protect): Remove unnecessary call to geteuid.
1076 Use chown_failure_ok rather than our own code.
1077 * src/cp.c (cp_options_init): Use chown_privileges rather than geteuid.
1078 * src/install.c (cp_option_init): Likewise.
1079 * src/mv.c (cp_option_init): Likewise.
1081 2005-05-29 Paul Eggert <eggert@cs.ucla.edu>
1083 * src/chgrp.c (getgrnam) [!defined _POSIX_VERSION]: Remove decl.
1084 * src/chown-core.c (getgrnam, getgrgid) [!defined _POSIX_VERSION]:
1086 * src/cp.c (geteuid) [!defined _POSIX_VERSION]: Remove decl.
1087 * src/id.c (getpwuid, getgrgid, getuid, getgid, geteuid, getegid)
1088 [!defined _POSIX_VERSION]: Remove decls.
1089 * src/install.c (getpwnam, getgrnam): Remove decl.
1090 (getuid, getgid) [!defined _POSIX_VERSION]: Remove decls.
1091 * src/md5sum.c (OPENOPTS, TEXT1T01, TEXTCNVT): Remove.
1092 (digest_file): Use O_BINARY-using expr instead of OPENOPTS.
1093 * src/system.h: Don't bother mentioning _POSIX_VERSION in comment.
1094 * src/test.c: Include sys/param.h if it exists, not if _POSIX_VERSION
1096 Don't include <sys/file.h>; no longer needed.
1097 (getegid, geteuid): Remove no-longer-necessary decls.
1099 * src/pathchk.c (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
1100 Define to 256, not 255, as per modern POSIX.
1102 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
1104 * NEWS: dd seek=N now conforms to POSIX if the output isn't seekable.
1105 * src/dd.c (skip): Return the number of records that were not
1106 skipped due to encountering EOF.
1107 (dd_copy): If the file wasn't seekable and EOF was encountered,
1108 write zeros past EOF until the desired offset is reached.
1110 * NEWS: expr and test now correctly compare integers of unlimited size.
1111 (Also, correct a comment that claimed that expr detects integer
1112 overflow; it does so only when converting from strings.)
1113 * src/expr.c: Include strnumcmp.h, xstrtol.h.
1114 (looks_like_integer): New function.
1115 (toarith): Use it. Also, use xstrtoimax rather than rolling our
1117 (eval2): Don't look for trouble if !evaluate; this simplifies things.
1118 Compare numbers using string comparison, so that overflow is
1120 * src/sort.c: Refactor so that others can use large-integer
1121 comparison functions.
1122 Include "strnumcmp.h".
1123 (NEGATION_SIGN, NUMERIC_ZERO, fraccompare):
1124 Remove; moved to strnumcmp.
1125 (decimal_point): Now int, to simplify converison overhead with
1126 new API. All uses changed.
1127 (thousands_sep): Now -1 if there isn't one, as per new API.
1129 (numcompare): Move contents to strnumcmp module, except for
1131 * src/test.c: Include inttostr.h, strnumcmp.h.
1132 (whitespace, digit, digit_value, integer_expected_error): Remove.
1133 (is_int): Remove; replaced by...
1134 (find_int): New function.
1135 (binary_operator): Don't let integers overflow in comparisons;
1136 return the correct answer instead. Simplify the code.
1137 (unary_operator): Convert the integer ourself, since find_int
1139 * tests/expr/basic (bigcmp): New test.
1140 * tests/test/Test.pm (eq-6, gt-5, lt-5): New tests.
1142 2005-05-26 Paul Eggert <eggert@cs.ucla.edu>
1144 * NEWS: nohup now redirects a tty stdin to an unreadable fd
1145 instead of closing it.
1146 * doc/coreutils.texi (nohup invocation): Document this.
1147 * src/nohup.c (main): Implement this.
1149 2005-05-26 Jim Meyering <jim@meyering.net>
1151 * src/expr.c (toarith): Fix a sign error introduced on 2005-01-14.
1152 Reported by David Alan Gilbert.
1153 * tests/expr/basic: Add tests using arithmetic on negative integers.
1155 2005-05-19 Jim Meyering <jim@meyering.net>
1157 * src/remove.c (AD_mark_helper, AD_mark_current_as_unremovable):
1158 Remove inaccurate-but-harmless `const' attributes.
1160 * src/join.c (decode_field_spec): Add an abort after
1161 `error (EXIT_FAILURE, ...' to avoid a gcc warning in caller,
1162 about variables being used uninitialized.
1164 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
1166 * configure.ac: Add copyright notice. gl_LIB_CHECK -> cu_LIB_CHECK.
1167 * src/Makefile.am: Add copyright notice.
1168 (factor_LDADD): Remove, as factor no longer needs sqrt.
1169 * src/hostname.c: Remove test for HAVE_LIMITS_H; we can assume
1170 it's always true now.
1172 2005-05-16 Paul Eggert <eggert@cs.ucla.edu>
1174 Fix Cygwin porting problem reported by Eric Blake.
1175 * src/remove.c (DT_IS_DIR): Remove.
1176 (DT_IS_KNOWN, DT_MUST_BE): New macros.
1177 (remove_entry): Use them.
1179 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
1181 * src/remove.c: Include unlinkdir.h.
1182 (UNLINK_CAN_UNLINK_DIRS): Remove.
1183 (remove_entry): Use cannot_unlink_dirs () rather than
1184 UNLINK_CAN_UNLINK_DIRS.
1186 2005-05-14 Jim Meyering <jim@meyering.net>
1188 Update FSF postal mail address.
1189 * Makefile.maint, Makefile.cfg, gnupload
1190 * src/basename.c, src/cat.c, src/checksum.h, src/chgrp.c
1191 * src/chmod.c, src/chown-core.c, src/chown-core.h, src/chown.c
1192 * src/chroot.c, src/cksum.c, src/comm.c, src/copy.c, src/copy.h
1193 * src/cp-hash.c, src/cp-hash.h, src/cp.c, src/csplit.c, src/cut.c
1194 * src/date.c, src/dcgen, src/dd.c, src/df.c, src/dircolors.c
1195 * src/dirname.c, src/du.c, src/echo.c, src/env.c, src/expand.c
1196 * src/expr.c, src/factor.c, src/fmt.c, src/fold.c, src/fs.h
1197 * src/groups.sh, src/head.c, src/hostid.c, src/hostname.c, src/id.c
1198 * src/install.c, src/join.c, src/kill.c, src/lbracket.c, src/link.c
1199 * src/ln.c, src/logname.c, src/ls-dir.c, src/ls-ls.c, src/ls-vdir.c
1200 * src/ls.c, src/ls.h, src/md5.c, src/md5sum.c, src/mkdir.c
1201 * src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c, src/nl.c
1202 * src/nohup.c, src/od.c, src/paste.c, src/pathchk.c, src/pinky.c
1203 * src/pr.c, src/printenv.c, src/printf.c, src/ptx.c, src/pwd.c
1204 * src/readlink.c, src/remove.c, src/remove.h, src/rm.c, src/rmdir.c
1205 * src/seq.c, src/setuidgid.c, src/sha1sum.c, src/shred.c
1206 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c
1207 * src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac-pipe.c
1208 * src/tac.c, src/tail.c, src/tee.c, src/test.c, src/touch.c
1209 * src/tr.c, src/true.c, src/tsort.c, src/tty.c, src/uname.c
1210 * src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c
1211 * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c
1213 2005-05-13 Jim Meyering <jim@meyering.net>
1215 * NEWS: `rm -r' now removes all of the files it should, even on
1216 systems with a buggy readdir affecting file systems inaccessible
1219 In some unusual circumstances `rm -r' would fail to remove --
1220 or even consider -- all entries in a directory with more than 254
1221 (SunOS) or 338 (Darwin) entries. This could cause trouble even on
1222 other types of systems when using an affected file system via e.g.,
1223 NFS. The underlying cause was a bug in readdir on those systems.
1224 Coreutils-5.2.1 and earlier used a configure-time test designed
1225 to detect precisely those problem systems, but it would detect
1226 the problem and enable remove.c's work-around code only when its
1227 configure-time test was run on a losing file system. Obviously,
1228 it couldn't detect a problem if the offending file system wasn't
1229 tested or even mounted at coreutils configure time. Now, rm itself
1230 performs a minimal-cost run-time test to detect the problem.
1232 * src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Define.
1233 (remove_cwd_entries): When readdir returns NULL for a directory from
1234 which we've removed more than CONSECUTIVE_READDIR_UNLINK_THRESHOLD
1235 entries, call rewinddir and then resume the readdir/unlink loop.
1236 (UNLINK_CAN_UNLINK_DIRS): Rename from ROOT_CAN_UNLINK_DIRS.
1238 2005-05-12 Paul Eggert <eggert@cs.ucla.edu>
1240 * NEWS: nohup now closes stdin if it is a terminal, unless
1241 POSIXLY_CORRECT is set. This fixes a glitch noted by Wayne Pollock in
1242 <https://www.opengroup.org/sophocles/show_mail.tpl?
1243 source=L&listname=austin-group-l&id=8341>.
1244 * doc/coreutils.texi (nohup invocation): Document this.
1245 * src/nohup.c (main): Implement this.
1247 2005-05-12 Jim Meyering <jim@meyering.net>
1249 * src/date.c: Assume `free (NULL)' works.
1250 * src/dd.c: Likewise.
1251 * src/df.c:Likewise.
1252 * src/dircolors.c:Likewise.
1253 * src/head.c: Likewise.
1254 * src/ls.c: Likewise.
1255 * src/md5sum.c: Likewise.
1256 * src/pr.c: Likewise.
1257 * src/sort.c: Likewise.
1259 2005-05-10 Jim Meyering <jim@meyering.net>
1261 * tests/touch/not-owner: Skip this test if the user running it
1262 owns `/' or has write access to it.
1264 * src/copy.c (abandon_move): Remove erroneous UNWRITABLE check.
1265 This makes `mv -i --reply=no f1 f2' work as expected (in not
1266 performing the move operation). But note that specifying `-i'
1267 after `--reply=no' does *not* work.
1268 Tiny patch from Vlada Macek.
1270 * tests/mv/reply-no: New file. Test for the above fix.
1271 * tests/mv/Makefile.am (TESTS): Add reply-no.
1273 * tests/ls-2/tests: Don't print PATH to stderr.
1275 2005-05-08 Paul Eggert <eggert@cs.ucla.edu>
1277 * NEWS: cp, ln, mv, rm no longer discard white space when intepreting
1280 2005-05-06 Paul Eggert <eggert@cs.ucla.edu>
1282 * NEWS: dd has new iflag= and oflag= flags "binary" and "text".
1283 * src/dd.c (flags, usage): Add support for "binary" and "text".
1285 2005-05-04 Paul Eggert <eggert@cs.ucla.edu>
1287 * NEWS: chmod -w now complains if it differs from chmod a-w.
1288 * src/chmod.c: Include quotearg.h.
1289 (diagnose_surprises): New var.
1290 (process_file): Diagnose surprises. Simplify the logic a bit,
1292 (main): Prepare to diagnose surprises. Remove useless code for
1294 * tests/chmod/Makefile.am (TESTS): Add umask-x.
1295 * tests/chmod/umask-x: New file.
1297 2005-05-02 Paul Eggert <eggert@cs.ucla.edu>
1299 * NEWS: ls --indicator-style=directory renamed to ls
1300 --indicator-style=slash, to avoid confusion with ls --directory.
1301 * src/ls.c (usage): Likewise.
1302 (slash): Renamed from directory_only. All uses changed.
1304 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
1306 * NEWS: "chmod +1 foo" is now diagnosed.
1308 2005-04-29 Paul Eggert <eggert@cs.ucla.edu>
1310 * NEWS: ls -p now marks only directories. New option
1311 --indicator-style=directory equivalent to -p.
1312 * doc/coreutils.texi (ls invocation): Document this.
1313 Also, mention ">" is for doors.
1314 * src/ls.c (enum indicator_style): New constant directory_only,
1316 (indicator_style_args, indicator_style_types): Set it appropriately.
1317 (decode_switches, gobble_file, print_type_indicator):
1318 (length_of_file_name_and_frills):
1319 Implement the change described in NEWS.
1320 (decode_switches): Quote ">", too.
1321 (usage): Update to match the new behavior. Describe ">".
1322 * tests/ls/file-type: Test for new behavior. Omit -1 option.
1323 The "ls --color" test wasn't being checked; add a check for
1324 "ls --color=auto" instead.
1326 * tests/head/Test.pm: Don't set _POSIX2_VERSION; no longer needed.
1327 * tests/misc/split-fail: Likewise.
1328 * tests/pr/Test.pm: Likewise.
1329 * tests/sort/Test.pm: Fix comment to match new behavior of "sort".
1330 * tests/tail/Test.pm (tv): Rename tests from obs to obs-plus
1331 if they use file names starting with +.
1332 (test_vector): Don't set _POSIX2_VERSION if obs but not obs-plus.
1333 * tests/uniq/Test.pm (tv, test_vector): Likewise.
1335 The following was partly derived from a tiny change by Eric Blake:
1336 * tests/misc/nice: Don't use 'set -'. It's not portable to strict
1337 POSIX 1003.1-2001 hosts. Also, don't set _POSIX2_VERSION.
1338 * tests/mkdir/perm: Don't use 'set -'. Simplify test construction.
1339 Work even if the underyling system attaches ACLs to new dirs.
1340 * tests/mv/part-hardlink: Don't use 'set -'.
1341 * tests/stty/row-col-1: Don't use 'set -'.
1343 2005-04-28 Paul Eggert <eggert@cs.ucla.edu>
1345 * NEWS: Document fixes described below.
1346 * src/chmod.c (change, umask_value): New static vars.
1347 (reference_file): Move this static var to inside "main".
1348 (process_file, process_files): Remove CHANGES arg; now taken from
1349 static var. All uses changed.
1350 (usage): Fix incorrect description of MODE operand.
1351 (main): For invalid mode usages, output a brief usage message.
1352 Adjust to new modechange API.
1353 * install.c (main): Adjust to new modechange API.
1354 Also, free the mode_change object when done.
1355 * mkdir.c (main): Likewise.
1356 * mkfifo.c (main): Likewise.
1357 * mknod.c (main): Likewise.
1358 * tests/chmod/equal-X: Check for =xX bug.
1359 * tests/chmod/equals: Check for =u bug.
1360 * tests/chmod/usage: Check for u+gr and ug,+x bugs.
1362 2005-04-26 Paul Eggert <eggert@cs.ucla.edu>
1364 Restore support for usages like "head -1" and "tail -1",
1365 even when conforming to POSIX 1003.1-2001.
1366 Fix bug with "POSIXLY_CORRECT=1 fold file -3".
1367 join now supports a NUL field separator, e.g., "join -t '\0'".
1368 join now detects and reports incompatible options, e.g.,
1370 * NEWS: Document this.
1371 * src/date.c: Remove posixver.h and its uses.
1372 (COMMON_SHORT_OPTIONS): Remove.
1373 (short_options): New constant.
1374 (short_options, usage): -I now always takes an optional arg.
1375 * src/expand.c: Remove posixver.h and its uses.
1376 (shortopts): New constant. -DIGIT now always takes an optional arg.
1377 (main): Revamp parsing of -DIGIT to let parse_tab_stops handle it.
1378 Don't complain about -DIGIT.
1379 * src/fold.c: Remove posixver.h and its uses.
1380 (shortopts): New constant. -DIGIT now always takes an optional arg.
1381 (main): Don't preprocess arg list; that was buggy. Use method
1383 * src/head.c: Remove posixver.h and its uses.
1384 (header_mode_option): Remove.
1385 (main): Don't complain about obsolete -NUM args.
1386 * src/join.c: Remove posixver.h and its uses.
1387 (obsolete_usage): Remove.
1388 (join_field_1, join_field_2): Initialize to SIZE_MAX to indicate
1389 they haven't been set yet.
1390 (tab): Now int, not char. Initialize to -1 to indicate white space
1391 separates columns, so that we can use NUL as a separator.
1393 (OBSOLETE_LONG_OPTIONS, get_option): Remove.
1394 (string_to_join_field): Remove ERR_MSG_FMT arg; a single format
1395 suffices. Use xstrtoul for sizes; it suffices.
1396 (decode_field_spec): Report an error and exit on failure. Return void,
1398 (add_field_list): Likewise.
1399 (set_join_field): New function.
1400 (enum operand_status): New enum.
1401 (add_file_name): New args OPERAND_STATUS, JOPTION_COUNT,
1402 PREV_OPTC_STATUS, OPTC_STATUS to handle the bewildering array of
1403 possibilities with obsolete option parsing.
1404 (main): Use it. Do not depend on POSIX version.
1405 Check for conflicting options. Parse obsolete options -j1 and -j2
1406 so that it is a pure extension to POSIX 1003.1-2001.
1407 Allow '-t\0' to specify a NUL tab, stealing the code from 'sort'.
1408 * src/nice.c: Remove posixver.h and its uses.
1409 (main): Always support -NUM option.
1410 * src/od.c: Remove posixver.h and its uses.
1411 (short_options): New constant, which always supports -w[num].
1412 (COMMON_SHORT_OPTIONS): Remove.
1413 * src/pr.c: Remove posixver.h and its uses.
1414 (short_options): New constant, which always supports -S[string].
1415 (COMMON_SHORT_OPTIONS): Remove.
1416 * src/sort.c: Remove posixver.h and its uses.
1417 (short_options): New constant, which always supports -y arg.
1418 (COMMON_SHORT_OPTIONS): Remove.
1419 (main): Redo workaround for Solaris compatibility with -y.
1420 This change isn't visible to the user; it just cleans up the
1421 code so that we don't need posixver.h.
1422 * src/split.c: Remove posixver.h and its uses.
1423 (main): Don't complain about -NUM option.
1424 * src/tail.c (parse_obsolete_option): Don't complain about -NUM.
1425 * src/unexpand.c: Remove posixver.h and its uses.
1426 (main): Don't complain about -TAB.
1427 * src/uniq.c (main): Don't complain about -NUM.
1429 2005-04-22 Paul Eggert <eggert@cs.ucla.edu>
1431 * src/nohup.c (main): If getopt fails, exit with status 127,
1432 not status 1. POSIX requires this.
1433 * NEWS: Document this.
1435 * src/nice.c (main): Report proper program name when getopt finds
1436 trouble. Problem reported by Behdad Esfahbod.
1438 * NEWS: Fix bug with "mkdir -m =+x dir"; the umask was being ignored
1439 when the "+x" was being evaluated.
1440 * mkdir.c (main): Compile mode with MODE_MASK_ALL and initial umask.
1441 * mkfifo.c (main): Likewise.
1442 * mknod.c (main): Likewise.
1443 * tests/mkdir/perm: Test for the above bug.
1445 2005-04-20 Paul Eggert <eggert@cs.ucla.edu>
1447 Port test cases to Microsoft-Windows-related environments,
1448 following suggestions from Eric Blake.
1449 * tests/install/Makefile.am (TESTS_ENVIRONMENT): Add EXEEXT.
1450 * tests/install/basic-1: Undo previous change.
1451 (dd, dd2): New vars, which use $EXEEXT. All uses of dd and dd2 changed.
1452 * tests/install/trap: Undo previous change.
1453 (sig): New var. Use it insted of "trap '' CHLD".
1454 Append $EXEEXT to executable name.
1456 "fetish" -> "coreutils" in more places.
1457 * tests/Coreutils.pm: Renamed from tests/Fetish.pm.
1458 (package Coreutils): Renamed from package Fetish. All uses changed.
1459 * tests/Makefile.am (EXTRA_DIST): Add Coreutils.pm and
1462 2005-04-19 Paul Eggert <eggert@cs.ucla.edu>
1464 * tests/mv/setup (dot_mount_point): Use stat -L, in case the
1465 directory is actually a symbolic link. Problem reported by
1468 * tests/mv/mv-special-1: Use test -p to test for fifos, rather
1469 than the (incorrect) test -f and the (inadequate) ls. ls is
1470 inadequate because on some hosts a buggy mv will create a file of
1471 the wrong type (problem reported by Eric Blake). Skip this test
1472 if test -p doesn't work.
1474 * tests/chmod/setgid: Use numeric group ids, not symbolic group names,
1475 since the latter can have shell metacharacters in them (e.g., spaces).
1476 This follows up to the 2005-01-17 patch, which missed this occurrence.
1478 2005-04-18 Paul Eggert <eggert@cs.ucla.edu>
1480 "fetish" -> "coreutils" in several places.
1481 * Makefile.cfg (ftp): Remove fetish.sf.net.
1482 * Makefile.maint (emit_upload_commands): Likewise.
1483 * src/Makefile.am (LDADD, $(PROGRAMS)): fetish -> coreutils.
1484 * tests/group-names (COREUTILS_GROUPS): Renamed from FETISH_GROUPS.
1485 * tests/chmod/setgid (FETISH_GROUP): Renamed from COREUTILS_GROUP.
1487 * tests/install/basic-1: Use "cat", not "test", to test for
1488 ../../src/dd. Problem reported by Eric Blake.
1490 2005-04-18 Jim Meyering <jim@meyering.net>
1492 * src/dd.c: Don't include stat-macros.h directly. system.h does that.
1494 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
1496 Work around a couple of "make check" failures reported for Cygwin
1497 and ash by Eric Blake.
1498 * tests/install/basic-1: Skip this test if ../../src/dd isn't readable.
1499 * tests/install/trap: Skip this test if "trap '' CHLD" doesn't work.
1501 2005-04-16 Jim Meyering <jim@meyering.net>
1503 * src/dd.c (S_TYPEISSHM): Remove definition.
1504 Get the definition by including "stat-macros.h", instead.
1506 2005-04-14 Paul Eggert <eggert@cs.ucla.edu>
1508 Fix test suite problems reported by Eric Blake on Cygwin.
1509 * tests/mv/mv-special-1: Ignore chatter about when files are removed,
1510 since POSIX doesn't require rename to fail across file systems.
1511 * tests/mv/setup (dot_mount_point): Use stat rather than df, as
1513 (other_partition_tmpdir): Remove df from name as that would be
1516 2005-04-14 Jim Meyering <jim@meyering.net>
1518 * src/chown-core.c: Correct typo, fchmod -> fchown, in a comment.
1520 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
1522 * src/ls.c (usage): "uid" -> "user ID".
1524 2005-04-12 Jim Meyering <jim@meyering.net>
1526 * src/tsort.c (tsort): Use "%s" as the format string,
1527 rather than a diagnostic or a file name.
1529 * src/comm.c (compare_files): Remove declaration of unused local.
1531 * src/chown-core.c (chopt_free): Mark parameter as unused.
1533 2005-04-11 Paul Eggert <eggert@cs.ucla.edu>
1535 * man/chown.x: Reword to match user manual.
1536 * man/id.x: Likewise.
1537 * src/setuidgid.c (usage): Use "user ID", not "UID", and similarly
1539 * src/whoami.c (usage, main): Likewise.
1541 Add bulletproofing for cases where stdin, stdout, or stderr are closed.
1542 * src/comm.c: Include stdio-safer.h.
1543 (compare_files): Exit right away on I/O error rather than continuing
1544 and producing confusing output and error messages.
1545 Return void, not int; all callers changed.
1546 Use fopen_safer to avoid confusion with file descriptors.
1547 * src/copy.c: Include unistd-safer.h.
1548 (copy_reg): Use fd_safer.
1549 * src/csplit.c: Include stdio-safer.h.
1550 (input_desc): Remove unnecessary static initialization.
1551 (set_input_file): Use STDIN_FILENO, not 0.
1552 (create_output_file): Use fopen_safer.
1553 * src/dircolors.c (dc_parse_file): Don't assume fopen does not
1555 * src/head.c (head_file): Don't assume open does not return 0.
1556 * src/join.c: Include stdio-safer.h.
1557 (main): Use fopen_safer. Simplify the resulting code.
1558 * src/md5sum.c (digest_file, digest_check):
1559 Don't assume that fopen does not return stdin.
1560 * src/nohup.c: Include unistd-safer.h.
1561 (main): Don't dup stderr to stdin or stdout by mistake.
1562 * src/od.c (check_and_close): Don't assume fopen does not return stdin.
1563 * src/paste.c (paste_serial): Likewise.
1564 * src/pr.c: Include stdio-safer.h.
1565 (open_file): Use fopen_safer.
1566 (close_file): Don't assume fopen does not return stdin.
1567 * src/ptx.c (main): Don't assume fopen returns stdout after closing
1568 stdout. Use freopen instead.
1569 * src/shred.c: Include unistd-safer.h.
1570 (wipename): Use fd_safer on directory file descriptor.
1571 (wipefile): Remove special case for /dev/fd/* on older hosts.
1572 It didn't work in general, and wasn't documented.
1574 * src/sort.c: Include unistd-safer.h.
1575 (create_temp_file): Use fd_safer.
1576 (xfclose): Don't assume fileno (stdin) == STDIN_FILENO, etc.
1577 * src/split.c: Include unistd-safer.h.
1578 (cwrite): Use fd_safer. Replace mystery constant 0666 with symbolic
1579 version, as POSIX requires.
1580 * src/sum.c (bsd_sum_file, sysv_sym_file):
1581 Use same pattern as elsewhere for checking for stdin.
1582 * src/tac.c: Include unistd-safer.h.
1583 (copy_to_temp): Use fd_safer.
1584 (tac_file): Don't assume fopen cannot return stdin.
1585 * src/tail.c: Include unistd-safer.h rather than fcntl-safer.h.
1586 (recheck, tail_file): Use fd_safer rather than open_safer.
1587 * src/tee.c: Include stdio-safer.h.
1588 (tee): Use fopen_safer.
1589 * src/touch.c: Include unistd-safer.h.
1590 (touch): Use fd_safer.
1591 * src/tsort.c (have_read_stdin): Remove; no longer needed. All uses
1593 (tsort): Do not assume fopen can't return stdin.
1594 Close stdin before returning. All uses changed.
1595 * src/unexpand.c (next_file): Don't assume fopen cannot return stdin.
1596 * src/uniq.c: Include stdio_safer.h.
1597 (check_file): Don't assume fopen cannot return stdin or stdout.
1599 2005-04-09 Jim Meyering <jim@meyering.net>
1601 * src/dd.c (quit): Define with ATTRIBUTE_NORETURN.
1603 Now that close_stdout closes standard output unconditionally,
1604 these workarounds for dd and cat are no longer necessary.
1605 * src/dd.c (close_stdout_wrapper): Remove function.
1606 (main): Call atexit with close_stdout, instead.
1607 * src/cat.c (close_stdout_wrapper): Likewise.
1608 Don't close STDOUT_FILENO explicitly; close_stdout does it.
1610 * src/system.h (__attribute__): Readability nit:
1612 # define __attribute__(x)
1614 # define __attribute__(x) /* empty */
1616 2005-04-09 Jim Meyering <jim@meyering.net>
1618 * src/rm.c (usage): Mention that --recursive removes listed
1619 directories too, not just their contents.
1620 Say that by default, rm does not remove directories.
1622 * src/pr.c: Don't include "timespec.h". system.h does that.
1623 * Makefile.maint (sc_system_h_headers): Propagate exit status
1626 2005-04-08 Paul Eggert <eggert@cs.ucla.edu>
1628 * NEWS: Document that dd no longer treats QUIT or PIPE specially,
1629 and when conforming to POSIX no longer treats USR1 specially.
1630 Document that dd no longer dumps core when handling signals.
1631 * src/system.h (RETSIGTYPE): Remove; no longer needed. All uses
1633 * src/csplit.c (SA_NOCLDSTOP): Define to 0 if not defined.
1635 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
1636 (delete_all_files): New arg IN_SIGNAL_HANDLER, to avoid undefined
1637 behavior when called from a signal handler. All uses changed.
1638 (main) [!defined SA_NOCLDSTOP]:
1639 Use siginterrupt to specify that system calls should be interrupted.
1640 * src/dd.c: Do not include safe-read.h or full-write.h; no longer needed.
1641 (process_signals): Add forward decl.
1642 (SA_NOCLDSTOP, sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]:
1644 (siginterrupt) [! HAVE_SIGINTERRUPT]: New macro.
1645 (SA_NODEFER) [!defined SA_NODEFER]: New macro.
1646 (SA_RESETHAND) [!defined SA_RESETHAND]: New macro.
1647 (caught_signals, interrupt_signal, info_signal_count, catch_siginfo):
1649 (usage): Mention -USR1 versus -INFO.
1650 (cleanup): Don't invoke print_stats; the caller must do it now.
1651 All callers changed.
1652 (quit): Process signals just before exiting.
1653 (interrupt_handler): Simply record the signal and return.
1654 (siginfo_handler): Simply increment the signal counter and return.
1655 (install_handler): Remove, replacing with:
1656 (install_signal_handlers, process_signals, iread, iwrite):
1657 New functions. All callers to safe_read and full_write replaced
1658 by iread and iwrite. All callers to install_handler replaced by
1660 * src/ls.c (SA_NOCLDSTOP): Define to 0 if not defined.
1662 (siginterrupt) [! HAVE_SIGINTERRUPT]: New macro.
1663 (main) [! SA_NOCLDSTOP]: Use it.
1664 * src/shred.c: Remove all uses of signals; modern hosts have
1665 /dev/random and don't need this gorp.
1666 Do not include signal.h.
1667 (env, sigill_handler, isaac_seed_machdep): Remove. All uses removed.
1668 * src/sort.c (SA_NOCLDSTOP): Define to 0 if not defined.
1670 (siginterrupt) [! HAVE_SIGINTERRUPT]: New macro.
1671 (main) [! SA_NOCLDSTOP]: Use it.
1673 * src/dd.c: Do not include inttostr.h, no longer needed.
1674 (print_stats, main): Rewrite and simplify formats to use PRIuMAX
1675 instead of umaxtostr.
1676 (print_stats): Work even in languages that have special
1677 forms for two of things, for r_truncate and w_bytes. We can't
1678 fix delta_s in this way, since ngettext doesn't support floating-point.
1679 (main): Rewrite to avoid casts.
1681 2005-04-07 Jim Meyering <jim@meyering.net>
1683 Placate gcc-4's -Wuninitialized.
1684 * src/md5sum.c (digest_check) [lint]: Initialize hex_digest to NULL.
1685 * src/test.c (binary_operator) [lint]: Initialize lt and rt to 0.
1687 * src/test.c (is_int, age_of, binop): Declare `char *' parameters to
1689 (binop): Move function definition to precede first use so we can...
1690 (binop): ...remove prototype.
1692 2005-04-05 Paul Eggert <eggert@cs.ucla.edu>
1694 * man/Makefile.am (.x.1): Remove "COMMAND.td/" from examples.
1695 * src/basename.c (usage): Add examples.
1696 * src/cat.c (usage): Likewise.
1697 * src/chgrp.c (usage): Likewise.
1698 * src/chown.c (usage): Likewise.
1699 * src/dirname.c (usage): Likewise.
1701 2005-04-05 Jim Meyering <jim@meyering.net>
1703 * src/nice.c (usage): Mention that some shells provide a
1704 built-in function by the same name.
1705 * src/nohup.c (usage): Likewise.
1706 * src/printenv.c (usage):Likewise.
1708 2005-04-04 Dmitry V. Levin <ldv@altlinux.org>
1710 * src/tee.c (tee): When closing files, do not close stdout,
1711 leave this job to close_stdout() instead.
1712 * configure.ac (AC_CONFIG_FILES): Add tests/tee/Makefile.
1713 * tests/Makefile.am (SUBDIRS): Add tee.
1714 * tests/tee/Makefile.am: New file.
1715 * tests/tee/.cvsignore: Likewise.
1716 * tests/tee/{basic,dash}: New tee tests.
1718 2005-04-04 Jim Meyering <jim@meyering.net>
1720 * src/echo.c (usage): Mention that some shells provide a
1721 built-in function by the same name.
1722 * src/kill.c (usage): Likewise
1723 * src/printf.c (usage): Likewise.
1724 * src/pwd.c (usage): Likewise.
1725 * src/stat.c (usage): Likewise.
1726 * src/test.c (usage): Likewise.
1727 * src/true.c (usage):
1728 * src/system.h (USAGE_BUILTIN_WARNING): New macro.
1730 * man/echo.x: Remove `DESCRIPTION' section, now that --help includes it.
1731 * man/printf.x: Likewise.
1732 * man/pwd.x: Likewise.
1734 2005-04-03 Jim Meyering <jim@meyering.net>
1736 * src/pr.c (main): Fix off-by-one error.
1737 pr -$(perl -e 'print "0"x63 . 1') would write one byte beyond the
1738 end of a malloc'd buffer.
1740 2005-04-01 Jim Meyering <jim@meyering.net>
1742 * src/pr.c (main): Free column_count_string when done with it.
1744 Don't let pr treat +1:-1 like +1:18446744073709551615.
1745 * src/pr.c (strtoumax): Remove declaration.
1746 (first_last_page): Use xstrtoumax in place of strtoumax,
1747 so we don't interpret a negative page number (e.g., in an option
1748 like --pages=1:-1) as valid.
1749 * tests/pr/Test.pm (neg-page): Add a test for this.
1751 2005-03-30 Paul Eggert <eggert@cs.ucla.edu>
1753 * src/pinky.c (short_pinky): Adjust to read_utmp signature change.
1754 * src/uptime.c (uptime): New arg OPTIONS. All uses changed.
1755 * src/users.c (users): Likewise.
1756 * src/who.c (who): Likewise.
1757 * src/uptime.c (main): Check PIDs when invoked with zero arguments.
1758 * src/users.c (main): Likewise.
1759 * src/who.c (main): Likewise. Also with two arguments.
1760 Omit duplicate code in 2-arg case.
1761 (UT_PID): Moved to ../lib/readutmp.h.
1763 2005-03-29 Jim Meyering <jim@meyering.net>
1765 * src/system.h (ptr_align): Declare `ptr' parameter to be a
1766 `const' pointer, since this function never writes through it.
1768 * src/uname.c: Indent cpp directives to reflect nesting.
1770 2005-03-28 Jim Meyering <jim@meyering.net>
1772 * src/seq.c (get_width_format) [HAVE_RINT && HAVE_MODF && HAVE_FLOOR]:
1773 Add `void' to make this an ANSI-style function declaration.
1774 * src/remove.c (ds_init): Likewise.
1775 * src/pr.c (print_sep_string): Likewise.
1777 * src/stty.c (speeds): Declare this array to be static.
1778 * src/Makefile.am (sc_tight_scope): Adjust to catch any
1779 new declarations like that of stty.c's `speeds'.
1781 * src/system.h (GETOPT_HELP_OPTION_DECL): Use NULL, not `0'.
1782 (GETOPT_VERSION_OPTION_DECL): Likewise.
1783 * src/chown.c (long_options): Likewise.
1784 * src/chgrp.c (long_options): Likewise.
1785 * src/chmod.c (long_options): Likewise.
1786 * src/cp.c (sparse_type_string, reply_args, decode_preserve_arg):
1788 * src/chown-core.c (chopt_init): Likewise.
1789 * src/comm.c (long_options): Likewise.
1790 * src/copy.c (copy_reg): Likewise.
1791 * src/csplit.c (extract_regexp): Likewise.
1792 * src/cut.c (longopts): Likewise.
1793 * src/date.c (time_spec_string): Likewise.
1794 * src/df.c (find_mount_point, show_point): Likewise.
1795 * src/expr.c (docolon): Likewise.
1796 * src/fmt.c (long_options): Likewise.
1797 * src/ls.c (time_style_args, indicator_style_args, long_options)
1798 (format_args, sort_args, time_args, decode_switches)
1799 (gobble_file): Likewise.
1800 * src/md5sum.c (long_options): Likewise.
1801 * src/mv.c (reply_args): Likewise.
1802 * src/paste.c (longopts): Likewise.
1803 * src/pinky.c (print_entry): Likewise.
1804 * src/pr.c (long_options): Likewise.
1805 * src/ptx.c (long_options, format_args): Likewise.
1806 * src/readlink.c (longopts): Likewise.
1807 * src/sort.c (long_options, mergefps): Likewise.
1808 * src/stat.c (long_options): Likewise.
1809 * src/tac.c (main): Likewise.
1810 * src/tail.c (follow_mode_string): Likewise.
1811 * src/touch.c (longopts, time_args): Likewise.
1812 * src/uniq.c (delimit_method_string): Likewise.
1813 * src/uptime.c (print_uptime): Likewise.
1814 * src/who.c (print_user): Likewise.
1816 2005-03-27 Jim Meyering <jim@meyering.net>
1818 * src/dcgen: Simplify further, clean up.
1819 Add a standard-output-closing global destructor.
1821 * src/wheel-gen.pl: Use the same global destructor as dcgen.
1823 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
1825 * src/dcgen: Squeeze multiple blanks into one. Output a simple
1826 array of adjacent strings rather than a more complicated data
1827 structure; this saves space in the dircolors executable.
1828 * src/dircolors.c (parse_line): Use char *, not unsigned char *.
1830 (dc_parse_stream, main): Avoid casts.
1831 Adjust to simpler data structure generated by new dcgen.
1833 2005-03-25 Eric Blake <ebb9@byu.net> (tiny change)
1835 * src/ls.c (usage): Document usage of LS_COLORS.
1837 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
1839 * src/dircolors.hin: Add "TERM cygwin".
1841 2005-03-25 Jim Meyering <jim@meyering.net>
1843 * src/system.h (DECIMAL_DIGIT_ACCUMULATE): Reverse the sense of
1844 the return value, and update callers:
1845 * src/cut.c (set_fields): Update use of DECIMAL_DIGIT_ACCUMULATE.
1846 * src/expand.c (parse_tab_stops, main): Likewise.
1847 * src/split.c (main): Likewise.
1848 * src/unexpand.c (parse_tab_stops, main): Likewise.
1849 * src/uniq.c (main): Likewise.
1851 2005-03-22 Jim Meyering <jim@meyering.net>
1853 * build-aux: New directory. Renamed from config.
1854 * configure.ac: Reflect renaming: config -> build-aux.
1855 * Makefile.am (dist-hook): Likewise.
1856 * Makefile.maint: Likewise.
1857 * Makefile.cfg (cvs_files): Likewise.
1858 * .x-sc_sun_os_names: Likewise.
1859 * .x-sc_trailing_blank: Likewise.
1861 * src/ls.c (get_funky_string): Use '\a', rather than 7, for
1862 portability to EBCDIC hosts.
1864 2005-03-20 Jim Meyering <jim@meyering.net>
1866 * src/pr.c (init_header): Add missing `%' in new format string.
1867 (init_header): Use zero-filled `.%09d' format, not space-filled `.%9d'.
1869 2005-03-19 Jim Meyering <jim@meyering.net>
1871 * src/Makefile.am (pr_LDADD): Now that pr uses gettime, add
1872 $(LIB_CLOCK_GETTIME) to get the required -lrt on newer Linux systems.
1874 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
1876 * NEWS: pr -D "FORMAT" now accepts the same formats that
1877 date +"FORMAT" does.
1878 * src/pr.c: Include strftime.h, timespec.h.
1879 (init_header): Obtain and format nanosecond part of time stamp.
1881 * NEWS: nohup now ignores the umask when creating nohup.out.
1882 nohup now closes stderr if it is a terminal and stdout is closed.
1883 * src/nohup.c (main): Likewise. Be a little more paranoid about
1884 return values; e.g., check for any negative return from open.
1885 Assume free (NULL) works.
1886 Close file descriptor leak when redirecting standard output to a file.
1888 2005-03-17 Jim Meyering <jim@meyering.net>
1890 * src/cut.c (set_fields): Use DECIMAL_DIGIT_ACCUMULATE macro,
1891 in place of functionally-equivalent code.
1892 * src/expand.c (parse_tab_stops, main): Likewise.
1893 * src/split.c (main): Likewise.
1894 * src/unexpand.c (parse_tab_stops, main): Likewise.
1895 * src/uniq.c (main): Likewise.
1896 * src/od.c: Use VERIFY macro in place of an equivalent open-coded
1898 * src/system.h (VERIFY, VERIFY_EXPR, DECIMAL_DIGIT_ACCUMULATE):
1901 Before, this command would make uniq skip 11 fields and print
1902 only the first line:
1903 $ _POSIX2_VERSION=1 ./uniq -f1 -1 <(seq --format='1 %g' 2)
1906 * src/uniq.c (main): Interpret `uniq -f1 -1' like `uniq -f1',
1907 not like `uniq -f11'.
1909 2005-03-15 Jim Meyering <jim@meyering.net>
1911 Both `pr -0' and e.g., `pr -03' would evoke `column count too large'.
1912 `pr -0' should give a better diagnostic and `pr -03' should be
1913 equivalent to `pr -3'.
1914 * src/pr.c (parse_column_count): Change return type to void.
1915 Call error (EXIT_FAILURE, ... for an invalid string.
1916 (main): Allocate space for column_count_string using malloc.
1917 Accumulate all old-style column-count digits before converting.
1918 When the number of columns is specified via both old-style,
1919 (e.g., -3), and a long option (--columns=5), ensure that only
1920 the last one specified takes effect.
1921 * tests/pr/Test.pm: Add tests for the above.
1923 2005-03-15 Corinna Vinschen <corinna@vinschen.de> (tiny change)
1925 * src/copy.c (copy_reg): Copy regular files in binary mode.
1927 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
1929 * NEWS: Restate why ls limits time stamp lengths.
1931 2005-03-12 Jim Meyering <jim@meyering.net>
1933 Add a little infrastructure to help prevent future bugs like the
1935 * src/stat.c (xstrcat): New function.
1936 (print_statfs, print_stat): Add buf_len parameter and convert all
1937 uses of strcat to xstrcat. Update callers.
1938 (print_it): Call print_func with buf_len parameter.
1940 Invoking stat -c FMT with a lone format directive of %s, %f, %h, %s,
1941 could cause a buffer overrun error.
1942 * src/stat.c (print_it): Allocate 2 more bytes, to accommodate our
1943 conversion of the stat %s format string to the longer printf %llu one.
1944 Patch from Guochun Shi.
1946 2005-03-11 Paul Eggert <eggert@cs.ucla.edu>
1948 * src/ls.c (TIME_STAMP_LEN_MAXIMUM): New constant.
1949 (long_time_expected_width, print_long_format): Use it, to avoid
1950 some possible denial-of-service attacks.
1951 * NEWS: Document this.
1953 2005-03-11 Jim Meyering <jim@meyering.net>
1955 Prompt once again for `mv -i A B' when A and B are hard links
1956 to the same file. This fixes a bug introduced by my 2003-04-04
1957 (coreutils-5.0.1) change. Reported by Thomas Wolff via Eric Blake.
1958 * src/copy.c (abandon_move): New function, factored out of
1959 copy_internal, now that this code is being used from two places.
1960 (copy_internal): Perform the same interactive-related test for
1961 whether it's alright to proceed and (usually) overwrite the
1963 * tests/mv/i-4: Add tests for the above.
1965 Don't segfault for a very long date format string, e.g.,
1966 ls -ld --time-style=+%99999999H .
1967 * src/ls.c (long_time_expected_width): Use x2nrealloc, not alloca,
1968 so format string abuse cannot provoke stack overflow.
1969 (print_long_format): Likewise.
1971 Don't segfault for a long header date string, e.g.,
1972 echo a|pr -D +%9999999A
1973 * src/pr.c (init_header): Use x2nrealloc, rather than alloca.
1974 Don't bother with fixed-sized initial buffer; always use x*alloc.
1976 * src/pr.c (init_header): Use slightly clearer INT_BUFSIZE_BOUND
1977 in place of equivalent INT_STRLEN_BOUND + 1.
1978 * src/expr.c (tostring, printv): Likewise.
1980 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
1982 * src/system.h: Include intprops.h.
1983 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_STRLEN_BOUND): Remove;
1984 they are now defined in intprops.h.
1986 2005-03-09 Jim Meyering <jim@meyering.net>
1988 * TODO: Remove entry about named pipes. It was fixed in 5.3.0.
1990 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
1992 * src/date.c (usage): Redo to match recent documentation changes.
1993 Don't bother documenting which usages are GNU extensions; the list
1994 wasn't correct, and is better left to the printed manual anyway.
1996 2005-03-06 Jim Meyering <jim@meyering.net>
1998 Factor out column-count processing.
1999 * src/pr.c: Include "inttostr.h".
2000 (parse_column_count): New function.
2001 (main): Use the new function for both old-style, -9, and long,
2002 --columns=-9, options.
2004 * src/cksum.c: Remove `register' keyword.
2005 * src/cut.c: Likewise.
2006 * src/dd.c: Likewise.
2007 * src/env.c: Likewise.
2008 * src/factor.c: Likewise.
2009 * src/fmt.c: Likewise.
2010 * src/fold.c: Likewise.
2011 * src/id.c: Likewise.
2012 * src/logname.c: Likewise.
2013 * src/ls.c: Likewise.
2014 * src/pr.c: Likewise.
2015 * src/printf.c: Likewise.
2016 * src/shred.c: Likewise.
2017 * src/sort.c: Likewise.
2018 * src/sum.c: Likewise.
2019 * src/test.c: Likewise.
2020 * src/tsort.c: Likewise.
2021 * src/uniq.c: Likewise.
2022 * src/wc.c: Likewise.
2023 * src/whoami.c: Likewise.
2025 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
2027 * src/Makefile.am (nanosec_libs): Remove $(LIB_XANOSLEEP); no
2030 2005-03-01 Jim Meyering <jim@meyering.net>
2032 * src/copy.c (copy_internal): Change test of source type from
2033 !S_ISREG to S_ISLNK. Reported by Paul Eggert in
2034 http://lists.gnu.org/archive/html/bug-coreutils/2004-10/msg00050.html.
2036 2005-02-28 Jim Meyering <jim@meyering.net>
2038 * NEWS: Mention that xnanosleep fixes sleep failure on linux-2.6.8.1.
2040 2005-02-21 Paul Eggert <eggert@cs.ucla.edu>
2042 * src/Makefile.am (dd_LDADD, shred_LDADD): Add $(LIB_GETHRXTIME).
2043 (nanosec_libs): Add $(LIB_XNANOSLEEP). Needed for newer GNU/Linux
2044 hosts with clock_gettime.
2046 2005-02-20 Paul Eggert <eggert@cs.ucla.edu>
2048 * NEWS: Describe user-visible change to dd.
2049 * src/Makefile.am (dd_LDADD, shred_LDADD, nanosec_libs):
2050 Remove $(LIB_CLOCK_GETTIME). These functions now use
2052 * src/dd.c: Include gethrxtime.h, xtime.h.
2053 (start_time): Now of type xtime_t, not struct timespec.
2054 (print_stats, main): Use gethrxtime rather than gettime.
2055 * src/ls.c (time): Remove obsolete decl.
2056 (get_current_time): gettimeofday always returns 0, so don't
2058 * src/shred.c: Include gethrxtime.h.
2059 (isaac_seed): Use gethrxtime rather than a mishmash.
2060 * src/touch.c (time): Remove obsolete decl.
2062 * tests/misc/split-fail: Don't assume that the current host
2063 supports integers wider than 32 bits. Fix comment typo.
2064 * tests/od/x8: Likewise.
2066 * src/chown-core.c (enum RCH_status): Remove trailing comma,
2067 as it's not valid in standard C89.
2069 2005-02-15 Jim Meyering <jim@meyering.net>
2071 * src/stat.c (human_fstype): Add case/definition for S_MAGIC_XFS
2072 so that file systems of type `xfs' are recognized as such.
2073 * src/fs.h: Regenerate.
2074 Reported by Bernd Eckenfels.
2075 * src/stat.c (human_fstype): Likewise for S_MAGIC_JFS/jfs.
2076 * src/fs.h: Regenerate.
2077 Reported by Andreas Schwab.
2079 * src/nice.c (NZERO) [NZERO == 0]: Undefine and define to 20,
2080 to work around the invalid definition from Darwin 7.7.0.
2081 Test failure reported by Sébastien Maret.
2083 2005-02-14 Paul Eggert <eggert@cs.ucla.edu>
2085 * src/sort.c (mergefps): Use binary search rather than linear one
2086 when comparing new line to lines already in main memory.
2087 Idea suggested by James Lemley.
2089 2005-02-09 Jim Meyering <jim@meyering.net>
2091 * src/copy.c (valid_options): Add an assertion that
2092 not both hard_link and symbolic_link are set.
2094 2005-02-08 Paul Eggert <eggert@cs.ucla.edu>
2096 * NEWS: Document stat -f -c %S, plus changes to default formats.
2097 * doc/coreutils.texi (stat invocation): Normalize terminology,
2098 capitalization, and sort order to match --help output. Mention %c
2099 for file systems. Add new -f -c format %S, and document %s versus %S;
2100 problem reported by Jeroen van Wolffelaar.
2101 * src/stat.c (usage): Likewise.
2102 (STATFS_FRSIZE): New macro.
2103 (print_statfs): Use it, for stat -f -c %S.
2104 (do_statfs): Change default formats to output %S.
2106 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
2108 * src/system.h: Include "memrchr.h".
2109 (memrchr) [!HAVE_DECL_MEMRCHR]: Remove decl.
2111 2005-02-02 Jim Meyering <jim@meyering.net>
2113 * tests/du/8gb: Also adjust the test (s/64/128/) to detect
2114 systems that don't support sparse files.
2115 Check for $2 -ge 128, rather than $2 = 128, in case
2116 there is a file system type that doesn't support sparse files,
2117 yet for which metadata takes up additional space.
2118 Both reported by Andreas Schwab.
2120 2005-02-01 Eric Blake <ebb9@byu.net> (tiny change)
2122 * tests/du/8gb: Create a larger test file, so we properly
2123 detect that sparse files can be created on NTFS under cygwin.
2125 2005-01-30 Jim Meyering <jim@meyering.net>
2127 * src/head.c (elide_tail_bytes_pipe): Correct wording in diagnostic.
2129 * src/stty.c: Remove unnecessary parentheses in all #if directives.
2131 2005-01-29 Eric Blake <ebb9@byu.net> (tiny change)
2133 * .cvsignore: Ignore config.cache and config.status.lineno.
2134 * src/stty.c [VSWTCH]: Some systems, like Cygwin, use VSWTC
2135 instead of VSWTCH, for use with CSWTCH.
2137 2005-01-29 Eric Blake <ebb9@byu.net> (tiny change)
2139 * tests/Makefile.am (.PHONY): Add check-root and root-hint.
2140 * tests/rwx-to-mode: Ignore ACL designation.
2141 * tests/setgid-check: Likewise.
2142 * tests/chown/separator: Quote user and group names.
2144 2005-01-24 Jim Meyering <jim@meyering.net>
2146 * src/cp.c (usage): Merge the descriptions of --no-dereference and -P.
2147 Suggestion from Johan Boule.
2149 2005-01-17 Eric Blake <ebb9@byu.net> (tiny change)
2151 * src/Makefile.am (all_programs.list): Strip $(EXEEXT) and remove
2153 * man/Makefile.am (all_programs): Revert previous patch; updated
2154 all_programs.list fixes this.
2155 (.x.1): No need to add $(EXEEXT).
2157 2005-01-03 Corinna Vinschen <corinna@vinschen.de> (tiny change)
2159 * src/system.h: Use S_BLKSIZE value for ST_NBLOCKSIZE where
2162 2005-01-22 Jim Meyering <jim@meyering.net>
2164 * Makefile.maint (v_etc_file): The version string has moved to
2165 version-etc-fsf.c, search that new file, not version-etc.c.
2167 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
2169 * tests/group-names: Use numeric group ids, not symbolic group names,
2170 since the latter can have shell metacharacters in them (e.g., spaces).
2171 Problem reported by Eric Blake.
2172 * tests/chgrp/basic: Assume groups are numeric, not symbolic.
2173 * tests/chgrp/deref: Likewise.
2174 * tests/chgrp/posix-H: Likewise.
2175 * tests/chgrp/recurse: Likewise.
2177 2005-01-15 Jim Meyering <jim@meyering.net>
2179 * src/shred.c (isaac_seed) [HAVE_GETHRTIME]: #if-0 this block,
2180 because just calling gethrtime evokes an `illegal instruction'
2181 failure when compiled with Sun's c89 on Solaris 8 and 9.
2182 Reported by Nelson Beebe.
2184 * src/shred.c (isaac_seed) [HAVE_GETHRTIME]: Don't call ISAAC_SEED
2185 twice with the same value of `t'.
2186 Replace nested #if-#else blocks with #if-#elif-#elif chain.
2188 2005-01-14 Jim Meyering <jim@meyering.net>
2190 The test, tests/tail/f-1, failed on powerpc-apple-darwin7.7.0.
2191 * src/tail.c (IS_TAILABLE_FILE_TYPE): Adjust definition also to include
2192 sockets, since that's what you get when reading from a command-line-
2193 supplied pipe on Darwin 7.7.
2194 (IS_PIPE_LIKE_FILE_TYPE): Define.
2195 (main): Use new IS_PIPE_LIKE_FILE_TYPE rather than simply S_ISFIFO.
2196 Reported by Nelson Beebe.
2197 This same change is also required on NetBSD/sparc-1.5.
2198 Reported by Adrian Bunk.
2200 * src/expr.c (toarith): Rewrite to detect/diagnose integer overflow,
2201 rather than suffering silently.
2202 Before, expr would silently overflow and wrap around:
2203 $ expr 9223372036854775808 = 0 # $(echo 2^63|bc)
2205 Now it detects the problem and exits nonzero:
2206 $ ./expr $(echo 2^63|bc) = 0
2207 ./expr: 9223372036854775808: integer is too large
2209 * tests/chown/separator (id_gn): Exit 77, not 1, for a test-framework
2210 failure, so that doesn't cause `make check' to stop. Nelson Beebe
2211 reported that this test would fail with the diagnostic,
2212 `cannot find name for group ID 10', on one of his systems.
2214 2005-01-13 Jim Meyering <jim@meyering.net>
2216 * src/test.c (is_int): Don't overflow when evaluating integer
2217 constants. Before, ./test $(echo 2^64|bc) -eq 0 && echo FAIL
2220 * tests/Fetish.pm (run_tests): Add code (if-0'd out) to detect
2221 names of temporary files that would clash on 8.3 file systems.
2222 * tests/mk-script (validate): Likewise.
2224 2005-01-12 Jim Meyering <jim@meyering.net>
2226 * tests/dd/skip-seek: Shorten test names to accommodate 8.3 systems.
2228 * tests/tr/Test.pm (repeat-xC): Change test name from
2229 `repeat-Compl', to avoid 8.3 conflict with `repeat-compl'.
2230 Reported by Eric Blake.
2231 (repeat-000): Rename to `repeat-zeros' for the same reason.
2233 2005-01-11 Jim Meyering <jim@meyering.net>
2235 * configure.ac: Update version to 5.3.1.
2237 2005-01-11 Eric Blake <ebb9@byu.net>
2239 * src/Makefile.am (check-README, check-AUTHORS): Account for $(EXEEXT).
2240 * man/Makefile.am (all_programs): Account for $(EXEEXT).
2242 2005-01-11 Jim Meyering <jim@meyering.net>
2244 * src/unexpand.c (add_tab_stop): Properly diagnose a tabstop list
2245 with decreasing values.
2247 * src/expand.c (main): Likewise.
2248 * src/unexpand.c (main): Check for overflow in tabstop values
2249 specified via the obsolete form. E.g., now this command fails:
2250 _POSIX2_VERSION=1 ./unexpand -$(echo '2^64+1'|bc)
2251 Before it would act like `_POSIX2_VERSION=1 ./unexpand -1'.
2252 * tests/unexpand/basic-1 (obs-ovflo): New test for this.
2254 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
2256 Respond to POSIX interpretations about pathchk -p dated 2005-01-06.
2257 * NEWS: Document the changes.
2258 * doc/coreutils.texi (pathchk invocation): Likewise.
2259 * src/pathchk.c (PORTABILITY_OPTION): New constant.
2260 (longopts, usage, main, validate_file_name):
2261 Add support for new -P option.
2262 Reject empty file names (unless -p is not specified and the
2263 current system allows empty file names).
2264 Change --portability so that is now equivalent to -p -P.
2265 Don't test whether file name is too long, if it is known to exist.
2266 (no_leading_hyphen): New function.
2267 * tests/misc/pathchk1: Add tests for empty file names and
2270 2005-01-08 Jim Meyering <jim@meyering.net>
2274 `pr --columns=N' was not equivalent to `pr -N' when also using
2277 * src/pr.c (main): Set `explicit_columns' for --columns=N,
2278 not just for -N. This bug has existed since the introduction
2279 of the --columns=N option on 1998-08-15.
2280 * NEWS: Document this.
2281 * tests/pr/Test.pm (test_vector): For each -N test, automatically
2282 create a new test vector using --columns=N.
2284 2005-01-07 Paul Eggert <eggert@twinsun.com>
2286 * src/pr.c (main): Check for column count overflow with
2287 usages like "pr -2147483648".
2289 2005-01-07 Jim Meyering <jim@meyering.net>
2291 * src/pr.c (init_fps): Use xnmalloc, rather than xmalloc.
2293 2005-01-06 Jim Meyering <jim@meyering.net>
2295 * README: List the precise HP-UX version numbers that are affected.
2296 Suggestion from Bob Proulx.
2298 * Makefile.maint (sc_changelog): Specify find's `-maxdepth 2'
2299 predicate before `-name ChangeLog' to avoid a harmless warning
2302 2005-01-05 Jim Meyering <jim@meyering.net>
2304 * tests/help-version: Punt on the uptime test, since it fails when
2305 it can't get boot time, and I don't want that to stop `make check'.
2307 * src/du.c (process_file): Evaluate exclusion rules against
2308 the entire file name, not just the last component.
2309 Reported by Robert Lindgren.
2310 * tests/du/exclude: Test for this.
2311 * NEWS: Document this.
2313 Ensure that tests/Makefile.am's check-root actions stay up to date.
2314 * Makefile.maint (sc_root_tests): New rule.
2315 (syntax-check-rules): Add it to the list.
2317 2005-01-04 Jim Meyering <jim@meyering.net>
2319 * man/shred.x: Change one-line summary to reflect that shred does
2320 not remove files by default. Suggestion from Helen Faulkner in
2321 http://bugs.debian.org/288552
2323 * README: Request VERBOSE=yes output when reporting test failures.
2324 Other minor changes.
2326 * tests/Makefile.am (check-root): Update.
2328 2005-01-03 Paul Eggert <eggert@cs.ucla.edu>
2330 * src/system.h: Undo previous change; we now use Autoconf.
2332 2005-01-03 Jim Meyering <jim@meyering.net>
2334 * tests/stty/row-col-1: Don't set rows or columns to zero, to avoid
2335 a bug in the TIOCGWINSZ ioctl on at least Solaris5.9 systems. Setting
2336 either (or both) to zero would succeed, but subsequent `stty size'
2337 would say `no size information for this device' due to the ioctl
2338 failing with EINVAL.
2340 * src/system.h: If PRIdMAX, PRIoMAX, PRIuMAX, and PRIxMAX are
2341 not all defined and either ULONG_MAX or ULLONG_MAX is not defined,
2342 then fail at compile-time rather than let tools like od produce
2343 invalid results at run time.
2345 2004-12-21 Jim Meyering <jim@meyering.net>
2347 * src/csplit.c (usage): Say the default names are `xx00, xx01, ...',
2348 not `xx01, xx02, ...'.
2349 Reported by Matt Kraai in http://bugs.debian.org/286605
2351 * tests/misc/split-fail: Avoid spurious failure on x86 Solaris5.9
2354 2004-12-20 Paul Eggert <eggert@cs.ucla.edu>
2356 * src/split.c (usage): Mention default size. Suggested by Dan Jacobson.
2358 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
2360 * NEWS: Mention that one should eval "`dircolors`" rather than
2363 2004-12-17 Jim Meyering <jim@meyering.net>
2365 * tests/mv/hard-link-1: Rearrange to use newer trap-handling code,
2366 so temporary directories aren't left behind upon e.g., interrupt.
2368 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
2370 * src/ls.c (print_dir): Use "%s: not listing already-listed
2371 directory", not "not listing already-listed directory: %s", to
2372 format already-listed directories, to be consistent with other
2373 diagnostics involving file names and colons.
2375 2004-12-15 Jim Meyering <jim@meyering.net>
2377 * src/Makefile.am (__LDADD): Define, so that building `[' on
2378 Solaris still uses the -lgen library that it requires in order
2379 to get a definition of eaccess.
2381 2004-12-14 Jim Meyering <jim@meyering.net>
2383 tac would exit immediately upon I/O or temp-file creation failure.
2384 Now it continues on, processing any remaining command line arguments.
2386 * src/tac.c: Include quotearg.h.
2387 Use quotearg_colon in most diagnostics.
2388 (copy_to_temp): Rewrite not to exit upon I/O or temp-file-creation
2389 failure. Before, this command (with /full/tmp being a full partition)
2390 TMPDIR=/full/tmp ./tac /proc/modules tac.c
2391 would exit immediately upon the write error while trying to copy
2392 non-seekable /proc/modules to the full partition. Now it still
2393 reports the failure but continues on with the remaining file.
2394 (tac_nonseekable): Return false also if copy_to_temp fails.
2395 [DONT_UNLINK_WHILE_OPEN]: Add a FIXME comment explaining that
2396 using atexit like this is wrong.
2397 * NEWS: Document this.
2398 * tests/misc/tac-continue: New test for this.
2399 * tests/misc/Makefile.am (TESTS): Add tac-continue.
2401 * tests/chown/basic: Add a few more tests.
2403 2004-12-13 Paul Eggert <eggert@cs.ucla.edu>
2405 * src/ls.c (gobble_file): Change arg name to be command_line_arg
2406 rather than explicit_arg, for consistency with copy.c.
2407 (extract_dirs_from_files): Remove ignore_dot_and_dot_dot arg, since
2408 it is deducible from dirname arg. All callers changed.
2409 (extract_dirs_from_files, print_dir, queue_directory):
2410 Add command_line_arg arg. All callers changed.
2411 (struct pending): Add command_line_arg member.
2412 (main): Use NULL rather than 0 when appropriate.
2413 (set_exit_status, file_failure): New functions.
2414 (queue_directory): Store command_line_arg into new structure.
2415 (print_dir, gobble_file, get_link_name):
2416 Use file_failure to report problems in accessing files,
2417 so that the exit status is set consistently.
2418 (print_dir): Simplify readdir failure code yet again.
2419 If closedir fails, report "closing directory" rather than "reading
2421 (xstrcoll): Use set_exit_status to set status on failure.
2422 * tests/ls-2/tests (no-a-isdir-b): This now exits with status 2,
2425 2004-12-11 Jim Meyering <jim@meyering.net>
2427 Avoid a race condition vulnerability in chown, when used with
2428 --from=O:G and without the (-h) --no-dereference option.
2429 * src/chown-core.c (restricted_chown): New function.
2430 (change_file_owner): Call it.
2431 Reported by Ulrich Drepper.
2432 * NEWS: Mention this.
2434 2004-12-09 Paul Eggert <eggert@cs.ucla.edu>
2436 * ls now exits with status 1 on minor problems, 2 if serious trouble.
2437 * NEWS: Document this.
2438 * src/ls.c (LS_MINOR_PROBLEM, LS_FAILURE): New constants.
2439 All uses of EXIT_FAILURE replaced with LS_FAILURE, unless
2441 (main): Initialize exit failure to LS_FAILURE.
2442 (print_dir, gobble_file, get_link_name, xstrcoll):
2443 Set exit status to LS_MINOR_PROBLEM if the failure is minor.
2444 (print_dir): Do not give up on entire directory merely because readdir
2446 (usage): Explain exit status.
2447 * tests/help-version: ls and variants now exit with status 2
2450 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
2452 * NEWS: Document new UTC+HH:MM date syntax, and put date changes
2455 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
2457 * src/factor.c (factor): Don't list 1 as a factor of 1.
2458 Problem reported by Thomas Folz-Donahue.
2460 2004-12-06 Jim Meyering <jim@meyering.net>
2462 * tests/du/files0-from: Sanitize environment.
2463 Otherwise, e.g., BLOCKSIZE=k would cause a failure, and that
2464 setting is the default (exported from /etc/profile) on at least one
2466 * tests/du/no-deref: Likewise.
2467 * tests/cp/symlink-slash: Likewise.
2468 * tests/ls/symlink-slash: Likewise
2470 2004-12-05 Jim Meyering <jim@meyering.net>
2472 * tests/tail/Test.pm (err-6) ["tail -c"]: Avoid test failure when
2473 _POSIX2_VERSION=199209 is in the environment, or when building on
2476 2004-12-04 Jim Meyering <jim@meyering.net>
2478 * NEWS: Mention cut's new --complement option.
2480 2004-10-01 Paolo Bonzini <bonzini@gnu.org>
2482 * cut.c (complement, COMPLEMENT_OPTION): New.
2483 (longopts): Add --complement.
2484 (usage): Say not that -b, -c, and -f `print' fields,
2485 but rather that they `select' fields for printing.
2486 Describe the new --complement option.
2487 (mark_range_start): Extracted from set_fields.
2488 (print_kth): Support --complement.
2489 (compare_ranges): New function.
2490 (set_fields): Rewrite the part that populates range_start_ht,
2491 merging it with the part that populates printable_field.
2492 (main): Handle --complement.
2494 2004-12-03 Paul Eggert <eggert@cs.ucla.edu>
2496 * src/tail.c (tail_file): Set errnum to -1 if the initial "tail"
2497 failed. This works around an assertion failure reported by
2499 http://lists.gnu.org/archive/html/bug-coreutils/2004-12/msg00012.html
2501 2004-12-02 Jim Meyering <jim@meyering.net>
2503 With using --color and with LS_COLORS saying not to color
2504 executables, don't stat every file.
2505 * src/ls.c (is_colored): New function.
2506 (gobble_file): Use it.
2507 (main): Use it here, in place of too-strict tests against NULL:
2508 if either ORPHAN or MISSING was set to 0 from LS_COLORS, the
2509 old test would fail.
2511 2004-12-01 Paul Eggert <eggert@cs.ucla.edu>
2513 * src/comm.c (compare_files): Assume setlocale exists.
2514 * src/join.c (keycmp): Likewise.
2515 * src/seq.c (decimal_point): Treat like sort. Now char.
2517 (main): Assume localeconv exists. Use same code as sort.
2518 * src/sort.c (C_DECIMAL_POINT): Remove. Use changed to '.'.
2519 Assume setlocale exists.
2520 (thousands_sep): Renamed from th_sep.
2521 (IS_THOUSANDS_SEP): Remove. All uses replaced by comparisons.
2522 (NONZERO): Parenthesize use of arg.
2523 (numcompare): Avoid duplicate loads. Use ISDIGIT as boolean, for
2524 consistency. Avoid unnecessary negation by reversing
2526 (main): Rewrite localeconv call to match seq.c.
2527 * src/system.h: Assume locale.h exists.
2528 (HAVE_SETLOCALE): Remove.
2529 * src/uniq.c (different): Assume setlocale exists.
2531 * src/ls.c (sort_files): Minor cleanup. Remove an unnecessary
2532 'volatile' on a local variable. Rewrite to avoid unnecessary
2533 double-assignment to 'func' in the usual case where strcoll does
2536 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
2538 * src/pinky.c (gethostname): Remove decl.
2539 (scan_entries): Use IS_USER_PROCESS instead of by-hand code.
2540 * src/uptime.c (print_uptime): Use IS_USER_PROCESS and
2541 UT_TYPE_BOOT_TIME instead of by-hand code.
2542 * src/users.c (list_entries_users): Use IS_USER_PROCESS
2543 instead of by-hand code.
2544 * src/who.c (USER_PROCESS, RUN_LVL, INIT_PROCESS, LOGIN_PROCESS,
2545 DEAD_PROCESS, BOOT_TIME, NEW_TIME, UT_TYPE_UNDEF, UT_TYPE): Remove.
2546 (IS_USER_PROCESS): Move to ../lib/readutmp.h.
2547 (UT_TYPE_RUN_LVL, UT_TYPE_INIT_PROCESS, UT_TYPE_LOGIN_PROCESS,
2548 UT_TYPE_DEAD_PROCESS, UT_TYPE_NEW_TIME): New macros.
2549 (gethostname): Remove decl.
2550 (list_entries_who, scan_entries): Use the new macros defined above,
2551 for consistency with pinky, uptime, and users.
2553 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
2555 Fix problem reported by Scott S. Tinsley for HP-UX 11.11 using
2556 HP's ANSI C compiler. Declaring int functions causes warnings on
2557 some modern systems and shouldn't be needed to compile on ancient
2559 * src/copy.h (stat, lstat, rename): Remove decls.
2560 * src/install.c (stat): Remove decl.
2561 * src/ln.c (link, symlink): Remove decls.
2563 2004-11-25 Jim Meyering <jim@meyering.net>
2565 * man/help2man: Import help2man-1.35.1.
2566 * man/Makefile.am (.x.1): Remove now-unnecessary use of
2567 locally-added --program-name=NAME option. Now, help2man gets
2568 the name from the [NAME] section (i.e. from our .x file).
2569 * man/install.x: Use `install', not `ginstall' in the one-line
2570 description. Reported by Brendan O'Dea.
2571 * man/sha1sum.x: Use `sha1sum', not `shasum'.
2573 2004-11-24 Jim Meyering <jim@meyering.net>
2575 Since the changes of 2004-05-22, the u.saved_cwd member at
2576 the bottom of the active-directory stack was no longer
2577 strictly necessary. This change removes that member and uses
2578 the newer cwd_state parameter for the final restore_cwd.
2580 * src/remove.c (struct AD_ent) [u]: Remove now-unnecessary union.
2581 [dev_ino]: Rename from `a'.
2582 (AD_pop_and_chdir): Add a parameter to play the role of just-removed
2583 bottom-of-stack cwd-state member.
2584 (AD_pop_and_chdir): No longer return boolean. Adjust caller.
2585 (AD_push_initial): Remove CWD parameter. Adjust caller.
2587 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
2589 Minor performance improvements and cleanups for "touch".
2590 * src/touch.c (posix_date): Remove; not needed as a static var.
2592 (touch): Use new futimens function to operate more efficiently
2593 in some cases. Don't stat/fstat existing file when
2594 (!amtime_now && change_times == (CH_ATIME | CH_MTIME)); the
2595 old time stamps aren't needed in that case.
2596 (main): change_times is int, not bool. Simplify test for
2599 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
2601 * src/install.c (usage): Avoid usage that runs afoul of Docbook
2602 translation. Problem reported by Eric S. Raymond.
2604 Restore dd's noctty flag, reverting the change of 2004-04-08.
2605 POSIX does not allow "dd" to use O_NOCTTY by default.
2606 * NEWS: Add noctty flag to dd.
2607 * doc/coreutils.texi (dd invocation): Likewise.
2608 * src/dd.c (flags, usage, main): Likewise.
2610 2004-11-19 Alfred M. Szmidt <ams@gnu.org>
2612 * src/ls.c (usage): Clarified description of --no-group (-G),
2613 --human-readable (-h), --inode (-i), --size (-s), --time,
2616 2004-11-19 Jim Meyering <jim@meyering.net>
2618 * src/ls.c (usage): Clarify description of --author.
2619 Tweak indentation so that help2man creates better nroff.
2620 Reported by Dan Jacobson.
2622 * src/uniq.c (check_file): Don't check stdout for errors here.
2624 * src/pwd.c (find_dir_entry): Update comment to match reality.
2626 2004-11-18 Jim Meyering <jim@meyering.net>
2628 * src/pwd.c (robust_getcwd): Correct the comment: this function
2629 constructs the directory name. The caller prints it.
2631 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
2633 * src/stat.c (STATFS): New macro, for portability to Solaris 9.
2634 (do_statfs): Use it.
2636 * src/basename.c, src/chroot.c, src/cksum.c, src/dd.c, src/dirname.c,
2637 src/factor.c, src/hostid.c, src/hostname.c, src/link.c, src/logname.c,
2638 src/nohup.c, src/printenv.c, src/pwd.c, src/setuidgid.c, src/sleep.c,
2639 src/sync.c, src/tsort.c, src/unlink.c, src/uptime.c, src/users.c,
2640 src/whoami.c, src/yes.c (main): Use getopt_long rather than getopt.
2641 * src/readlink.c (main): argv is not const.
2643 * src/cut.c (usage): Improve documentation along the lines suggested
2645 * src/echo.c (usage): Likewise.
2646 * src/expr.c (usage): Likewise.
2648 * src/dircolors.hin: Add putty, screen-bce.
2650 * src/pinky.c (print_entry): Fix memory leak.
2651 * src/who.c (print_user): Likewise.
2653 2004-11-15 Paul Eggert <eggert@cs.ucla.edu>
2655 * NEWS: New dd operand "status=noxfer".
2656 * src/dd.c (C_ASCII, C_EBCDIC, C_IBM, C_BLOCK, C_UNBLOCK,
2657 C_LCASE, C_UCASE, C_SWAB, C_NOERROR, C_NOTRUNC, C_SYNC, C_TWOBUFS,
2658 C_NOCREAT, C_EXCL, C_FDATASYNC, C_FSYNC): Now constants, not
2660 (STATUS_NOXFER, statuses): New constants.
2661 (usage, print_stats, scanargs): Add support for status=noxfer.
2662 (usage): Update status output to match new behavior.
2663 (print_stats): Always output complete byte count.
2664 Put space between numbers and units, as SI requires.
2665 Use ngettext so that i18n can use plurals for "byte" and "second".
2666 Don't multiply by 1e-9 (inexact); divide by 1e9 (which is exact).
2667 (iflag_error_msgid, oflag_error_msgid): Remove; replace uses by
2669 * tests/dd/skip-seek (@Tests): Use status=noxfer to avoid
2670 problems with regression testing.
2672 2004-11-14 Paul Eggert <eggert@cs.ucla.edu>
2674 * NEWS: dd now outputs total bytes, seconds, and bytes per second.
2675 * src/Makefile.am (dd_LDADD): Add $(LIB_CLOCK_GETTIME).
2676 * src/dd.c: Include "human.h".
2677 (w_bytes, start_time): New vars.
2678 (usage): Document new I/O statistics output
2679 (print_stats): Output new I/O statistics.
2680 (cleanup): Do statistics after closing stdin and stdout, so that
2681 the times are more accurate.
2682 (write_output, dd_copy): Count output bytes.
2683 (main): Get initial value of clock.
2685 2004-11-14 Jim Meyering <jim@meyering.net>
2687 Backslash-escape `-'s in email addresses, so that they are
2688 rendered properly in UTF-locales.
2689 * man/help2man (escape_hyphens): New function.
2690 (main): Call it on email addresses.
2692 * src/sort.c (zaptemp): Mark new diagnostic for translation.
2694 * tests/misc/close-stdout: New file. Test today's closeout.c change.
2695 * tests/misc/Makefile.am (TESTS): Add close-stdout.
2697 2004-11-13 Jim Meyering <jim@meyering.net>
2699 * src/test.c (usage): Put the description of `[-n] STRING'
2700 on two lines, one for `-n STRING' and one for `STRING' so that
2701 help2man properly escapes the `-'. Otherwise, the hyphen is
2702 rendered inappropriately in UTF-8 locales.
2703 Reported by Uwe Zeisberger in http://bugs.debian.org/281069.
2705 2004-11-12 Paul Eggert <eggert@cs.ucla.edu>
2707 * NEWS: Document the following changes.
2709 * src/sort.c: Avoid O(N**2) behavior when there are many temporary
2711 (temptail): New variable, so that we can easily append to list.
2712 (create_temp_file): Create new files at end of list, so that
2713 searching the list has O(N*NMERGE) behavior instead of O(N**2).
2714 (zaptemp): Update temptail if needed.
2715 (mergefps, merge): Accept new arg that counts temp files, and keep it
2716 up to date as we create and remove temporaries. This is for
2717 efficiency, so that we don't call zaptemp so often.
2718 All callers changed.
2719 (sort): Don't create array in reverse order, since the list of
2720 temporaries is now in the correct order.
2722 (zaptemp): Protect against race condition: if 'sort' is
2723 interrupted in the middle of zaptemp, it might unlink the
2724 temporary file twice, and the second time this happens the file
2725 might already have been created by some other process.
2727 (zaptemp): Warn if a temporary file is not removed.
2729 (create_temp_file): Use offsetof for clarity.
2730 (die): Move it up earlier, to clean up the code a bit.
2732 * src/pr.c (strtoumax): Declare if not declared.
2733 (skip_to_page, first_page_number, last_page_number, page_number,
2734 first_last_page, print_header):
2735 Use uintmax_t for page numbers.
2736 (first_last_page): Remove unnecessary forward declaration.
2737 Do not modify arg (it is now a const pointer).
2738 Return a true if successful, false (without print a diagnostic)
2740 (main): If +XXX does not specify a valid page range, treat it
2741 as a file name. This follows the response to Open Group XCU ERN 41
2742 <http://www.opengroup.org/sophocles/show_mail.tpl?source=L&listname=austin-group-l&id=7717>,
2743 which says the behavior is allowed.
2744 (skip_to_page): When starting page number exceeds page count,
2745 print both numbers in the diagnostic.
2746 (print_header): Detect page number overflow.
2748 2004-11-07 Jim Meyering <jim@meyering.net>
2750 * src/uname.c [__APPLE__]: Include <mach/machine.h> and <mach-o/arch.h>.
2751 (main) [__APPLE__]: Get the processor type via syscall rather than
2752 hard-coding "powerpc". From Toby Peterson.
2754 * src/sort.c (merge): Remove declarations of now-unused variables.
2756 2004-11-06 Paul Eggert <eggert@cs.ucla.edu>
2758 * src/sort.c (first_same_file): Remove. Move most of the code to....
2759 (avoid_trashing_input): New function.
2760 (merge): Avoid some silly merges, e.g., copying a single file to
2761 a temporary file when there are exactly 17 input files to merge.
2762 Take a count of temporary files rather than a max_merge arg.
2765 2004-11-06 Jim Meyering <jim@meyering.net>
2767 * src/sort.c (xfclose): Don't close stdout here (just flush it),
2768 since close_stdout now closes stdout unconditionally.
2770 2004-11-05 Paul Eggert <eggert@cs.ucla.edu>
2772 * src/sort.c (inittables, sort_buffer_size, getmonth, mergefps,
2773 first_same_file, merge, sort, main): Use size_t for indexes to arrays.
2774 This fixes some unlikely havoc-wreaking bugs (e.g., more than INT_MAX
2776 (getmonth, keycompare, compare): Rewrite to avoid need for alloca,
2777 thus avoiding unchecked stack overflow in some cases. As a side
2778 effect this improve the performance of "sort -M" by a factor of 4
2781 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
2783 * src/stty.c: Include "vasprintf.h" since we use vasprintf now.
2785 * src/Makefile.am (check-AUTHORS): Don't assume \? works in a sed
2786 expression; it's not portable. Problem reported by Albert Chin.
2787 Don't invoke a program more than once.
2788 * src/groups.sh (version): New variable, containing author info,
2789 for benefit of AUTHORS check. Use it when acting on --version option.
2790 * AUTHORS: Remove duplicate lines. Remove bogus "chroot:"
2793 * src/system.h: Don't #define and #undef getopt around <stdlib.h>,
2794 as this breaks the new regime that does "#define getopt rpl_getopt".
2795 Problem reported by Albert Chin for Solaris 9 with Sun cc in:
2796 http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00019.html
2797 I suppose this may cause problems on ancient hosts with
2798 incompatible getopt declarations, but we'll cross that bridge if
2799 the problem gets reported to us by someone who can test the fix.
2801 2004-11-03 Jim Meyering <jim@meyering.net>
2803 * src/tac.c: quote(...) file names in diagnostics.
2805 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
2807 * NEWS: Document getdate changes.
2809 2004-10-29 Jim Meyering <jim@meyering.net>
2811 * src/tac.c (tac_file): Remove temporary prototype and move this
2812 function `down' so that it precedes definition of tac_nonseekable.
2814 `tac /proc/modules' would print nothing
2815 Reported by Harald Dunkel in http://bugs.debian.org/278604.
2817 * src/tac.c (copy_to_temp): Renamed from save_stdin, since
2818 now it copies a general file descriptor, not just stdin.
2819 (tac_nonseekable): Renamed/adapted from tac_stdin.
2820 (tac_file): Get fd via `open' directly rather than via fopen/fileno,
2821 since we never used the stream. Perform "-" to stdin mapping here
2822 rather than in main. Determine whether a file is seekable,
2823 by trying to `lseek' to its end, and dispatch to tac_seekable or
2824 tac_nonseekable accordingly.
2825 (main): Rewrite argument handling now that it uses only tac_file.
2826 * NEWS: Mention it here.
2828 2004-10-21 Jim Meyering <jim@meyering.net>
2830 * tests/mv/leak-fd: New file.
2831 * tests/mv/Makefile.am (TESTS): Add it.
2832 * tests/rm/dot-rel: New file.
2833 * tests/rm/Makefile.am (TESTS): Add it.
2835 Correct my patch of 2004-10-18.
2836 * src/remove.c (rm): Destroy the saved_cwd here (via cwd_state),
2837 if necessary, not in remove_dir. Otherwise, removing multiple
2838 `.'-relative nonempty directories no longer worked.
2840 2004-10-20 Paul Eggert <eggert@cs.ucla.edu>
2842 * src/fmt.c (usage): Improve description of --prefix.
2843 Problem reported by Edward Welbourne.
2845 * man/uniq.x: Change summary so that it doesn't imply that
2846 uniq writes to its input file. Problem reported by
2849 2004-10-18 Jim Meyering <jim@meyering.net>
2851 Plug a leak that would cause a cross-device mv to fail when
2852 operating on too many command-line-specified nonempty directories.
2853 * src/remove.c (remove_dir): Destroy the `struct saved_cwd' on the
2854 top of the stack before returning. This usually closes the file
2855 descriptor that was used to return to the original working directory.
2856 Reported by Cyril Bouthors in
2857 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/3048
2858 * NEWS: Mention it here.
2860 * src/pathchk.c (validate_file_name): Give a more descriptive
2861 diagnostic when pathconf fails. This also avoids an unwarranted
2862 warning from gcc-3.3.5 about a format not being a string literal.
2864 * src/sleep.c (main): Remove declaration of unused local, c.
2865 * src/printenv.c (main): Likewise.
2866 * src/logname.c (main): Likewise.
2867 * src/uptime.c (main): Likewise, for optc.
2868 * src/tsort.c (main): Likewise, for opt.
2870 2004-10-17 Paul Eggert <eggert@cs.ucla.edu>
2872 * AUTHORS: Add self to pathchk.
2873 * src/pathchk.c (AUTHORS): Add self.
2874 Change "path" to "file name" whenever possible.
2875 Remove usage comment, as it was a duplication of the code or doc.
2876 Include <wchar.h> if available.
2877 (mbrlen, mbstate_t) [! (HAVE_MBRLEN && HAVE_MBSTATE_T)]: Define.
2878 (NEED_PATHCONF_WRAPPER, PATH_MAX, PATH_MAX_FOR, NAME_MAX,
2879 pathconf_wrapper, portable_chars, dir_ok): Remove.
2880 (NAME_MAX_MINIMUM, PATH_MAX_MINIMUM): New macros.
2881 (pathconf, _PC_NAME_MAX, _PC_PATH_MAX): Define if nonexistent.
2882 (portable_chars_only): New arg FILELEN.
2883 Don't assume ASCII; we might be on an EBCDIC host.
2884 Don't assume unibyte locale in diagnostic.
2885 (component_start, component_len): New functions.
2886 (validate_file_name): Renamed from validate_path. All uses changed.
2887 Pretty much a complete rewrite.
2888 Don't make copy of file arg. Always append trailing slash to
2889 pathconf arg, just in case it's a symlink (this is pure paranoia;
2890 we don't know of any hosts where the trailing slash is required).
2891 Use size_t instead of long int when possible.
2892 Avoid need to call pathconf in most practical cases.
2893 Don't use euidaccess several times to test searchability;
2894 just use lstat once. Reword diagnostic to put the (often very long)
2897 2004-10-15 Paul Eggert <eggert@cs.ucla.edu>
2899 * src/printf.c (usage): Mention Unicode, and use H for hex digits.
2901 2004-10-13 Jim Meyering <jim@meyering.net>
2903 * NEWS: Mention today's fts.c fix.
2905 2004-10-13 Paul Eggert <eggert@cs.ucla.edu>
2907 * tests/stty/row-col-1: Set LC_ALL=C.
2909 2004-10-12 Jim Meyering <jim@meyering.net>
2911 * src/dircolors.hin: Add .flac and .mpc as audio suffixes.
2912 From Jesus Climent in http://bugs.debian.org/276149.
2914 2004-10-05 Paul Eggert <eggert@cs.ucla.edu>
2916 * src/ls.c (ignore_mode): Renamed from ignore, to avoid shadowing
2917 problems. All uses changed.
2919 2004-10-05 Jim Meyering <jim@meyering.net>
2921 * .x-sc_trailing_blank: Add an exclusion for config/texinfo.tex,
2922 since Karl says its trailing blanks are there to stay :-)
2924 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
2926 * src/expr.c (NEW, OLD): Remove, partly to avoid
2927 reference to obsolescent macro XMALLOC.
2928 All uses replaced by xmalloc and free.
2930 2004-09-28 Jim Meyering <jim@meyering.net>
2932 * src/tail.c (usage): Clarify: --retry works only with --follow=name.
2933 Reported by Nik A. Melchior in http://bugs.debian.org/273781.
2935 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
2937 * src/od.c (format_address_paren): c is optional, so don't output
2940 2004-09-26 Paul Eggert <eggert@cs.ucla.edu>
2942 Add support for ls --hide. Idea suggested by Bardur Arantsson.
2943 * NEWS: Document this.
2944 * src/ls.c (file_ignored): Renamed from file_interesting, with
2945 inverted return value. Accept the file name, not a struct dirent *.
2946 All uses changed. Avoid the expense of calling fnmatch if the
2947 file is ignorable due to leading '.'.
2948 (all_files, really_all_files): Removed; replaced by:
2949 (ignore): New variable. All uses changed.
2950 (IGNORE_DEFAULT, IGNORE_DOT_AND_DOTDOT, IGNORE_MINIMAL, HIDE_OPTION):
2952 (hide_patterns): New variable.
2953 (long_options, decode_switches, file_ignored, usage):
2954 Add support for --hide.
2955 (patterns_match): New function.
2956 (usage): Replace "hide" with "ignore" in explanation, to avoid
2959 2004-09-25 Paul Eggert <eggert@cs.ucla.edu>
2961 * src/ls.c (gobble_file, print_long_format): Don't assume that
2962 human-readable output has a byte count equal to its column width;
2963 this isn't always true in locales where the radix character is not
2965 (format_user_or_group): Revamp code to match the above fix;
2966 this avoids the (very faint) possibility of integer overflow.
2968 2004-09-24 Paul Eggert <eggert@cs.ucla.edu>
2970 * NEWS: Mention that "chmod -r -w x" now works as expected.
2971 * src/chmod.c (main): Revamp option processing to support this.
2972 * tests/chmod/Makefile.am (TESTS): Add 'usage'.
2973 * tests/chmod/usage: New set of tests for usage like that.
2975 2004-09-24 Jim Meyering <jim@meyering.net>
2977 * Makefile.maint (CVS_LIST): Use --types=AFGM option so that
2978 it lists only cvs-controlled regular files.
2980 * src/csplit.c (xalloc_die): Declare to be `extern', not `static'
2981 to avoid a warning from gcc-3.4.1. Reported by Paul Eggert.
2983 2004-09-23 Paul Eggert <eggert@cs.ucla.edu>
2985 * Makefile.maint (CVS_LIST): New macro.
2986 (sc_space_tab, sc_prohibit_atoi_atof, sc_file_system,
2987 sc_prohibit_jm_in_m4, sc_system_h_headers, sc_sun_os_names,
2988 sc_trailing_blank, po-check): Use it instead of the
2989 nonstandard "cvsu --list".
2991 * src/tail.c (parse_obsolete_option): Bring back support
2992 for obsolete option followed by non-obsolete, or by more
2993 than one file. When obsolete, conform to SUSv2 rather than
2994 original POSIX 1003.2-1992, as SUSv2 corrected the case of
2995 "tail -c". Add support for the SUSv2 "b" modifier.
2996 * NEWS: Mention the above.
2997 * tests/tail/Test.pm: New test case obs-b to check the above.
2998 err-[134] no longer need _POSIX2_VERSION=199209.
2999 Fix comments to match revised behavior.
3001 2004-09-22 Jim Meyering <jim@meyering.net>
3003 * Use automake-1.9.2. Regenerate dependent files.
3005 * src/remove.c (struct dirstack_state) [current_arg_jumpbuf]:
3006 Improve the comment.
3008 Clean up scoping etc. so that some make `distcheck' tests pass.
3009 * src/csplit.c (xalloc_die): Declare to be static.
3010 * src/chown-core.c (chown_files): Declare as `extern'.
3011 * src/cp-hash.c (remember_created): Likewise.
3012 * src/copy.c (copy): Likewise.
3013 * src/checksum.h (enum) [ALG_MD5]: Define to be 1, not 0.
3015 * src/id.c, src/nl.c, src/expand.c: Remove trailing blanks.
3016 * src/unexpand.c: Likewise.
3018 * src/Makefile.am (check-AUTHORS): New rule.
3019 (check): Depend on it.
3022 * Makefile.maint (syntax-check-rules): Remove duplicate sc_tight_scope.
3023 (sc_system_h_headers): Also exclude copy.h; it includes <stdbool.h>.
3025 2004-09-22 Paul Eggert <eggert@cs.ucla.edu>
3027 * src/ls.c (decode_switches): Don't compare a short value
3028 to SIZE_MAX: GCC sometimes complains.
3030 2004-09-21 Paul Eggert <eggert@cs.ucla.edu>
3032 * NEWS: The following commands now reject unknown options:
3033 basename dirname factor hostname link nohup sync unlink yes
3034 Also, pathchk no longer accepts trailing options.
3036 * src/basename.c: Include <getopt.h>.
3037 * src/chroot.c: Likewise.
3038 * src/dirname.c: Likewise.
3039 * src/factor.c: Likewise.
3040 * src/hostid.c: Likewise.
3041 * src/hostname.c: Likewise.
3042 * src/nohup.c: Likewise.
3043 * src/pwd.c: Likewise.
3044 * src/setuidgid.c: Likewise.
3045 * src/sync.c: Likewise.
3047 * src/basename.c (main): Reject unknown options.
3048 * src/dirname.c (main): Likewise.
3049 * src/factor.c (main): Likewise.
3050 * src/hostid.c (main): Likewise.
3051 * src/hostname.c (main): Likewise.
3052 * src/link.c (main): Likewise.
3053 * src/nohup.c (main): Likewise.
3054 * src/pwd.c (main): Likewise.
3055 * src/setuidgid.c (main): Likewise.
3056 * src/sync.c (main): Likewise.
3057 * src/unlink.c (main): Likewise.
3058 * src/yes.c (main): Likewise.
3060 * src/cat.c (main): Remove unused "case 0".
3061 * src/chgrp.c (main): Likewise.
3062 * src/chmod.c (main): Likewise.
3063 * src/chown.c (main): Likewise.
3064 * src/comm.c (main): Likewise.
3065 * src/cp.c (main): Likewise.
3066 * src/csplit.c (main): Likewise.
3067 * src/cut.c (main): Likewise.
3068 * src/date.c (main): Likewise.
3069 * src/df.c (main): Likewise.
3070 * src/du.c (main): Likewise.
3071 * src/env.c (main): Likewise.
3072 * src/expand.c (main): Likewise.
3073 * src/fold.c (main): Likewise.
3074 * src/head.c (main): Likewise.
3075 * src/id.c (main): Likewise.
3076 * src/install.c (main): Likewise.
3077 * src/join.c (main): Likewise.
3078 * src/ln.c (main): Likewise.
3079 * src/ls.c (decode_switches): Likewise.
3080 * src/mkdir.c (main): Likewise.
3081 * src/mkfifo.c (main): Likewise.
3082 * src/mknode.c (main): Likewise.
3083 * src/mv.c (main): Likewise.
3084 * src/nl.c (main): Likewise.
3085 * src/paste.c (main): Likewise.
3086 * src/pinky.c (main): Likewise.
3087 * src/pr.c (main): Likewise.
3088 * src/ptx.c (main): Likewise.
3089 * src/readlink.c (main): Likewise.
3090 * src/rm.c (main): Likewise.
3091 * src/rmdir.c (main): Likewise.
3092 * src/seq.c (main): Likewise.
3093 * src/shred.c (main): Likewise.
3094 * src/split.c (main): Likewise.
3095 * src/sum.c (main): Likewise.
3096 * src/tac.c (main): Likewise.
3097 * src/tail.c (main): Likewise.
3098 * src/tee.c (main): Likewise.
3099 * src/touch.c (main): Likewise.
3100 * src/tr.c (main): Likewise.
3101 * src/tty.c (main): Likewise.
3102 * src/uname.c (main): Likewise.
3103 * src/unexpand.c (main): Likewise.
3104 * src/wc.c (main): Likewise.
3105 * src/who.c (main): Likewise.
3107 * src/chroot.c (main): Use getopt where it suffices, not getopt_long.
3108 * src/cksum.c (main): Likewise.
3109 * src/dd.c (main): Likewise.
3110 * src/logname.c (main): Likewise.
3111 * src/printenv.c (main): Likewise.
3112 * src/sleep.c (main): Likewise.
3113 * src/tsort.c (main): Likewise.
3114 * src/uptime.c (main): Likewise.
3115 * src/users.c (main): Likewise.
3116 * src/whoami.c (main): Likewise.
3118 * src/du.c (long_options): Standardize on NULL vs 0.
3119 * src/rm.c (long_opts): Likewise.
3121 * src/logname.c (long_options): Remove.
3122 * src/printenv.c (long_options): Likewise.
3123 * src/sleep.c (long_options): Likewise.
3124 * src/tsort.c (long_options): Likewise.
3125 * src/uptime.c (longopts): Likewise.
3126 * src/users.c (longopts): Likewise.
3127 * src/whoami.c (long_options): Likewise.
3129 * src/pathchk.c (longopts): Add --help, --version.
3130 (main): Use longopts rather than parse_long_options.
3131 * src/stty.c (longpts, main): Likewise.
3133 * src/pathchk.c (main): Don't reorder arguments, so that
3134 we can check weird file names.
3136 * src/readlink.c: Don't include "long-options.h".
3137 * src/sort.c: Likewise.
3138 * src/stty.c: Likewise.
3140 * src/split.c (verbose): Now bool, not int.
3141 (VERBOSE_OPTION): New enum.
3142 (longopts, main): Use it.
3144 * tests/factor/basic: Adjust to new wording in diagnostic
3145 that results from the above changes.
3147 2004-09-21 Jim Meyering <jim@meyering.net>
3149 * man/rm.x: Say "the response is affirmative" rather than "the
3150 response begins with y or Y", so that the documentation is
3151 accurate in non-English locales. Problem reported by Munzir Taha.
3153 2004-09-19 Paul Eggert <eggert@cs.ucla.edu>
3155 * src/echo.c (main): Don't pass NULL to strcmp when
3156 POSIXLY_CORRECT and given no arguments.
3158 * src/md5sum.c (STRING_OPTION): Remove.
3159 (long_options, main): Remove support for undocumented and
3160 obsolete --string option, as suggested in the 1996-09-26 patch.
3161 * NEWS: Document this.
3163 * tests/rm/fail-eperm: Don't try to remove writeable files in a
3164 sticky /tmp directory, as SVR4-like systems (e.g., Solaris 9) let
3165 you remove such files. Problem reported by Bert Fischer in:
3166 http://lists.gnu.org/archive/html/bug-coreutils/2004-09/msg00074.html
3168 2004-09-18 Paul Eggert <eggert@cs.ucla.edu>
3170 * src/md5sum.c (STATUS_OPTION, STRING_OPTION): New enums.
3171 (long_options, main): Use them instead of magic numbers 2 and 1.
3172 For --string, optarg can't possibly be NULL.
3174 * src/dd.c (usage): Distinguish between options and operands.
3175 (scanargs): Don't mess with argc, argv; getopt_long handles this now.
3176 Say "operands" for operands, not "options".
3177 (main): Use getopt_long, so that "dd --" works as POSIX requires.
3178 * tests/dd/misc: Check for "dd --".
3180 * src/chroot.c (main): Reject unknown options instead of
3181 interpreting them as a directory to chroot to.
3183 * src/cksum.c: Remove obsolete comment about POSIX 1003.2/D11.2.
3184 The current standard (POSIX 1003.1-2004) is correct.
3185 (crc_remainder) [defined CRCTAB]: Renamed from "remainder" to avoid
3186 collision with builtin function.
3187 (main) [defined CRCTAB]: Output in lowercase hexadecimal, and
3188 output the first 0 as 8 digits, to make it easier to compare to
3189 the text of the standard. Output crctab to be a const array.
3190 (crctab): Use result of above changes.
3191 (long_options): Remove; not needed if empty.
3192 (main): getopt_long can't return 0 here, so simplify the code.
3194 2004-09-13 Jim Meyering <jim@meyering.net>
3196 * src/Makefile.am (localedir.h): Don't redirect directly to target.
3198 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
3200 * src/id.c (print_full_info): Don't exit with failure status simply
3201 because a user or group number can't be turned into a name.
3202 Problem reported by Felipe Kellermann in:
3203 http://lists.gnu.org/archive/html/bug-coreutils/2004-09/msg00081.html
3205 2004-09-12 Jim Meyering <jim@meyering.net>
3207 * Makefile.maint (my-distcheck): When building with -Werror, also
3210 2004-09-10 Paul Eggert <eggert@cs.ucla.edu>
3212 * NEWS: "tail" now handles obscure POSIX 1003.2-1992 cases better.
3213 * src/tail.c (parse_obsolete_option): Renamed from
3214 parse_obsolescent_option, since the options are obsolete now.
3215 Remove bool *arg; just exit if there's an error. Revamp to follow
3216 POSIX 1003.2-1992 more precisely, to handle cases like "tail -
3217 file" and "tail -10 -- file" correctly when we are conforming to
3219 (main): Adjust to this change.
3220 * tests/tail/Test.pm (test_vector): minus-* requires
3221 _POSIX2_VERSION=199209 now, to work correctly if there is
3222 an input file. err-1 and err-3 no longer errors if there
3225 2004-09-09 Paul Eggert <eggert@cs.ucla.edu>
3227 * src/test.c (usage): Document -r, -w, -x more carefully.
3229 2004-09-08 Paul Eggert <eggert@cs.ucla.edu>
3231 * src/test.c (usage): Document "test" (with no args) and "[ ]".
3232 Document that -h and -L don't dereference.
3234 * NEWS: Document that "tr xy -z" now works as per POSIX.
3235 Sort the descriptions.
3236 * src/tr.c (main): Don't reorder options.
3237 * tests/tr/Test.pm (fowler-1): New test case.
3239 2004-09-06 Paul Eggert <eggert@cs.ucla.edu>
3241 * src/touch.c (main): Fix POSIX-conformance bug: "touch --
3242 MMDDhhmm file" must be treated like "touch MMDDhhmm file" when
3243 conforming to pre-2001 POSIX.
3244 * NEWS: Document this.
3245 * tests/touch/obsolescent: Test for this bug. Also, set
3246 _POSIX2_VERSION=199209 and POSIXLY_CORRECT=1 so that it's
3247 a better test for obsolescent features.
3249 * src/sort.c (main): Emulate Solaris 8 and 9 "sort -y", so that
3250 "sort -y abc" is like "sort abc" whereas "sort -y 100" is like
3253 * src/od.c: Several changes for POSIX and FreeBSD compatibility.
3254 (COMMON_SHORT_OPTIONS): Add -B, -D, -e, -F, -H, -I, -L, -O, -s, -X.
3255 (long_options, main): --strings is now -S, not -s.
3256 (usage): Reflect the usage changes.
3257 (parse_old_offset): Do not issue a diagnostic on failure;
3258 callers now do this as necessary.
3259 (main): Support POSIX syntax. Remove unused case 0 from getopt_long.
3260 Add support for new short options (many undocumented) for
3261 compatibility with FreeBSD. Remove FIXME for -s; it's now
3262 POSIX-compatible. Default format is now oS, not o2.
3263 * NEWS: Describe the above.
3265 2004-09-05 Paul Eggert <eggert@cs.ucla.edu>
3267 * src/stty.c (valid_options): Remove.
3268 (main): Fix some bugs in handling invalid option-combinations
3270 (recover_mode): Arg is now char const *, not char *.
3271 (main): Use STDIN_FILENO, not 0.
3272 Simplify option-parsing code a tad.
3273 * tests/stty/basic-1: Check for the fixed bugs.
3275 2004-09-03 Paul Eggert <eggert@cs.ucla.edu>
3277 * src/stat.c (HAVE_STRUCT_STATXFS_F_TYPE): Fix typo that prevented
3278 it from ever being nonzero. Reported by Pozsar Balazs in:
3279 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00189.html
3280 (human_fstype): Add ramfs, squashfs, sysfs.
3281 Reported by Pozsar Balazs in:
3282 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00188.html
3283 (human_fstype): Return char const *, not char *.
3284 Simplify internals a bit, and avoid casts.
3286 * src/dd.c (usage): "alternated EBCDIC" -> "alternate EBCDIC".
3287 (bit_count): Remove. All uses changed to....
3288 (multiple_bits_set): New function.
3289 (scanargs): Use it, and check separately for each set of
3290 incompatible options, to improve diagnostics.
3292 (apply_translations): Move checks for incompatible options
3293 to scanargs, so that they're done consistently.
3295 2004-09-02 Paul Eggert <eggert@cs.ucla.edu>
3297 Output correct errno-related diagnostic on "paste" I/O errors.
3298 * src/paste.c (write_error, xputchar): New functions.
3299 (paste_parallel): Use correct errno value after input error.
3300 (paste_parallel, paste_serial): Report errno value after output error.
3302 Port to diet libc. Problem reported by Felix von Leitner in:
3303 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00171.html
3304 * src/paste.c (dummy_closed, CLOSED, dummy_endlist, ENDLIST): Remove;
3305 it's not portable C to assume FILE is a complete type.
3306 (paste_parallel): Use index test instead of ENDLIST, and NULL
3309 2004-08-24 Paul Eggert <eggert@cs.ucla.edu>
3311 POSIX-conformance fixes for "expand" and "unexpand".
3312 Also, consistently use "tab stop" rather than "tabstop".
3313 * NEWS: Document fixes.
3314 * src/expand.c: Revamp to resemble the new unexpand.c better.
3315 (usage): -i does not convert tabs after non-tabs.
3316 (add_tab_stop): Renamed from add_tabstop. All uses changed.
3317 (parse_tab_stop): Renamed from parse_tabstop. All uses changed.
3318 (validate_tab_stop): Renamed from validate_tabstop. All uses changed.
3319 (next_file, main): Check fclose against 0, not EOF.
3320 (expand): Remove unnecessary casts.
3321 Add another loop nesting level, for lines, so that per-line variables
3322 are initialized cleanly.
3323 Revamp tab checking. Check for write error immediately, rather
3324 than just once at the end of the program.
3325 * src/unexpand.c: Lkewise (for the expand.c changes).
3326 (TAB_STOP_SENTINEL): Remove.
3327 (tab_size): Now size_t, not uintmax_t, since we need to store
3328 the sequences of blanks.
3329 (max_column_width): New var.
3330 (usage): Say "blank" where POSIX requires this.
3331 (add_tab_stop): Calculate maximum column width.
3332 (unexpand): Store the pending blanks, instead of merely counting them.
3333 Follow POSIX's rules about -a requiring two blanks before a tab stop.
3334 Get rid of internal label and goto.
3335 * tests/unexpand/basic-1: Fix infloop-3 to match POSIX.
3336 Add blanks-1 through blanks-13.
3338 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
3340 * NEWS: "chown : file", "chown '' file", and "chgrp '' file" now
3341 succeed without changing the uid and gid, like FreeBSD.
3342 * src/chgrp.c (parse_group): Return gid_t rather than storing it
3343 through a pointer. Treat "chgrp '' file" as a no-op change,
3345 (main): Set chopt.group_name to NULL if the group is the empty
3347 * src/chown-core.c (describe_change): Describe changes to -1:-1
3348 without using "to OWNERSHIP" phrase.
3349 * src/chown.c (usage): "chown '' file" is now allowed.
3350 (main): Do not set user name to the empty string if the group
3352 * tests/chgrp/basic: Test "chgrp '' file".
3353 * tests/chown/Makefile.am (TESTS): Add separator.
3354 * tests/chown/separator: New file, partly taken from
3355 Dmitry V. Levin's suggestion in
3356 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
3358 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
3360 * tests/install/basic-1: Test for the -d regression.
3362 2004-08-11 Dmitry V. Levin <ldv@altlinux.org>
3364 * src/install.c (main): Fix -d regression introduced with
3365 --target-directory support at 2004-06-25.
3367 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
3369 * src/copy.c (copy_internal): When preserving links, unlink
3370 a destination with link count greater than one. This is so
3371 that commands like "cp -a" don't get confused when copying into
3372 a destination that already contains many hard links. Problem
3373 reported by Tim Waugh in:
3374 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00053.html
3376 2004-08-10 Paul Eggert <eggert@cs.ucla.edu>
3378 Convert all files to UTF-8.
3379 * tests/fmt/basic (8-bit-pfx): Use UTF-8, not Latin-1.
3380 * tests/sort/Test.pm (16a): Likewise.
3381 * tests/uniq/Test.pm (8): Likewise.
3382 * tests/misc/printf-hex: Use ASCII, not Latin-1.
3384 * NEWS: Document "sort -o -" and "tee -" POSIX-conformance fixes.
3385 * src/shred.c (usage): "-" is an operand, not an option.
3386 * src/sort.c (die, xfopen, mergefps, first_same_file, merge):
3387 A null file arg means standard output.
3388 (main): "-o -" means to write to a file named "-",
3389 not to standard output.
3390 * src/tee.c (usage, tee): "tee -" writes to standard output, not
3391 to a file named "-".
3393 2004-08-10 Dmitry V. Levin <ldv@altlinux.org>
3395 * src/install.c (change_timestamps): Fix int->bool conversion
3396 bugs introduced on 2004-07-29.
3398 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
3400 * src/shred.c (wipename): Work even if the directory is writeable
3401 and not readable. Prefer write access, since this should work
3402 better with fdatasync.
3404 * src/csplit.c (xalloc_die): New function.
3405 (main): Remove now-obsolete initialization of xalloc_fail_func.
3407 * src/md5sum.c: Adjust to sha->sha1 renaming.
3409 2004-08-08 Dmitry V. Levin <ldv@altlinux.org>
3412 * src/readlink.c (canonicalize_fname): Remove unneeded proxy function.
3413 (can_mode): Make variable local.
3415 2004-08-07 Paul Eggert <eggert@cs.ucla.edu>
3417 * src/system.h (O_BINARY) [!O_BINARY && defined O_BINARY]:
3418 Do not define, to avoid annoying compiler messages on QNX 6.3.
3419 Problem reported by Johan in:
3420 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00050.html
3422 2004-08-04 Paul Eggert <eggert@cs.ucla.edu>
3424 * src/system.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX):
3425 Define to a concatenation of string literals, not to an expression;
3426 needed for concatenation contexts.
3427 (INTMAX_MAX, INTMAX_MIN): New macros.
3429 * src/stat.c (print_stat): Don't assume st_ino / st_dev fits in
3430 unsigned long; this isn't true for st_ino on Solaris 9.
3432 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
3434 * src/uname.c: Do not depend on HAVE_SYSCTL when deciding
3435 whether to include files. Include <sys/param.h> if
3436 HAVE_SYS_PARAM_H (not HAVE_SYSCTL).
3437 (main) [defined __POWERPC__]: Add a kludge to work around a
3438 Mac OS X bug, so that uname -p defaults to "powerpc" if
3439 sysctl ((int[]) {CTL_HW, HW_MACHINE_ARCH}, 2, buffer, &bufsize, 0, 0)
3440 fails. Problem reported by Petter Reinholdtsen in:
3441 http://lists.gnu.org/archive/html/bug-gnu-utils/2003-02/msg00201.html
3443 * src/uniq.c (hard_LC_COLLATE, ignore_case, different, check_file,
3444 main): Use bool for booleans.
3445 (writeline, check_file): Use uintmax_t for line counts.
3446 (check_file): Check for and report line number overflow,
3448 * src/wc.c (iswspace, wc): Use to_uchar rather than a cast.
3449 (print_lines, print_words, print_chars, print_bytes, print_linelength,
3450 have_read_stdin, wc, wc_file, main):
3451 Use bool for booleans.
3452 (exit_status): Remove.
3453 (wc, wc_file): Return bool status. All callers changed.
3454 * src/who.c (scan_entries): 0 -> STDIN_FILENO.
3455 * src/whoami.c (main): Print uids using unsigned long int, not
3458 * src/unexpand.c: Int cleanup and minor reorganization to be more
3460 Include quote.h, xstrndup.h.
3461 (TAB_STOP_SENTINEL): Increase from INT_MAX to INTMAX_MAX.
3462 (convert_entire_line, have_read_stdin, parse_tabstops, next_file,
3464 Use bool for booleans.
3465 (tab_size, tab_list, add_tabstop, validate_tabstops, unexpand):
3466 Use uintmax_t for column counts.
3467 (first_free_tab, validate_tabstops, unexpand): Use size_t for sizes.
3468 (add_tabstop, parse_tabstops, main): Don't reserve UINTMAX_MAX
3470 (parse_tabstops): Don't use ISBLANK on possibly-signed char.
3471 Detect overflow in tab stop string.
3472 (next_file, main): Use EXIT_FAILURE/EXIT_SUCCESS instead of 1/0.
3473 (unexpand): Concatenate input files the same way expand does.
3475 * src/touch.c (no_create, use_ref, posix_date, amtime_now,
3476 touch, main): Use bool for booleans.
3477 (main): Avoid integer overflow when given more than INT_MAX
3479 * src/tsort.c (struct item, n_strings): Use size_t for sizes.
3480 (have_read_stdin, count_items, scan_zeros, detect_loop,
3481 recurse_tree, walk_tree, tsort, main):
3482 Use bool for booleans.
3483 (exit_status): Remove.
3484 (tsort): Return a success flag instead of storing into a global.
3486 * src/tty.c (silent, main): Use bool for booleans.
3487 (main): 0 -> STDIN_FILENO.
3488 * src/uname.c (print_element): Use bool for booleans.
3490 * src/test.c (TRUE, FALSE, SHELL_BOOLEAN, TRUTH_OR, TRUTH_AND):
3491 Remove. All uses replaced by C99 boolean primitives.
3492 (TEST_TRUE, TEST_FALSE): New constants, for readability.
3493 (test_unop, binop, unary_operator, binary_operator, two_arguments,
3494 three_arguments, posixtest, expr, term, and, or, is_int, age_of,
3495 one_argument, main): Use bool for booleans.
3496 (advance, unary_advance): Now inline procedures rather than a macros.
3497 (is_int): Renamed from isint, to avoid namespace clash with ctype.h.
3498 (term, and, or): When it's easy, loop instead of recursing.
3499 (term): Avoid integer overflow if there are INT_MAX-3 args (!).
3500 (binary_operator, unary_operator): Simplify by systematically rewriting
3501 true==FOO to FOO (where FOO is a boolean).
3502 (unary_operator): Don't consider a file to be a regular file
3503 merely because its mode&S_IFMT is zero. Just use S_ISREG.
3504 Remove unnecessary casts. Remove ifdefs for things like
3505 S_ISSOCK that are no longer needed, since stat-macros.h always
3508 * src/tac-pipe.c (buf_init_from_stdin, find_bol, tac_mem):
3509 Use bool for booleans.
3510 (buf_init_from_stdin, buf_free, find_bol, print_line):
3511 Use size_t for sizes.
3512 * src/tac.c (separator_ends_record, tac_seekable, tac_file,
3513 tac_stdin, tac_stdin_to_mem, main): Use bool for booleans.
3514 (match_length, G_buffer_size, tac_seekable, main): Use size_t for sizes.
3515 (tac_seekable): Use ptrdiff_t for pointer subtraction.
3516 Report an error if the result is out of range.
3517 (tac_seekable, main): Check for integer overflow in buffer size
3519 (main): Remove unnecessary casts.
3521 * src/su.c (run_shell): Pass a new n_additional_args arg, so that
3522 the callee doesn't have to count 'em. All callers changed.
3523 Don't allocate more space for the arg vector than we'll need.
3524 Use memcpy to copy the args rather than rolling our own loop.
3525 Use size_t for sizes.
3526 (fast_startup, simulate_login, change_environment, log_su,
3527 correct_password, restricted_shell, main): Use bool for booleans.
3528 (longopts): Don't assume change_environment is an int.
3529 Use NULL, not 0, for pointers.
3530 (xsetenv): New function, replacing xputenv and concat.
3531 All callers changed.
3532 (elements): Remove; no longer needed.
3533 (log_su, correct_passwd, main): Prefer !x to x==NULL.
3534 (log_su): 2 -> STDERR_FILENO.
3535 (modify_environment, main): Don't assume that getenv's returned value
3536 has an indefinite lifetime.
3537 (modify_environment): Allocate a larger environ.
3538 (main): Remove an impossible 'case 0'; if it happens now, it'll
3539 get diagnosed. Don't assume getpwnam results outlive endpwent.
3540 Check for null or empty pw_name, pw_dir and for null pw_passwd.
3542 * src/stty.c (VA_START): Remove. All callers now use va_start.
3543 (_POSIX_VDISABLE): Remove unnecessary cast.
3544 (struct control_info, visible): Use cc_t for control chars.
3545 (struct control_info): Use size_t for sizes.
3546 (recover_mode, set_mode, display_speed, display_window_size,
3547 valid_options, main, display_changed):
3548 Use bool for booleans.
3549 (integer_arg): Return unsigned long int, not long int.
3550 Accept new max arg; all callers changed, to specify a maximum
3551 value for integer parameters instead of silently overflowing.
3552 (wrap): Do not overrun the stack buffer if the output contains
3553 more than 1024 bytes. Instead, malloc a buffer.
3554 (main): Remove a "what is this?!?" FIXME. Nobody knows what it is.
3555 Remove unnecessary casts.
3556 (set_control_char): Allow int values only up to cc_t range.
3557 (screen_columns): Don't reject INT_MAX.
3558 (display_changed, display_all, display_speed, recover_mode):
3559 Don't assume cc_t fits in int.
3561 * src/remove.h: Add copyright notice.
3562 (struct rm_options): Use bool for booleans.
3563 * src/rmdir.c (empty_paths, ignore_fail_on_non_empty, verbose,
3564 errno_rmdir_non_empty, remove_parents, main): Likewise.
3565 * src/sum.c (have_read_stdin, bsd_sum_file, sysv_sum_file,
3567 (main): Don't dump core if invoked with argv[0]==NULL.
3568 * src/tee.c (tee, append, ignore_interrupts, main, tee):
3569 Use bool for booleans.
3570 (tee): Use ssize_t for read returns.
3572 * src/ptx.c: Add a FIXME mentioning that there are many
3573 unchecked integer overflows in this file.
3574 (gnu_extensions, auto_reference, input_reference, right_reference,
3575 ignore_case, initialize_regex, fix_output_parameters,
3576 output_one_roff_line, output_one_text_line, output_one_dumb_line, main):
3577 Use bool for booleans.
3578 (SKIP_SOMETHING, compare_words, digest_break_file,
3579 find_occurs_in_text, fix_output_parameters):
3580 Use to_uchar instead of a caset.
3581 (print_field): Rewrite to avoid cast.
3583 * src/printf.c (posixly_correct): Use bool for booleans.
3584 (verify, main): Use EXIT_FAILURE/EXIT_SUCCESS instead of 1/0.
3585 (STRTOX): Rewrite to avoid casts.
3586 (print_esc_char): Arg is char, not int.
3587 * src/readlink.c (canonicalize): Remove. All uses now merely inspect
3589 (no_newline, verbose): Use bool for booleans.
3590 (can_mode): Now of type int; use -1 to denote otherwise-uninitialized.
3591 * src/shred.c (struct Options, main): Use bool for booleans.
3592 (isaac_seed_data, fillpattern, wipefile): Rewrite to avoid casts.
3593 * src/split.c (cwrite, bytes_split, lines_split, line_bytes_split):
3594 Use bool for booleans.
3595 * src/stat.c (G_fail): Remove.
3596 (print_statfs): Print various gotta-be-nonnegative values using
3597 unsigned long int, not long int or int.
3598 (do_statfs, do_stat): Return a boolean success flag.
3599 (do_stat, main): Use bool for booleans.
3601 * src/pr.c: Add a FIXME mentioning that there are many
3602 unchecked integer overflows in this file.
3603 (TRUE, FALSE): Remove. All uses replaced by true and false.
3604 (struct COLUMN, read_line, print_page, print_stored, open_file,
3605 skip_to_page, init_fps, parallel_files, align_empty_cols,
3606 empty_line, FF_only, explicit_columns, extremities, keep_FF,
3607 print_a_FF, print_a_header, use_form_feed, have_read_stdin,
3608 print_across_flag, storing_columns, balance_columns,
3609 truncate_lines, join_lines, untabify_input, failed_opens,
3610 numbered_lines, skip_count, use_esc_sequence, use_cntrl_prefix,
3611 double_space, ignore_failed_opens, use_col_separator,
3612 pad_vertically, last_line, main, init_parameters, skip_read,
3613 read_line, print_stored):
3614 Use bool for booleans.
3615 (struct COLUMN, char_to_clump, store_char, print_char):
3617 (clump_buff, print_clump): Use char[], not int[], for an array whose
3618 elements are always chars.
3619 (first_last_page, main, getoptarg, balance, add_line_number,
3620 char_to_uclump): Remove unnecessary casts.
3621 (init_parameters): Allocate chars, not ints, for clump_buff.
3622 (print_char): Use to_uchar before invoking ISPRINT.
3623 (char_to_clump): Convert to unsigned char before invoking ISPRINT.
3625 * src/nohup.c (main): Use bool for booleans.
3626 * src/paste.c (paste_parallel, paste_serial, main): Likewise.
3627 * src/pathchk.c (validate-path, main, portable_chars_only): Likewise.
3628 (portable_chars_only): Use to_uchar rather than a cast.
3629 * src/printenv.c (main): Use bool for booleans.
3630 Do not assume that the environ has at most one matching entry
3631 for each option (integer overflow was possible otherwise).
3633 * src/od.c (FMT_BYTES_ALLOCATED): Now an enum, not a decimal
3634 constant. Do not assume PRIdMAX etc. are strings of length 3 or
3636 (struct tspec): Use it. fmt_string is now an array, not
3637 a pointer, as there's little point to the indirection here.
3638 (struct tspec, flag_dump_strings,
3639 traditional, flag_pseudo_start, limit_bytes_to_format,
3640 abbreviate_duplicate_blocks, have_read_stdin, simple_strtoul,
3641 decode_one_format, open_next_file, check_and_close,
3642 decode_format_string, skip, write_block, read_char, read_block,
3643 parse_old_offset, dump, dump_strings, main):
3644 Use bool for booleans.
3645 (struct tspec): Use void *, not char *, for generic pointers.
3646 (bytes_to_oct_digits, bytes_to_signed_dec_digits,
3647 bytes_to_unsigned_dec_digits, bytes_to_hex_digits):
3648 Use char, not unsigned int, since char suffices.
3649 (print_s_char, print_char, print_s_short, print_short,
3650 print_int, print_long, print_long_long, print_float,
3651 print_double, print_long_double): Rewrite to avoid casts.
3652 These now take void * arguments, instead of char *.
3653 Use the same body for all functions, except for the choice
3654 of type. Assume C89 to simplify handling of signed char.
3655 (dump_hexl_mode_trailer, print_named_ascii, print_ascii):
3656 Rewrite to avoid casts.
3657 (print_named_ascii, print_ascii): Now takes void *, not char *.
3658 (decode_one_format): Use int for printf field widths, not
3659 unsigned int. Pass void * to subsidiary printers,
3660 not char *. Simplify handling of floating-point formats
3661 by factoring out common code dealing with precision and field width.
3662 (decode_format_string): Avoid need for temporary copy of
3663 each decoded struct tspec.
3664 (get_lcm): Remove unnecessary cast.
3665 (main): Fix bug where more than INT_MAX failed decodes were ignored.
3667 2004-08-02 Paul Eggert <eggert@cs.ucla.edu>
3669 * src/nl.c (TRUE, FALSE): Remove; all uses changed to true, false.
3670 (enum number_format): Remove.
3671 (FORMAT_RIGHT_NOLZ, FORMAT_RIGHT_LZ, FORMAT_LEFT): Now strings,
3673 (DEFAULT_SECTION_DELIMITERS): Now an array constant, not a macro.
3674 (section_del): Now const.
3675 (print_fmt): Remove.
3676 (starting_line_number, page_incr, blank_join, line_no,
3677 print_lineno, proc_text, main):
3678 Use intmax_t for line numbers.
3679 (reset_numbers, have_read_stdin, build_type_arg, nl_file, main):
3680 Use bool for booleans.
3681 (lineno_format): Now a string, not an enum value.
3682 (build_print_fmt): Remove. All calls removed. This work is
3683 now done within print_lineno.
3684 (build_type_arg): Use size_t for sizes.
3685 (print_lineno): Check for line number overflow.
3686 (proc_text, main): Remove unnecessary cast.
3688 * src/ln.c (symbolic_link, interactive, remove_existing_files,
3689 verbose, hard_dir_link, dereference_dest_dir_symlinks,
3690 do_link, main): Use bool for booleans.
3692 * src/ls.c (struct fileinfo, file_interesting,
3693 extract_dirs_from_files, color_symlink_as_referent,
3694 FILE_OR_LINK_MODE, sort_reverse, print_owner, print_group,
3695 numeric_ids, print_block_size, dired, print_with_color,
3696 check_symlink_color, print_inode, recursive, immediate_dirs,
3697 all_files, really_all_files, qmark_funny_chars,
3698 print_dir_name, format_needs_stat, format_needs_type, visit_dir,
3699 main, decode_switches, parse_ls_color, print_dir, file_interesting,
3700 gobble_file, make_link_path, basename_is_dot_or_dotdot,
3701 extract_dirs_from_files, print_long_format):
3702 Use bool for booleans.
3703 (dir_defaulted): Remove; no longer needed.
3704 (main): Use int to count files, since it suffices for argv.
3705 Rewrite to avoid need for dir_defaulted.
3706 (main, print_dir, gobble_file, get_link_name,
3708 Set exit status to EXIT_SUCCES/EXIT_FAILURE rather than 0/1.
3709 (decode_switches): Put back check for ws.ws_col <= SIZE_MAX.
3710 Remove unnecessary cast to int. Use int instead of unsigned
3711 int to count from 0 to 1.
3712 (get_funky_string, print_type_indicator): Use char for bytes, not int.
3713 (make_link_path): Use NULL for null pointers.
3714 (quote_name): Use to_uchar instead of cast.
3716 * src/id.c (use_name, main, print_user, xgetgroups, print_group_list,
3717 print_full_info): Use bool for booleans.
3718 (problems): Remove, replacing with....
3719 (ok): New var (inverted from old sense).
3720 (print_user, print_group, print_full_info):
3721 Print uids/gids with %lu, not %u.
3722 (xgetgroups): Don't run out of memory if getgroups or getugroups
3724 * src/setuidgid.c (main): Print uids/gids with %lu, not %ld.
3726 * src/factor.c (wheel_tab): Use unsigned char instead of unsigned
3727 int, since it suffices.
3728 (factor, print_factors): Use size_t for sizes.
3729 (print_factors, do_stdin, main): Use bool for booleans.
3730 * src/fold.c (TAB_WIDTH): New macro; use it instead of "8".
3731 (fold_file, main): Use bool for booleans.
3732 (fold_file, main): Use size_t for sizes.
3733 (main): Allow -w options up to SIZE_MAX - TAB_WIDTH - 1, instead
3734 of prohibiting widths greater than INT_MAX.
3735 * src/head.c (presume_input_pipe, print_headers, have_read_stdin,
3736 write_header, elide_tail_bytes_pipe, elide_tail_bytes_file,
3737 elide_tail_lines_pipe, elide_tail_lines_seekable,
3738 elide_tail_lines_file, head_bytes, head_lines, head, head_file,
3739 string_to_integer, main):
3740 Use bool for booleans.
3741 (main): Rewrite to avoid cast.
3743 * src/csplit.c (struct line): Use size_t for sizes.
3744 (main): Remove unnecessary cast.
3745 * src/cut.c (cut_fields): Use to_uchar rather than a cast.
3746 * src/cut.c (cut_file, main): Use bool for booleans.
3747 * src/date.c (show_date, rfc_format, batch_convert, main): Likewise.
3748 * src/env.c (main): Likewise.
3749 * src/expr.c (nextarg): Likewise.
3750 * src/env.c (main): Remove unused and nonstandard envp arg.
3752 * src/fmt.c (COST, MAXWORDS): Add a comment describing some of
3753 fmt's arbitrary limits.
3754 (TRUE, FALSE): Remove; all uses changed to (true, false).
3755 (main): Use bool for booleans.
3756 Limit maximum width to MAXCHARS / 2. Use xstrtoul, not xstrtol,
3758 (copy_rest): Remove unnecessary cast.
3759 (get_prefix): Rewrite to avoid cast.
3760 (check_punctuation): Use char *, not unsigned char *; C89 requires
3761 this. Avoid off-by-one buffer read overrun when line is empty.
3762 (flush_paragraph): Don't assume wptr-parabuf is <= INT_MAX.
3763 Remove unnecessary casts.
3764 * tests/fmt/basic (wide-1, wide-2, bad-suffix): Adjust to above
3767 * src/expand.c (convert_entire_line, have_read_stdin, parse_tabstops,
3768 next_file, expand, main):
3769 Use bool for booleans.
3770 (tab_size, tab_list, add_tabstop, parse_tabstops, validate_tabstops,
3772 Use uintmax_t for column counts.
3773 (add_tabstop): Don't reserve -1 (now UINTMAX_MAX) as a special value.
3774 All callers changed.
3775 (parse_tabstops): Don't pass a negative char to isblank.
3776 Avoid memory leak with large tab stops.
3777 (validate_tabstops, expand): Don't assume number of tab stops is
3779 (next_file, main): Use EXIT_SUCCESS/EXIT_FAILURE rather than 0/1 when
3780 storing values into exit_status.
3781 (expand): Use same pattern as unexpand for reading chars.
3782 Report an error when input line is too long, instead of silently
3783 screwing up. Do not mishandle tab stops when backspacing left
3786 * src/dircolors.c (have_read_stdin, append_quoted,
3787 dc_parse_stream, dc_parse_file, main): Use bool for booleans.
3788 (dc_parse_stream): Use enum for state, rather than int.
3789 Use ssize_t to store getline result.
3791 * src/dd.c (translation_needed, parse_integer, scanargs,
3792 apply_translations, char_is_saved, swab_buffer, skip_via_lseek):
3793 Use bool for booleans.
3794 (translate_buffer): Use to_uchar rather than a cast.
3795 (swab_buffer, copy_simple, copy_with_unblock):
3796 Use size_t for sizes.
3798 * src/seq.c (equal_width, valid_format, main): Use bool for booleans.
3799 * src/sleep.c (apply_suffix): Likewise.
3800 * src/tail.c (struct File_spec, reopen_inaccessible_files, count_lines,
3801 forever, from_start, print_headers, have_read_stdin, valid_file_spec,
3802 write_header, file_lines, pipe_lines, pipe_bytes, recheck,
3803 tail_forever, tail_bytes, tail_lines, tail, tail_file,
3804 parse_obsolescent_option, parse_options, main): Likewise.
3805 * src/sleep.c (apply_suffix): Invert sense of result.
3806 Use int (not unsigned int) for multiplier, as this generates better
3807 code with some compilers. Simplify code a bit.
3808 * src/tail.c (struct File_spec, max_n_unchanged_stats_between_opens,
3809 parse_options): Use uintmax_t, not unsigned int or unsigned long int,
3811 (tail_bytes, tail_lines): Redo test of return value (-1, 0, 1) to
3812 make it a bit clearer.
3814 * src/hostname.c: Include "xgethostname.h".
3815 (xgethostname): Remove decl; xgethostname.h has it.
3816 (sethostname) [!defined(HAVE_SETHOSTNAME) && defined(HAVE_SYSINFO)
3817 && defined (HAVE_SYS_SYSTEMINFO_H) && defined(HAVE_LIMITS_H)]: Use
3818 prototypes rather than K&R form. Assume any negative value from
3819 sysinfo denotes failure, not just -1.
3820 (main): Simplify use of sethostname.
3822 * src/pinky.c (include_idle, include_heading, include_fullname,
3823 include_project, include_plan, include_home_and_shell, do_short_format,
3824 include_where, main): Use bool for booleans.
3825 (count_ampersands, create_fullname, scan_entries, short_pinky):
3826 Use size_t for sizes.
3827 (create_fullname): Check for overflow in size calculations.
3828 (idle_string): Don't assume that the number of idle days
3829 is less than 10**8 and/or INT_MAX/(24*60*60).
3830 (main): No need to pass a non-NULL last arg to getopt_long.
3831 * src/uptime.c (print_uptime, uptime): Use size_t for sizes.
3832 (print_uptime): Remove unused local variable.
3833 (main): No need to pass a non-NULL last arg to getopt_long.
3834 * src/users.c (list_entries_users, users): Use size_t for sizes.
3835 (list_entries_users): Use char for bytes.
3836 (main): No need to pass a non-NULL last arg to getopt_long.
3837 * src/who.c (do_lookup, short_list, short_output, include_idle,
3838 include_heading, include_mesg, include_exit, need_boottime,
3839 need_deadprocs, need_login, need_initspawn, need_clockchange,
3840 need_runlevel, need_users, my_line_only, main): Use bool for booleans.
3841 (print_runlevel): Use unsigned char for bytes.
3842 (list_entries_who, scan_entries, who): Use size_t for sizes.
3843 (main): No need to pass a non-NULL last arg to getopt_long.
3845 * src/install.c (isdir): Remove decl.
3846 (install_file_to_path): Rely on make_path to fail if the destination
3847 is not a directory, by passing preserve_existing==true to it.
3848 Hence we no longer need to call isdir.
3849 Free dest_dir immediately when it's no longer needed, rather than
3850 waiting until the end of the function.
3851 (copy_file): Don't bother calling isdir, as copy will do the
3852 right thing if the destination is a directory.
3854 * src/du.c (fts_debug, opt_all, apparent_size, opt_count_all,
3855 print_grand_total, opt_separate_dirs, hash_ins, process_file, main):
3856 Use bool for booleans.
3857 (max_depth): Now size_t, not int, to avoid an arbitrary limit
3858 of INT_MAX on depth.
3859 (G_fail): Remove: no longer needed, now that the relevant
3860 functions return bool.
3861 (process_file): Use return value to signal success rather than
3862 setting a global. Remove first_call static var; not needed, since
3863 we can look at n_alloc. Use size_t for depths. Remove FIXME
3864 about size_t casts, as it's now fixed. Use xnrealloc rather
3865 than the obsolescent XREALLOC. Don't bother to check whether
3866 reallocation is needed unless level > prev_level.
3867 (du_files): Invert sense of result, for consistency with
3868 other coreutils code. All callers changed.
3869 (main): Allow --max-depth values up to SIZE_MAX.
3871 * src/df.c (inode_format, show_all_fs, show_local_fs,
3872 show_listed_fs, posix_format, require_sync, print_type,
3873 selected_fstype, excluded_fstype, show_dev, show_point, main):
3874 Use bool for booleans.
3875 (df_readable, show_dev): Use UINTMAX_MAX instead of -1.
3876 (show_dev, show_point, main):
3877 Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
3878 Don't assume disk name lengths are <= INT_MAX.
3879 Rewrite pct calculation to avoid cast.
3880 (show_point): Don't assume resolved length is <= SSIZE_MAX.
3882 * src/cut.c (hash_int) [!defined UINTPTR_MAX]: Use size_t
3883 instead of uintptr_t.
3884 * src/shred.c (UINT_MAX_32_BITS): Remove.
3885 (word32): Remove. All uses changed to uint32_t.
3886 (isaac_seed_data): Remove unnecessary cast.
3887 * src/system.h (ptr_align): Use size_t; in practice, this is just as
3888 good as uintptr_t in checking for alignments, and has fewer
3889 configuration hassles.
3891 * src/Makefile.am (localedir.h): Make it readonly; this
3892 undoes part of the 2004-07-27 patch.
3894 2004-07-30 Paul Eggert <eggert@cs.ucla.edu>
3896 * src/sort.c (UCHAR): Remove; all uses changed to to_uchar.
3897 (IS_THOUSANDS_SEP): Use bool when appropriate.
3898 (numcompare, main): Use char, not int, when the value is always a char.
3899 (numcompare): Remove "register"; compilers are smart enough these days.
3900 * src/system.h (errno, CHAR_BIT): Remove decls;
3901 no longer needed now we assume C89 or better.
3902 Include <inttypes.h> before <stdint.h>, as it's the
3903 Autoconf-recommended pattern.
3904 (to_uchar): New inline function, moved here from tr.c.
3905 Use full names for int types, e.g. "long int" rather than "long".
3906 * src/tr.c (to_uchar): Remove; now in system.h.
3907 (is_char_class_member): Use bool when appropriate.
3909 * src/mkdir.c (create_parents, main): Use bool when appropriate.
3910 (main): Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
3912 2004-07-29 Paul Eggert <eggert@cs.ucla.edu>
3914 * src/mkfifo.c (main): Use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1.
3916 * src/chmod.c (recurse, force_silent, process_file, process_files,
3917 main): Use bool when appropriate.
3918 * src/cksum.c (cksum, main): Likewise.
3919 * src/comm.c (hard_LC_COLLATE, only_file_1, only_file_2, both,
3920 compare_files, main): Likewise.
3922 * src/copy.h (struct cp_options): Likewise.
3923 * src/copy.c (copy_internal, is_ancestor, copy_dir, copy_reg,
3924 same_file_ok, seen_file, copy_internal, valid_options, copy): Likewise.
3925 * src/cp-hash.h (remember_created): Likewise.
3926 * src/cp-hash.c (remember_created): Likewise.
3927 * src/cp.c (struct dir_attr, flag_path, remove_trailing_slashes,
3928 re_protect, make_path_private, target_directory_operand, do_copy,
3929 cp_option_init, decode_preserve_arg, main): Likewise.
3930 * src/install.c (isdir, change_timestamps, change_attributes,
3931 copy_file, install_file_to_path, install_file_in_dir,
3932 install_file_in_file, strip_files, dir_arg, cp_option_init, main,
3933 change_attributes, change_timestamps): Likewise.
3934 * src/mv.c (remove_trailing_slashes, rm_option_init,
3935 cp_option_init, do_move, movefile, main): Likewise.
3936 * src/remove.c (right_justify), full_filename_, AD_pop_and_chdir,
3937 AD_push, prompt, remove_dir): Likewise.
3938 * src/rm.c (rm_option_init, main): Likewise.
3940 * src/remove.c (top_dir, pop_dir, full_filename_):
3941 Use size_t for sizes.
3942 * src/cp.c (target_directory_operand): Do not clear *NEW_DST if stat
3943 succeeds. It's not necessary in that case, as *NEW_DST is always
3945 (do_copy): Rewrite slightly to avoid need for "unreachable" comment.
3946 (main): Use EXIT_SUCCESS, EXIT_FAILURE instead of 0, 1.
3947 * src/rm.c (main): Likewise.
3949 md5sum, sha1sum integer cleanups.
3951 * src/checksum.h: Don't include config.h, sys/types.h, stdio.h:
3953 (ALG_UNSPECIFIED): Remove.
3954 (ALG_MDT): Don't make it equal to CHAR_MAX + 1; this isn't necessary.
3955 * src/md5.c: Don't include any files other than checksum.h.
3956 * src/sha1sum.c: Likewise.
3957 * src/md5sum.c (OPENOPTS, have_read_stdin, status_only, warn,
3958 bsd_split_3, split_3, hex_digits, digest_file, digest_check, main):
3959 Use bool when appropriate.
3960 (digest_check): Increase limit of number of input lines to
3961 UINTMAX_MAX from INT_MAX. Diagnose any overflows of this counter.
3962 Use ngettext instead of hard-to-i18nize hardcoded stuff for plurals.
3964 2004-07-28 Paul Eggert <eggert@cs.ucla.edu>
3966 * src/cat.c (exit_status): Remove. Now done by passing a boolean
3968 (simple_cat, cat): Return true if successful. All callers changed.
3969 (simple_cat, cat, main): Use bool for booleans.
3970 (simple_cat): Use size_t for sizes.
3971 (cat, main): Use the same names for parameters that we use for
3972 long options, to avoid confusion. This inverts the sense of the
3973 show_tabs (formerly output_tabs) and number_nonblank
3974 (formerly numbers_at_empty_lines) variables.
3975 (main): Don't mess up (due to integer overflow) if we are given
3976 INT_MAX - INT_MIN + 1 options.
3977 [O_BINARY]: Don't invoke isatty unless the other options require it.
3978 (main): When deciding whether to use simple_cat, don't worry
3979 about binary option; it's irrelevant.
3981 * src/dcgen: Remove comments, trailing white space, and empty
3982 lines from the output strings, to save space.
3983 Use a narrower type like 'unsigned char' for line lengths, if
3985 Make the output variables static, not extern.
3987 * src/chgrp.c (parse_group): Require base 10 when parsing
3989 (main): int -> bool when appropriate.
3990 * src/chown.c (main): Likewise.
3991 * src/chown-core.c: Include inttostr.h.
3992 (UINT_MAX_DECIMAL_DIGITS, uint_to_string): Remove.
3993 (gid_to_name, uid_to_name): Use imaxtostr/umaxtostr
3994 instead of uint_to_string).
3995 (describe_change): Instead of an int flag, use a char *
3996 auxiliary; this avoids the need for casts.
3997 Assume free (NULL) works.
3998 (change_file_owner): Return true/false, not 0/-1, since
3999 we don't set errno. All callers changed.
4000 Use bool when appropriate.
4001 (chown_files): Likewise.
4002 * src/chown-core.h (chown_files): Likewise.
4004 * tests/chown/basic: Test for proper handling of uids like
4005 "010", which must be parsed as decimal.
4007 * tests/misc/pwd: Don't assume that Perl's getpwd agrees with our
4008 pwd when there are multiple names for the working directory
4009 (which can happen with an automounter, sigh).
4011 * src/Makefile.am ($(SCRIPTS)): Don't depend on Makefile;
4012 this causes Solaris 8 'make' to refuse to build "groups".
4013 (localedir.h): Don't depend on Makefile: this causes Solaris
4014 8 'make' to build localedir.h unnecessarily. The dependence
4015 on Makefile is ineffective anyway, since $(localedir) might
4016 change even if Makefile hasn't.
4018 * src/remove.c (remove_dir): If we can't save the state of the
4019 working directory, pretend we started from "/", not ".".
4020 This avoids a bug on hosts like Solaris that don't let you
4021 remove the working directory.
4023 2004-07-27 Paul Eggert <eggert@cs.ucla.edu>
4025 * src/printf.c (strtiomax, strtoumax): Declare if not already
4026 declared: this fixes a portability bug with Solaris 8 + GCC.
4027 (STRTOX): Parenthesize use of macro arg as expression.
4028 (vstrtoimax, vstrtoumax, vstrtold): Remove now-unnecessary
4030 * configure.ac: Check for declaration of strtoumax, for
4033 * src/Makefile.am (cp_LDADD, ginstall_LDADD, mv_LDADD,
4034 pathchk_LDADD, rm_LDADD, test_LDADD): New vars, for eaccess.
4036 * tests/readlink/can-e: Don't assume that we can remove the
4037 working directory: this isn't possible under Solaris 8, say.
4038 * tests/readlink/can-f: Likewise.
4039 * tests/readlink/can-m: Likewise.
4041 * src/copy.c (copy_internal): find_backup_file_name no longer
4042 returns NULL, so don't bother to check for this.
4043 * src/cp.c (do_copy): Likewise.
4044 * src/ln.c (do_link): Likewise.
4046 2004-07-25 Paul Eggert <eggert@cs.ucla.edu>
4048 * src/nice.c (GET_NICE_VALUE): Renamed from GET_PRIORITY.
4050 (NZERO): New macro, if system doesn't define it already.
4051 (usage): Distinguish priorities from nice values.
4052 Don't assume NZERO is 20.
4053 (main): Use bool instead of int where appropriate.
4054 If user specifies an adjustment out of range, always truncate it
4055 to an inrange value instead of sometimes giving an error message
4057 Do not assume that -1 is an error return from "nice" or
4058 "getpriority", as it might be the current nice value minus NZERO.
4059 If nice/setpriority fails with errno == EPERM, go ahead and run
4060 the command anyway; POSIX requires this.
4062 * src/pathchk.c: Include euidaccess.h.
4063 (dir_ok): Use euidaccess, not access.
4064 * src/test.c (R_OK, W_OK, X_OK, FOK): Remove; system.h defines them.
4065 (eaccess): Remove. All users changed to use euidaccess instead.
4067 2004-07-24 Paul Eggert <eggert@cs.ucla.edu>
4069 * src/uptime.c (print_uptime) [defined BOOT_MSG]:
4070 Don't assume ut_line is null-terminated.
4071 * src/who.c (print_line): New arguments USERLEN and LINELEN,
4072 since USER and LINE might not be null terminated. All callers
4075 2004-07-23 Paul Eggert <eggert@cs.ucla.edu>
4077 Fix bug with "tail -f" reported by Rob Holland in
4078 <http://lists.gnu.org/archive/html/bug-coreutils/2004-07/msg00054.html>.
4079 Also, remove the undocumented and unsupported-since-2000
4080 --max-consecutive-size-changes options. Fix another related bug:
4081 "tail" got confused if stdin, stdout, or stderr were closed.
4082 Also, use output buffering even with "tail -f".
4084 * NEWS: Document this, plus yesterday's patch.
4085 * doc/coreutils.texi (tail invocation): "size has remained the same"
4086 -> "file has not changed", which is more accurate for fifos.
4087 * src/tail.c: Include fcntl-safer.h.
4088 (COPY_TO_EOF): Set to UINTMAX_MAX, not OFF_T_MAX (which was wrong).
4089 (COPY_A_BUFFER): New macro.
4090 (struct File_spec): New members mtime, mode, blocking.
4091 Remove member n_consecutive_size_changes.
4092 (DEFAULT_MAX_N_CONSECUTIVE_SIZE_CHANGES,
4093 max_n_consecutive_size_changes_between_opens,
4094 MAX_CONSECUTIVE_SIZE_CHANGES_OPTION): Remove.
4095 (long_options, tail_forever, parse_options):
4096 Remove (non-)support for --max-consecutive-size-changes.
4097 (record_open_fd): New function.
4098 (recheck, tail_file): Use it. Don't assume that stdin is open.
4099 (dump_remainder): Add support for new COPY_A_BUFFER special value.
4100 Treat errno==EAGAIN like EOF, since it might be a nonblocking read.
4101 (recheck): New arg BLOCKING, specifying whether to use blocking reads.
4103 (n_live_files): Remove, replacing with...
4104 (any_live_files): New function. All uses changed.
4105 (tail_forever): Use nonblocking I/O unless we know that blocking I/O
4106 is safe; this avoids some hangs when reading from a fifo.
4107 Avoid invoking fstat or sleep when using blocking I/O.
4108 Do not check for changes to size if the file is not a regular file,
4109 as the size is undefined in that case.
4110 Check for changes to mtime or mode, too; this works for non-regular
4112 (tail_forever, main): Redo fflush strategy to work even when input
4113 is nonblocking. Don't use unbuffered output; just flush when needed.
4115 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
4117 * src/tail.c (main): Ignore -f if no file operand is specified
4118 and standard input is a pipe.
4119 * doc/coreutils.texi (tail invocation): Do not ignore -f for
4120 all pipes, just for when standard input is a pipe and no
4121 file operand is specified.
4122 * tests/tail/Test.pm: Reinstate f-1 test, since we now pass.
4123 Add a new commented-out f-2 test, which we still fail.
4124 (test_vector): All f-* tests are special cases, not just f-1.
4126 2004-07-12 Paul Eggert <eggert@cs.ucla.edu>
4128 * src/uptime.c: Include c-strtod.h.
4129 (print_uptime): Use c_strtod instead of setlocale and sscanf.
4130 Use long int rather than int to count days (for 64-bit hosts),
4131 and check for arithmetic overflow when converting double to time_t.
4133 2004-07-11 Paul Eggert <eggert@cs.ucla.edu>
4135 * src/printf.c (vstrtold): Renamed from vstrtod.
4136 Now returns long double. All uses changed.
4137 (print_direc): Use "L" length modifier when printing floating point
4138 numbers, since we're now printing long double.
4140 2004-07-06 Paul Eggert <eggert@cs.ucla.edu>
4142 printf cleanup, to avoid undefined behavior, to add support for
4143 formats that Bash supports, and to support wide integers like
4146 * NEWS: Document this.
4147 * src/printf.c (UNSPECIFIED): Remove. All uses now replaced by
4148 booleans, so that we don't reserve any values for precision or
4150 (STRTOX): Use prototype, not K&R-style definition.
4151 (vstrtoimax): Renamed from xstrtol (to avoid confusion with xstrtol
4152 in ../lib), with type change to intmax_t.
4154 (vstrtoumax): Renamed from xstrtoul, with type change to uintmax_t.
4156 (vstrtod): Renamed from xstrtod. All uses changed.
4157 (print_direc): Use boolean arg instead of special value to indicate
4158 a missing precision or width. LENGTH no longer includes
4159 length modifiers or conversion character. New arg CONVERSION
4160 now specifies conversion character.
4161 Use intmax_t-width formatting for integers (like Bash).
4162 Add support for C99 %a, %A, %F (like Bash).
4163 Add support for field width with %c (POSIX requires this).
4164 Add a FIXME for lack of support for field width and precision
4166 Add support for '\'', '0' flags.
4167 Check for invalid combinations of flags, field width, precision,
4168 and conversion, to prevent use of undefined behavior.
4169 Allow multiple length modifiers, for formats like "%lld" (like Bash).
4170 Add support for C99 'j', 't', 'z' length modifiers (like Bash).
4171 In error message, output entire invalid conversion specification,
4172 instead of merely outputting % followed by the conversion char.
4173 * tests/misc/printf: Add tests for the above.
4175 2004-04-03 Dmitry V. Levin <ldv@altlinux.org>
4177 Change "readlink -f" to be more compatible with prior implementations.
4178 Add more canonicalize options, -e and -m.
4179 Add comprehensive tests for all readlink modes.
4181 * m4/canonicalize.m4 (AC_FUNC_CANONICALIZE_FILE_NAME):
4182 Do not add canonicalize.c here.
4184 * src/readlink.c (longopts): Add new options.
4185 (usage): Document them.
4186 (canonicalize_fname): New proxy function.
4187 (main): Handle new options.
4188 * doc/coreutils.texi (readlink invocation): Document new
4189 "readlink -f" behaviour and new canonicalize options, -e and -m.
4191 * configure.ac (AC_CONFIG_FILES): Add tests/readlink/Makefile.
4192 * tests/Makefile.am (SUBDIRS): Add readlink.
4193 * tests/readlink/Makefile.am: New file.
4194 * tests/readlink/{rl-1,can-e,can-f,can-m}: New readlink tests.
4195 * tests/misc/Makefile.am (TESTS): Remove basic readlink test.
4196 * tests/misc/readlink: Remove file.
4198 2004-07-04 Jim Meyering <jim@meyering.net>
4200 * src/copy.c (copy_internal): Add a FIXME comment.
4202 2004-07-02 Paul Eggert <eggert@cs.ucla.edu>
4204 * src/copy.c (copy_dir): Assume path_concat returns non-NULL.
4205 * src/cp.c (do_copy): Likewise.
4206 * src/mv.c (movefile): Likewise.
4208 * src/cp.c (make_path_private): 2nd arg is now size_t, not int,
4209 to avoid problem when path_concat dir name is longer than 2 GiB (!).
4211 * src/nohup.c (main): Don't pass NULL first argument to path_concat.
4212 This cleans up the semantics a bit, as we no longer try to open the
4215 2004-07-01 Paul Eggert <eggert@cs.ucla.edu>
4217 * NEWS: Add short names -t and -T for --target-directory
4218 and --no-target-directory options, respectively.
4220 * src/cp.c (NO_TARGET_DIRECTORY_OPTION, TARGET_DIRECTORY_OPTION):
4221 Remove. All uses changed to 'T' and 't', respectively.
4222 * src/install.c, src/ln.c, src/mv.c: Likewise.
4224 * src/cp.c (long_opts, usage, do_copy, main): Add -t and -T as
4225 aliases for --target-directory and --no-target-directory,
4227 * src/install.c (long_options, main, usage): Likewise.
4228 * src/ln.c, src/mv.c: Likewise.
4230 2004-07-01 Jim Meyering <jim@meyering.net>
4232 * Makefile.maint (sc_file_system): New target.
4233 (syntax-check-rules): Add it.
4234 .x-sc_file_system: New file.
4235 * Makefile.am (EXTRA_DIST): Add it.
4237 * man/sync.x: Use "file system" rather than "filesystem".
4238 * man/stat.x, man/df.x: Likewise.
4240 2004-06-30 Paul Eggert <eggert@cs.ucla.edu>
4242 * src/df.c (usage, main): Output "file system" rather than
4244 * src/du.c (usage): Likewise.
4245 * src/shred.c (usage): Likewise.
4246 * src/stat.c (usage): Likewise.
4247 * src/stat.c (long_options, usage): Rename "--filesystem" to
4248 "--file-system". But keep the old name around, for compatibility
4251 2004-06-29 Paul Eggert <eggert@cs.ucla.edu>
4253 Add support for --no-target-directory option.
4255 * NEWS: Document it.
4256 * doc/coreutils.texi (Common options, Target directory, cp
4257 invocation, install invocation, mv invocation, ln invocation):
4259 (link invocation): Explain how to rewrite link using ln now
4260 that we have --no-target-directory.
4261 (ln invocation): Explain that --no-target-directory subsumes
4263 (unlink invocation): Modify wording to match new wording in
4266 * src/cp.c (NO_TARGET_DIRECTORY_OPTION): New constant.
4267 (long_opts, usage, do_copy, main): Add support for
4268 --no-target-directory,
4269 * src/install.c (NO_TARGET_DIRECTORY_OPTION, long_options, main,
4271 * src/ln.c (NO_TARGET_DIRECTORY_OPTION, long_options, usage,
4273 * src/mv.c (NO_TARGET_DIRECTORY_OPTION, long_options, usage,
4275 * src/mv.c (enum): Sort values.
4277 2004-06-29 Jim Meyering <jim@meyering.net>
4279 Don't let verbose-mode output from a subshell obscure actual differences.
4280 * tests/rm/inaccessible: Turn off command-echoing just before
4281 invoking subshell, then turn it back on if VERBOSE=yes afterward.
4283 2004-06-25 Paul Eggert <eggert@cs.ucla.edu>
4285 Add support for 'install --target-directory', an option
4286 that has been documented for years but not implemented (!).
4287 * doc/coreutils.texi (install invocation): Document
4288 --target-directory in synopsis, too.
4289 * src/install.c (TARGET_DIRECTORY_OPTION): New var.
4290 (long_options, main, usage): Add --target-directory.
4291 (target_directory_operand): New function, stolen from mv.c.
4292 (main): Use it. Check for -d and --target-directory.
4293 Alter wording of diagnostics to match other programs.
4295 2004-06-28 Jim Meyering <jim@meyering.net>
4297 * src/cp.c (usage): Fix copy+paste error in description of
4298 --target-directory: s/move/copy/. From Paul Jarc.
4300 2004-06-27 Paul Eggert <eggert@cs.ucla.edu>
4302 Use more-consistent rules among cp, ln, and mv when dealing with
4303 last operands that are (or look like) directories.
4305 * src/cp.c (target_directory_operand): New, nearly-common function,
4306 It reports an error if the destination appears to be a directory
4307 (e.g., because it has a trailing slash) but is not.
4308 * src/ln.c, src/mv.c: Likewise.
4309 * src/cp.c (do_copy): Use it.
4310 * src/ln.c (main): Likewise.
4311 * src/mv.c (main): Likewise.
4313 * src/cp.c (do_copy): Don't assume argc is positive.
4314 Don't bother to lstat dest, since copy() will do that for us.
4315 Use "const" to avoid the need for cast.
4317 * src/cp.c (do_copy): Don't output a usage message because of file
4318 problems (e.g., an operand is not a directory). Use it only for
4319 syntax. Standardize on "target %s is not a directory" for the
4321 * src/ln.c (main): Likewise.
4322 * src/mv.c (main): Likewise.
4324 * src/cp.c (do_copy): Remove test for trailing slash, since
4325 target_directory_operand now does this.
4326 * src/ln.c (main): Likewise.
4327 * src/mv.c (movefile): Likewise.
4329 * src/cp.c (main): Reject multiple target directories.
4330 Check whether a specified target is a directory when parsing the
4331 options, using stat. This gives more-accurate diagnostics.
4332 * src/ln.c (main): Likewise.
4334 * src/ln.c (isdir): Remove decl; no longer needed.
4335 * src/mv.c (isdir, lstat): Likewise.
4337 * src/ln.c (do_link): New arg dest_is_dir. All uses changed.
4338 Don't check the destination ourself; rely on dest_is_dir.
4339 This way we can avoid lstatting the destination in the
4340 usual case, and in the worst case we lstat 1, not 3 times.
4341 Don't bother to unlink unless link failed; this saves a syscall.
4342 Remove unnecessary backup_succeeded flag;
4343 it was identical to "dest_backup != NULL".
4345 * src/ln.c (main): Use int to count to argc, not unsigned int.
4346 This handles negative operand counts.
4347 * src/mv.c (main): Likewise.
4349 * src/mv.c (do_move): Don't call hash_init; expect the caller to
4350 do it, for consistency with cp.c and ln.c. All callers changed.
4351 (movefile): dest_is_dir parameter is now bool, not int.
4352 (main): Standardize on "missing destination file operand after %s"
4353 for the diagnostic, for consistency with cp.c.
4355 * tests/mv/diag: Don't assume "mv --target=nonexistentdir"
4356 will complain about the arg count.
4357 Adjust to new (briefer) diagnostics.
4358 * tests/cp/fail-perm: Add a test to verify that we get the new
4359 diagnostic when failing to copy through a symlink-to-inaccessible-dir.
4361 2004-06-27 Paul Eggert <eggert@cs.ucla.edu>
4363 Fix a bug: formerly, if d/x was a directory and x a file, "ln x
4364 d/" incorrectly created a link d/x/x. It also saves some system
4367 * NEWS: Document the fix.
4369 * src/ln.c (main): Don't append basename to dest if this
4370 results in an existing directory name.
4371 * tests/ln/misc: See whether a trailing slash is followed too far.
4373 2004-06-26 Jim Meyering <jim@meyering.net>
4375 * src/printf.c (main): When given no arguments, print the standard
4376 "missing operand\nTry printf --help..." message -- to be consistent.
4378 2004-06-26 Jim Meyering <jim@meyering.net>
4380 * src/mknod.c (main): Add \n at the end of message output via fprintf.
4382 2004-06-25 Jim Meyering <jim@meyering.net>
4384 * tests/ln/misc: Add test for ln subscript error.
4386 2004-06-23 Paul Eggert <eggert@cs.ucla.edu>
4388 * src/ln.c (do_link): Remove unnecessary call to lstat.
4389 (main): Avoid subscript error when the destination is "".
4391 2004-06-23 Jim Meyering <jim@meyering.net>
4393 * tests/*: Replace all occurrences of `(exit N); exit' with
4394 `(exit N); exit N'. Otherwise, those many tests could exit with
4395 improper exit status when exiting via e.g., a trapped interrupt.
4396 Thanks to a report from Bob Proulx.
4398 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
4400 * src/who.c (idle_string, print_user): New arg boottime,
4401 specifying the most recent boot time. All uses changed.
4402 (idle_string) Consider a line to be "old" if it hasn't been used
4403 since the last boot time. Watch out for overflow when computing
4404 times, and for times in the future.
4405 (idle_string): Record latest boot time.
4407 2004-06-22 Jim Meyering <jim@meyering.net>
4409 * src/test.c (usage): Correct description of `-t FD'. The file
4410 descriptor, FD, is no longer optional. Reported by Ton Nijkes.
4412 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
4414 The 2004-06-19 fix for who and pinky was incomplete, as ctime
4415 has undefined behavior if the year precedes -999 or follows 9999.
4416 Since we have to stop using ctime anyway, we might as well use
4417 strftime and fix the FIXME, and support internationalized dates.
4419 * NEWS: Document the new behavior.
4420 * src/who.c: Include "hard-locale.h".
4421 (time_format, time_format_width): New vars.
4422 (time_string, print_line): Use them.
4424 (time_string): Use localtime + strftime instead of
4425 ctime, to avoid problems with years before -999 or after 9999.
4426 * src/pinky.c: Likewise.
4428 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
4430 Fix bug: GNU 'ls' didn't count columns correctly if user or group
4431 names contained multibyte characters where the column count
4432 differed from the byte count. This patch also corrects
4435 * src/ls.c (format_user_or_group): New function, which counts
4437 (format_user, format_group): Use it.
4438 (format_user_or_group_width): New function, which counts columns
4440 (format_user_width, format_group_width): Use it.
4442 2004-06-21 Jim Meyering <jim@meyering.net>
4444 * tests/priv-check: Quote "$PATH" in PATH=$PATH.
4445 Suggestion from Andreas Schwab.
4447 * tests/priv-check: When running as root, be sure to propagate
4448 PATH through to the process we exec as non-root.
4449 Reported by michael@aplatform.com.
4451 * src/mknod.c (main): Don't segfault when calculating the
4452 expected number of operands for `mknod NAME'.
4454 2004-06-20 Jim Meyering <jim@meyering.net>
4456 * src/dd.c (input_seek_errno): Declare file-scoped variable as static.
4458 2004-06-20 Paul Eggert <eggert@cs.ucla.edu>
4460 * src/basename.c (main):
4461 Standardize on the diagnostics given when someone gives
4462 too few operands ("missing operand after `xxx'") or
4463 too many operands ("extra operand `xxx'").
4464 Include "quote.h" and/or "error.h" if it wasn't already being included.
4465 * src/chgrp.c (main): Likewise.
4466 * src/chmod.c (main): Likewise.
4467 * src/chown.c (main): Likewise.
4468 * src/chroot.c (main): Likewise.
4469 * src/comm.c (main): Likewise.
4470 * src/cp.c (do_copy): Likewise.
4471 * src/csplit.c (main): Likewise.
4472 * src/date.c (main): Likewise.
4473 * src/dircolors.c (main): Likewise.
4474 * src/dirname.c (main): Likewise.
4475 * src/du.c (main): Likewise.
4476 * src/expr.c (main): Likewise.
4477 * src/hostid.c (main): Likewise.
4478 * src/hostname.c (main): Likewise.
4479 * src/id.c (main): Likewise.
4480 * src/install.c (main): Likewise.
4481 * src/join.c (add_file_name, main): Likewise.
4482 * src/link.c (main): Likewise.
4483 * src/ln.c (main): Likewise.
4484 * src/logname.c (main): Likewise.
4485 * src/md5sum.c (main): Likewise.
4486 * src/mkdir.c (main): Likewise.
4487 * src/mkfifo.c (main): Likewise.
4488 * src/mknod.c (main): Likewise.
4489 * src/mv.c (main): Likewise.
4490 * src/nohup.c (main): Likewise.
4491 * src/od.c (main): Likewise.
4492 * src/pathchk.c (main): Likewise.
4493 * src/ptx.c (main): Likewise.
4494 * src/readlink.c (main): Likewise.
4495 * src/rm.c (main): Likewise.
4496 * src/rmdir.c (main): Likewise.
4497 * src/seq.c (main): Likewise.
4498 * src/setuidgid.c (main): Likewise.
4499 * src/shred.c (main): Likewise.
4500 * src/sleep.c (main): Likewise.
4501 * src/sort.c (main): Likewise.
4502 * src/split.c (main): Likewise.
4503 * src/stat.c (main): Likewise.
4504 * src/test.c (beyond, main): Likewise.
4505 * src/touch.c (main): Likewise.
4506 * src/tr.c (main): Likewise.
4507 * src/tsort.c (main): Likewise.
4508 * src/tty.c (main): Likewise.
4509 * src/uname.c (main): Likewise.
4510 * src/uniq.c (main): Likewise.
4511 * src/unlink.c (main): Likewise.
4512 * src/uptime.c (main): Likewise.
4513 * src/users.c (main): Likewise.
4514 * src/who.c (main): Likewise.
4515 * src/whoami.c (main): Likewise.
4517 * tests/basename/basic: Adjust to new diagnostics.
4518 * tests/du/files0-from: Likewise.
4519 * tests/expr/basic: Likewise.
4520 * tests/mv/diag: Likewise.
4521 * tests/tsort/basic-1: Likewise.
4523 2004-06-20 Jim Meyering <jim@meyering.net>
4525 * src/ln.c: Remove declaration of yesno.
4526 Instead, include yesno.h.
4527 * src/copy.c: Likewise.
4529 * src/remove.c: Remove declaration of yesno.
4530 Instead, include yesno.h.
4531 (top_dir): Remove now-unnecessary cast of obstack_base.
4532 (pop_dir): Likewise.
4533 (full_filename_): Likewise.
4535 2004-06-19 Paul Eggert <eggert@cs.ucla.edu>
4537 Don't dump core if ctime returns NULL; this is possible on
4538 hosts with 64-bit time_t and 32-bit int.
4539 * src/who.c: Include "inttostr.h".
4540 (time_string): If ctime fails, print the raw time as an integer
4541 instead of dumping core.
4542 * src/pinky.c: Likewise, as follows:
4543 Include "inttostr.h".
4544 (time_string): New function, copied from who.c.
4545 (print_entry): Use it.
4547 2004-06-19 Paul Eggert <eggert@cs.ucla.edu>
4549 * src/who.c (print_line): Don't truncate user names at 8 bytes.
4550 Problem reported by Guido Leenders in:
4551 http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00056.html
4552 * NEWS: document this.
4554 2004-06-19 Jim Meyering <jim@meyering.net>
4556 * src/system.h (case_GETOPT_VERSION_CHAR): Switch back to
4557 using GNU_PACKAGE (from PACKAGE) once again. This restores
4558 `GNU' to the parenthesized package name in --version output.
4559 Before, the first argument from AC_INIT, `GNU coreutils', would
4560 be propagated to the PACKAGE variable. Now, `GNU ' is trimmed.
4561 Reported by Richard Stallman.
4563 2004-06-17 Jim Meyering <jim@meyering.net>
4565 * src/tr.c (to_uchar): Rename function from `uchar'. The latter
4566 would clash with a typedef in Tru64's <sys/types.h>. From Albert Chin.
4568 2004-06-15 Paul Eggert <eggert@cs.ucla.edu>
4570 * NEWS: Remove more special cases for POSIXLY_CORRECT when POSIX
4571 allows the GNU behavior. "--" is now supported by chroot, hostid,
4572 hosname, pwd, sync, yes.
4573 * doc/coreutils.texi (yes invocation, false invocation,
4574 true invocation): Document this.
4575 * src/chroot.c (main): Handle "--".
4576 * src/hostid.c (main): Likewise.
4577 * src/hostname.c (main): Likewise.
4578 * src/pwd.c (main): Likewise.
4579 * src/sync.c (main): Likewise.
4580 * src/yes.c (main): Likewise.
4581 * src/true.c (main): Recognize --help and --version even if
4582 POSIXLY_CORRECT is set.
4583 * src/yes.c (main): Likewise.
4585 2004-06-09 Paul Eggert <eggert@cs.ucla.edu>
4587 * NEWS: Remove special cases for POSIXLY_CORRECT when POSIX allows
4589 * doc/coreutils.texi (pr invocation, unlink invocation): Document this.
4590 * src/ls.c (decode_switches): Pay attention to TABSIZE even if
4591 POSIXLY_CORRECT is set. POSIX reserves upper-case environment
4592 variables to the implementation, so it's OK for ls to depend on
4594 * src/pr.c: Include "hard-locale.h".
4595 (main): When in a non-POSIX locale, ignore POSIXLY_CORRECT, since
4596 POSIX specifies the behavior only in the POSIX locale.
4597 * src/printf.c (print_esc): Support \x, \u, \U even if POSIXLY_CORRECT,
4598 since POSIX says the behavior is unspecified here.
4599 * src/tail.c (parse_obsolescent_option): Support multiple file operands
4600 even if POSIXLY_CORRECT, since POSIX does not require a diagnostic.
4601 * src/printf.c (main): Recognize --help, --version even if
4602 POSIXLY_CORRECT. POSIX does not specify any options, but it
4603 does not prohibit options either, so "printf" is like "expr" here.
4604 * src/unlink.c (main): Likewise.
4605 * tests/misc/printf: Adjust to the new semantics for \x if
4608 2004-06-14 Jim Meyering <jim@meyering.net>
4610 * tests/misc/pwd: New test, for fix of 2004-04-19.
4611 * tests/misc/Makefile.am (TESTS): Add pwd.
4612 (BUILD_SRC_DIR): Define BUILD_SRC_DIR.
4614 * src/copy.c: Remove declaration of euidaccess.
4615 Instead, include "euidaccess.h".
4617 2004-06-13 Paul Eggert <eggert@cs.ucla.edu>
4619 * src/who.c (PIDSTR_DECL_AND_INIT): Don't assume pid_t fits in int.
4620 (UT_ID) [!HAVE_STRUCT_XTMP_UT_ID]: Remove bogus comment,
4621 as (sizeof "??") reliably returns 3.
4622 (print_line): Guard against idle and pid being too long
4623 (which is possible when printing headers).
4624 (print_user): Allocate enough bytes for idlestr. Use IDLESTR_LEN.
4625 Avoid unnecessary cast of sizeof to int.
4626 (make_id_equals_comment): Do not assume that UT_ID returns
4627 a string; it might return a non-null-terminated array.
4628 Use strncat instead. It's not very often where strncat is
4629 exactly what you want, but this is one of those rare cases.
4631 2004-06-11 Paul Eggert <eggert@cs.ucla.edu>
4633 * src/who.c (list_entries_who): Don't output a trailing space.
4635 2004-06-09 Jim Meyering <jim@meyering.net>
4637 * src/touch.c (usage): Improve wording in description of the
4638 --time=WORD option. Reported by Dan Jacobson.
4640 * src/chown-core.c (change_file_owner): Change names of parameters
4641 old_uid and old_gid to required_uid and required_gid respectively.
4643 * src/chmod.c (mode_changed): Return false, not 0, now that the
4644 function returns `bool'.
4646 2004-06-08 Paul Eggert <eggert@cs.ucla.edu>
4648 Adjust chmod and chown to be similar if -c or -v are given. In
4649 particular, a no-op chown is no longer reported as a change; this
4650 reverts to previous behavior. Also, fix both commands so that -v
4651 report failures even if the failure is not due to the chmod or
4654 * src/chmod.c (CH_NOT_APPLIED): New constant.
4655 (describe_change): Handle it.
4656 (process_file): Use it, if a symlink wasn't changed.
4657 (mode_changed): Return bool, not int. Accept new argument
4658 NEW_MODE; all callers changed. This lets us avoid statting the
4659 file unless the new mode has unusual bits.
4660 (process_file): Return -1 on error. With -v, report all errors
4661 verbosely, not just some.
4663 * src/chown-core.c (change_file_owner): Return -1 on error, not
4664 1 sometimes and -1 on others. Our caller ORs together our results,
4665 and (-1 | 1) == 0 on ones-complement hosts.
4666 With -v report all errors verbosely, not just some.
4667 Fix bug when chopt->root_dev_ino && !chopt->affect_symlink_referent:
4668 file_stats wasn't set properly in that case.
4670 * tests/chgrp/basic: Adjust to above changes.
4672 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
4674 * tests/chgrp/basic: Test that chgrp -h does not fail on
4675 symlinks, even on hosts where that's not supported.
4676 Test that if -R is specified without -H or L, -h is assumed.
4677 Test that chown() is not optimized away.
4679 2004-05-18 Paul Eggert <eggert@cs.ucla.edu>
4681 Several fixes to chgrp and chown for compatibility with POSIX and BSD:
4683 Check for incompatible options. When -R and --dereference are
4684 both used, then either -H or -L must also be used. When -R and -h
4685 are both used, then -P must be in effect.
4687 -H, -L, and -P have no effect unless -R is also specified.
4688 If -P and -R are both specified, -h is assumed.
4690 Do not optimize away the chown() system call when the file's owner
4691 and group already have the desired value. This optimization was
4692 incorrect, as it failed to updated the last-changed time and reset
4693 special permission bits, as POSIX requires.
4695 Do not report an error if the owner or group of a
4696 recursively-encountered symbolic link cannot be updated because
4697 the file system does not support it.
4699 * NEWS: Document the above.
4701 * src/chgrp.c (main): Check for incompatible options. -R --dereference
4702 requires either -H or -L, and -R -h requires -P. If -H, specify
4703 FTS_PHYSICAL as well as FTS_COMFOLLOW; this is faster. Make this
4704 file as much like chown.c as possible.
4705 * src/chown.c (main): Likewise.
4707 * src/chown-core.c (change_file_owner): Use ent->fts_statp only if
4708 needed. Chown a directory only after chowning its children; this
4709 avoids problems if the new directory ownership doesn't permit
4710 access to the children. Dereference symlinks before doing
4711 ROOT_DEV_INO_CHECK, not after, so that we catch symlinks to /.
4712 Do not optimize away the chown() system call when the file's owner
4713 and group already have the desired value. POSIX does not permit
4714 this optimization. Rely on chown and lchown to do the right
4715 thing with symlinks and/or -1 arguments, now that we have wrappers
4716 to do this. Use ENOTSUPP not ENOSYS, and ignore all ENOTSUPP
4717 errors, not just command-line errors.
4718 (chown_files): Pass FTS_NOSTAT to xfts_open if we don't need file status.
4720 * src/system.h (ENOTSUP): Remove.
4722 * tests/chgrp/basic: Use chown --from to discover whether the
4723 group changed, since chgrp now changes unconditionally. This
4724 complicates the sed script a bit. Do not specify --dereference,
4725 since it's the default (and we want to test this). Adjust output
4726 to match the fact that chgrp no longer optimizes the case of
4727 changing a file's group to the same value as before.
4728 * tests/chgrp/posix-H: Do not attempt to combine -h and -H; these
4729 options are incompatible, and their behavior is undefined with POSIX.
4730 (changed, not_changed): Adjust to match the fact that -h is no longer
4731 specified. Sort names.
4732 * tests/chown/deref: Adjust error-diagnostic spelling to match new
4735 2004-06-07 Paul Eggert <eggert@cs.ucla.edu>
4737 * src/uname.c (main): Fix typo introduced on 2003-05-10 that
4738 prevented a diagnostic of any operands.
4740 2004-06-08 Jim Meyering <jim@meyering.net>
4742 * src/shred.c (direct_mode): Turn it on/off with directio, too.
4744 2004-06-07 Jim Meyering <jim@meyering.net>
4746 Enable direct-mode I/O (bypassing the buffer cache), if possible.
4747 Prompted by a suggestion from Kalle Olavi Niemitalo
4748 in http://bugs.debian.org/207035.
4749 * src/shred.c (direct_mode): New function.
4750 (do_wipefd): Turn on direct-mode I/O.
4751 (dopass): If a file's first write fails with EINVAL,
4752 turn off direct-mode I/O and retry the write.
4754 2004-06-05 Paul Eggert <eggert@cs.ucla.edu>
4756 * src/tr.c (main): "tr -d a b" is now a fatal error even if
4757 POSIXLY_CORRECT is set. The POSIX SYNOPSIS does not allow this
4760 2004-06-04 Paul Eggert <eggert@cs.ucla.edu>
4762 * src/shred.c (dopass): Don't subtract 1 from the offset after
4763 a write error. Problem reported by Jon Peatfield in:
4764 http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00020.html
4766 2004-06-02 Paul Eggert <eggert@cs.ucla.edu>
4768 Fix bug reported by Buciuman Adrian in
4769 <http://mail.gnu.org/archive/html/bug-coreutils/2003-08/msg00105.html>
4770 where 'dd' created a file that was too large. The bug was that dd
4771 assumed that the input file offset does not advance after a failed
4772 read; but POSIX says that the input file offset is undefined after
4775 * src/dd.c (MAX_BLOCKSIZE): New macro.
4776 (input_seekable, input_seek_errno, input_offset,
4777 input_offset_overflow): New vars.
4778 (scanargs): Reject block sizes greater than MAX_BLOCKSIZE.
4779 (advance_input_offset): New function.
4780 (skip_via_lseek): Set errno to zero when reporting our failure,
4781 so that we don't report based on garbage errno.
4782 (skip): If fdesc is standard input, advance the input offset.
4783 Do not quit if reading, and if noerror was specified;
4784 POSIX seems to require this.
4785 If read fails on output file, report the earlier lseek failure
4786 instead; this fixes a FIXME in dd_copy.
4787 (advance_input_after_read_error): New function.
4788 (dd_copy): Use it, instead of assuming that failed reads
4789 do not advance the file pointer. Advance input offset
4790 after nonfailed reads. Advance only a partial block if
4791 the previous read (before the failed read) succeeded, and
4792 do not generate an output block of zeros in this case.
4793 (main): Determine initial input offset, seekability of input,
4794 and error if it wasn't seekable.
4796 2004-06-02 Jim Meyering <jim@meyering.net>
4798 rm (without -f) could hang unnecessarily when attempting to
4799 remove a symlink to a file on an off-line NFS-mounted partition.
4800 Reported by David Howells in https://bugzilla.redhat.com/124699.
4801 * src/remove.c (write_protected_non_symlink): New function.
4802 Don't invoke euidaccess on symlinks.
4803 (prompt): Use write_protected_non_symlink rather than using
4804 euidaccess directly, being careful not to call lstat twice for a file.
4806 Fix a bug in how the --output-delimiter=D option works with
4807 abutting byte or character ranges. Reported by David Krider in
4808 http://lists.gnu.org/archive/html/bug-coreutils/2004-05/msg00132.html
4809 * src/cut.c (print_kth): Remove special case for open-ended range.
4810 (set_fields): Record the range start index for an interval even
4811 when it abuts another interval on its low side.
4812 Also record the range start index of the longest right-open-interval.
4813 * tests/cut/Test.pm: Add tests of --output-delimiter=S with
4814 abutting and overlapping byte ranges.
4816 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
4818 Some POSIX-conformance cleanups for tr.
4820 * src/tr.c (posix_pedantic): Remove; no longer needed since
4821 we need to test this in just one place now.
4822 (usage): Mention -C.
4823 (unquote): Note that \055, \n, etc are escaped.
4824 Do not worry about POSIXLY_CORRECT when warning about ambiguous
4826 \ at end of string stands for itself.
4827 Do not diagnose invalid backslash escapes: POSIX says the behavior
4828 is unspecified in this case, so we don't need to diagnose it.
4829 (main): Add support for -C (currently an alias for -c).
4830 Do not diagnose 'tr [:upper:] [:upper:], as POSIX does not require
4832 * tests/tr/Test.pm: New tests bs-055, bs-at-end, repeat-Compl.
4833 Fix comment for range-a-a.
4835 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
4837 Improve the efficiency (and in one case, correctness) of code
4838 that reads symlinks.
4840 * src/copy.c (copy_internal): Don't use alloca, as it can mess up
4841 royally if the link length is long (e.g., GNU/Hurd). Use
4842 xreadlink instead, it's safer. Don't bother to read the link if
4843 it's the wrong size. Add a FIXME because this area is a bit murky
4845 * src/ls.c (get_link_name): Update use of xreadlink.
4846 * src/readlink.c (main): Likewise.
4847 * src/stat.c (print_stat): Likewise.
4849 2004-06-01 Jim Meyering <jim@meyering.net>
4851 * src/env.c (main): Prefer the notation `STREQ (a, b)'
4852 over `!strcmp (a, b)'.
4853 * src/sort.c (main, sort_buffer_size): Prefer the notation
4854 `STREQ (a, b)' over `strcmp (a, b) == 0'.
4855 * src/date.c (batch_convert): Likewise.
4856 * src/expr.c (nextarg): Likewise.
4857 * src/su.c (correct_password, restricted_shell, main): Likewise.
4858 * src/ptx.c (swallow_file_in_memory, main): Likewise.
4859 * src/test.c (binary_operator, and, or, main): Likewise.
4861 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
4863 * NEWS: echo compatibility cleanup.
4864 * doc/coreutils.texi (echo invocation): Document the changes.
4865 * src/echo.c (V9_ECHO): Remove; always enabled.
4866 (DEFAULT_ECHO_TO_XPG): Renamed from V9_DEFAULT, so that
4867 we use the same naming convention as bash. Now an enum,
4869 (usage): Reword to mention -e/-E more accurately.
4870 Mention \0NNN (the POSIX syntax) rather than \NNN (nonstandard).
4871 (hextobin): New function.
4872 (main): Use bool rather than int for local vars when appropriate.
4873 Do not allow options if POSIXLY_CORRECT, unless we are using
4874 BSD semantics and the first argument is "-n".
4875 Don't pass unnecessary extra arg to parse_long_options.
4876 do_v9 now defaults to DEFAULT_ECHO_TO_XPG, not to allow_options.
4877 Do not look for options if !allow_options.
4878 Use size_t rather than int when appropriate.
4879 Open-code option test rather than using strrchr.
4880 Use faster test for "-".
4881 Avoid redundant argc test.
4882 Add support for \x, for Bash compatibility.
4883 Use e.g. '\a' rather than '\007', for portability to EBCDIC hosts.
4884 When '\c' is encountered, stop printing immediately, as POSIX
4886 Add support for \xhh syntax.
4887 Add support for \0ooo syntax; POSIX requires this.
4889 2004-06-01 Jim Meyering <jim@meyering.net>
4891 * Use automake-1.8b. Regenerate dependent files.
4893 2004-05-31 Jim Meyering <jim@meyering.net>
4895 * tests/Makefile.am.in (TESTS_ENVIRONMENT): Define PATH to include
4896 the build src/ directory -- at the front.
4897 ($(srcdir)/$x-tests): Depend on Makefile.am.
4898 Use $x as the program name, except when it would be `test' (test is
4899 the sole program tested via mk-script that is also a shell built-in).
4900 In that case, use the old ../../src/$x.
4902 2004-05-30 Jim Meyering <jim@meyering.net>
4904 Work around HPUX /bin/cc compiler bug that is exposed, now that
4905 sets are arrays of type `bool'. More details here:
4906 http://lists.gnu.org/archive/html/bug-gnulib/2004-05/msg00094.html
4907 FIXME: verify that the above URL points to the right message
4909 * src/tr.c (card_of_complement): Use cleaner `sizeof in_set'
4910 rather than `N_CHARS * sizeof(in_set[0])'. Using HPUX's /bin/cc
4911 (aC++/ANSI C B3910B A.05.55 [Dec 04 2003]) on an ia64-hp-hpux11.22
4912 system, those two expressions are not the same (256 vs. 1024).
4913 The effect of this problem was that `tr -c x y' would fail:
4914 tr: when not truncating set1, string2 must be non-empty
4915 (set_initialize): Remove unnecessary initialization of the `in_set'
4916 buffer; that initialization triggered the same compiler bug as above.
4918 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
4920 tr cleanup, mostly having to do with integer type ranges.
4923 * tests/tr/Test.pm: Add a few tests for the below. Alas, most of
4924 the test cases wouldn't be portable, or would take too much CPU
4927 * src/tr.c (N_CHARS, N_CHAR_CLASSES): Now an enum, not a macro.
4928 This is safe since the code already assumes N_CHARS fits in int.
4929 (Filter): Remove: we want to prototype everything.
4930 (ORD, CHR): Remove. All uses removed. Some replaced with:
4931 (uchar): New function. All places where a char must be converted
4932 to an unsigned char are now done this way, not by ad-hoc methods.
4933 (count): New type. Use it whenever counts or states are needed.
4934 (BEGIN_STATE): Increase from INT_MAX - 1 (which was bogus, anyway,
4935 since we used it in an unsigned int context) to UINTMAX_MAX - 1.
4936 (REPEAT_COUNT_MAXIMUM): New macro. Use it in place of BEGIN_STATE
4937 whenever appropriate.
4938 (NOT_A_CHAR): Remove global macro; now a local enum.
4939 (UL_LOWER, UL_UPPER, UL_NONE): No longer specify values, since
4940 the rest of the code no longer depends on them.
4941 (class_ok): Remove; all uses changed to use inline comparisons.
4942 (RE_NO_TYPE): Remove; wasn't used or needed.
4943 (struct List_element): normal_char and equiv_code are now unsigned
4945 first_char, last_char, and the_repeated_char are now unsigned char,
4946 not unsigned int. repeat_count is now count, not size_t.
4948 (struct Spec_list): state is now count, not unsigned int.
4949 lengthis now count, not size_t.
4950 n_indefinite_repeats is now size_t, not int.
4951 has_equiv_class, has_char_class, and has_restricted_char_class
4952 are now bool, not int. All uses changed.
4953 (struct E_string): s is now char *, not unsigned char *.
4954 escaped is now bool *, not int *. All uses changed.
4955 (ES_MATCH): Remove macro, replacing with:
4956 (es_match): New inline function. All uses changed.
4957 (squeeze_repeats, complement, posix_pedantic, truncate_set1,
4958 translating): Now bool, not int.
4959 (io_buf): Now char array, not unsigned char.
4960 (SET_TYPE): Remove. All uses replaced with bool.
4961 (is_equiv_class_member, unquote, append_range, append_char_class,
4962 append_equiv_class, find_closing_delim, star_digits_closebracket,
4963 build_spec_list, parse_str, homogeneous_spec_list):
4964 Now returns bool, not int. All uses changed.
4965 (is_equiv_class_member): Now inline.
4966 (is_equiv_class_member, is_char_class_member, make_printable_str,
4967 append_normal_char, append_range, append_repeated_char,
4969 Args are now of proper integer type.
4970 (unquote, look_up_char_class, make_printable_str,
4971 append_equiv_class, build_spec_list, squeeze_filter):
4972 Avoid unsigned char *p; gently convert *p to unsigned char instead.
4973 (unquote, get_spec_stats): Do not jump past declarations and then
4974 use them; C doesn't allow this in portable programs.
4975 (make_printable_str): Check for overflow in size calculations.
4976 (xmemdup): Remove. All uses rewritten.
4977 (find_bracketed_repeat): Args are now of proper pointer-to-integer
4978 type. Do not reject [c*0]. Use xstrtoumax, not xstrtoul.
4979 (find_bracketed_repeat, star_digits_closebracket): Check that the
4980 digits are not escaped.
4981 (build_spec_list): Don't bother to copy opnd_str; not needed.
4982 (build_spec_list, get_next): Simplify internal logic a bit.
4983 (card_of_complement): Fix bug due to char overflow.
4984 (get_spec_stats): Don't assume len fits into int.
4985 Check for integer overflow. Use abort() rather than assert(0).
4986 (string2_extend): Fix subscript error: is_char_class_member (..., 255)
4988 (squeeze_filter): READER is never null now; simplify code.
4989 READER arg now has a simpler type. Remove unnecessary casts.
4990 (squeeze_filter, main): Calls to fwrite improperly checked result
4991 against zero, rather than against requested size.
4992 (plain_read): New function.
4993 (read_and_delete, read_and_xlate):
4994 Remove unused filter arg, and don't worry about hit_eof.
4995 Simplify by using plain_read.
4996 (set_initialize): Args are bool and bool *, not int and SET_TYPE *.
4997 (main): Always pass a non-null procedure to squeeze_filter.
4998 Rewrite so that class_ok isn't needed.
5000 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
5002 * src/shred.c (dosync): Ignore EBADF errors, as IRIX 6.5
5003 fdatasync reports EBADF when syncing (unwritable) directories.
5004 Problem reported by Albert Chin-A-Young in:
5005 http://lists.gnu.org/archive/html/bug-coreutils/2004-05/msg00165.html
5007 2004-05-29 Jim Meyering <jim@meyering.net>
5009 * tests/chown/deref: Fix typo: use ls -ldo, not ls -ldg.
5010 Patch from Albert Chin.
5012 * src/ptx.c (text_buffer_maxend): Remove declaration of unused variable.
5014 * src/remove.c (push_dir): Merge declaration and adjacent assignment
5015 into a single statement.
5017 2004-05-28 Jim Meyering <jim@meyering.net>
5019 * src/remove.c (AD_mark_helper): Eliminate an unnecessary comparison.
5021 2004-05-22 Jim Meyering <jim@meyering.net>
5023 rm -r would get a failed assertion when run from an inaccessible
5024 directory and with two or more command line arguments including an
5025 absolute-named directory followed by a relative-named directory.
5027 * src/remove.h (struct rm_options) [require_restore_cwd]: New member.
5028 * src/remove.c (struct cwd_state): Define.
5029 (AD_pop_and_chdir): Redesign interface so that a restore_cwd failure
5030 can be detected by the caller. Instead of returning a malloc'd
5031 directory name, communicate it to caller via a new parameter, and
5032 return an indication of whether restore_cwd failed. Update caller.
5033 Eliminate an unnecessary call to AC_stack_top.
5034 (remove_dir): Change type of cwd_state parameter to `struct cwd_state'
5035 so we can now communicate to caller whether/how functions like
5036 restore_cwd have failed. Update caller.
5037 (rm_1): Fail if we've failed to restore the working directory
5038 and the name of the next file to remove is `.'-relative.
5039 (rm): Fail if the require_restore_cwd flag is true and we've
5040 failed to restore the working directory.
5041 * src/mv.c (rm_option_init): Initialize new member,
5042 x->require_restore_cwd.
5043 * src/rm.c (rm_option_init): Likewise.
5045 2004-05-21 Jim Meyering <jim@meyering.net>
5047 * tests/rm/inaccessible: New test for the above fix.
5048 * tests/rm/Makefile.am (TESTS): Add inaccessible.
5050 * src/remove.c (rm): Use free rather than XFREE.
5051 (remove_dir): Use xmalloc, not XMALLOC.
5052 (ds_init): Likewise.
5054 2004-05-20 Jim Meyering <jim@meyering.net>
5056 * Makefile.maint (sc_unmarked_diagnostics): Now that the unmarked
5057 diagnostics in shred.c have been fixed, don't exempt shred.c from
5060 * src/shred.c: Use translatable diagnostics, e.g.
5061 change "%s: remove" to _("%s: failed to remove") and
5062 change "%s: close" to _("%s: failed to close").
5064 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
5066 * src/shred.c (names): Bring back lower-case letters, "_", and
5067 ".". But continue to omit +, =, %, @, #, as they're either
5068 shell metacharacters (for some shells) or are not in some
5069 character sets, or (in the case of '%') must be a
5070 metacharacter somewhere.
5072 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
5074 * src/cut.c (cut_fields): Adjust to new signature of getndelim2.
5076 2004-05-17 Jim Meyering <jim@meyering.net>
5078 * src/shred.c (incname): Decrement `len' only once per loop iteration.
5080 chgrp and chown now dereference symlinks by default, per POSIX.
5081 Reported by Michal Politowski as http://bugs.debian.org/249177.
5083 * src/chown-core.c (chopt_init): Affect each symlink referent by default.
5084 * src/chown.c (usage): Update to reflect this.
5085 * src/chgrp.c (usage): Likewise.
5086 * NEWS: Describe the change.
5087 Adapt tests accordingly.
5088 * tests/chgrp/basic: Use -h where necessary to retain semantics.
5089 * tests/chgrp/deref: Likewise.
5090 * tests/chgrp/posix-H: Likewise.
5092 2004-05-15 Paul Eggert <eggert@cs.ucla.edu>
5094 In shred, check for errors from fdatasync more carefully. If
5095 fdatasync fails with errno==EINVAL, it means this implementation
5096 does not support synchronized I/O for this file. Do not report
5097 this as an error, as (for example) AIX 5.2 fdatasync reports it
5098 for raw disk devices. Problem reported by Albert Chin in
5099 <http://mail.gnu.org/archive/html/bug-gnu-utils/2004-05/msg00028.html>.
5101 Check for write errors, though: the old code ignored them.
5102 Improve error checking in a few other cases, too (e.g., close of a
5105 Also, change several 'int' values to 'bool', so that the error
5106 checking is a bit clearer. Similarly, change unsigned values
5107 to size_t where appropriate.
5109 * src/shred.c: Include "dirname.h".
5110 (datasync) [!HAVE_FDATASYNC]: Remove.
5111 (dosync): New function.
5112 (dopass): Use it. Return 1 on write error, -1 on other error.
5113 All callers changed. Report write error if dosync does.
5114 (do_wipefd, wipefd, wipename, wipefile): Return bool (true/false),
5115 not int (0/-1). All callers changed. Return false if there's a
5117 (incname): Return bool (true/false), not int (0/1). Accept
5118 size_t length, not unsigned. All callers changed. Do not
5119 bother checking for non-digits; it can't happen. Replace
5120 recursion with iteration.
5121 (wipename): Use dir_name, base_name, etc. instead of assuming
5122 Unix file names. Use size_t for length, not unsigned.
5123 Report error if unlink or close fails.
5124 (wipename, main): Use bool for booleans.
5126 (names): Use only digits and uppercase letters, for greater
5129 2004-05-16 Jim Meyering <jim@meyering.net>
5131 * tests/chown/deref: New test for the yesterday's change.
5132 * tests/chown/Makefile.am (TESTS): Add deref.
5134 2004-05-15 Jim Meyering <jim@meyering.net>
5136 chown --dereference did nothing when the owner/group of a
5137 symlink matched the desired owner/group. Reported by David Malone.
5138 Also reported in 1999 as http://bugs.debian.org/39642.
5140 * src/chown-core.c (change_file_owner): When --dereference has
5141 been specified, and when processing a symlink, stat it to get the
5142 owner and group of the referent.
5144 2004-05-14 Jim Meyering <jim@meyering.net>
5146 * man/pwd.x, man/echo.x, man/printf.x: Fix typo:
5147 s/supercede/supersede/ reported by Andrew Fabbro.
5149 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
5151 Improve performance of `sort -m' on large files, at the cost of
5152 making some contrived examples unsafe. POSIX allows this
5153 optimization. Performance problem reported by Jonathan Baker in
5154 <http://mail.gnu.org/archive/html/bug-coreutils/2004-05/msg00071.html>.
5156 * src/sort.c (first_same_file): Do not treat input pipes
5157 differently from other files.
5158 * doc/coreutils.texi (sort invocation): Document that "sort -m -o F"
5159 might write F before reading all the input.
5162 2004-05-12 Paul Eggert <eggert@cs.ucla.edu>
5164 * src/od.c (print_ascii, dump_strings): Use e.g. '\a' rather than
5165 '\007', for portability to EBCDIC hosts.
5166 * src/printf.c (print_esc_char): Likewise.
5167 * src/tr.c (unquote, make_printable_str): Likewise.
5169 2004-05-12 Jim Meyering <jim@meyering.net>
5171 * src/remove.c (AD_pop_and_chdir): Move lstat-`.' into if-block
5172 where the result is used. This avoids one unnecessary lstat call
5173 per command line argument.
5175 2004-05-12 Paul Eggert <eggert@cs.ucla.edu>
5177 Don't assume that "make -C" works; Solaris "make" doesn't have -C.
5179 * src/Makefile.am (all_programs.list): New rule, copied from
5180 man/Makefile.am and tests/Makefile.am, except that we use the
5181 system tr rather than ./tr and we don't use tr -s.
5182 * tests/Makefile.am (all_programs): Use it.
5183 * man/Makefile.am (all_programs): Likewise. Renamed from programs,
5184 for consistency. All uses changed.
5186 2004-05-11 Jim Meyering <jim@meyering.net>
5188 * tests/rm/unread3: New test, for the above fix and today's
5189 lib/save-cwd.c improvement.
5190 * tests/rm/Makefile.am (TESTS): Add unread3.
5192 * src/rm.c: Don't include "save-cwd.h". It's no longer used.
5194 2004-05-10 Jim Meyering <jim@meyering.net>
5196 * tests/install/trap: New file. Test for bug fix of 2004-04-18.
5197 * tests/install/Makefile.am (TESTS): Add trap.
5199 * src/remove.c (AD_push): Don't use errno in diagnostic about
5202 Remove these generated files from CVS.
5203 * tests/cut/cut-tests, tests/date/date-tests, tests/join/join-tests:
5204 * tests/ls/ls-tests, tests/pr/pr-tests, tests/tac/tac-tests:
5205 * tests/tail/tail-tests, tests/test/test-tests, tests/tr/range-tests:
5206 * tests/tr/tr-tests, tests/wc/wc-tests:
5208 2004-05-09 Jim Meyering <jim@meyering.net>
5210 * src/tr.c (unquote): Use xcalloc rather than xmalloc and
5211 a loop initializing the just-allocated memory to zero.
5213 2004-05-08 Jim Meyering <jim@meyering.net>
5215 * tests/rm/no-give-up: New file; check for today's fix.
5216 * tests/rm/Makefile.am (TESTS): Add no-give-up.
5218 2004-05-08 Paul Eggert <eggert@cs.ucla.edu>
5220 Fix bug where "rm" gave up too easily, reported by Dan Jacobsen in
5221 <http://mail.gnu.org/archive/html/bug-coreutils/2004-05/msg00013.html>.
5223 * src/remove.c (remove_entry): Check for errno values like ENOENT
5224 that show the file cannot be directory, instead of for errno
5225 values like EPERM that show the file might be a directory. This
5226 is necessary because, when a single unlink() call has multiple
5227 reasons to fail, it can set errno to any of those reasons; it's
5228 only the rare errno value like ENOENT that excludes all the other
5229 possible reasons to fail even when the file is a directory.
5230 (remove_cwd_entries): Don't attempt chdir if the file is known
5231 to not be a directory.
5232 (remove_dir): Use the same method that remove_cwd_entries uses
5233 (for some reason they differed). Don't assert that saved_errno
5234 must be EPERM; it might be just about anything.
5236 2004-05-06 Jim Meyering <jim@meyering.net>
5238 * src/id.c (xgetgroups): Use xnmalloc, rather than xmalloc.
5239 Don't add `1' to the buffer size (it was to protect against malloc
5240 implementations that fail to allocate a buffer of size zero).
5241 That is no longer necessary, since we use a malloc wrapper
5244 * src/wc.c (get_input_fstatus): Use xnmalloc, rather than xmalloc.
5245 * src/head.c (elide_tail_bytes_pipe): Likewise.
5246 * src/df.c (main): Likewise.
5247 * src/shred.c (do_wipefd): Likewise.
5248 * src/users.c (list_entries_users): Likewise.
5249 * src/tail.c (main): Likewise.
5250 * src/md5sum.c (main): Likewise.
5252 2004-04-29 Paul Eggert <eggert@cs.ucla.edu>
5254 * src/df.c (show_disk, show_point): If several filesystems are
5255 mounted on the same mount point, prefer the last one, not the first.
5256 Problem reported by Christian Jones in
5257 <http://mail.gnu.org/archive/html/bug-coreutils/2004-04/msg00200.html>.
5258 (show_disk): Remove unused statp arg. Return bool, not int.
5259 (show_point): Rewrite to avoid gotos. Use the same algorithm
5260 for lofs and dummies for each pass through the mount table,
5261 rather than subtly different algorithms (which are probably
5264 2004-05-03 Jim Meyering <jim@meyering.net>
5266 * Makefile.am (EXTRA_DIST): Add m4/ChangeLog, now that we no longer
5269 2004-05-01 Jim Meyering <jim@meyering.net>
5271 When chown or chgrp is modifying the referent of a symlink,
5272 use the chown(2) function, if possible.
5273 * src/chown-core.c (change_file_owner): Don't hard-code the
5274 open/fchown/close kludge here. Use `chown' instead.
5275 The chown function works just fine on conforming systems.
5276 Other systems now go through the new chown wrapper that
5277 resorts to the old kludge.
5279 * src/chown-core.c (change_file_owner): Add a comment.
5281 2004-04-27 Jim Meyering <jim@meyering.net>
5283 * src/ptx.c: Make over 40 global extern variables `static'.
5284 (syntax_table, re_syntax_table): Remove declarations of two unused
5285 variables (they were exposed by the above change).
5287 * src/du.c (G_fail, opt_nul_terminate_output): Declare `static'.
5288 * src/ln.c (backup_type): Likewise.
5290 * src/remove.c (rm): Add `extern' keyword.
5291 * src/cp-hash.c (forget_created, remember_created)
5292 (src_to_dest_lookup, remember_copied, hash_init, forget_all): Likewise.
5293 * src/copy.c (dest_info_init, src_info_init, copy): Likewise.
5294 * src/chown-core.c (chopt_init, chopt_free, gid_to_name)
5295 (uid_to_name, chown_files): Likewise.
5297 * src/Makefile.am (sc_tight_scope): New rule.
5298 * Makefile.maint (sc_tight_scope): New rule.
5299 (syntax-check-rules): Add it.
5301 2004-04-26 Jim Meyering <jim@meyering.net>
5303 * Use automake-1.8.4. Regenerate dependent files.
5305 * src/sort.c (limfield): Make a comment clearer.
5307 2004-04-25 Paul Eggert <eggert@twinsun.com>
5309 Fix POSIX-conformance bug: "sort -k 3,3.5b" is supposed to skip
5310 leading blanks when computing the location of the field end;
5311 it is not supposed to skip trailing blanks. Solaris 8 "sort"
5312 does conform to POSIX. Also fix the documentation to clarify
5313 this and related issues.
5315 * doc/coreutils.texi (sort invocation): Mention -k earlier, so
5316 that the options are in alphabetical order. Describe how -b works
5317 more-accurately; this involves fixing some examples, too. Mention
5318 what happens if the start field falls after an end field or after
5319 a line end. Warn about using -k without -b, -g, -M, -n, or -t.
5320 Add an example of how to sort IPv4 addresses and Apache Common
5321 Log Format dates. Remove a duplicate example.
5322 (Putting the tools together): Use separate options rather
5323 than agglomerating them.
5324 * src/sort.c (limfield): Use skipeblanks, not skipsblanks, to
5325 decode whether to skip leading blanks.
5326 (trailing_blanks): Remove.
5327 (fillbuf, getmonth, keycompare): Don't trim trailing blanks.
5329 * tests/pr/Test.pm: Fix typo in env_default comment.
5330 * tests/sort/Test.pm: Likewise.
5331 (18c, 18d): Reverse the order of output lines, so that the
5332 test cases conform to POSIX.
5334 2004-04-22 Paul Eggert <eggert@twinsun.com>
5336 More signal-handling cleanup for ls.c. Do not allow signals to
5337 happen between arbitrary output bytes, as the
5338 restore-default-color sequence can bollix up multibyte chars or
5339 color-change sequences in the ordinary output. Instead, process
5340 signals only between printing a file name and changing the color
5341 back to non_filename_text color. That way, if the signal handler
5342 changes the color (to the default), 'ls' will change it back when
5343 'ls' continues (after being suspended).
5345 Also, do not bother with signal-handling unless stdout is a
5346 controlling terminal; this lets stdio buffer better when "ls
5347 --color" is piped or sent to a file.
5349 * src/ls.c (sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]: New macros.
5350 Do not include "full-write.h"; no longer needed.
5351 (tcgetpgrp) [! HAVE_TCGETPGRP]: New macro.
5352 (put_indicator_direct): Remove. All callers changed to use
5354 (caught_signals, interrupt_signal, stop_signal_count): New vars.
5355 (restore_default_color): Don't bother checking for put_indicator
5357 (sighandler): Don't handle SIGTSTP; that's another handler now.
5358 Simply set interrupt_signal to the signal, then exit.
5359 (stophandler, process_signals): New functions.
5360 (main): Don't output any color changes until _after_ the signal
5361 handlers are set up. This fixes a race condition where 'ls'
5362 could be interrupted while initializing colors, and leaving the
5363 terminal in an undesirable state.
5364 Don't mess with signal-handling if standard output is not a
5365 controlling terminal.
5366 When exiting, restore the default color, then restore the
5367 default signal handling, then act on any signals that weren't
5369 Do not print //DIRED// etc. in colors; this avoids the need
5370 to catch signals when printing them.
5371 (print_name_with_quoting): Process signals just before switching
5372 color back to non_filename_text.
5374 2004-04-23 Jim Meyering <jim@meyering.net>
5376 Avoid segfault on systems for which SIZE_MAX != (size_t) -1.
5377 * src/ls.c (quote_name): Use SIZE_MAX, not -1, in calls
5378 of quotearg_buffer. Patch by Mikulas Patocka.
5380 2004-04-18 Paul Eggert <eggert@twinsun.com>
5382 tee ignored SIGPIPE, but POSIX doesn't allow this.
5384 * src/tee.c (main): Do not ignore SIGPIPE, as POSIX 1003.1-2001
5385 does not allow this. This undoes the 1996-10-24 patch.
5387 2004-04-18 Paul Eggert <eggert@twinsun.com>
5389 Signal-handling cleanup for coreutils. Here are the highlights:
5391 - csplit sometimes failed to remove files when interrupted.
5392 - csplit didn't clean up if two signals arrived nearly simultaneously.
5393 - install -s would infloop on System V if SIGCHLD was ignored.
5394 - ls could incorrectly restore color if multiple signals
5395 arrived nearly simultaneously.
5397 * src/csplit.c (sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]:
5399 (filename_space, prefix, suffix, digits, files_created, remove_files):
5401 (caught_signals): New var.
5402 (cleanup): Block signals while deleting all files.
5403 (cleanup_fatal, handle_line_error, regexp_error):
5404 Mark with ATTRIBUTE_NORETURN.
5405 (create_output_file, close_output_file, interrupt_handler):
5406 Block signals while changing the number of output files,
5407 to fix some race conditions.
5408 (delete_all_files): Do nothing if remove_files is zero.
5409 Clear files_created.
5410 (main): Don't mess with signals until after argument processing
5413 * src/csplit.c (main): Rewrite signal-catching code to make it
5414 similar to other coreutils programs. When processing signals,
5415 block all signals that we catch, but do not block signals that we
5416 don't catch. Avoid problems with unsigned int warnings.
5417 * src/ls.c (main): Likewise.
5418 * src/sort.c (main): Likewise.
5420 * src/csplit.c (interrupt_handler):
5421 Use void, not (obsolete) RETSIGTYPE.
5422 * src/shred.c (sigill_handler, isaac_seed_machdep): Likewise.
5424 * src/csplit.c (interrupt_handler) [defined SA_NOCLDSTOP]:
5425 Use simpler "signal (sig, SIG_DFL)" rather than sigaction equivalent.
5426 * src/ls.c (sighandler) [defined SA_NOCLDSTOP]: Likewise.
5427 * src/sort.c (sighandler) [defined SA_NOCLDSTOP]: Likewise.
5428 * src/nohup.c (main) [!defined _POSIX_SOURCE]: Likewise, except
5430 * src/tee.c (main) [!defined _POSIX_SOURCE]: Likewise.
5432 * src/install.c: Include <signal.h>.
5433 (main) [defined SIGCHLD]: Set SIGCHLD handler to the default, if -s is
5434 given, since System V fork+wait does not work if SIGCHLD is ignored.
5436 * src/ls.c (sighandler) [!defined SA_NOCLDSTOP]: Reset signal
5437 handler to self, not to SIG_IGN, since SIGTSTP can be received
5439 (main): Use SA_RESTART, as that is simpler than checking for EINTR
5440 failures all over the place.
5442 2004-04-20 Jim Meyering <jim@meyering.net>
5444 * src/remove.c (is_empty_dir): Clarify comment.
5446 * man/help2man: Accept new option: --program-name=NAME, so that we
5447 can override the one in --version output. This is needed solely
5448 so that test.1 doesn't refer to `[' as the program name.
5449 Reported by Benjamin Cutler as http://bugs.debian.org/205251.
5450 * man/Makefile.am (.x.1): Use help2man's new --program-name option.
5452 * src/pwd.c: Don't include pathmax.h; system.h already does it.
5454 * src/cut.c (cut_fields): Free buffer upon getndelim2 failure.
5456 2004-04-19 Jim Meyering <jim@meyering.net>
5458 * src/shred.c (isaac_seed_start) [AVOID_USED_UNINITIALIZED_WARNINGS]:
5459 Initialize a buffer to avoid warnings from tools like valgrind.
5461 * Makefile.maint (sc_trailing_blank): New rule.
5462 (syntax-check-rules): Add it.
5463 * .x-sc_trailing_blank: New file.
5465 Make pwd work even if the resulting name is so long that getcwd fails.
5466 * src/pwd.c: (path_free, path_init, path_prepend): New functions.
5467 (nth_parent, find_dir_entry, robust_getcwd): New functions.
5468 (main): First try getcwd, then, upon failure, robust_getcwd.
5470 2004-04-18 Jim Meyering <jim@meyering.net>
5472 * src/who.c (print_user): Use xrealloc here, rather than
5473 unchecked realloc. Remove anachronistic casts.
5475 * src/remove.c (full_filename_): Don't leak upon failed realloc.
5477 * src/system.h (readdir_ignoring_dot_and_dotdot): New inline function,
5479 * src/remove.c (readdir_ignoring_dotdirs): Move function to system.h,
5480 renaming it. Update uses.
5482 2004-04-17 Jim Meyering <jim@meyering.net>
5484 * configure.ac: Depend on automake-1.8.3.
5486 * src/join.c (add_file_name): Declare function to be `static'.
5487 (string_to_join_field): Likewise.
5488 * src/remove.c (ds_init, ds_free): Likewise.
5490 * Makefile.maint (sc_prohibit_jm_in_m4): New rule.
5491 (syntax-check-rules): Add to the list.
5493 2004-04-13 Paul Eggert <eggert@twinsun.com>
5495 Use page-aligned buffers whenever we bother to do I/O using buffer
5496 sizes that are tailored for the files.
5498 * src/cat.c: Include getpagesize.h.
5499 * src/copy.c: Likewise.
5500 * src/shred.c: Likewise.
5501 * src/split.c: Likewise.
5502 * src/cat.c (main): Align I/O buffers to page boundaries.
5503 * src/copy.c (copy_reg): Likewise.
5504 * src/shred.c (dopass): Likewise.
5505 * src/split.c (main): Likewise.
5506 * src/dd.c (ROUND_UP_OFFSET, PTR_ALIGN): Remove.
5507 All uses replaced by ptr_align.
5508 * src/od.c (gcd, lcm): Remove; now in system.h.
5509 * src/system.h (gcd, lcm, ptr_align): New functions, moved from od.c.
5511 2004-04-14 Jim Meyering <jim@meyering.net>
5513 Remove m4/Makefile.am: it's no longer needed, with newer automake
5514 * configure.ac (AC_CONFIG_FILES): Remove m4/Makefile.in from the list.
5515 * Makefile.am (SUBDIRS): Remove `m4' from the list.
5517 2004-04-13 Jim Meyering <jim@meyering.net>
5519 * configure.ac: Change `jm_' in AC_DEFINE'd names to `gl_'.
5521 2004-03-27 Paul Eggert <eggert@twinsun.com>
5523 * NEWS: cp -pu and mv -u (when copying) now take the destination
5524 file system time stamp resolution into account.
5525 * doc/coreutils.texi (mv invocation): Document this.
5526 (cp invocation): Document -u (it was missing!) with new behavior.
5528 * src/copy.c: Include "utimecmp.h".
5529 (copy_internal): Compare time stamps using utimecmp rather than
5532 2004-04-09 Jim Meyering <jim@meyering.net>
5534 * Makefile.maint (.re-list): New rule/file, to replace
5535 hard-coded list of header file names.
5536 (sc_system_h_headers): Use the new file.
5537 Don't look for sys2.h anymore.
5539 * src/system.h: Include new "stat-macros.h" rather than hard-coding
5540 all of its macro definitions -- the list was slightly out of date.
5541 Suggestion from Dmitry V. Levin.
5543 2004-04-08 Paul Eggert <eggert@cs.ucla.edu>
5545 * NEWS: Remove noctty flag from dd. Suggested by Philippe Troin.
5546 * doc/coreutils.texi (dd invocation): Likewise.
5547 * src/shred.c (O_NOCTTY): Remove redundant decl.
5548 * src/dd.c (flags, usage): Remove noctty flag.
5549 (main): Always use O_NOCTTY when opening files.
5551 2004-04-08 Jim Meyering <jim@meyering.net>
5553 * src/dd.c (dd_copy): Mark two diagnostics for translations.
5554 (set_fd_flags): Undo part of today's change: it's a little
5555 cleaner -- and more efficient in the common case -- to go
5556 ahead and OR in the -1 when fcntl fails.
5558 * Makefile.maint (sc_dd_max_sym_length): New target.
5559 (syntax-check-rules): Add it.
5561 * src/md5sum.c (PROGRAM_NAME) [algorithm == ALG_SHA1]:
5562 Correct spelling: s/shasum/sha1sum. Reported by Jesse Kornblum.
5564 * src/dd.c (set_fd_flags): Don't OR in -1 when fcntl fails.
5565 Rename parameter, flags, to avoid shadowing global.
5566 (LONGEST_SYMBOL): Tweak comment.
5568 2004-04-07 Paul Eggert <eggert@twinsun.com>
5570 * NEWS: New dd conv= symbols nocreat, excl, fdatasync, fsync,
5571 and new dd options iflag= and oflag=.
5572 * src/dd.c (usage): Likewise.
5573 * src/Makefile.am (dd_LDADD, shred_LDADD): Add fdatasync's lib.
5574 * src/dd.c (fdatasync) [!HAVE_FDATASYNC]: New macro.
5575 (C_NOCREAT, C_EXCL, C_FDATASYNC, C_FSYNC): New macros.
5576 (input_flags, output_flags): New vars.
5577 (LONGEST_SYMBOL): New macro.
5578 (struct symbol_value): Renamed from struct conversion. Members
5579 symbol and value renamed from convname and conversion. The
5580 symbol value is now an array instead of a pointer; this saves
5581 a bit of space and time in practice. All uses changed.
5582 (conversions): Add nocreat, excl, fdatasync, fsync. Now const.
5583 (flags): New constant array.
5584 (iflag_error_msgid, oflag_error_msgid): New constants.
5585 (parse_symbols): Renamed from parse_conversion and generalized
5586 to handle either conversion or flag symbols.
5587 (scanargs): Adjust uses of parse_symbols accodingly. Add
5588 support for iflag= and oflag=. Reject attempts to use
5589 both excl and nocreat.
5590 (set_fd_flags): New function.
5591 (dd_copy): Just return X rather than calling quit (X), since our
5592 caller invokes quit with the returned value. Add support for
5593 fdatasync and fsync.
5594 (main): Add support for iflag=, oflag=, and new conv= symbols.
5595 * src/system.h (O_DIRECT, O_DSYNC, O_NDELAY, O_NOFOLLOW,
5596 O_RSYNC, O_SYNC): Define to 0 if not already defined.
5598 * NEWS: Remove duplicate mention of BLOCKSIZE.
5600 2004-04-02 Andreas Schwab <schwab@suse.de>
5602 * src/stty.c: Add support for IUTF8 input flag.
5604 2004-04-06 Jim Meyering <jim@meyering.net>
5606 * src/system.h (makedev) [mkdev && !makedev]: Define in terms of mkdev.
5607 Interix spells it `mkdev'. Reported by Mark Funkenhauser.
5609 2004-04-04 Jim Meyering <jim@meyering.net>
5611 A specified format is no longer automatically newline terminated.
5612 If you want a newline at the end of your format, use `\n'.
5613 * src/stat.c (print_it): Don't print a newline at the end of
5615 (do_statfs): Add a newline at end of each default format string.
5617 2004-03-30 Paul Eggert <eggert@twinsun.com>
5619 * src/nohup.c (main): Adjust to new calling convention
5620 for set_cloexec_flag.
5622 2004-03-31 Jim Meyering <jim@meyering.net>
5624 * tests/Fetish.pm (run_tests): Remove `.orig' file.
5625 Remove debugging diagnostic.
5627 Specifying an invalid --width=N (-w) or --gap-size=N (-g)
5628 would not elicit an error.
5629 * src/ptx.c: Include "xstrtol.h" and "quotearg.h".
5630 (main): Don't use atoi. Use xstrtoul instead.
5632 2004-03-30 Jim Meyering <jim@meyering.net>
5634 * Makefile.maint (sc_prohibit_atoi_atof): New rule.
5635 (syntax-check-rules): Add it.
5636 * .x-sc_prohibit_atoi_atof: New file.
5638 2004-03-29 Jim Meyering <jim@meyering.net>
5640 * tests/du/files0-from: Use new OUT_SUBST directive, so that this
5641 test is not sensitive to system-dependent block size differences.
5642 Prompted by a report of Solaris 8 differences from Paul Eggert.
5644 * tests/Fetish.pm: Accept new directives: OUT_SUBST, ERR_SUBST.
5645 Rename `%tmp' to `%actual'. Reverse order of last two args to
5646 _compare_files (to $actual, $expected) so as to match declaration.
5648 2004-03-28 Paul Eggert <eggert@twinsun.com>
5650 Fix some gotchas encountered when porting to Solaris 8, using
5651 the Forte 6u2 compiler.
5653 * src/hostname.c [HAVE_SETHOSTNAME && !defined sethostname]:
5654 Declare sethostname, since no Solaris header does it.
5655 * src/who.c: Include "vasprintf.h", for asprintf.
5657 2004-03-28 Jim Meyering <jim@meyering.net>
5660 * src/du.c (process_file): Don't record dev/inode for directories.
5662 Under some circumstances, without -c, du would mistakenly count the
5663 space of hard-linked files, not just the first one it encountered.
5664 Reported by Anthony Thyssen.
5665 * src/du.c (du_files): Don't ever clear the set of `seen' dev/inodes.
5667 * src/du.c: Rename global `print_totals' to `print_grand_total'.
5669 * src/du.c (main): Rearrange filtering loop to be a tiny bit
5672 * src/chown-core.c: Don't include savedir.h -- no longer needed.
5673 * src/chmod.c: Likewise.
5675 2004-03-25 Jim Meyering <jim@meyering.net>
5677 * src/du.c (main): Remove now-unused declaration of `i'.
5679 2004-03-24 Paul Eggert <eggert@twinsun.com>
5681 * src/du.c (main): Filter out file names of length zero before
5682 invoking fts, so that they don't cause fatal errors.
5684 2004-03-25 Jim Meyering <jim@meyering.net>
5686 * tests/du/files0-from (zero-len): Add a test for the above.
5688 2004-02-25 Paul Eggert <eggert@twinsun.com>
5690 * NEWS: New environment var BLOCKSIZE.
5691 * lib/human.c (humblock): Support BLOCKSIZE as well as BLOCK_SIZE.
5692 * tests/envvar-check: Test for it. Factor the code to simplify it.
5694 2004-03-23 Paul Eggert <eggert@twinsun.com>
5696 * NEWS: Shorten the du --files0-from announcement, and say
5697 "NUL-terminated" rather than "NUL-separated".
5698 * src/du.c (EXPECTED_BYTES_PER_FILE_NAME, DEFAULT_PROJECTED_N_FILES):
5700 (usage): Say "NUL-terminated", not "NUL-separated".
5701 (main): Check for I/O error when istream is closed.
5702 Allow --files0-from=F even if F is empty; this specifies no files.
5703 (du_files): Now that we allow the list of files to be empty,
5705 * tests/du/files0-from: Adjust to above changes to src/du.c.
5707 2004-03-24 Jim Meyering <jim@meyering.net>
5709 * tests/tail-2/assert: Avoid race condition that could cause
5710 spurious failure. Based on a patch from Andreas Schwab.
5712 2004-03-23 Jim Meyering <jim@meyering.net>
5714 * src/du.c (main): Free the hash table, too.
5716 2004-03-22 Jim Meyering <jim@meyering.net>
5718 * man/Makefile.am (.x.1): Remove --info-page= option, reverting
5719 the change of 2004-01-22. I can no longer reproduce the problem
5720 that prompted that change, and `info coreutils pr' would display the
5721 `printing text' section of the manual, not the one on `pr invocation'.
5723 * tests/du/files0-from (nul-1, nul-2): Adjust expected diagnostics
5724 to match corrected output.
5726 * src/du.c: Include "readtokens0.h" rather than "readtokens.h".
5727 (main): Use readtoken0 functions rather than readtokens.
5728 Don't use errno when diagnosing readtokens0 failure.
5729 Fix off-by-one error in the token number reported in a diagnostic.
5730 (du_files): Return bool, rather than int.
5731 (main): Call readtokens0_free.
5733 2004-03-21 Jim Meyering <jim@meyering.net>
5735 * src/remove.c (ds_free): Plug a small leak.
5737 * tests/Fetish.pm: Fix typo in comment.
5739 2004-03-07 Jim Meyering <jim@meyering.net>
5741 * NEWS: du accepts a new option --files0-from=FILE, where FILE
5742 contains a list of NUL-separated file names.
5744 * src/du.c: Include "readtokens.h".
5745 (usage): Describe the new option, and adjust the `Usage':
5746 with this option, no FILE may be specified on the command line.
5747 (main): Handle the new option.
5749 * tests/du/files0-from: New tests, for the above.
5750 * tests/du/Makefile.am (TESTS): Add files0-from.
5752 * src/factor.c (do_stdin): Reflect changes in use of readtoken.
5753 * src/tsort.c (tsort): Likewise.
5755 2004-02-29 Paul Eggert <eggert@twinsun.com>
5757 * NEWS: Add support for a new notation @N to get_date to represent
5758 the time stamp with numeric value N. Improve support for
5759 fractional time stamps. date's -d and -f options now accept them.
5760 Likewise for touch -t. date has a new option --iso-8601=ns.
5762 * doc/coreutils.texi (touch invocation):
5763 Describe use of fractional seconds.
5764 (date invocation, Options for date): Likewise.
5765 * doc/getdate.texi (General date syntax, Time of day items): Likewise.
5766 * doc/coreutils.texi (date invocation): Mention effect of LC_TIME.
5767 (Options for date): Describe new --iso-8601=ns option.
5769 * doc/getdate.texi: Add copyright notice. Change getdate to
5770 get_date when talking about the function name.
5771 (Seconds since the Epoch): New section, containing the time_t
5772 info moved from Date input formats section, along with new
5773 info about the @ syntax. Mention negative time stamps,
5774 fractional time stamps, and leap seconds.
5775 (General date syntax): Modernize examples a bit to reflect new
5777 (General date syntax, Relative items in date strings):
5778 Use ' rather than " to quote formats.
5779 (Time of day items): Add an example with fractional seconds.
5780 Describe fractional-second syntax.
5782 * src/Makefile.am (touch_LDADD): New macro, since `touch' now
5783 needs clock_gettime.
5785 * src/date.c (enum Time_spec): New enum TIME_SPEC_NS.
5786 (time_spec_string, time_spec, show_date): Support it.
5787 (usage): Remove description of -ITIMESPEC, as it's obsolete and
5788 confusing. Mention --iso-8601=ns.
5789 (batch_convert): getline returns ssize_t, not int.
5791 * src/touch.c (newtime): Now an array of two timespecs, one
5792 for access and one for modification.
5793 (ref_stats): Remove.
5794 (get_reldate): Use get_date's parameter profile.
5795 (touch, main): Adjust to above changes.
5796 (main): Work even if tm_year == INT_MAX (so long as long int is wider).
5797 Use gettime instead of gettimeofday, for new get_date signature.
5799 * tests/date/Test.pm (test_vector): New tests epoch, ns-10, ns-max32,
5802 2004-03-15 Jim Meyering <jim@meyering.net>
5804 * Makefile.maint (alpha beta major): `Make' the emit_upload_commands
5805 target before updating $(prev_version_file).
5807 * tests/misc/date-sec: New file, to test for just-fixed bug in date.
5808 See today's change in lib/getdate.y.
5809 * tests/misc/Makefile.am (TESTS): Add date-sec.
5811 2004-03-14 Jim Meyering <jim@meyering.net>
5813 * announce-gen (print_changelog_deltas): Use `.sig' suffix for
5814 signature files, not `.asc'. Reported by angico@yahoo.com.
5816 2004-03-13 Jim Meyering <jim@meyering.net>
5818 * src/cp.c (do_copy): Tweak wording in a diagnostic.
5819 Suggestion from Karl Berry.
5820 Include "quoatearg.h".
5821 (do_copy): Use quotearg_colon (not quote) for diagnostics
5822 that begin with `"%s:'.
5824 * src/nl.c (usage): Specify that nl uses _basic_ regular expressions.
5825 Suggestion from Dan Jacobson.
5827 2004-03-12 Jim Meyering <jim@meyering.net>
5831 Sometimes, when source and destination partition are different,
5832 mv mistakenly fails to preserve a hard link. Reported by IIDA Yosiaki.
5834 * src/copy.c: When moving a set of N hard-linked files between
5835 partitions, via two or more command line arguments where the
5836 command line argument containing the Nth link contains no other
5837 link to that same file, mv would mistakenly copy the file, rather
5838 than hard-linking it to the other(s). That happens because when the
5839 final link is processed, its link count has been reduced to 1 since
5840 the other links have been `copied' to the destination partition
5841 and the source links have been removed.
5842 (copy_internal): When in move mode, use the source dev/inode
5843 pair to look up destination name even when st_nlink == 1.
5844 * src/cp-hash.c (src_to_dest_lookup): New function.
5845 * src/cp-hash.h (src_to_dest_lookup): Add prototype.
5846 * tests/mv/part-hardlink: New file. Test for the above fix.
5847 * tests/mv/Makefile.am (TESTS): Add part-hardlink.
5849 * announce-gen: Sync with autoconf.
5851 * tests/ls/time-1: Exit 77 (not 1) if we can't set up for the test.
5852 This was triggered on a Linux-2.2.19 system using a file system
5853 NFS-mounted from some sort of Sun.
5855 2004-03-11 Jim Meyering <jim@meyering.net>
5857 * Use automake-1.8.3. Regenerate dependent files.
5859 2004-03-10 Jim Meyering <jim@meyering.net>
5861 * tests/du/deref-args: Also convert sizes in the 70-79 kB range,
5862 so that this test works with SELinux-enabled systems.
5863 Based on a patch from Tim Waugh.
5865 `join -1 x' would give a misleading diagnostic
5866 * src/join.c (string_to_join_field): Report that a non-numeric field
5867 number is invalid, rather than `so large that it is not representable'.
5868 * tests/join/Test.pm (invalid-j): New partial test for the above fix.
5870 2004-03-06 Jim Meyering <jim@meyering.net>
5872 cp --sparse=always sparse-image-file.img /dev/hda1 could
5873 produce an invalid copy on the destination device.
5875 * src/copy.c (copy_reg): Even with --sparse=always, try to
5876 make `holes' only if the destination is a regular file.
5877 Reported by Szakacsits Szabolcs.
5879 2004-03-03 Paul Eggert <eggert@twinsun.com>
5881 * src/nohup.c (main): Don't invoke set_cloexec_flag with
5882 a file descriptor of -1.
5884 2004-03-02 Dmitry V. Levin <ldv@altlinux.org>
5886 * src/nohup.c: Include "cloexec.h".
5887 (main): Set the copy of stderr to close on exec.
5889 2004-03-01 Paul Eggert <eggert@twinsun.com>
5891 * configure.ac: Include <signal.h> when checking for strsignal,
5892 sys_siglist, and friends. Problem reported by Tony Leneis in
5893 <http://mail.gnu.org/archive/html/bug-coreutils/2004-02/msg00136.html>.
5895 2004-02-25 Paul Eggert <eggert@twinsun.com>
5897 * tests/du/deref-args, tests/du/exclude, tests/du/slash:
5898 * tests/du/trailing-slash: Run envvar-check in case BLOCK_SIZE
5901 2004-02-23 Paul Eggert <eggert@twinsun.com>
5903 * NEWS: Document how chown's USER.GROUP argument is now parsed.
5905 2004-02-23 Jim Meyering <jim@meyering.net>
5907 * src/seq.c (usage): Remove stray space after \n in --help output.
5909 2004-02-22 Jim Meyering <jim@meyering.net>
5911 * src/du.c (usage): Separate -H and --si. Say that the meaning
5912 of -H will soon change to that of --dereference-args (-D).
5914 2004-02-21 Jim Meyering <jim@meyering.net>
5916 * src/comm.c (usage): Tell what comm does when there are no options.
5917 Reword in terms of FILE1 and FILE2 rather than `left file' and
5918 `right file'. Suggestion from Dan Jacobson.
5920 2004-02-15 Paul Eggert <eggert@twinsun.com>
5922 Fix some POSIX-conformance bugs in expr.
5924 * NEWS: document the following changes to src/expr.c.
5925 * doc/coreutils.texi (expr invocation): Likewise.
5926 Document what forms integers may take, and say "integer"
5927 consistently instead of "number". Warn about operands
5928 that "expr" can misinterpret, and how to work around the
5930 * src/expr.c (eval, eval7, eval6, eval5, eval4, eval3, eval2, eval1):
5931 Accept a bool argument specifying whether to evaluate the
5932 expression. This is to allow short-circuit evaluation. All
5934 (null): Report that a string is zero even if it has
5935 a form like "-0" or "00".
5936 (eval1, eval): Use short-circuit evaluation for | and &.
5937 (eval): Return 0 if both arguments are null or zero, instead
5938 of returning the first argument.
5939 * tests/expr/basic: Add some tests for the above.
5941 2004-02-17 Jim Meyering <jim@meyering.net>
5945 `make check' from a build inside a chroot environment would fail
5946 * tests/help-version: Specify an argument (`/') for df, in the
5947 unusual event that there is no valid entry in /etc/mtab.
5948 Likewise for id: add the -u option, so we don't get spurious
5949 failures when there are no user or group names.
5952 * src/sort.c (usage) [-u]: Add punctuation so that the description in
5953 the help2man-generated (line-joined) man page is more readable.
5954 Reported by Tim Waugh.
5955 [-T]: Add a semicolon, for the same reason.
5957 2004-02-15 Jim Meyering <jim@meyering.net>
5959 * Makefile.am (dist-hook): Qualify target with $(srcdir)/ prefix.
5961 2004-02-11 Jim Meyering <jim@meyering.net>
5963 * tests/Makefile.am.in ($(srcdir)/Makefile.am): Use more portable
5964 $(srcdir)/../Makefile.am.in, rather than $<.
5965 Suggestion from Michael Elizabeth Chastain.
5967 2004-02-10 Jim Meyering <jim@meyering.net>
5969 * config/install-sh: Make this script executable.
5970 * Makefile.am (dist-hook): New target, to ensure that config/install-sh
5971 is executable. Otherwise, on systems that lack a suitable install
5972 binary, `make install' would fail, because of the way this script
5973 is invoked (without `$SHELL ' prefix).
5974 Reported by Bob Proulx.
5976 2004-02-08 Jim Meyering <jim@meyering.net>
5980 * tests/rm/rm5: Avoid triggering a bug in OSF/Tru64's sed
5981 that would cause an unwarranted test failure.
5982 * tests/rm/rm3: Likewise.
5984 2004-02-07 Jim Meyering <jim@meyering.net>
5986 Remove xstat function pointer member. The way it was used was not
5987 portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
5988 inline `stat' and `lstat' functions, thus making the tests of
5989 `xstat == lstat' in copy.c always fail.
5990 * src/copy.h (struct cp_options) [xstat]: Remove member.
5992 * src/copy.c (copy_dir): Set `.dereference' member, not .xstat.
5993 (copy_internal): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.
5994 Use `x->dereference == DEREF_NEVER' in place of `x->xstat == lstat'.
5995 (valid_options): Remove now-obsolete FIXME comments.
5997 * src/cp.c (re_protect): Use `XSTAT (x, ...)' in place of
5998 `*(x->xstat) (...)'.
5999 (do_copy): Declare/use local xstat rather than x->xstat.
6000 (main): Remove code that set x.xstat.
6001 * src/mv.c (cp_option_init): Don't initialize xstat member.
6002 * src/install.c (cp_option_init): Likewise.
6004 * Makefile.cfg (gnu_ftp_host-alpha, etc.): Un-factor .gnu.org suffix,
6005 so that emit_upload_commands can use these variables, too.
6007 2004-02-06 Jim Meyering <jim@meyering.net>
6009 * tests/rm/deep-1: Remove `du' stack space test.
6010 Apparently, `ulimit -s N' isn't portable enough.
6011 This test will be restored (with a guard against losing ulimit)
6012 in its own file later.
6014 * tests/rm/deep-1 (deep): Remove progress-style diagnostics,
6015 since this test doesn't take long enough to merit them.
6016 Run du on $tmp (the containing dir), not $deep, the full path to leaf.
6018 * Makefile.maint (signatures): Remove definition.
6019 Now, automake's gnupload handles this.
6020 (%.sig: %): Remove now-unused rule.
6021 (rel-files): Use automake's $(DIST_ARCHIVES), rather than
6022 `$(distdir).tar.bz2 $(distdir).tar.gz'.
6023 (emit-upload-commands): Adjust to use gnupload.
6025 2004-02-05 Jim Meyering <jim@meyering.net>
6027 * src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP): Remove definitions.
6028 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
6029 Now, those are all defined in timespec.h.
6032 * src/date.c: Don't include timespec.h, now that system.h does it.
6034 2004-02-02 Paul Eggert <eggert@twinsun.com>
6036 Don't dump core if localtime returns NULL (possible on
6037 hosts with 64-bit time_t and 32-bit int).
6038 * src/date.c: Include "inttostr.h".
6039 (batch_convert, main):
6040 If time conversion fails, exit with nonzero status.
6041 (show_date): Return int to report conversion failure.
6042 Print the time as an int if localtime fails.
6043 * src/uptime.c: Print "??" if the current clock can't
6044 be converted by localtime. This won't happen until the year
6045 2*31 + 1900, but we don't want to dump core even if the current
6046 clock has the wrong value.
6048 * src/stat.c: Include "inttostr.h".
6049 (human_time): Print the date/time as a number of seconds since the
6050 epoch if it can't be converted by localtime. This is better than
6051 just saying "invalid", and is consistent with what "ls" does.
6052 Don't dump core if the year has more than 48 digits; this isn't
6053 possible on any contemporary host, but we might as well do it right.
6055 2004-01-31 Paul Eggert <eggert@twinsun.com>
6057 * src/stat.c (human_time): Accept time rather than
6058 pointer-to-const-time parameter, for clarity. All callers changed.
6060 2004-02-02 Jim Meyering <jim@meyering.net>
6062 * src/stat.c (do_stat): Remove extra trailing newline from
6063 default formats. Reported by Nelson H. F. Beebe.
6065 Print actual fractional seconds in time stamps, not just `.00000000'.
6066 * src/stat.c (human_time): Add and use new parameter, t_ns.
6067 (print_stat): Update callers.
6068 * src/ls.c (TIMESPEC_NS): Remove definition.
6069 * src/system.h (TIMESPEC_NS): Define here, instead, now that stat.c
6070 also uses this macro.
6071 Nelson H. F. Beebe noticed that ls --full-time printed nonzero
6072 fractional seconds for files on an XFS file system, but that stat's
6073 fractional seconds were always zero.
6075 2004-01-28 Paul Eggert <eggert@twinsun.com>
6077 * src/seq.c (print_numbers): Use 'double' for loop index, not
6078 'int', to avoid problems with integer overflow. On almost all
6079 machines 'double' works in every case where 'int' works, and
6080 it works on other cases besides.
6082 2004-01-27 Jim Meyering <jim@meyering.net>
6084 * src/seq.c (usage): Mention that if INCREMENT is omitted,
6085 it defaults to 1, even when FIRST is larger than LAST.
6086 Reword so as not to exclude the possibility that INCREMENT be zero.
6088 2004-01-25 Jim Meyering <jim@meyering.net>
6092 * Makefile.maint (signatures): Comment out definition.
6094 2004-01-23 Jim Meyering <jim@meyering.net>
6096 * Makefile.maint (header_regexp): Add exitfail.
6098 * man/Makefile.am (EXTRA_DIST): Add help2man.
6099 Reported by Nelson H. F. Beebe.
6101 * man/Makefile.am (.x.1): Prefix help2man invocation with `$(PERL) --'
6102 so it works on systems with Perl installed somewhere other than in
6105 * src/paste.c (paste_parallel): Declare local, chr, to be of type
6106 `int', not `char', since it must hold EOF. This bug would make
6107 paste infloop on some systems. Test failures reported by
6108 Nelson H. F. Beebe and Christian Krackowizer.
6110 2004-01-22 Jim Meyering <jim@meyering.net>
6112 * tests/rmdir/fail-perm: New file. Test for just-fixed rmdir bug.
6113 * tests/rmdir/Makefile.am (TESTS): Add fail-perm.
6115 * man/help2man: Fix it so using --info-page='coreutils PROG' works.
6116 * man/Makefile.am (.x.1): Invoke our own (tweaked) copy of help2man.
6117 Use --info-page='coreutils PROG' option.
6118 Now, readlink.1 refers the user to `info coreutils readlink'
6119 rather than to `info readlink'. Reported by Matt Swift.
6121 2004-01-21 Paul Eggert <eggert@twinsun.com>
6123 Exit status cleanup.
6125 * src/basename.c (usage): Use EXIT_SUCCESS, not 0, for clarity.
6126 * src/cat.c, src/chgrp.c, src/chmod.c, src/chown.c, src/chroot.c,
6127 * src/cksum.c, src/comm.c, src/cp.c, src/csplit.c, src/cut.c,
6128 * src/date.c, src/dd.c, src/df.c, src/dircolors.c, src/dirname.c,
6129 * src/du.c, src/echo.c, src/env.c, src/expand.c, src/expr.c,
6130 * src/factor.c, src/fmt.c, src/fold.c, src/head.c, src/hostid.c,
6131 * src/hostname.c, src/id.c, src/install.c, src/join.c, src/kill.c,
6132 * src/link.c, src/ln.c, src/logname.c, src/ls.c, src/md5sum.c,
6133 * src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c,
6134 * src/nl.c, src/nohup.c, src/od.c, src/paste.c, src/pathchk.c,
6135 * src/pinky.c, src/pr.c, src/printenv.c, src/printf.c, src/pwd.c,
6136 * src/rm.c, src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c,
6137 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c,
6138 * src/su.c, src/sum.c, src/sync.c, src/tac.c, src/tail.c, src/tee.c,
6139 * src/test.c, src/touch.c, src/tr.c, src/tsort.c, src/tty.c,
6140 * src/uname.c, src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c,
6141 * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c: Likewise.
6143 * src/cat.c (usage): Don't bother normalizing exit status
6144 since the arg is already the correct exit status now.
6145 * src/cksum.c, src/comm.c, src/csplit.c, src/cut.c,
6146 * src/dircolors.c, src/expand.c, src/fmt.c, src/fold.c, src/head.c,
6147 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c,
6148 * src/pr.c, src/split.c, src/sum.c, src/tac.c, src/tail.c, src/tr.c,
6149 * src/tsort.c, unexpand.c, src/src/uniq.c, src/src/wc.c: Likewise.
6151 * src/chown.c (main): Removed unused local 'fail'.
6153 * src/chroot.c (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE):
6156 * src/chroot.c (main): Initialize exit_failure to EXIT_FAIL.
6157 * src/env.c, src/nice.c, src/su.c: Likewise.
6158 * src/nohup.c (main): Likewise, to NOHUP_FAILURE.
6159 * src/setuidgid.c (main): Likewise, to SETUIDGID_FAILURE.
6160 * src/expr.c (main): Use initialize_exit_failure rather than
6161 setting exit_failure directly; this optimizes away redundant
6163 * src/printenv.c, src/sort.c, src/test.c, src/tty.c: Likewise.
6165 * src/chroot.c (main): Exit with status 1 rather than 127
6166 if chroot itself fails, as per documentation.
6168 * src/chroot.c (main): Use EXIT_ENOENT and EXIT_CANNOT_INVOKE
6169 rather than roll-your-own symbols or integers.
6170 * src/env.c (main): Likewise.
6171 * src/nohup.c (main): Likewise.
6172 * src/su.c (run_shell): Likewise.
6174 * src/cp.c (exit_status): Remove static var....
6175 (main): Making it local here instead. Use =, not |=, to set it.
6177 * src/cut.c (FATAL_ERROR, main): Exit with status EXIT_FAILURE,
6179 * src/date.c (batch_convert, main): Likewise.
6180 * src/dd.c (dd_copy): Likewise.
6181 * src/pr.c (first_last_page, main, getoptarg): Likewise.
6182 * src/tr.c (main): Likewise.
6183 * src/date.c (main): Don't assume EXIT_FAILURE == 1, as
6184 POSIX doesn't require it.
6185 * src/dd.c (write_output, skip, dd_copy): Likewise.
6186 * src/df.c (main): Likewise.
6187 * src/id.c (main): Likewise.
6188 * src/install.c (main): Likewise.
6189 * src/ln.c (main): Likewise.
6190 * src/ls.c (main): Likewise.
6191 * src/mv.c (main): Likewise.
6192 * src/shred.c (main): Likewise.
6194 * src/env.c (main): Exit with status 1, not 2, on errors detected
6196 * src/hostname.c (main): Likewise.
6197 * src/nl.c (main): Likewise.
6198 * src/stty.c (main): Likewise.
6200 * src/expr.c (EXPR_FAILURE): Renamed from EXPR_ERROR, for
6201 consistency with the other programs' naming conventions.
6204 * src/factor.c (main): Do not report a usage error simply
6205 because stdin has bad numbers.
6207 * src/id.c (problems): Now a boolean int, not a counter,
6208 so that we don't have to worry about int overflow. All uses changed.
6209 * src/touch.c (err): Likewise.
6211 * src/md5sum.c (main): Use int, not size_t, to store boolean int.
6213 * src/mkfifo.c (main): Exit with status 1, not 4, if not implemented.
6214 * src/mknod.c: Likewise.
6216 * src/nice.c (main): Exit with status EXIT_FAIL, not EXIT_FAILURE,
6217 on error; this is in case EXIT_FAILURE is unusual.
6218 * src/su.c (main): Likewise.
6220 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE): Remove; all uses
6221 changed to EXIT_CANNOT_INVOKE.
6223 * src/printenv.c (PRINTENV_FAILURE): New constant.
6224 (main): Exit with status PRINTENV_FAILURE, not EXIT_FAILURE, on
6225 command-line syntax problems.
6227 * src/rmdir.c (remove_parents): Don't set 'fail' to a negative number.
6228 (main): Avoid integer overflow when seeing whether errors occurred.
6230 * src/seq.c (print_numbers): Now returns void, not (zero) int.
6231 All callers changed.
6232 (main): Remove unused local variable 'errs'. Always exit successfully
6233 if we reach the end.
6235 * src/setuidgid.c (SETUIDGID_FAILURE): Renamed from FAIL_STATUS,
6236 for consistency with other programs here. All uses changed.
6237 (main): Use 'error' to exit rather than invoking 'exit' here.
6239 * src/sort.c: Don't include <assert.h>.
6240 (SORT_OUT_OF_ORDER, SORT_FAILURE): Now enums, not macros.
6241 (usage): Don't use 'assert'.
6242 (main): Remove redundant assignment to exit_failure.
6244 * src/system.h (EXIT_FAIL, EXIT_CANNOT_INVOKE, EXIT_ENOENT):
6246 (initialize_exit_failure): New inline function.
6247 Include exitfail.h here, since we refer to exit_failure.
6248 All callers changed to not include exitfail.h.
6250 * src/tty.c (TTY_FAILURE, TTY_WRITE_ERROR): New enum values;
6251 substitute them for the corresponding integer constants.
6253 * tests/help-version (expected_failure_status_date): Remove, as
6254 'date' is now normal.
6255 (expected_failure_status_nohup): New var.
6257 2004-01-21 Jim Meyering <jim@meyering.net>
6259 * tests/touch/relative: Remove `command' syntax.
6260 Thanks to Nelson H. F. Beebe and Paul Eggert.
6262 * tests/touch/relative: Test only year/month/day, not hours/min/sec,
6263 so as to avoid problems with systems using TAI clocks.
6264 Although it's no longer necessary, set TZ=UTC0 also for the
6265 initial touch command. Reported by Paul Jarc here:
6266 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/1504
6268 2004-01-20 Diego Biurrun <diego@biurrun.de>
6270 * src/dircolors.hin: Add .mov to the list of media files.
6272 2004-01-19 Paul Eggert <eggert@twinsun.com>
6274 * tests/touch/relative: Use TZ=UTC0, not TZ=utc (which isn't
6275 portable). Problem reported by Christian Krackowizer. Also, use
6276 +0000 rather than +0 to specify a time zone, as the documentation
6277 requires four digits.
6279 2004-01-19 Jim Meyering <jim@meyering.net>
6281 * tests/mv/hard-4: Run envvar-check in case SIMPLE_BACKUP_SUFFIX is set.
6282 * tests/mv/backup-is-src: Likewise.
6283 Problem reported by Peter Horst
6285 2004-01-17 Jim Meyering <jim@meyering.net>
6287 * announce-gen (print_changelog_deltas): Use .sig suffix, not .asc.
6291 2003-12-15 Paul Eggert <eggert@twinsun.com>
6293 * NEWS, doc/coreutils.texi: touch -r and -d can now both be specified,
6294 with -r specifying the origin for -d.
6295 * src/touch.c (flexible_date): Remove static var.
6296 (get_reldate): New function.
6297 (main): Use it, to implement this new behavior.
6299 2004-01-16 Jim Meyering <jim@meyering.net>
6301 * tests/touch/relative: New test for the above.
6302 * tests/touch/Makefile.am (TESTS): Add relative.
6304 2004-01-13 Jim Meyering <jim@meyering.net>
6306 * src/system.h: Include contents of sys2.h.
6307 * src/sys2.h: Remove file.
6308 * src/Makefile.am (noinst_HEADERS): Remove sys2.h.
6310 * Use automake-1.8.2. Regenerate dependent files.
6312 * Update to gettext-0.13.1.
6313 * configure.ac: Use gettext-0.13.1.
6314 * .x-sc_space_tab: Add m4/po.m4 to the list of exceptions.
6316 2004-01-12 Jim Meyering <jim@meyering.net>
6318 * Makefile.maint (%.sig): Use .sig suffix rather than .asc.
6320 * Makefile.maint (po-check): Ensure that cvsu works before using it.
6321 Reported by Alexandre Duret-Lutz.
6323 * src/tail.c (main): Warn about following stdin only when it's a tty.
6325 * configure.ac: Use gl_DEFAULT_POSIX2_VERSION.
6327 2004-01-10 Jim Meyering <jim@meyering.net>
6329 * tests/misc/stat-fmt: Use backticks, not `$()' notation.
6331 2004-01-09 Jim Meyering <jim@meyering.net>
6333 * configure.ac: Quote underquoted `jm_DUMMY_1' to avoid new warning.
6335 2004-01-08 Jim Meyering <jim@meyering.net>
6337 * src/stat.c (human_fstype): Use %lx, not %x format for `unsigned long'.
6338 From Andreas Schwab.
6340 * tests/Makefile.am (TESTS_ENVIRONMENT): Remove `/vg' (prerelease test
6341 remnant) from PATH component. That would cause tests in this directory
6342 not to run the just-built binaries, but rather whatever happened
6343 to be in one's PATH. Reported by Christian Krackowizer.
6345 2004-01-04 Jim Meyering <jim@meyering.net>
6347 * src/csplit.c (new_control_record): Use x2nrealloc
6348 rather than xrealloc.
6350 * src/cp.c (re_protect): Use ASSIGN_STRDUPA rather than
6352 (make_path_private): Likewise.
6354 2004-01-03 Jim Meyering <jim@meyering.net>
6356 * src/paste.c: Use `bool' (not int) as the type for a few
6358 (collapse_escapes): Rewrite to set globals rather than modifying
6360 Use size_t (not int) for all counters and related index variables.
6361 (paste_parallel): Remove needless complexity of
6362 using xrealloc in the loop; just allocate the buffers up front.
6363 Free the two temporary buffers.
6364 Move declarations of locals `down' into scope where used.
6365 (paste_serial): Remove `register' attributes.
6366 (main): Simplify delim-related code.
6367 Free `delims', now that it's malloc'd.
6369 2004-01-02 Jim Meyering <jim@meyering.net>
6371 * src/chroot.c: Include "quote.h".
6372 (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): Define.
6373 (main): Exit with status of 127, not 1, for too-few-args,
6374 chroot failure, or chdir failure.
6375 Give a better diagnostic upon execvp failure.
6377 * src/du.c (usage): Mention that, with its current meaning,
6380 * src/tail.c (main): Warn about following stdin when it's a tty.
6381 Fail when following by name but no names are specified.
6383 2003-12-30 Jim Meyering <jim@meyering.net>
6385 * src/fold.c (main): Use memcpy, not strcpy.
6387 * src/copy.c (copy_internal): Use ASSIGN_STRDUPA rather than
6390 2003-12-28 Jim Meyering <jim@meyering.net>
6392 * src/unexpand.c (n_tabs_allocated): New global.
6393 (add_tabstop): Use x2nrealloc rather than xrealloc.
6394 * src/expand.c: Likewise.
6396 * tests/misc/expand: New file.
6397 * tests/misc/Makefile.am (TESTS): Add expand.
6399 * src/sort.c (add_temp_dir): Use x2nrealloc rather than xrealloc.
6400 (fillbuf): Use x2nrealloc rather than xrealloc.
6401 (sort): Use xnmalloc rather than xmalloc.
6404 2003-12-27 Jim Meyering <jim@meyering.net>
6406 * src/tee.c (tee): Use xnmalloc rather than xmalloc.
6408 2003-12-29 Paul Eggert <eggert@twinsun.com>
6410 * NEWS: Remove support for join -j1 FIELD, -j2 FIELD, and -o LIST1
6411 LIST2 in POSIX 1003.1-2001 hosts, as required by POSIX.
6413 * doc/coreutils.texi (join invocation): Remove documentation
6414 accordingly. Document that -t makes all separators significant.
6416 * src/join.c: Include posixver.h.
6417 (obsolete_usage): New var.
6418 (longopts): Put obsolete options first.
6419 (OBSOLETE_LONG_OPTIONS): New constant.
6420 (get_option, add_file_name): New functions.
6421 (main): Use them to support new behavior.
6422 (usage): Remove documentation for -j1 FIELD and -j2 FIELD.
6423 Do not mark -j FIELD as obsolescent; it is longstanding
6424 UNIX tradition and is a valid extension to POSIX.
6426 * tests/join/Test.pm (tv): Avoid obsolete -o usage.
6428 2003-12-28 Paul Eggert <eggert@twinsun.com>
6430 * src/join.c (add_field_list): Don't use alloca with unbounded
6431 size; just modify the argument, which is no longer const *.
6433 Various other minor cleanups, mostly to avoid the need for casts.
6435 (extract_field): Renamed from ADD_FIELD, as it's now a function.
6437 (struct field.beg): Now char *, not unsigned char const *. All
6438 uses changed. It shouldn't be const since xmemcoll writes on its
6440 (extract_field): Likewise, for 2nd arg.
6441 (keycmp): Remove now-unnecessary cast of xmemcoll args.
6443 (is_blank): New function, to avoid need to cast arg to unsigned char.
6444 (extract_field): Use it.
6446 (xfields): Rewrite pretty much from scratch.
6448 (hard_LC_COLLATE): Now bool, not int.
6449 (get_line, getseq, add_field_list): Now returns bool, not int.
6450 (decode_field_spec, add_field_list): Return true on success (not
6451 false), for consistency with the rest of the code. All uses changed.
6453 (tab): Now char, not unsigned char. This wasn't 100% necessary
6454 but is slightly cleaner.
6455 (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler.
6457 (empty_filler): Now const *.
6459 (make_blank): Remove; wasn't needed. Remove all calls.
6460 (main): Don't set uni_blank.nfields; zero is fine.
6462 2003-12-27 Jim Meyering <jim@meyering.net>
6464 * src/join.c: Include "quote.h".
6465 (min, max): Remove definitions.
6466 Make a few function parameters and corresponding
6467 locals `const'. Use bool for boolean variables.
6468 Use size_t (not int) for all counters and related index variables.
6469 (prjoin): Remove now-useless assertion.
6470 (string_to_join_field): New function.
6471 (main): Accept join fields as large as SIZE_MAX.
6472 (keycmp): Rename `min' to MIN and max to MAX.
6474 2003-12-26 Jim Meyering <jim@meyering.net>
6476 fold -s didn't work on e.g., alpha-based systems.
6477 * src/fold.c (fold_file): Adjust types (int->size_t) so that using
6478 x2nrealloc works properly on systems with differing sizes for int
6479 and size_t. Reported by Nelson Beebe.
6481 * src/fold.c: Use `bool' (not int) as the type for a few
6484 2003-12-23 Paul Eggert <eggert@twinsun.com>
6486 * src/ls.c (length_of_file_names_and_frills):
6487 Remove forward decl; not needed.
6488 (print_file_name_and_frills, length_of_file_name_and_frills):
6489 With -m, don't output spaces before inum or size.
6490 (print_with_commas): Don't output space just before newline.
6492 2003-12-24 Jim Meyering <jim@meyering.net>
6494 * tests/ls/Makefile.am (TESTS): Add m-option.
6495 * tests/ls/m-option: New file. Test for above fixes.
6497 2003-12-20 Jim Meyering <jim@meyering.net>
6501 * src/pr.c: Change type of global, buff_allocated, to size_t.
6503 * src/join.c [struct seq]: Change types of members count and alloc
6504 from `int' to `size_t'.
6506 * tests/Makefile.am (root-hint): Tweak wording.
6508 * src/du.c: Accept new option (-0, --null) that makes it so each
6509 output line is NUL-terminated rather than newline-terminated.
6511 * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync.
6512 Reported by Volker Paul.
6513 * tests/dd/Makefile.am (TESTS): Add unblock-sync.
6514 * tests/dd/unblock-sync: New test for the above.
6516 2003-12-19 Jim Meyering <jim@meyering.net>
6518 * tests/misc/nohup: Double quote back-ticked expression,
6519 in case it ends up having an unexpected value.
6521 * tests/ls/no-arg: Use ls's -1 option in both runs.
6523 * src/du.c (fts_debug): New global.
6524 (FTS_CROSS_CHECK, DEBUG_OPT): Define.
6525 (main): Make fts use FTS_TIGHT_CYCLE_CHECK.
6526 (main) [DU_DEBUG]: Accept -d option.
6528 2003-12-18 Jim Meyering <jim@meyering.net>
6530 * src/ls.c (format_user): Increment dired_pos via two statements,
6531 `dired_pos += width; dired_pos++;' rather than one,
6532 `dired_pos += width + 1;' since the latter could conceivably overflow.
6533 (format_group): Likewise.
6536 * configure.ac: Require automake-1.8.
6538 2003-12-12 Jim Meyering <jim@meyering.net>
6540 * Use automake-1.8. Regenerate dependent files.
6542 2003-12-08 Jim Meyering <jim@meyering.net>
6544 * Makefile.maint (news-date-check): New rule.
6545 (alpha beta major): Depend on it.
6547 2003-12-03 Paul Eggert <eggert@twinsun.com>
6549 * NEWS: ls -l (and similar options) now adjust all columns to
6550 fit the data. Generalized from a suggestion by Leah Q for file sizes.
6551 * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
6552 (format_user_width, format_group_width, unsigned_file_size,
6553 format_group): New functions.
6554 (block_size_width): Renamed from block_size_size.
6555 (inode_number_width, nlink_width, owner_width, group_width,
6556 author_width, major_device_number_width, minor_device_number_width,
6557 file_size_width): New vars.
6558 (clear_files): Initialize them.
6559 (gobble_file): Set them. Don't ceiling block_size_width to 7.
6560 (print_long_file): Use them.
6561 (gobble_file): Use a new local variable 'f' to make the code
6562 smaller and more consistent with other functions.
6563 (format_user): Output to stdout, not to a buffer, so that we
6564 don't have to worry about buffer overrun. Update dired_pos.
6565 (print_long_file): Don't put owner, group, author into buffer;
6566 just print them directly. Don't assume link counts and
6567 major and minor numbers fit into unsigned long int.
6568 * tests/cp/same-file, tests/mv/part-symlink: Don't assume that
6569 'ls' output is fixed-width.
6571 2003-12-02 Jim Meyering <jim@meyering.net>
6573 * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h.
6575 2003-11-27 Jim Meyering <jim@meyering.net>
6577 * Use automake-1.7f. Regenerate dependent files.
6579 2003-11-24 Paul Eggert <eggert@twinsun.com>
6581 Parse floating-point operands and options in the C locale.
6582 POSIX requires this for printf, and we might as well be
6583 consistent elsewhere (tail, sleep, seq).
6585 * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer
6586 needed now that we assume C89. Include "c-strtod.h".
6587 (xstrtod): Call c_strtod, not strtod.
6588 * src/sleep.c: Include "c-strtod.h".
6589 (main): Update xstrtod call to include new argument, c_strtod.
6590 * src/seq.c (scan_double_arg): Likewise.
6591 * src/tail.c (parse_options): Likewise.
6593 2003-11-24 Jim Meyering <jim@meyering.net>
6595 * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM).
6596 Reported by Mark Conty.
6598 2003-11-22 Jim Meyering <jim@meyering.net>
6600 * Makefile.maint (sc_xalloc_h_in_src): Remove rule. Subsumed by...
6601 (sc_system_h_headers): Do this test only if sys2.h exists.
6603 2003-11-20 Jim Meyering <jim@meyering.net>
6605 * tests/help-version: Ensure that the bug-reporting address is
6606 included in the --help output for every program.
6607 * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.
6609 * src/ptx.c (usage): Output bug-reporting address.
6610 Reported by Dan Jacobson.
6612 2003-11-19 Jim Meyering <jim@meyering.net>
6614 * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted
6615 on the join fields. Suggestion from Bruce Robertson.
6617 2003-11-18 Jim Meyering <jim@meyering.net>
6619 `od -c -w9999999' could segfault
6620 * src/od.c (dump): Use xnmalloc/free, not alloca.
6622 2003-11-16 Jim Meyering <jim@meyering.net>
6624 * Use autoconf-2.59. Regenerate dependent files.
6626 * tests/du/hard-link: Minor tweak: use mkdir -p.
6628 Fix read-from-free'd-buffer error detected by valgrind.
6629 * src/csplit.c (remove_line): Don't return a pointer to data in
6630 a freed buffer. Instead, arrange to free the buffer on the
6633 * tests/misc/csplit: New test for above fix.
6635 2003-11-11 Jim Meyering <jim@meyering.net>
6637 * src/ls.c (extract_dirs_from_files): Avoid useless copy operations.
6638 This avoids a warning from valgrind about memcpy with overlapping
6639 source and destination.
6641 * configure.ac: Require automake-1.7.8.
6643 2003-11-09 Jim Meyering <jim@meyering.net>
6645 * Use automake-1.7.9. Regenerate dependent files.
6647 * src/rm.c: Support new options: --preserve-root and --no-preserve-root.
6648 * src/chown.c: Likewise.
6650 * src/chown-core.c: Include "root-dev-ino.h".
6651 (chopt_init): Initialize new member.
6652 (change_file_owner): Support rm's new --preserve-root option.
6654 * src/remove.c: Include "root-dev-ino.h".
6655 (remove_cwd_entries): Remove now-obsolete FIXME comment.
6656 (remove_dir): Support rm's new --preserve-root option.
6658 * src/chown.c: Include "root-dev-ino.h".
6659 Add new options: --preserve-root and --no-preserve-root.
6661 * src/chmod.c: Include "root-dev-ino.h".
6662 (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
6663 ROOT_DEV_INO_WARN macros.
6664 (get_root_dev_ino): Remove function definition, now that it's
6665 been moved to a separate file.
6666 (usage): Describe new options.
6668 * src/mv.c (rm_option_init): Initialized new member.
6670 * src/remove.h: Include "dev-ino.h".
6671 (struct rm_options): Add new member: root_dev_ino.
6672 * src/chown-core.h: Include "dev-ino.h".
6673 (struct Chown_option): Add new member: root_dev_ino.
6675 2003-11-06 Jim Meyering <jim@meyering.net>
6677 * src/paste.c (paste_parallel): Use `sizeof *var' rather than
6678 hard-coding `sizeof FILE*'.
6680 2003-11-05 Dennis Smit <ds@nerds-incorporated.org>
6682 * src/wc.c (main): Free `fstatus' so there is no confusion about
6683 whether it's leaked or not.
6684 * src/who.c (who): Likewise for `utmp_buf'.
6686 2003-11-05 Paul Eggert <eggert@twinsun.com>
6688 Fix 'cut' problems with size_t overflow and unsigned int.
6689 More generally, resize integer variables to fit use more precisely.
6690 * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens.
6691 (struct range_pair): Make members to be of type size_t, not unsigned.
6692 (max_range_endpoint, eol_range_start): Now size_t, not unsigned.
6693 (suppress_non_delimited, output_delimiter_specified,
6694 have_read_stdin, print_kth, set_fields): Now bool, nt int.
6695 (delim): Now unsigned char, not int.
6696 (mark_printable_field, is_printable_field, is_range_start_index,
6697 set_fields, set_fields, cut_bytes, cut_fields):
6698 Use size_t, not unsigned, for field and byte counts.
6699 (hash_int): Use uintptr_t, not unsigned, for pointers converted
6700 to integers. This squeezes more info out of them.
6701 (set_fields, cut_bytes, cut_fields, main):
6702 Use bool, not int, for booleans.
6703 (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc.
6705 2003-11-05 Paul Eggert <eggert@twinsun.com>
6707 * man/Makefile.am (check-programs-vs-x):
6708 Work even if $(programs) contains '$'.
6709 Work even if 'missing=1' in environment.
6710 Don't report an error simply because $(programs) outputs nothing.
6712 2003-11-05 Jim Meyering <jim@meyering.net>
6714 * Use autoconf-2.58. Regenerate dependent files.
6716 * src/tr.c (spec_init): Fix typo in last change.
6718 * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in
6719 call to variadic version_etc function, so that it works even on systems
6720 for which sizeof char* != sizeof int.
6721 * src/true.c (main): Likewise.
6722 * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c:
6723 * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c:
6724 * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c:
6725 * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c:
6726 Similarly, cast NULL to `(char *)' in call to variadic function,
6727 parse_long_options, so that it works even on systems for which
6728 sizeof char* != sizeof int.
6729 A similar problem was reported by Harti Brandt in
6730 http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html.
6732 * src/users.c (users): Free `utmp_buf' explicitly so that people
6733 don't mistake this for a real leak.
6734 Patch by Dennis Smit <ds@nerds-incorporated.org.
6736 2003-11-04 Paul Eggert <eggert@twinsun.com>
6738 * README: Document _POSIX2_VERSION.
6740 2003-11-04 Jim Meyering <jim@meyering.net>
6742 * src/tac.c (memrchr): Remove #if-0'd function.
6743 (tac_stdin_to_mem): Clean up #if-0'd code.
6745 * src/od.c (decode_format_string): Remove unnecessary casts.
6746 Use more maintainable `sizeof *var'.
6747 (main): Call decode_format_string rather than decode_one_format,
6748 now that `spec' may be NULL.
6750 * src/chmod.c (AUTHORS): Add my name.
6752 * src/split.c (next_file_name): Use `sizeof *var' rather than
6753 hard-coding `sizeof size_t'.
6755 * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...).
6757 * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc,
6758 to avoid potential overflow in pointer arithmetic.
6759 (set_fields): Use not `1', but rather `sizeof *printable_field' as
6760 second argument to xcalloc.
6761 * src/od.c (decode_format_string, dump_strings): Use x2nrealloc
6762 rather than xrealloc.
6763 * src/date.c (show_date): Likewise.
6764 * src/join.c (ADD_FIELD, initseq, getseq): Likewise.
6765 * src/pr.c (store_char): Likewise.
6766 * src/fold.c (fold_file): Likewise.
6768 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
6769 type changes (unsigned int -> size_t) in hash.c.
6770 * src/cp-hash.c (src_to_dest_hash): Likewise.
6771 * src/du.c (entry_hash): Likewise.
6772 * src/ls.c (dev_ino_hash): Likewise.
6773 * src/cut.c (hash_int): Likewise. Declare function as static.
6775 2003-11-03 Jim Meyering <jim@meyering.net>
6777 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
6778 * tests/misc/fold: Fail the test immediately if we're not running
6779 the expected version of fold.
6781 2003-11-02 Jim Meyering <jim@meyering.net>
6783 * src/tr.c (append_normal_char, append_range, append_char_class)
6784 (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var'
6785 rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable
6786 and usually shorter.
6787 * src/copy.c (copy_internal): Likewise.
6788 * src/join.c (initseq, add_field, make_blank): Likewise.
6789 * src/od.c (main): Likewise.
6790 * src/cp.c (make_path_private): Likewise.
6791 * src/tsort.c (new_item, record_relation): Likewise.
6793 * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise.
6794 (main): Also remove anachronistic cast of xmalloc return value.
6795 * src/ptx.c (alloc_and_compile_regex, main): Likewise.
6796 (main): Also remove anachronistic cast of xmalloc return value.
6797 * src/sort.c (inittables): Likewise.
6798 (sort): Also Split a long line.
6800 2003-10-25 Jim Meyering <jim@meyering.net>
6802 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
6803 type changes (unsigned int -> size_t) in hash.c.
6804 * src/cp-hash.c (src_to_dest_hash): Likewise.
6805 * src/du.c (entry_hash): Likewise.
6806 * src/ls.c (dev_ino_hash): Likewise.
6807 * src/cut.c (hash_int): Likewise. Declare function as static.
6809 2003-10-21 Jim Meyering <jim@meyering.net>
6811 Don't fail when run with VERBOSE=yes.
6812 * tests/chgrp/basic: Do `set +x' before starting the subshell
6813 from which we invoke chgrp. Otherwise, the output from the
6814 VERBOSE=yes-induced `set -x' would result in spurious differences.
6815 Reported by Russel Coker via Michael Stone.
6817 2003-10-19 Jim Meyering <jim@meyering.net>
6819 chmod now uses fts to perform a directory traversal when -R is
6820 specified. Before, it operated on full path names, and as such
6821 would encounter the PATH_MAX (often 4096) limit.
6823 * src/chmod.c: Include "xfts.h".
6824 (process_file): Rename from change_file_mode.
6825 Adapt to be used with fts.
6826 (process_files): New function.
6828 2003-10-18 Jim Meyering <jim@meyering.net>
6830 * tests/du/deref-args: Ensure that du -D now dereferences all
6831 symlinks specified on the command line, not just those that
6832 reference directories.
6834 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
6835 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
6836 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
6837 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
6838 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
6839 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
6840 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
6841 * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
6842 of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
6843 Update the call to parse_long_options so that `AUTHORS, NULL' are the
6845 * src/true.c (main): Append NULL to version_etc argument list.
6846 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
6848 2003-10-17 Andreas Schwab <schwab@suse.de>
6850 * tests/mk-script: Get $srcdir from first parameter instead of
6852 (main): Update usage.
6854 * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as
6855 first argument of mk-script.
6856 ($(srcdir)/Makefile.am): Likewise. Prepend $(srcdir) to target.
6858 2003-10-17 Jim Meyering <jim@meyering.net>
6860 * src/mv.c (usage): Tweak descriptions of -i and -f so that the
6861 generated `man' page is more readable. Suggestion from Dan Jacobson.
6863 * src/chown-core.c (change_file_owner): Handle the cases in
6864 which fts_info indicates an error with the given entry.
6866 * src/du.c (main): Simply assign to bit_flags.
6867 Don't bother with bit arithmetic.
6869 * tests/chmod/no-x: New file.
6870 * tests/chgrp/no-x: New file.
6871 * tests/chmod/Makefile.am (TESTS): Add no-x.
6872 * tests/chgrp/Makefile.am (TESTS): Likewise.
6874 * src/du.c: Include "xfts.h".
6875 (du_files): Use xfts_open, rather than fts_open.
6876 * src/chown-core.c (chown_files): Likewise.
6878 2003-10-16 Jim Meyering <jim@meyering.net>
6880 * src/chgrp.c (main): Simply assign to bit_flags.
6881 Don't bother with bit arithmetic.
6882 * src/chown.c (main): Likewise.
6883 Rename a couple of local variables.
6884 Remove unnecessary casts.
6886 * src/tail.c (start_bytes): Rename local, remainder, to avoid
6887 gcc's warning about shadowing a global.
6889 2003-10-15 Jim Meyering <jim@meyering.net>
6891 chown and chgrp now accept POSIX-mandated -H, -L, -P options and
6892 use fts to perform a directory traversal when -R is specified.
6893 Before, they operated on full path names, and as such would
6894 encounter the PATH_MAX (often 4096) limit.
6895 They are more efficient. For example, before, chgrp -R would
6896 take almost 5 seconds to change about 2000 directories and fail
6897 (with `File name too long'), while now it succeeds on a hierarchy
6898 of depth 20,000 in 1/10 the time.
6900 * src/chown.c: Include "userspec.h" and "fts_.h".
6901 (WRITTEN_BY): Add my name.
6902 (getpwnam, getgrnam, getgrgid): Remove declarations.
6903 (endpwent): Remove definition.
6905 (main): Handle new options.
6906 Call new function, chown_files rather than change_file_owner.
6908 * src/chgrp.c: Include "fts_.h".
6909 (WRITTEN_BY): Add my name.
6910 (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of
6913 (main): Handle new options.
6914 Call new function, chown_files rather than change_file_owner.
6916 Rewrite to iterate through hierarchies using fts rather than
6917 via explicit recursion.
6918 * src/chown-core.c: Include "fts_.h"
6919 (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
6920 on a single file at a time.
6921 (chown_files): New function.
6922 * src/chown-core.h [enum Dereference_symlink]: Remove declaration.
6923 [struct Chown_option] (recurse, force_silent): Change type to `bool'.
6924 [struct Chown_option] (dereference): Remove member with ambiguous name.
6925 [struct Chown_option] (affect_symlink_referent): New member.
6926 (chown_files): New prototype.
6928 * tests/chgrp/recurse: Update tests accordingly.
6929 * tests/chgrp/posix-H: New tests for the above.
6930 * tests/chgrp/Makefile.am (TESTS): Add posix-H.
6932 * src/ln.c (usage): Clarify that --directory, -d, -F probably won't
6933 work even for superuser. Suggestion from Dan Jacobson.
6935 2003-10-14 Paul Eggert <eggert@twinsun.com>
6937 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
6939 * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h,
6940 lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib.
6941 * src/sort.c (parse_field_count): Handle the case where overflow
6942 and invalid suffix char are both reported.
6944 2003-10-14 Jim Meyering <jim@meyering.net>
6946 * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the
6947 warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
6950 2003-10-13 Paul Eggert <eggert@twinsun.com>
6952 Fix to avoid a denial-of-service attack if the display width is
6953 enormous. Also, clean up the code a bit by removing duplicate code.
6955 * src/ls.c (init_column_info): Remove forward decl; no longer needed.
6956 (calculate_columns): New function, that contains code that used
6957 to be common to print_many_per_line and print_horizontal.
6958 (print_many_per_line, print_horizontal): Use it.
6959 (decode_switches): Set max_idx here, not in calculate_columns.
6960 (print_current_files): Don't call init_column_info; calculate_columns
6962 (init_column_info): Don't allocate a lot more space than is needed
6963 to represent the current set of files. Allocate all the new
6964 size_t cells in one call to xnmalloc, rather than a row at a time.
6966 2003-10-13 Jim Meyering <jim@meyering.net>
6968 * src/ls.c (init_column_info): Add another FIXME comment.
6970 2003-10-13 Paul Eggert <eggert@twinsun.com>
6972 Fix address-arithmetic bug in 'ls', reported by Georgi Guninski.
6973 Remove several arbitrary limits on hosts where int cannot represent
6976 * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent,
6977 nfiles, files_index, tabsize, line_length, struct column_info.line_len,
6978 struct column_info.col_arr[0], max_idx):
6979 Now size_t, not int.
6980 (get_funky_string): Return bool indicating success, instead of
6981 a negative count to indicate failure. Store number of columns
6982 through new parameter OUTPUT_COUNT; that way, they can never
6983 go negative. Change equals_end from int to bool. All uses
6985 (struct column_info.valid_len): Now bool, not int. All uses changed.
6986 (dired_dump_obstack, get_funky_string, clear_files,
6987 extract_dirs_from_files, print_current_files,
6988 print_many_per_line, print_horizontal, init_column_info,
6989 put_indicator, length_of_file_name_and_frills,
6990 print_with_commas): Use size_t, not int, for local variables
6992 (decode_switches): Decode sizes using xstrtoul, not xstrtol.
6993 Check for TIOCGWINSZ returing negative values (or values greater
6995 (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
6997 Use xmalloc and xnmalloc, not XMALLOC.
6998 (gobble_file): Use xnrealloc, not XREALLOC.
6999 (print_color_indicator): Remove now-unnecessary cast to size_t.
7001 2003-10-12 Paul Eggert <eggert@twinsun.com>
7003 * tests/du/no-x: Change wording of diagnostic to match latest du.c.
7004 * tests/sort/sort-tests: Remove from CVS; assume that people
7005 brave enough to check coreutils out from CVS can rebuild it.
7007 2003-10-12 Jim Meyering <jim@meyering.net>
7009 New options: --preserve-root and --no-preserve-root.
7010 * src/chmod.c (change_file_mode): Honor new option.
7011 (change_file_mode): Strip trailing slashes on directory
7012 argument passed to change_dir_mode.
7013 (get_root_dev_ino): New function.
7014 (main): Initialize global, root_dev_ino.
7016 * src/copy.c (copy_internal): Don't #ifdef-out simple uses of
7017 S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined
7019 * src/chmod.c (change_file_mode): Likewise.
7021 2003-10-08 Jim Meyering <jim@meyering.net>
7023 * src/csplit.c (main): Remove obsolete FIXME.
7025 2003-10-07 Jim Meyering <jim@meyering.net>
7027 * Use automake-1.7.8. Regenerate dependent files.
7029 2003-09-29 Paul Eggert <eggert@twinsun.com>
7033 * doc/coreutils.texi (csplit invocation):
7034 The regexp offset need not have a sign; POSIX requires support
7035 for signless offets.
7037 Be more careful about int widths. For example, remove some
7038 arbitrary limits by replacing 'unsigned' with 'size_t',
7039 'uintmax_t', etc. Use standard bool rather than a homegrown type.
7040 * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
7041 * src/csplit.c (FALSE, TRUE, boolean): Remove. All uses changed
7042 to <stdbool.h> usage.
7043 (struct control): offset is now intmax_t, not int.
7044 repeat_forever is now bool, not int.
7045 (struct cstring): len is now size_t, not unsigned int.
7046 (struct buffer_record): bytes_alloc, bytes_used, num_lines are now
7047 size_t, not unsigned. start_line, first_available are now
7048 uintmax_t, not unsigned.
7049 (hold_count, control_used): Now size_t, not unsigned.
7050 (last_line_number, current_line, bytes_written):
7051 Now uintmax_t, not unsigned.
7052 (save_to_hold_area, red_input, keep_new_line, record_line_starts,
7053 create_new_buffer, get_new_buffer, load_buffer, find_line,
7054 process_regexp, split_file, new_control_record, extract_regexp,
7055 get_format_width, get_format_prec, max_out):
7056 size args, locals, and returned values are now size_t, not unsigned
7058 (get_first_line_in_buffer, find_line, write_to_file,
7059 handle_line_error, process_line_count, regexp_error, process_regexp,
7061 File line, byte, and repetition counts are now uintmax_t, not unsigned.
7062 (check_for_offset): Don't require a sign before the offset.
7063 Use xstrtoimax to do the real work.
7064 (extract_regexp): Remove harmful cast of size to unsigned.
7065 256 -> 1<<CHAR_BIT, for clarity.
7066 (get_format_flags): Return at most 3, to avoid worries about overflow.
7068 (bytes_to_octal_digits): Remove.
7070 (cleanup): Don't check whether output_stream is NULL, since
7071 close_output_file does that for us.
7073 (new_line_control, create_new_buffer): Use "foo *p = xmalloc
7074 (sizeof *p);" instead of the more long-winded alternatives.
7076 (get_new_buffer): Use O(1) algorithm for resizing a buffer
7077 to a much larger size, instead of an O(N) algorithm.
7079 (process_regexp): Use plain NULL rather than casted 0.
7081 (make_filename): Use %u, not %d, to format unsigned file number.
7083 (new_control_record): Use xrealloc exclusively, since it handles
7086 (extract_regexp): Change misspelled word in diagnostic.
7088 (get_format_width): Even if a minimum field width is specified,
7089 allow room for enough octal digits to represent the value of
7090 the maximum representible integer. This fixes a potential
7091 buffer overrun. Calculate this room at compile-time, not
7092 at run-time; this removes the need for bytes_to_octal_digits.
7093 Check for overflow; this removes a FIXME.
7095 (get_format_prec): Don't allow precision to be signed; it's
7096 not ANSI. Check for overflow. Remove hardcoded "11" as
7097 default precision; this fixes a potential buffer overrun
7098 on hosts with wider size_t.
7100 (get_format_conv_type): Change local variable to be of type
7101 unsigned char, not int; this removes a potential subscript
7102 violation on hosts where char is signed.
7104 (max_out): Replace "for (;*p;)" with more-standard "while (*p)".
7105 Allow "%%" in format. Don't overflow when
7106 counting lots of percents.
7108 (usage): Default sprintf format is %02u, not %d.
7110 2003-10-05 Jim Meyering <jim@meyering.net>
7112 * src/chown-core.c (change_file_owner): Remove set-but-not-used local.
7114 * src/du.c (du_files): Mark diagnostic for translation.
7116 2003-10-04 Jim Meyering <jim@meyering.net>
7118 * src/du.c (du_files): Ignore any failure of fts_close.
7119 Give better diagnostics for failed fts_open.
7121 * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition.
7123 Deprecate existing use of -H (aka --si).
7124 * src/du.c (enum) [HUMAN_SI_OPTION]: New member.
7125 [long_options]: Use HUMAN_SI_OPTION, not 'H'.
7126 (main): Warn that the meaning of -H will soon change to be
7129 2003-10-03 Jim Meyering <jim@meyering.net>
7131 * src/du.c: Accept --no-dereference (-P).
7133 2003-10-02 Jim Meyering <jim@meyering.net>
7135 * tests/du/trailing-slash: Adjust for slightly different output.
7137 Rewrite du.c to use fts.
7138 * src/du.c: Include "fts_.h", not ftw.h.
7139 (opt_dereference_arguments, arg_length, suffix_length): Remove globals.
7140 (IS_FTW_DIR_TYPE): Remove definition.
7141 (IS_DIR_TYPE): Define.
7142 (is_symlink_to_dir): Remove now-unnecessary function.
7143 (process_file, du_files): Rewrite to use fts.
7145 * tests/du/inaccessible-cwd: Ensure that even when run from an
7146 inaccessible directory, du can still operate on accessible
7147 directories elsewhere.
7148 * tests/du/Makefile.am (TESTS): Add inaccessible-cwd.
7150 * tests/rm/deep-1: Ensure that du can process a hierarchy
7151 of depth 400 while using no more than 50KB of stack space.
7153 2003-10-01 Akim Demaille <akim@epita.fr>
7155 * announce-gen (print_news_deltas): New function, extracted from main.
7156 (main): Make `news_file' an array.
7157 Use '...=s' => \@var for --news and --url-directory specs.
7158 Before there were a couple of portability problems.
7160 2003-09-28 Jim Meyering <jim@meyering.net>
7162 * Makefile.maint (sc_cast_of_alloca_return_value): New rule.
7163 (syntax-check-rules): Add it.
7165 * src/copy.c: Remove unnecessary cast of alloca, since now it's
7166 guaranteed to be (void *).
7167 * src/cp.c: Likewise.
7168 * src/join.c: Likewise.
7169 * src/ln.c: Likewise.
7170 * src/ls.c: Likewise.
7171 * src/od.c: Likewise.
7172 * src/sys2.h (ASSIGN_STRDUPA): Likewise.
7174 2003-09-27 Jim Meyering <jim@meyering.net>
7176 Don't exhaust virtual memory when processing large inputs.
7177 Fix this by removing csplit's internal free-list management;
7178 instead rely on malloc for that.
7180 * src/csplit.c (free_list): Remove global.
7181 (clear_all_line_control): Remove function.
7182 (get_new_buffer): Always use create_new_buffer to obtain a
7183 new buffer, rather than searching free_list.
7184 (free_buffer): Just call free.
7185 Reported by Nikola Milutinovic.
7187 2003-09-26 Jim Meyering <jim@meyering.net>
7189 * man/rm.x: Also list `chattr' in SEE ALSO section.
7190 Suggestion from Mark Hubbart.
7192 2003-09-25 Jim Meyering <jim@meyering.net>
7194 * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now
7195 that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them.
7197 * Use autoconf-2.57d. Regenerate dependent files.
7199 2003-09-24 Jim Meyering <jim@meyering.net>
7201 Minor efficiency tweak.
7202 * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
7203 (do_link): Likewise.
7205 2003-09-23 Jim Meyering <jim@meyering.net>
7207 * src/paste.c (paste_serial): Save errno after input error,
7208 to report proper errno value.
7209 Based on a patch from Paul Eggert.
7211 * src/tee.c (tee): Adjust fwrite arguments so that the return
7212 value is the number of bytes written.
7214 2003-09-16 Paul Eggert <eggert@twinsun.com>
7216 Don't assume ferror sets errno. Bug reported by Bruno Haible.
7218 * src/comm.c (compare_files): Save errno after input error,
7219 to report proper errno value.
7220 * src/fold.c (fold_file): Likewise.
7221 * src/od.c (check_and_close, skip, read_char, read_block): Likewise.
7222 * src/unexpand.c (unexpand): Likewise.
7224 * src/csplit.c (close_output_file): Don't report bogus errno value
7225 after ferror discovers an output error. We don't know the proper
7226 errno value, since it might have been caused by any of a whole
7227 bunch of calls, and it might have been trashed in the meantime.
7228 Fixing this problem will require much more extensive changes;
7229 in the meantime just say "write error".
7230 * src/od.c (check_and_close, dump, dump_strings): Likewise.
7231 * src/uniq.c (check_file): Likewise.
7233 * src/join.c (get_line): Report error right away if I/O fails,
7234 so that the proper errno value is used.
7235 * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise.
7236 * src/tee.c (tee): Likewise.
7237 * src/uniq.c (check_file): Likewise.
7239 * src/od.c (skip): If a read fails, don't retry it later, so
7240 that we report the proper errno.
7242 * src/tac.c (tac_mem): Don't return a value; nobody uses it.
7244 * src/tee.c (tee): Once a write failure has occurred, don't bother
7245 writing anything more to that stream.
7247 * src/uniq.c (check_file): Check for ferror (stdout) even if
7250 * src/yes.c (UNROLL): Remove.
7251 (main): Exit immediately when write failure is detected.
7252 Simplify code by assigning to argv when argc == 1.
7254 2003-09-21 Paul Eggert <eggert@twinsun.com>
7256 * src/ptx.c: Switch encoding from Latin-1 to UTF-8.
7257 (WRITTEN_BY): Change "Franc,ois" (actually using
7258 c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
7261 2003-09-19 Jim Meyering <jim@meyering.net>
7263 `du -D symlink-to-dir' would mistakenly omit the slash in
7264 lines like this: 24 symlink-to-dir/subdir
7265 * src/du.c (process_file): Fix offset calculation.
7266 Reported by Jeff Sheinberg as Debian bug #211591;
7267 http://bugs.debian.org/205251
7269 * tests/du/deref-args: New file/test for the above.
7270 * tests/du/Makefile.am (TESTS): Add deref-args.
7272 * src/du.c (process_file): Remove useless disjunct.
7274 * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
7276 * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
7277 Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
7278 Mark each WRITTEN_BY string as translatable.
7280 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
7281 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
7282 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
7283 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
7284 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
7285 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
7286 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
7287 * who.c, whoami.c, yes.c: Revert yesterday's changes.
7288 Instead, a subsequent change will embed `Written by ' in
7289 each string along with the author names.
7291 * src/true.c: Revert yesterday's changes.
7292 * src/sys2.h: Likewise.
7294 2003-09-18 Jim Meyering <jim@meyering.net>
7296 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
7297 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
7298 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
7299 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
7300 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
7301 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
7302 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
7303 * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
7304 comma-separated list of strings and/or update the call to
7305 parse_long_options so that `AUTHORS, NULL' are the last parameters.
7306 * src/true.c (main): Append NULL to version_etc argument list.
7307 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
7309 * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
7310 shadowing the math function name. Also rename loga to log_a.
7312 2003-09-14 Jim Meyering <jim@meyering.net>
7314 * src/factor.c (print_factors): Give a separate diagnostic
7315 for numbers that are too large, but otherwise valid.
7316 Reported by Dániel Varga.
7318 2003-09-10 Jim Meyering <jim@meyering.net>
7320 * Use automake-1.7.7. Regenerate dependent files.
7322 * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
7323 of `fmt -1'. Using the just-built tr is a little cleaner.
7324 Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
7325 * man/Makefile.am (programs, check-x-vs-1): Likewise.
7327 2003-09-09 Jim Meyering <jim@meyering.net>
7329 * src/copy.c: Alphabetize includes.
7330 Remove duplicate inclusion of "same.h".
7332 2003-09-08 Jim Meyering <jim@meyering.net>
7334 * Makefile.maint (GZIP_ENV): Remove --rsyncable.
7335 Didn't give enough of a benefit, mainly because it's not yet
7340 * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
7341 (check-programs-vs-x): Fail if $(programs) is empty.
7343 * src/remove.c: Add a comment.
7345 2003-09-07 Jim Meyering <jim@meyering.net>
7347 * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
7348 Don't define. These symbols are no longer used.
7350 * tests/misc/tty-eof: Write ^D as \cD.
7351 Complete the change of 2003-08-02.
7353 * Makefile.maint (po-check): Use cvsu, so that a temporary source
7354 file in lib/ or src/ doesn't induce an unwarranted failure.
7355 Add a kludge to filter out the sole generated source file that
7356 also has translatable messages: src/false.c.
7358 2003-09-06 Jim Meyering <jim@meyering.net>
7360 * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
7361 (parse_options): Give a diagnostic for (but still accept) the
7362 deprecated --allow-missing option.
7364 2003-09-04 Paul Eggert <eggert@twinsun.com>
7366 Don't ignore -S if input is a pipe. Bug report by Michael McFarland in
7367 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
7369 * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the
7370 size_bound ourselves. if an input file is a pipe and the user
7371 specified a size, use that size instead of trying to guess the
7372 pipe size. This has the beneficial side effect of avoiding the
7373 overhead of default_sort_size in that case. All callers changed.
7374 (sort): Remove static var size; now done by sort_buffer_size.
7376 2003-09-05 Jim Meyering <jim@meyering.net>
7378 * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files.
7380 * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
7381 to start, rather than just .1. Upon failure, print unexpected state.
7383 2003-09-04 Paul Eggert <eggert@twinsun.com>
7385 * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
7386 SAFE_READ_ERROR to tmp->nbytes.
7387 * src/tail.c (pipe_lines, pipe_bytes): Likewise.
7389 * src/head.c (struct linebuffer): Change nbytes and nlines
7390 from unsigned int to size_t. unsigned int is safe (after the
7391 2003-09-03 patch) but size_t is cleaner.
7392 * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
7393 (pipe_bytes): Likewise for local variable 'i', which was 'int'.
7395 Standardize on BUFSIZ as opposed to other macro names and values.
7396 * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ.
7397 * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
7398 stdio.h has always defined it,
7399 and other code already assumes it's defined.
7400 * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
7401 (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
7402 (io_buf): IO_BUF_SIZE -> BUFSIZ.
7404 2003-09-04 Paul Eggert <eggert@twinsun.com>
7406 * src/seq.c (step): Default to 1.
7407 (print_numbers): Allow the output to be empty.
7408 (main): The default step is 1, even if LAST < FIRST;
7409 as per documentation.
7410 * tests/seq/basic (onearg-2): Output should be empty.
7412 2003-09-05 Jim Meyering <jim@meyering.net>
7414 * Makefile.cfg (wget_files): Temporarily disable, until master
7415 versions are restored to ftp.gnu.org.
7417 * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
7419 Make seq's --width (-w) option work properly even when the
7420 endpoint requiring the larger width is negative and smaller than
7422 * src/seq.c (get_width_format): Include `-' in the set of bytes
7423 allowed in a `simple' number (no decimal point, no exponent).
7424 Reported by Patrick Mauritz.
7426 2003-09-02 Paul Eggert <eggert@twinsun.com>
7428 * NEWS: sort -t '\0' now uses a NUL tab.
7429 sort option order no longer matters, unless POSIX requires it.
7430 * src/sort.c (usage): Say "blanks" instead of "whitespace",
7431 Similar fixes for many comments.
7432 (TAB_DEFAULT): New constant, so that we can support NUL as
7433 the field separator.
7434 (tab): Now int, not char. Initialize to TAB_DEFAULT.
7435 (specify_sort_size): If multiple sizes are specified, use the largest.
7436 (begfield, limfield): Support NUL tab char.
7437 (set_ordering): Do not let -i override -d.
7438 (main): Report an error if incompatible -o or -t options are given.
7439 Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
7441 2003-09-05 Jim Meyering <jim@meyering.net>
7443 * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
7445 2003-09-03 Andreas Schwab <schwab@suse.de>
7447 Bug report and patch here:
7448 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
7449 * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
7450 * src/head.c (elide_tail_lines_pipe): Likewise.
7452 2003-09-03 Jim Meyering <jim@meyering.net>
7454 * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
7455 small amount of code from him was first moved to lib/human.c, and was
7456 subsequently rewritten entirely.
7457 * src/df.c (AUTHORS): Likewise.
7459 2003-08-22 Lawrence Teo <lcteo@uncc.edu>
7461 * src/md5sum.c (split_3): Accept the BSD format for generic
7462 message digest modes. Currently works with BSD's MD5 and SHA1
7463 formats since these are the two algorithms presently used in
7464 coreutils. Updated comments to reflect this change.
7465 (bsd_split_3): Updated comments.
7467 * tests/md5sum/basic-1: New test to make sure that
7468 `md5sum --check' doesn't accept the BSD SHA1 format (adapted
7469 from `check-bsd' test in tests/sha1sum/basic-1).
7471 * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
7472 --check exit status and BSD SHA1 format (adapted from tests
7473 in tests/md5sum/basic-1).
7475 2003-08-30 Jim Meyering <jim@meyering.net>
7477 * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
7479 When source and destination arguments refer to the same file, reside
7480 on a partition (e.g. VFAT) on which distinct names may refer to the
7481 same directory entry (often due to variations in case), and when the
7482 link count for the file is 1, mv no longer unlinks the file. Instead,
7483 it gives the expected diagnostic that the source and destination are
7484 the same. WARNING: this is an incomplete fix. If the file happens
7485 to have a link count of 2 or greater, such an erroneous mv command
7486 will still unlink it.
7487 Although that is not possible on vfat or umsdos, it is possible on
7488 other file system types, e.g., ntfs, and hpfs.
7489 * src/copy.c (same_file_ok): Invoke same_name (which might still
7490 return false for names that refer to the same directory entry)
7491 only if the link count is 2 or more.
7492 * tests/mv/vfat: Show how to demonstrate the above problem.
7493 This test is not run.
7494 * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
7496 2003-08-27 Jim Meyering <jim@meyering.net>
7498 * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
7499 who's -l option has been eliciting an unconditional warning about
7500 this impending change since sh-utils-2.0.12 (April 2002).
7502 * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
7503 This would happen for nonempty files not ending with a newline.
7504 Reported by Dan Jacobson.
7505 * tests/misc/paste-no-nl: New file. Test for above-fixed bug.
7506 * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
7508 * src/stat.c (print_it): Avoid buffer overrun that would
7509 occur when the user-specified format string ends with `%'.
7510 Patch by Tommi Kyntola.
7511 * tests/misc/stat-fmt: New file. Test for above-fixed bug.
7512 * tests/misc/Makefile.am (TESTS): Add stat-fmt.
7514 2003-08-26 Jim Meyering <jim@meyering.net>
7516 Apply changes from bison.
7517 * GNUmakefile (SHELL): Define to `sh', if necessary.
7519 * Makefile.maint (WGETFLAGS): Define to `-C off'.
7520 Update all uses of $(WGET).
7522 2003-08-22 Akim Demaille <akim@epita.fr>
7524 * Makefile.cfg (local-checks-to-skip): New.
7525 * Makefile.maint (local-check): Rename as...
7526 (local-checks-available): this.
7529 2003-08-26 Akim Demaille <akim@epita.fr>
7531 * announce-gen (print_changelog_deltas): Neutralize "<#" as
7532 "<\#" to avoid magic from Gnus when posting parts of this script.
7534 2003-08-25 Jim Meyering <jim@meyering.net>
7536 * src/stat.c (main): Warn about use of deprecated `-l' option.
7538 2003-08-22 Jim Meyering <jim@meyering.net>
7540 * src/stat.c (do_stat): For link count at end of line, use %h format,
7541 instead of %-5h. The latter would make stat emit trailing spaces.
7542 Reported by Dan Jacobson.
7544 2003-08-20 Jim Meyering <jim@meyering.net>
7546 * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
7548 2003-08-19 Jim Meyering <jim@meyering.net>
7550 * src/system.h: Include stdlib.h unconditionally,
7551 as we're now assuming that part of hosted C89.
7553 2003-08-18 Jim Meyering <jim@meyering.net>
7555 * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
7556 to avoid warnings from gcc.
7558 2003-08-17 Jim Meyering <jim@meyering.net>
7560 Avoid unnecessary and sometimes time-consuming hostname lookups.
7561 * src/who.c (print_user): Use strchr, not strrchr.
7562 * src/pinky.c (print_entry): Likewise.
7563 Patch by Michael Stone.
7564 This fixes a typo I introduced in who-users.c on 1996-02-23.
7566 * Makefile.maint (makefile-check): Add 0-9 to the range of characters
7567 disallowed between `@...@'.
7569 2003-08-16 Paul Eggert <eggert@twinsun.com>
7571 * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
7572 done by gnulib .m4 files.
7573 (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
7574 * src/sys2.h (strtoull): Remove unused declaration.
7576 2003-08-16 Jim Meyering <jim@meyering.net>
7578 * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
7581 * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
7582 race condition bug. The bug would be triggered when tailing a file
7583 with file pointer not at beginning of file, and where the file was
7584 truncated to have a length of less than the initial offset at just
7585 the right moment (between the two lseek calls in this function).
7587 An invalid initial value for *read_pos would result in
7588 `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
7589 busy-wait rather than sleeping between iterations. The bug manifests
7590 itself only when tailing regular files that are initially nonempty.
7591 * src/tail.c (tail_bytes): Set *read_pos to new file offset after
7593 (tail_lines): Likewise, after lseek calls.
7594 Reported by Nick Estes. See http://bugs.debian.org/205251 for details.
7595 * tests/tail-2/tail-n0f: New file. Test for above fix.
7596 * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
7598 2003-08-15 Jim Meyering <jim@meyering.net>
7600 * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
7601 (sc_sun_os_names): Likewise.
7602 * .x-sc_space_tab, .x-sc_sun_os_names: New files.
7604 * man/help2man: Remove some SPACEs before TAB.
7606 2003-08-14 Paul Eggert <eggert@twinsun.com>
7608 * Makefile.maint (LC_ALL): Set to C.
7609 * man/Makefile.am (ASSORT): New var.
7610 (check-x-vs-1, programs): Use it.
7611 * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
7612 * tests/Makefile.am (ASSORT, all_programs): Likewise.
7614 2003-08-11 Jim Meyering <jim@meyering.net>
7616 fold -s -wN would infloop for N < 8 with TABs in the input.
7617 E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
7618 * src/fold.c (fold_file): Move contents of `else'-block
7619 out of conditional so it's used also for --spaces (-s).
7620 * tests/misc/fold: Test for the above fix.
7621 * tests/misc/Makefile.am (TESTS): Add fold.
7623 2003-08-10 Jim Meyering <jim@meyering.net>
7625 * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
7626 system.h so the types from time.h and sys/time.h are available.
7627 It appears that this is necessary for OpenBSD, NetBSD, and
7628 Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
7630 2003-08-06 Paul Eggert <eggert@twinsun.com>
7632 * NEWS: Add support for setting file timestamps to microsecond
7633 resolution, on hosts that support this.
7634 * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
7635 * src/copy.c (copy_internal):
7636 Set file timestamps with utimens, not utime.
7637 * src/cp.c (re_protect): Likewise.
7638 * src/install.c (change_timestamps): Likewise.
7639 * src/touch.c (newtime, touch, main): Likewise.
7641 2003-08-09 Jim Meyering <jim@meyering.net>
7643 * Makefile.maint (sc_sun_os_names): New rule based on a regexp
7645 (syntax-check-rules): Add it.
7647 * src/tail.c (main): Tweak Solaris OS version number in comment.
7648 * src/wc.c (wc): Likewise
7649 * tests/tail-2/fflush: Likewise.
7651 * src/tail.c: Add new undocumented option, --presume-input-pipe.
7652 (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
7654 2003-08-08 Paul Eggert <eggert@twinsun.com>
7656 Use new gnulib 'extensions' module.
7657 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
7660 2003-08-08 Paul Eggert <eggert@twinsun.com>
7662 * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
7664 2003-08-09 Jim Meyering <jim@meyering.net>
7666 * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
7667 For tests of obsolete behavior, don't presume that unsetting
7668 _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
7670 2003-08-07 Paul Eggert <eggert@twinsun.com>
7672 * doc/coreutils.texi (split invocation):
7673 Add -d or --numeric-suffixes option to 'split'.
7674 From a suggestion by Jesse Kornblum.
7675 * src/split.c (suffix_alphabet): New var.
7676 (longopts, usage, next_file_name, main): Support -d.
7677 (next_file_name, main): Allow -a0, as POSIX requires.
7678 (next_file_name): Don't assume ASCII-like encoding;
7679 'a' through 'z' are not contiguous in EBCDIC.
7681 2003-08-05 Paul Eggert <eggert@twinsun.com>
7683 Merge getline from gnulib.
7684 * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
7685 * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
7686 New files, from gnulib.
7687 * lib/getdelim2.c, lib/getdelim2.h: Remove.
7688 * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
7689 getdelim2.h to getndelim2.c and getndelim2.h.
7690 * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
7691 checking for getdelim.
7692 (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
7693 than rolling our own.
7694 * src/cut.c: Include getndelim2.h rather than getdelim2.h.
7695 (cut_fields): Invoke getndelim2 rather than getdelim2.
7697 2003-08-04 Jim Meyering <jim@meyering.net>
7699 * src/sort.c (main): Use unsigned int instead of int for `nsigs'
7700 and for the indices to iterate through nsigs.
7702 2003-08-02 Paul Eggert <eggert@twinsun.com>
7704 * src/sort.c: Minor code cleanups, mostly to use more accurate
7705 types and to remove unnecessary casts.
7706 (min, max): Remove. All uses changed to MIN and MAX.
7707 (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
7708 keyfield.skipsblanks, struct keyfield.skipeblanks, struct
7709 keyfield.numeric, struct keyfield.general_numeric, struct
7710 keyfield.month, struct keyfield.reverse, reverse, unique,
7711 have_read_stdin): Now bool, not int. All uses changed.
7712 (eolchar): Now char, not int.
7713 (struct keyfield.ignore): Now bool const *, not int *.
7714 (struct keyfield.translate): Now char const *, not char *.
7715 (struct month.name): Likewise.
7716 (blanks, nonprinting, nondictionary): Now bool[], not int[].
7717 (cleanup, inittables, keycompare, check, mergefps, first_same_file,
7718 check, sort, main): Use const * pointers when possible.
7719 (month_cmp): Rewrite to avoid casts.
7720 (inittables): Initialize tables unconditionally, to avoid branches.
7721 (fillbuf): Return bool, not int. All uses changed.
7722 (fillbuf, keycompare, new_key, main):
7723 Use SIZE_MAX rather than (size_t) -1.
7724 (trailing_blanks): Renamed from trim_trailing_blanks.
7725 Return the number of blanks to trim. All uses changed.
7726 (getmonth): Use trailing_blanks rather than open code.
7727 (keycompare): Do not cast char * to unsigned char *; not needed.
7728 CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
7730 (compare, main): Use | rather than || to avoid jumps.
7731 Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
7733 (check, first_same_file, sort, main):
7734 Use bool instead of int local vars when possible.
7735 (check): Merge the old 'checkfp' and 'check' into a single function,
7736 that returns a boolean (true if the file was ordered).
7738 (main): Use int instead of unsigned for iterating through nsigs.
7739 Rename local var "posix_pedantic" to "posixly_correct".
7741 2003-08-02 Jim Meyering <jim@meyering.net>
7743 * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
7744 to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
7746 * src/cut.c (cut_fields): Don't read again after encountering an
7747 initial EOF. E.g., `cut -f2' would do so.
7748 * tests/misc/tty-eof: Add a test for the above fix.
7750 * src/sort.c (sortlines): Add description and references.
7753 * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
7754 the tests in help-version will use the just-built binaries.
7755 Reported by Christian Krackowizer.
7757 2003-07-31 Paul Eggert <eggert@twinsun.com>
7759 * NEWS: Add --rfc-2822 option to GNU date.
7760 * doc/coreutils.texi (Time directives, Options for date, Examples
7762 * src/date.c (long_options, usage, main): Likewise.
7763 * doc/getdate.texi (General date syntax): Likewise.
7764 * doc/coreutils.texi (Options for date): Fix a typo in format:
7765 it's now %d not %_d. Add URLs.
7767 2003-08-01 Jim Meyering <jim@meyering.net>
7769 * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
7770 Otherwise, with at least the /bin/sh from HPUX 10.20,
7771 the trap code would end up converting that to exit 1 and thus an
7772 unexpected test failure. Reported by Christian Krackowizer.
7774 2003-07-31 Paul Eggert <eggert@twinsun.com>
7776 * src/ptx.c: Do not include bumpalloc.h.
7777 (WORD_TABLE): New member alloc.
7778 (ALLOC_NEW_WORD): Remove.
7779 (occurs_alloc): New var.
7780 (digest_word_file, find_occurs_in_text): Check for arithmetic
7781 overflow when computing table size. Use xrealloc rather than
7782 bumpalloc primitives.
7784 2003-07-29 Jim Meyering <jim@meyering.net>
7788 * README: When running tests as root, suggest using
7789 sudo with NON_ROOT_USERNAME=$USER.
7791 * tests/Makefile.am (all_programs): Makefile is in ../src, not
7794 2003-07-28 Jim Meyering <jim@meyering.net>
7796 * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
7798 2003-07-28 Paul Eggert <eggert@twinsun.com>
7800 * lib/stdbool.hin (_Bool): Make it signed char, instead of
7801 an enum type, so that it's guaranteed to promote to int.
7802 * src/sort.c (sortlines_temp): Undo previous change.
7804 2003-07-28 Jim Meyering <jim@meyering.net>
7806 * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
7807 `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
7808 would cause lines[-1 - swap] (with swap = false) to evaluate to
7811 2003-07-27 Jim Meyering <jim@meyering.net>
7813 * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
7814 since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
7816 * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
7817 directories, as required by POSIX. Reported by Karl Berry.
7818 * tests/rm/dir-no-w: New file. Test for the above fix.
7819 * tests/rm/Makefile.am (TESTS): Add dir-no-w.
7821 * tests/mk-script: Emit `$xx', not its expansion.
7823 2003-07-27 Paul Eggert <eggert@twinsun.com>
7825 This change was inspired by a similar proposal by Stepan Kasal.
7826 * src/sort.c (mergelines, sortlines_temp): New functions.
7827 (sortlines): Use them, to reduce the number of times that
7828 we need to copy 'struct line' values. This improved CPU
7829 performance by about 30% on one 18 MB test.
7830 (sort): Don't invoke sortlines unless we have 2 or more lines.
7832 2003-07-26 Stepan Kasal <kasal@ucw.cz>
7834 * src/sort.c (sort): Don't require two `struct line's per text line,
7835 the new sort algorithm requires just 1.5.
7837 2003-07-27 Jim Meyering <jim@meyering.net>
7839 * src/pathchk.c (validate_path): Use %lu, not %ld.
7841 * src/cut.c (is_printable_field): Simplify bit arithmetic.
7843 * src/ls.c (sort_files): Put `volatile' in the right place.
7846 2003-07-26 Jim Meyering <jim@meyering.net>
7848 Use only one bit per field/offset in array, not one `int'.
7849 * src/cut.c (printable_field): Change type to `unsigned char'.
7850 (mark_printable_field, is_printable_field): New functions.
7851 Use them in place of all direct accesses of `printable_field'.
7853 * src/expand.c (parse_tabstops): Detect overflow properly.
7854 * src/cut.c (set_fields): Likewise.
7856 * src/rm.c: Include "dirname.h".
7857 (usage): Use base_name (program_name) in body of --help output.
7859 * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
7860 Idea from Brendan O'Dea, who suggested using
7861 `program_name = basename (argv[0]);' everywhere --
7862 can't do that, but using base_name works just fine here.
7864 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
7866 2003-07-24 Paul Eggert <eggert@twinsun.com>
7868 Fix some POSIX-compliance problems with 'test'. This makes
7869 'test' more compatible with Bash.
7871 * NEWS, doc/coreutils.texi: Document the following.
7872 * src/test.c: Include exitfail.h.
7873 (TEST_FAILURE): New constant, used for exit status if 'test' fails.
7874 (test-syntax_error): Use it.
7875 (binary_operator): Now takes bool arg specifying whether left operand
7876 is -l ARG, so that caller determines this rather than us.
7878 (term): Use posixtest to evaluate parenthesized subexpressions.
7879 (unary_operator, one_argument): Remove support for -t without operand.
7880 (one_argument): Take argument from argv[pos].
7881 (one_argument, two_arguments, three_arguments): Advance pos.
7882 All callers changed.
7883 (three_arguments): Look for binary ops before "!". Then look
7884 for parenthesized one_argument expressions, instead of trusting
7885 expr () to do the right thing.
7886 (posixtest): Now takes number of args. All callers changed.
7887 Treat "( A B )" like "A B".
7888 (main): Set exit_failure to TEST_FAILURE. Don't depend on
7889 POSIXLY_CORRECT, as we now conform to POSIX by default.
7890 (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
7891 * tests/test/Test.pm (test_vector): Add several tests to check
7892 the above. Syntax errors now exit with status 2, not 1.
7893 * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
7895 2003-07-26 Jim Meyering <jim@meyering.net>
7897 * tests/help-version: Adjust for above change in test behavior:
7898 `[' exits with 2, not 1, and test doesn't accept --help or --version.
7900 * Makefile.maint (ME): Don't use trick suggested in Make manual.
7901 It doesn't work for make-3.79.1. Reported by Christian Krackowizer.
7903 * Makefile.maint (sc_system_h_headers): Another syntax check.
7904 (syntax-check-rules): Add it to the list.
7906 * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
7907 so it matches `%ld' format even on 32-bit systems.
7909 * src/fmt.c (flush_paragraph): Cast field width to `int' to
7910 avoid warning on 64-bit systems.
7912 * src/ls.c (sort_files): Make `func' volatile, so it can't be
7913 clobbered by a `longjmp' into this function.
7915 2003-07-25 Jim Meyering <jim@meyering.net>
7917 * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
7920 * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
7921 because it'd evoke spurious failure on 64-bit systems.
7923 2003-07-24 Jim Meyering <jim@meyering.net>
7925 * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
7926 output its current record counts. Reported by Jurriaan.
7928 * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
7929 `wc' with no options. This goes along with the change of 2003-07-20.
7931 2003-07-23 Jim Meyering <jim@meyering.net>
7933 Don't include headers already included by system.h:
7934 * src/tr.c: Don't include errno.h.
7935 * src/true.c: Don't include version-etc.h.
7936 * src/test.c: Don't include limits.h or error.h.
7937 * src/stat.c: Don't include unistd.h or time.h.
7938 * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
7939 * src/pr.c: Don't include time.h.
7940 * src/pathchk.c: Don't include errno.h.
7941 * src/nice.c: Don't include sys/time.h.
7942 * src/ls.c: Don't include stdlib.h.
7944 * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
7945 * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
7946 * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
7947 * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
7948 * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
7949 * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
7950 * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
7951 * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
7952 Don't include closeout.h.
7954 * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
7955 can access the required version of rm.
7956 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
7958 * tests/cut/Test.pm (out-delim3a): New test.
7960 * man/help2man: Update to version 1.33.
7962 * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
7964 * src/dircolors.c: Include xstrndup.h.
7965 (xstrndup): Remove function, now that it's been factored out into
7968 2003-07-22 Paul Eggert <eggert@twinsun.com>
7970 * src/wc.c (wc): Fix typo in computation of file from file_x,
7971 which caused the former to be used uninitialized if file_x was
7974 2003-07-22 Jim Meyering <jim@meyering.net>
7976 * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
7978 * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
7979 help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by
7980 Thomas Luzat. See http://bugs.debian.org/202413 for details.
7982 * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
7984 * src/hostid.c: Don't include <unistd.h>. system.h already does that.
7986 * src/cut.c (set_fields): Mark all selected indices before trying to
7987 determine range endpoints.
7988 * tests/cut/Test.pm: New test for the above fix.
7990 Begin to address this comment: What if someone wants to
7991 extract the 1,000,000-th field of some huge input file?
7992 The first step is to rearrange things so that the values
7993 in the printable_field array are all 0/1 rather than 0/1/2.
7994 * src/cut.c (RANGE_START_SENTINEL): Remove.
7995 Store range-start indices in a hash table, rather than
7996 overloading the `printable_field' array.
7997 (range_start_ht): New global.
7998 (hash_int, hash_compare_ints, is_range_start_index): New functions.
7999 (print_kth): Use is_range_start_index; don't test printable_field.
8000 (set_fields): Detect overflow.
8001 (set_fields): Insert each range-start index into range_start_ht.
8002 (main): Call set_fields only once, and only after
8003 output_delimiter_specified and (if required) range_start_ht have
8006 2003-07-20 Paul Eggert <eggert@twinsun.com>
8008 * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
8009 invoked with a null pointer when there were no file arguments.
8011 2003-07-20 Jim Meyering <jim@meyering.net>
8013 * Makefile.maint (sc_changelog): Add another nit-picky check.
8015 * src/wc.c (write_counts): Add a comment.
8016 (wc): Rename `file' parameter.
8017 Set new local, `file', to be the file name, or (when it's NULL)
8018 _("standard output") so that all uses of `file' use the proper value.
8019 Use STREQ, not strcmp.
8021 2003-07-20 Paul Eggert <eggert@twinsun.com>
8023 wc count field widths now are heuristically adjusted depending
8024 on the input size, if known. If only one count is printed, it
8025 is guaranteed to be printed without leading spaces.
8027 Previously, wc did not align the count fields if
8028 POSIXLY_CORRECT was set, but POSIX did not actually require
8029 this undesirable behavior, so it has been removed.
8031 * NEWS: Document this.
8032 * doc/coreutils.texi (wc invocation): Likewise.
8034 * src/wc.c (number_width): New var.
8035 (posixly_correct): Remove.
8036 (struct fstatus): New struct.
8037 (write_counts): Output fields of width number_width.
8038 Do not worry about POSIXLY_CORRECT.
8039 Use null file, not empty-string file, to denote stdin,
8040 since "" is a valid file name on some hosts.
8041 (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
8043 (wc): Avoid problems if end_pos - current_pos overflows.
8044 Do not print odd message if stdin has a read error.
8045 (get_input_fstatus, compute_number_width): New functions.
8046 (main): Use them to implement the new behavior.
8047 Ignore POSIXLY_CORRECT.
8049 * tests/wc/Test.pm: Adjust to the new output widths.
8051 2003-07-19 Jim Meyering <jim@meyering.net>
8053 * tests/rm/fail-eperm: Don't create temporary directory --
8056 * tests/shred/remove: Don't open-code test for UID != 0.
8057 Use priv-check's require-non-root instead.
8058 Update to use newer framework.
8060 * tests/help-version (expected_failure_status_expr): Record that
8061 expr exits with status of 3 for e.g., a write error.
8063 * tests/priv-check: Use `id -u' to see if we're running as root,
8064 rather than trying go write to an write-protected file.
8065 When running as root, ensure $NON_ROOT_USERNAME is valid.
8066 When running as root with `require-non-root', ensure that `.'
8067 is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
8068 to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test.
8070 * src/printenv.c: Include "exitfail.h".
8071 (main): Set exit_failure rather than calling close_stdout_set_status.
8072 * src/date.c: Likewise.
8073 * src/sort.c: Likewise.
8074 * src/tty.c: Likewise.
8076 2003-07-18 Jim Meyering <jim@meyering.net>
8078 * tests/touch/not-owner: Update to use newer framework.
8080 * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
8081 directory, and remove Perl-coded `you may not run as root' test.
8082 * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
8083 hard-coding something not quite equivalent.
8084 Paul Jarc reported the inconsistent diagnostics.
8086 * src/sort.c (main): Use close_stdout via atexit.
8087 Now `sort --version' and `sort --help' fail, as they should
8088 when their output is redirected to /dev/full.
8090 * src/su.c (usage): Don't call close_stdout here.
8091 (main): Use close_stdout via atexit.
8092 Now `su --version > /dev/full' fails, as it should.
8093 Somehow, the change of 2000-05-07 that purports to fix this
8096 * tests/help-version (--help/--version vs. /dev/full): Special-case
8097 `[' to protect it from expected_failure_status-`eval'.
8099 * src/uniq.c (writeline): Use a SPACE, not a TAB between the
8100 count and the corresponding line, as required by POSIX.
8101 Reported by Clement Wang.
8102 * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
8104 * tests/expr/basic: Add tests for when exit status is 2.
8106 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
8107 Use an anonymous `enum', rather than #define.
8109 2003-07-17 Paul Eggert <eggert@twinsun.com>
8111 * src/expr.c: Include "exitfail.h", "quotearg.h".
8112 (EXPR_INVALID, EXPR_ERROR): New constants.
8113 (nomoreargs, null, toarith, nextarg): Return bool, not int.
8114 (syntax_error): New function, exiting with status 2. Use it
8115 insteading of printing "syntax error" ourselves.
8116 (main): Initialize exit_failure to EXPR_ERROR.
8117 Exit with EXPR_INVALID on syntax error (too few arguments).
8118 (nextarg): Use strcmp, not strcoll; strcoll might return
8119 an undesirable 0, or might fail.
8120 (docolon, eval4, eval3): Exit with status 3 on invalid argument type
8121 or other such error.
8122 (eval2): Report an error if strcoll fails in a string comparison.
8123 * src/sort.c: Include "exitfail.h".
8124 (main): Set exit_failure, not xalloc_exit_failure and
8125 xmemcoll_exit_failure.
8126 * tests/expr/basic: Invalid value exits with status 3, not 2.
8128 2003-07-16 Jim Meyering <jim@meyering.net>
8130 * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
8131 per GNU maintainer guidelines. The next non-beta release will be 5.1.
8133 This script would have caught at least two recent bugs:
8134 those in [ and kill.
8135 * tests/help-version: Revive this script.
8136 It wasn't doing anything useful, since $all_programs wasn't being
8137 defined by the invoking Makefile.am.
8138 Reflect that nohup is no longer a script, so don't exclude it.
8139 Add framework to handle the programs added since it was last run:
8140 kill, stat, unlink, [, link, readlink.
8141 Fix path-related problems deriving from the move of this script
8142 from src/ to its present location.
8143 * tests/Makefile.am (all_programs): Define.
8144 (TESTS_ENVIRONMENT): Use it.
8146 * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
8147 whereby kill would always attempt to operate on argv[0] and fail.
8149 * src/test.c (integer_expected_error): Improve diagnostic -- now,
8150 it also matches the one from bash's builtin test.
8151 (binary_operator): Add \n at end of diagnostic.
8153 * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ...
8154 * tests/priv-check: Move setuidgid-related and
8155 NON_ROOT_USERNAME-checking code to this file.
8157 * README: Update section on testing as `root'.
8158 Suggestion from Paul Jarc.
8160 * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
8161 names of authors that I just found in bash's builtins/test.def.
8163 Running `[' with no arguments would evoke a segfault.
8164 * src/test.c (main) [LBRACKET]: Move initialization of argv to
8165 precede potential use via test_syntax_error.
8167 * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
8168 warning from automake -Wall.
8170 2003-07-15 Jim Meyering <jim@meyering.net>
8174 * Makefile.maint (%.asc): Remove target first, so gpg doesn't
8177 * announce-gen (print_changelog_deltas): Relax tests for matching
8178 version-number line in NEWS.
8179 Change the .sig suffix to .asc here, too.
8181 2003-07-14 Jim Meyering <jim@meyering.net>
8183 * Makefile.maint (%.asc): Renamed from %.sig.
8184 Generate and use ascii-armored signatures.
8185 Use gpg's -o option.
8187 2003-07-13 Jim Meyering <jim@meyering.net>
8189 * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
8192 * Makefile.maint (syntax-check): Move each individual check into
8194 (syntax-check-rules): This is the list of syntax-check targets.
8195 (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
8196 (sc_cast_of_x_alloc_return_value, sc_space_tab):
8197 (sc_error_exit_success, sc_xalloc_h_in_src): New targets.
8199 2003-07-12 Jim Meyering <jim@meyering.net>
8201 * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
8202 traces of the nohup script.
8204 * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
8205 $(OPTIONAL_BIN_ZCRIPTS).
8207 * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
8208 target, not before the `>'.
8210 * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
8211 now that that function no longer calls `error'.
8213 * src/df.c (find_mount_point): Emit a diagnostic for each
8214 failed syscall, rather than relying on caller to do that.
8215 The caller couldn't do a good job, anyhow -- too many different
8216 ways to fail (each with a different referent).
8217 Give a diagnostic upon failed save_cwd, now that that function
8218 no longer calls `error'.
8219 (show_point): Don't diagnose find_mount_point's errors, now that
8220 it handles them itself.
8222 * src/df.c (find_mount_point): Don't let free clobber errno upon
8225 * src/sys2.h: Remove alloca-related block.
8226 * src/system.h: Include <alloca.h> here, instead.
8228 It appears that the `#pragma alloca' included via "system.h" is
8229 adequate, since join.c uses alloca, yet lacked an in-file #pragma.
8230 * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
8231 * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
8233 * src/chown-core.c (change_file_owner): Do not restore any special
8234 permission bits (e.g., set-user-ID, set-group-ID) that are reset
8235 by chown(2) on some systems. Suggestion and insistence :-) from
8238 * tests/input-tty: Also check `test -t 1'.
8239 This is necessary on linux-2.4.21. Otherwise, the stty/basic-1
8240 test would block when run in the background.
8242 2003-07-11 Jim Meyering <jim@meyering.net>
8244 * tests/sample-test: Also fail if cat-to-create-expected-output
8245 fails. Otherwise, if both `exp' and `out' were to end up empty
8246 because of e.g., a full disk, they would mistakenly compare equal.
8248 * src/nohup.c: New file. Rewrite of nohup.sh in C.
8249 This solves a portability problem: on at least Solaris systems,
8250 when nohup.sh used the vendor /bin/sh, it would exit with status
8251 of `1' rather than the required 126 or 127 upon failure to exec
8252 the specified program.
8254 * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
8255 (bin_PROGRAMS): Add nohup.
8256 (EXTRA_DIST): Remove nohup.sh.
8257 (all_programs): Remove use of $(EXTRA_SCRIPTS).
8258 * src/nohup.sh: Remove file.
8259 * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
8261 * tests/misc/nohup: Tests for the above.
8262 * tests/misc/Makefile.am (TESTS): Add nohup.
8264 * src/head.c (diagnose_copy_fd_failure): New function, renamed from
8265 the macro, COPY_FD_DIAGNOSE.
8266 (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
8267 (head_file): Likewise.
8269 * src/date.c: Include "quote.h".
8270 (batch_convert): Use the quote function rather than using literal `...'
8273 * src/setuidgid.c (main): Enclose diagnostic in _(...).
8274 * src/fmt.c (main): Likewise.
8275 * src/mknod.c (main): Likewise.
8276 * src/tac.c (tac_seekable): Likewise.
8277 * src/yes.c (main): Likewise.
8278 * src/od.c (main): Likewise.
8279 * src/install.c (change_attributes): Likewise.
8281 2003-07-10 Jim Meyering <jim@meyering.net>
8283 * src/head.c (usage): Use 1024*1024 in place of 1048576.
8284 * src/tail.c (usage): Likewise.
8286 * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
8287 place of the kludge in this test. Suggestion from Paul Jarc.
8289 * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
8290 * src/setuidgid.c: New program, solely for testing (not installed).
8292 * src/chown-core.c (change_file_owner): Don't leak file descriptors
8293 when dereferencing symlinks.
8295 2003-07-09 Jim Meyering <jim@meyering.net>
8297 * tests/du/slash: New file/test for today's lib/ftw.c fix.
8298 * tests/du/Makefile.am (TESTS): Add slash
8300 * src/tail.c (xlseek): Avoid warning about ``return without value
8301 from function returning non-void''.
8303 2003-07-08 Jim Meyering <jim@meyering.net>
8305 * man/help2man: Update to version 1.29.
8307 * man/help2man: Add END handler to close STDOUT and check for errors.
8309 2003-06-30 Paul Eggert <eggert@twinsun.com>
8311 Add support for a "[" that conforms to the GNU coding standards,
8312 i.e., that does not depend on its name.
8313 * src/lbracket.c: New file.
8315 * man/Makefile.am (programs): Ignore "[", since it doesn't have
8316 a separate man page.
8317 * src/Makefile.am (bin_PROGRAMS): Add "[".
8318 (__SOURCES): New var.
8319 * src/test.c (LBRACKET): Define to 0 if not defined.
8320 (main): Use LBRACKET rather than argv[0].
8322 * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
8323 Reported by Paul Jarc and Dan Jacobson.
8325 * src/test.c (main): Do not recognize --help or --version if
8326 POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
8327 Do not bother testing that margv[margc] is non-null.
8329 2003-07-04 Jim Meyering <jim@meyering.net>
8331 * src/who.c (print_line): Rewrite to use asprintf, in order to be
8332 able to avoid emitting trailing spaces. Reported by Dan Jacobson.
8334 * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
8335 option, and perform the +1600 invocations of head IFF the envvar
8336 RUN_EXPENSIVE_TESTS is set.
8338 2003-07-03 Jim Meyering <jim@meyering.net>
8340 * src/cp.c (do_copy): Give a better diagnostic when failing due
8341 to nonexistent destination directory. Reported by Dmitry Rutsky.
8342 See http://bugs.debian.org/199730 for details.
8344 2003-06-27 Jim Meyering <jim@meyering.net>
8346 split's --verbose option did nothing [broken in 4.5.10 and 5.0]
8347 * src/split.c (longopts): Use `1', not `0' as the value for
8348 for &verbose. Reported by Keith Thompson.
8350 Test for the above fix.
8351 * tests/misc/split-a: Also use --verbose and compare stderr
8352 output with what we'd expect.
8354 2003-06-20 Jim Meyering <jim@meyering.net>
8356 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
8357 Use `error_t' (rather than int) as type for local `err'.
8358 From Alfred M. Szmidt.
8360 2003-06-19 Marcus Brinkmann <marcus@gnu.org>
8362 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
8363 Fix author preservation code.
8365 2003-06-19 Jim Meyering <jim@meyering.net>
8367 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
8368 (do_link): Don't warn about hard link to symlink.
8370 2003-06-18 Jim Meyering <jim@meyering.net>
8372 * src/cut.c: Include "getdelim2.h", not "getstr.h".
8373 Reflect renaming: getstr -> getdelim2.
8375 * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
8376 readline -> readlinebuffer.
8378 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
8380 * src/readlink.c: Include <sys/types.h> before system.h (because
8381 the latter includes <sys/stat.h>). Required on Ultrix 4.3.
8383 2003-06-17 Jim Meyering <jim@meyering.net>
8385 * src/system.h (initialize_main): Define.
8386 Use it in every `main'. Applied via this:
8387 p='initialize_main (&argc, &argv);'
8388 perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \
8389 $(grep -l program_name.=.argv.0 *.c)
8390 test.c uses margc/margv, so I made the change manually for that file.
8391 Based on a patch from Bernard Giroud.
8393 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
8395 Fix for build failure on Ultrix 4.3.
8396 * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
8397 Include sys/param.h and sys/mount.h on ultrix.
8399 2003-06-16 Jim Meyering <jim@meyering.net>
8401 * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
8403 * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
8404 them here instead, but with one change: define EISDIR to -1, not 0.
8406 * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
8407 guaranteed to be defined.
8408 * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
8410 * README: Mention the CVS repository.
8411 Encourage addition of test cases.
8413 2003-06-12 Jim Meyering <jim@meyering.net>
8415 * src/touch.c (touch): Call close only if necessary.
8418 * src/wc.c (usage): Correct wording: wc prints counts in the order
8419 `newline, word, byte'. Reported by Keith M. Briggs.
8420 * man/wc.x: Fix it here, too. And change `lines' to `newlines'.
8422 2003-06-10 Jim Meyering <jim@meyering.net>
8424 * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
8426 2003-06-07 Jim Meyering <jim@meyering.net>
8428 * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
8431 2003-06-06 Jim Meyering <jim@meyering.net>
8433 * src/extract-magic (main): Avoid newer 3-arg form of open,
8434 so this script works also with e.g., perl5.005_03.
8435 Patch by John David Anglin.
8437 2003-06-04 Paul Eggert <eggert@twinsun.com>
8439 * src/system.h: Include <stdbool.h> unconditionally.
8441 2003-06-04 Jim Meyering <jim@meyering.net>
8443 * man/Makefile.am (check-programs-vs-x): Rename target
8444 from check-programs-vs-1. Adjust rule to check for the
8445 primary (.x) file, not the generated one (.1).
8447 2003-06-03 Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
8449 * man/kill.x: New file.
8450 * man/Makefile.am (dist_man_MANS): Add kill.1.
8453 2003-06-04 Jim Meyering <jim@meyering.net>
8455 Ensure that the .x file for a new program is never forgotten again.
8456 * man/Makefile.am (programs): Define.
8457 (check-programs-vs-1): New phony target.
8458 (check-local): Depend on it.
8460 2003-06-03 Jim Meyering <jim@meyering.net>
8462 Avoid unnecessary copying of environment.
8463 * src/env.c (main): Rather than clearing the environment and --
8464 unless told to ignore environment -- copying all settings from
8465 the saved, original environment, clear the environment only when
8466 that is requested. Suggested by Jens Elkner.
8468 2003-06-02 Jim Meyering <jim@meyering.net>
8470 * src/system.h: Always include <string.h>, since we assume C89.
8471 Include <limits.h> without checking for HAVE_LIMITS_H.
8473 * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
8474 (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
8476 2003-06-01 Jim Meyering <jim@meyering.net>
8478 Avoid a race condition in `tail -f' described by Ken Raeburn in
8479 http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
8480 * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
8481 (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
8482 (tail_bytes, tail_lines, tail): Likewise.
8483 (tail_file): Use the new `read_pos' value as the size,
8484 rather than stats.st_size from the fstat call.
8486 2003-05-28 Jim Meyering <jim@meyering.net>
8488 * src/extract-magic: Allow expansion of `$file' in the here-
8489 document corresponding to the comment at the top of fs.h.
8491 2003-05-26 Jim Meyering <jim@meyering.net>
8493 * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
8494 <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
8495 Use #if/#elif/... cascade so we get only one set of include files.
8496 Reported by Nelson Beebe.
8498 2003-05-24 Jim Meyering <jim@meyering.net>
8500 * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
8501 * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
8502 accept the BSD format.
8504 2003-03-28 Joe Orton <jorton@redhat.com>
8506 * src/md5sum.c (bsd_split_3): New function.
8507 (split_3): Detect checksums from BSD 'md5' command and handle them
8510 * tests/md5sum/basic-1: New tests for --check exit status, and for
8511 BSD-style checksum files.
8513 2003-05-21 Jim Meyering <jim@meyering.net>
8515 * src/head.c (elide_tail_lines_pipe): Fix a thinko.
8516 This sort of thing is why it'd be *Really Good* to factor
8517 out the common code used here and in tail.c.
8519 2003-05-14 Jim Meyering <jim@meyering.net>
8521 * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
8523 * tests/du/slink: Skip this test if `.' is on an XFS file system.
8525 * tests/du/fd-leak: New file. Test for the bug in du that
8526 was fixed by the 2003-05-12 change to lib/ftw.c.
8527 * tests/du/Makefile.am (TESTS): Add fd-leak.
8529 * src/head.c (AUTHORS): Enclose string in N_(...), now that it
8530 includes a translatable word, `and'.
8532 * src/dd.c (usage): Don't use `,' as the thousands separator
8533 in e.g. 1,000,000 and 1,048,576. Instead, do this:
8534 `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
8535 * src/df.c (usage): Likewise.
8536 * src/du.c (usage): Likewise.
8537 * src/ls.c (usage): Likewise.
8539 * Makefile.maint (syntax-check): Add another check.
8541 2003-05-13 Paul Eggert <eggert@twinsun.com>
8543 Fix uniq to conform to POSIX, which requires that "uniq -d -u"
8544 must output nothing. Problem reported by Josh Hyman.
8546 * src/uniq.c (enum output_mode, mode): Remove, replacing with:
8547 (output_unique, output_first_repeated, output_later_repeated):
8548 New vars. All uses of "mode" changed to use these variables,
8549 which are not mutually exclusive as "mode" was.
8550 (writeline): New arg "match", used to control whether to
8551 obey output_first_repeated or output_later_repeated.
8552 All callers changed.
8553 (check_file, main): Adjust to above changes.
8555 * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
8557 2003-05-14 Jim Meyering <jim@meyering.net>
8559 * tests/rm/rm3: Use tr's \n notation rather than \012.
8560 This package can afford to do that, since its tests are guaranteed use
8561 GNU tr, which has accepted the more modern notation for 10 years.
8562 * tests/rm/rm5: Likewise.
8563 * tests/cp/same-file: Likewise.
8564 * tests/stty/row-col-1: Likewise.
8565 * tests/stty/basic-1: Likewise.
8566 * tests/rm/deep-1: Likewise.
8567 * tests/mv/part-symlink: Likewise.
8568 * tests/mkdir/perm: Likewise.
8569 * tests/misc/nice: Likewise.
8571 2003-05-13 Jim Meyering <jim@meyering.net>
8573 * src/copy.c (struct F_triple) [name]: Remove const attribute.
8574 (triple_free): Don't apply cast to argument of free.
8575 (seen_file): Add cast here instead.
8577 * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
8578 (src_to_dest_free): Don't apply cast to argument of free.
8580 * src/sort.c (zaptemp): Don't apply cast to argument of free.
8581 * src/pr.c (init_fps, init_store_cols): Likewise.
8582 * src/join.c (delseq, freeline): Likewise.
8583 * src/expr.c (OLD): Likewise.
8584 * src/sort.c (sort): Likewise.
8585 * src/head.c (elide_tail_lines_pipe): Likewise.
8587 * src/tail.c: Include "quote.h".
8588 Use quote in diagnostics. Change many error format strings
8589 from just `%s' to e.g., `error reading %s'.
8590 (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
8591 Rewrite newline-counting loop to use memchr.
8593 * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
8594 Now that assert is no longer used, don't include <assert.h>.
8596 2003-05-12 Jim Meyering <jim@meyering.net>
8598 * src/head.c: Include <assert.h>.
8599 (AUTHORS): Add my name.
8600 (elide_tail_lines_pipe): New function.
8602 2003-05-10 Jim Meyering <jim@meyering.net>
8604 * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
8606 * src/readlink.c (main): Set program_name before first use.
8607 Remove that (redundant) first use.
8608 Don't exit successfully just because --verbose was specified.
8609 Pass 0, not EXIT_SUCCESS, as first argument to error; when that
8610 parameter is 0, error does not exit.
8612 * src/uname.c (main): When failing due to too many arguments, also say
8613 that, rather than just "Try `uname --help' for more information.".
8614 * src/comm.c (main): Likewise, but for too few arguments.
8615 * src/logname.c: Include error.h.
8616 (main): Say why we're failing.
8618 * src/uniq.c (main): Don't segfault when argc < optind.
8619 * src/who.c (main): Handle argc < optind.
8620 * src/df.c (main): Likewise.
8621 * src/install.c (main): Likewise.
8622 * src/mv.c (main): Likewise.
8623 * src/pwd.c (main): Likewise.
8624 * src/tty.c (main): Likewise.
8625 * src/chroot.c (main): Likewise.
8626 * src/hostname.c: Likewise.
8627 * src/du.c (main): Likewise.
8628 * src/expand.c (main): Likewise.
8629 * src/env.c (main): Likewise.
8630 * src/unexpand.c (main): Likewise.
8631 * src/printenv.c (main): Likewise.
8632 * src/sync.c (main): Handle argc == 0.
8633 * src/expr.c (main): Likewise.
8634 * src/printf.c (main): Likewise.
8635 * src/basename.c (main): Likewise.
8636 * src/ln.c (main): Test for `missing argument' before computing n_files.
8637 * src/tail.c (main): Test for the case of no arguments before
8640 * src/kill.c (send_signals): Don't check command line arguments here.
8641 (main): Check them here instead. Handle argc < optind.
8643 * src/logname.c (main): Use error, rather than fprintf, for the sake
8646 * src/rm.c (main): Don't overrun array bound if argc is 0.
8648 2003-05-09 Jim Meyering <jim@meyering.net>
8650 * src/sort.c (main): Don't overrun array bound if argc is 0.
8651 That would happen when invoked via: execl ("/usr/bin/sort", NULL);
8652 Reported by Wartan Hachaturow.
8654 2003-05-07 Jim Meyering <jim@meyering.net>
8656 Implement support so that `head --lines=-N' works on seekable files.
8657 * src/head.c (enum Copy_fd_status): Define.
8658 (COPY_FD_DIAGNOSE): New macro.
8659 (elide_tail_lines_seekable): New funtion.
8660 (elide_tail_lines_file): Call it here.
8662 2003-05-06 Jim Meyering <jim@meyering.net>
8664 * src/sys2.h (CHAR_BIT): Remove duplicate definition.
8666 2003-05-04 Jim Meyering <jim@meyering.net>
8668 * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
8669 caused the addition of thousands of small files to the tar archive.
8670 * tests/misc/head-elide-tail: New file. Add them here instead.
8671 * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
8673 2003-05-04 Paul Eggert <eggert@twinsun.com>
8675 * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
8676 (IF_READDIR_NEEDS_REWINDDIR): Remove.
8677 (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
8678 which was a bit weird because it couldn't be emulated by a function.
8680 2003-05-03 Jim Meyering <jim@meyering.net>
8682 Extend head to accept --lines=-N (--bytes=-N) and to print all
8683 but the N lines (bytes) at the end of the file.
8684 * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
8685 Use quote() in diagnostics, rather than literal `' marks.
8686 (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
8688 (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
8689 (head_file): Reorganize so as to call head from only one place.
8690 (main): Likewise, for head_file.
8691 Handle new, undocumented option, --presume-input-pipe.
8692 Handle negative line and byte counts.
8693 * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
8695 * tests/du/8gb: Skip test if the file system of `.' doesn't support
8696 sparse files -- otherwise it'd create a file of size 8GB.
8698 2003-05-02 Jim Meyering <jim@meyering.net>
8700 * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
8701 Instead explain about `-' and standard input.
8702 (main): Give a proper diagnostic for e.g., `fmt -c -72'.
8703 Reported by Keith Thompson.
8704 * tests/fmt/basic: Add test for the above fix.
8706 * src/fmt.c: Include "quote.h".
8707 Use quote() in diagnostics, rather than literal `' marks.
8708 (main): Exit nonzero when unable to open an input file.
8709 * tests/fmt/basic: Add test for the above fix.
8711 * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
8712 specifications like `-72x'.
8713 * tests/fmt/basic: Add test for the above fix.
8715 Work around nasty readdir bug on Darwin6.5.
8716 * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
8717 [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
8718 returned NULL and there has been at least one successful unlink or
8719 rmdir call since the opendir or previous rewinddir, then call
8720 rewinddir and reiterate the loop.
8722 Factor out common code.
8723 * src/remove.c (readdir_ignoring_dotdirs): New function.
8724 (is_empty_dir): Use it here.
8725 (remove_cwd_entries): Use it here.
8727 2003-05-01 Jim Meyering <jim@meyering.net>
8729 * tests/rm/r-3: Create 500 rather than just 300 files.
8730 There's a bug in Darwin6.5's readdir that shows up only with
8732 Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
8736 Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
8737 (dump_remainder): Move two declarations `down' into the scope
8738 where they are used.
8739 (xlseek): Return the resulting offset.
8740 (file_lines): Rename parameter, file_length, to end_pos.
8741 (pipe_lines): Don't coerce safe_read return value to `int'.
8742 Adapt tests accordingly.
8743 (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
8745 Change type of `total_bytes' from `int' to `size_t',
8746 since the former wouldn't always be wide enough.
8747 Don't coerce safe_read return value to `int',
8748 and adapt tests accordingly.
8749 Now that testing for a read error no longer involves
8750 using `tmp', handle that case *after* freeing `tmp'.
8751 (start_bytes): Clean up.
8752 (tail_bytes): Now that `n_bytes' may be larger than
8753 OFF_T_MAX, test for that condition and, if it's true, don't
8754 use lseek optimizations.
8755 (parse_options): Don't fail just because N_UNITS is larger than
8756 the maximum size of a file -- tail may be applied to an input
8757 stream (e.g., a pipe) with more data than that.
8759 * Makefile.maint (syntax-check): Rename from alloc-check.
8760 Also check for SPACE-TAB sequences.
8761 Also check for malloc/calloc/realloc casts.
8763 2003-05-01 Jim Meyering <jim@meyering.net>
8765 * src/tail.c (start_lines): Rewrite to use memchr. Clean up.
8767 2003-04-28 Jim Meyering <jim@meyering.net>
8769 * tests/misc/tty-eof: Send two tokens, not just one, so we don't
8770 make the now-more-picky tsort fail.
8772 2003-04-24 Jim Meyering <jim@meyering.net>
8774 * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
8775 (main): Minor syntactic clean-up.
8777 * src/tsort.c (tsort): Fail if the input contains an odd number of
8778 tokens. Reported by junkio@cox.net.
8780 * tests/tsort/basic-1: Test for the above fix.
8782 2003-04-21 Jim Meyering <jim@meyering.net>
8784 * tests/misc/printf: Add tests for the printf fixes below.
8786 * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
8788 2003-04-20 Paul Eggert <eggert@twinsun.com>
8790 Fix printf POSIX compatibility bug reported by Ben Harris in
8791 <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
8792 * doc/coreutils.texi (printf invocation): It's \NNN in the format,
8793 \0NNN in the %b operand.
8794 * src/printf.c (usage): Likewise.
8795 (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
8796 is desired. All uses changed. Behave like Bash printf if %b
8797 operand uses \NNN where the initial N is not 0.
8799 2003-04-17 Jim Meyering <jim@meyering.net>
8801 * src/stty.c: Remove uses of PROTOTYPE macro.
8803 2003-04-15 Jim Meyering <jim@meyering.net>
8805 * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
8806 each sequence of spaces before a TAB character.
8808 2003-04-13 Jim Meyering <jim@meyering.net>
8810 * src/remove.c (is_empty_dir): Don't closedir (NULL).
8812 2003-04-12 Jim Meyering <jim@meyering.net>
8814 Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
8815 --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
8816 FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
8817 * src/nl.c (main): Fix those problems and remove literal quote marks
8818 (e.g., "`%s'") from format string; instead use "%s" in each format
8819 string and `quote (optarg)' as the corresponding argument.
8820 Also, diagnose all invalid command line options before failing.
8822 * src/nl.c (proc_text): Fix a bug that would make nl output extra
8823 newlines in some cases. Details here: http://bugs.debian.org/177256.
8824 This bug was introduced on 2001-11-10 for textutils-2.0.17.
8825 * tests/misc/nl: Add test for the above-fixed bug.
8827 * tests/misc/readlink: New file. Test the --canonicalize option.
8828 * tests/misc/Makefile.am (TESTS): Add readlink.
8830 2003-04-11 Jim Meyering <jim@meyering.net>
8833 * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
8834 * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
8835 * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
8836 retain alignment) each sequence of spaces before a TAB character.
8838 * src/ls.c: Include <stdlib.h> unconditionally.
8840 * Makefile.maint (xalloc-check): Rename from header-check.
8842 * src/yes.c: Include error.h after system.h, not before.
8845 * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
8846 * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
8847 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
8848 * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
8849 * src/tr.c: * src/unexpand.c, src/users.c:
8850 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
8851 return values and of xrealloc's first argument.
8852 Fix the former with this:
8853 perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
8855 2003-04-10 Jim Meyering <jim@meyering.net>
8857 * src/stty.c (wrapf): Declare with format attribute.
8859 The S_MAGIC_... names shouldn't be maintained in two places (prior
8860 to this change, one would have to keep stat.c and fs.h in sync).
8861 This change makes it so those names and the corresponding
8862 hexadecimal constants all reside in stat.c. fs.h is now generated.
8863 * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
8864 (BUILT_SOURCES): Add fs.h, now that it's generated.
8865 (EXTRA_DIST): Add extract-magic.
8866 * src/extract-magic: New script to extract fs.h definitions from stat.c.
8867 * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
8868 fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
8870 * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
8871 file with nominal length > 4GB fails. Reported by Michael Deutschmann.
8873 * man/unexpand.x: Add `SEE ALSO' reference to expand.
8874 * man/expand.x: Add `SEE ALSO' reference to unexpand.
8875 Suggestion from Dan Jacobson.
8877 2003-04-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
8879 * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
8880 * src/stat.c (human_fstype): Handle Linux's devpts.
8882 2003-04-09 Paul Eggert <eggert@twinsun.com>
8884 * src/split.c (line_bytes_split): Arg is of type size_t, since
8885 that's all that is supported for now.
8886 (main): Check for overflow in obsolescent line count option.
8888 2003-04-09 Jim Meyering <jim@meyering.net>
8890 * tests/misc/split-fail: Add a new test for the above fix.
8892 * src/split.c (bytes_split): Use size_t temporary (rather than
8893 uintmax_t original) in remaining computations. From Paul Eggert.
8895 Handle command line option arguments larger than 2^31.
8896 This allows e.g., splitting into files of size 2GB and larger,
8897 and running split --lines=N with N=2^31 or more.
8898 But for --line-bytes=N, the restriction that N <= SIZE_MAX
8899 remains (for now), due to the way it is implemented.
8901 * src/split.c: Include "inttostr.h".
8902 (bytes_split, lines_split, line_bytes_split, main):
8903 Use uintmax_t, not size_t, for file sizes.
8904 (main): Give a better diagnostic for option arguments == 0.
8905 Use umaxtostr to print file sizes.
8906 Reported by Luke Hassell.
8908 2003-04-08 Jim Meyering <jim@meyering.net>
8910 * src/rm.c (usage): Mention that --directory (-d) works only
8911 on some systems. Suggestion from Samuel Tardieu.
8913 * tests/basename/basic: Run $PERL to see if it is available,
8914 rather than testing its value.
8915 * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
8916 * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
8917 * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
8918 * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
8919 * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
8920 * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
8921 * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
8922 * tests/sum/basic-1, tests/seq/basic: Likewise.
8924 * tests/misc/Makefile.am (TESTS): Add split-fail.
8925 * tests/misc/split-fail: New file.
8927 * src/split.c: Rename local variables: nchars -> n_bytes.
8928 (lines_split): Rename local, nlines -> n_lines.
8929 (main): Rename local variable: s/accum/n_units/.
8930 (main): Use STDIN_FILENO, not literal `0'.
8932 2003-04-07 Jim Meyering <jim@meyering.net>
8934 * src/stat.c: Add #include directives for Ultrix 4.4.
8935 Based on a suggested change from Bert Deknuydt.
8937 2003-04-06 Jim Meyering <jim@meyering.net>
8939 * Makefile.maint (makefile-check): New rule.
8940 (local-check): Add it.
8942 2003-04-05 Jim Meyering <jim@meyering.net>
8944 * Makefile.am (nearly all of them):
8945 Use $(VAR) rather than @VAR@, now that we can rely on automake to
8946 emit a definition for each substituted variable.
8947 * tests/Makefile.am.in: Likewise.
8949 * tests/rm/rm5: Add a comment explaining why this test fails when
8950 using Tru64's broken sed.
8951 * tests/rm/rm3: Likewise.
8953 Make `kill -t' output signal descriptions (not `?') on Tru64.
8954 * src/kill.c (sys_siglist): Also check for __sys_siglist.
8955 Patch by Tony Leneis.
8956 * configure.ac: Also check for declaration of __sys_siglist.
8957 Required for Tru64 4.0D, 4.0F, and 5.1.
8958 Reported by Tony Leneis.
8960 2003-04-04 Jim Meyering <jim@meyering.net>
8962 * src/Makefile.am (PERL): Remove unnecessary definition.
8964 Because of inappropriate (but POSIX-mandated) behavior of rename,
8965 `mv a b' would not remove `a' in some unusual cases. Work around
8966 this by unlinking `a' when necessary.
8968 * src/copy.c (same_file_ok): Add an output parameter.
8969 Set it in the offending case.
8970 (copy_internal): When necessary, unlink SRC_PATH and inform caller.
8971 Reported by Ed Avis.
8972 * tests/mv/hard-4: New test for the above.
8973 * tests/mv/Makefile.am (TESTS): Add hard-4.
8975 Clean up rules for automatically generated sources:
8976 * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
8977 Make each generated file be read-only.
8978 Add each file name to BUILT_SOURCES separately.
8979 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
8981 Put LOCALEDIR macro definition in new file: localedir.h.
8982 * src/Makefile.am (DEFS): Remove definition.
8983 (localedir.h): New rule.
8984 (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
8985 * src/system.h: Include "localedir.h".
8987 2003-04-02 Jim Meyering <jim@meyering.net>
8991 * tests/misc/Makefile.am (TESTS): Add false.
8993 * Makefile.maint (TMPDIR): Make sure it's defined.
8994 (my-distcheck): Build in $(TMPDIR), not `.'.
8996 * src/Makefile.am (false.c): Change all occurrences of
8997 `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
8998 unsuccessfully also with --help. Reported by Paul Jarc,
8999 * tests/misc/false: New test for the above.
9001 2003-03-30 Jim Meyering <jim@meyering.net>
9003 * NEWS: Note the location of older NEWS files.
9005 * src/remove.c (is_empty_dir): Don't let a failing closedir
9006 clobber errno. Spotted by Arnold Robbins.
9008 * src/env.c: Fix typo in comment. From Arnold Robbins.
9010 2003-03-29 Jim Meyering <jim@meyering.net>
9014 * README: Note to expect build problems for stat.c on Ultrix 4.3.
9015 Note that there are some harmless test failures when running
9016 `make check' as root on some systems.
9018 2003-03-28 Jim Meyering <jim@meyering.net>
9020 * tests/stty/row-col-1: Skip this test if stty can't get window size.
9021 This happens when connecting to sparc-solaris5.7 via ssh from within
9022 emacs. Reported by Karl Berry.
9024 * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
9025 Otherwise, on systems (DJGPP) that emulate pipes using files,
9026 this test would never complete, waiting for `yes' to terminate.
9027 * tests/du/slink: As above, use seq, not `yes' to generate link target.
9028 * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
9029 Reported by Rich Dawe.
9031 2003-03-27 Jim Meyering <jim@meyering.net>
9033 * src/id.c: Remove Arnold Robbins' obsolete e-mail address
9034 from `written by...' comment, at his request.
9036 2003-03-24 Paul Eggert <eggert@twinsun.com>
9038 Fix buffer overrun problem reported by TAKAI Kousuke, along
9039 with some other POSIX incompatibilities.
9041 * src/printf.c (print_esc): Do not treat \x specially if
9042 POSIXLY_CORRECT. Avoid buffer overrun if the format ends
9043 in backslash. Treat incomplete escape sequences as strings
9044 of characters, as POSIX requires.
9045 (print_formatted): Allow multiple flags. Avoid buffer overrun
9046 if the format is incomplete.
9048 2003-03-24 Jim Meyering <jim@meyering.net>
9050 * tests/misc/printf: Add tests for the above fixes and changes.
9052 2003-03-26 Jim Meyering <jim@meyering.net>
9054 * src/copy.h (struct cp_options): Add a comment.
9056 2003-03-23 Jim Meyering <jim@meyering.net>
9058 * README: Describe problem with 64-bit mode on HPUX 11.x,
9059 with patch for /usr/include/inttypes.h.
9060 * TODO: Plan to add an autoconf test to work around the bug.
9062 2003-03-22 Jim Meyering <jim@meyering.net>
9064 * src/stat.c: Don't include <sys/sysmacros.h>.
9065 That is already done via system.h. Otherwise, the multiple
9066 inclusion would evoke redefinition warnings from Cray's /bin/cc,
9067 aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28.
9068 (human_fstype): Factor some directives `up', out of this function.
9069 Cast away `const' to avoid error from Cray's /bin/cc.
9071 2003-03-20 Jim Meyering <jim@meyering.net>
9073 * announce-gen (print_changelog_deltas): Ensure that a newline
9074 precedes each row of `*'s.
9076 2003-03-20 Jim Meyering <jim@meyering.net>
9080 * src/seq.c (valid_format): Also accept ` ' and `'' as valid
9081 format flag characters.
9082 Do not require that a field width be specified.
9083 Do not fail when given a field width of `0'.
9084 Reported by Dan Jacobson.
9085 * tests/seq/basic: Add new tests for the above-fixed bug.
9087 * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
9088 (install-root): Likewise.
9089 (install-exec-local): Likewise.
9090 Based on a patch from Richard Dawe.
9092 2003-03-19 Jim Meyering <jim@meyering.net>
9094 * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
9095 because the DJGPP 2.03 port of 'ln -s' doesn't work.
9096 Include $(EXEEXT) in program names.
9097 Since $(LN_S) may degenerate to `cp -p', be careful
9098 to invoke it from the destination directory.
9099 Mostly from Richard Dawe.
9100 * configure.ac: Use AC_PROG_LN_S.
9102 * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the
9103 CDPATH shell variable set could cause this test to fail.
9104 Reported by Karl Berry.
9106 2003-03-18 Jim Meyering <jim@meyering.net>
9108 * src/fmt.c [struct Word] (paren, period, punct, final): Change the
9109 type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
9110 AIX 5.1's xlc could not compile the former.
9111 Patch by Petter Reinholdtsen. Also reported by Mike Jetzer.
9113 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
9115 * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
9116 program names, since automake only adds $(EXEEXT) to programs
9119 2003-03-16 Jim Meyering <jim@meyering.net>
9121 * src/remove.c (rm): Put two local variables in static storage,
9122 so they can't be clobbered by the potential longjmp.
9124 2003-03-15 Jim Meyering <jim@meyering.net>
9126 * Makefile.cfg (gnu_rel_host): Fix code to match the comment
9127 so that a version number with a two-digit component can still count
9128 as an alpha release. Reported by Richard A Downing.
9129 (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
9131 2003-03-14 Jim Meyering <jim@meyering.net>
9133 * src/ansi2knr.c: Remove no-longer-used file.
9134 * src/ansi2knr.1: Likewise.
9136 * Makefile.maint (prev_version_file): Don't use ?= for this particular
9137 assignment, since it causes trouble with old versions of GNU make
9138 (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here.
9139 http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
9140 Patch from Alexandre Duret-Lutz.
9142 * Use patched automake-1.7.3. Regenerate Makefile.in files in
9143 subdirectories so that each includes a definition of ACLOCAL_M4.
9145 * announce-gen (main): Label the compressed source URLs.
9149 * tests/du/slink: Relax the test for the `local'ness of a file system,
9150 so that now it works also for tmpfs.
9152 * tests/du/hard-link: Transform output from first du, so that this
9153 test doesn't fail on file systems like tmpfs that order directory
9154 entries differently.
9156 2003-03-13 Jim Meyering <jim@meyering.net>
9158 * tests/du/8gb: Work around what appears to be an NFS failure that
9159 would make this test fail on some systems.
9161 2003-03-11 Jim Meyering <jim@meyering.net>
9163 * tests/du/basic: Make the test file exactly 4k bytes long.
9165 * src/split.c (longopts): Don't hard-code `2' here.
9166 Instead, just specify `&verbose', and ...
9167 (main): ... remove the `case 2:' block for --verbose.
9169 * tests/du/basic: Make the test file larger than 64 bytes, so that
9170 we don't immediately disqualify file systems (e.g., NetApp) on which
9171 smaller files take up zero disk blocks. Reported by Vin Shelton.
9173 2003-03-10 Jim Meyering <jim@meyering.net>
9175 Don't segfault for a negative field width or precision in format string.
9176 Note that this is just a stopgap fix. The longer term solution may
9177 involve adapting bash's builtins/printf.def.
9179 * src/printf.c: (UNSPECIFIED): Define.
9180 (print_direc): Use the special value, UNSPECIFIED, to indicate
9181 that field_width or precision has not been specified.
9182 (print_formatted): Fail if field_width or precision is the
9183 special value, UNSPECIFIED.
9184 Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
9186 * src/sys2.h (INT_MIN): Define, if necessary.
9187 * tests/misc/printf: Add a test for the above-fixed bug.
9189 2003-03-09 Jim Meyering <jim@meyering.net>
9191 * src/remove.c (AD_stack_pop): Cast sizeof... to int before
9192 changing its sign. This avoids a warning from gcc on 64-bit systems.
9193 Reported by Bob Proulx.
9194 (pop_dir): Reverse order of sign change and cast, to be consistent
9197 2003-03-08 Jim Meyering <jim@meyering.net>
9199 * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
9200 shell variable, but only in the environment. With /bin/sh->bash, the
9201 shell variable is set to `y', and that would cause a spurious warning.
9202 Reported by Bob Proulx.
9204 * tests/Makefile.am (check-root): Remove touch/fifo.
9205 It doesn't appear to have to be run as root.
9207 * tests/rm/fail-2eperm: Rather than simply using the first non-root
9208 user name, make sure that the selected user name has a usable shell.
9209 Reported by Paul Jarc.
9211 Before, when using shred on a device, one had to specify --exact,
9212 or be careful to choose a size that would not be rounded up and
9213 exceed the maximum value; that could result in a failure of
9215 * src/shred.c (do_wipefd): --exact is now the default for non-regular
9216 files. Suggestion from Ben Elliston.
9219 * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
9220 Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
9221 Patch by Bob Proulx.
9223 * src/Makefile.am (check-misc): Check for use of `defined' in
9225 Change to $(srcdir) before running grep.
9227 * src/sleep.c: Remove now-unused #include and #define directives.
9229 * src/du.c (process_file): If a file's size is not being counted
9230 e.g., because it's a hard link to a file we've already counted,
9231 then don't print a line for it.
9233 * tests/du/hard-link: New test for the above-fixed bug.
9234 * tests/du/Makefile.am (TESTS): Add hard-link.
9237 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
9238 and make the two-array approach work.
9240 * tests/du/basic: Correct/add tests for the above fix.
9241 Set LC_ALL, etc., now that we use sort.
9242 Check the block/size of a small file, too.
9243 Correct expected results for simple dir1/dir2/file case.
9244 Add another test of du -S.
9246 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
9248 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
9249 middle-end/9986). As one of GCC's optimizations, it transforms a
9250 fputs_unlocked call to a fputc_unlocked call when the string is
9251 one character long. However, hpux doesn't have fputc_unlocked.
9253 * expr.c (usage): Use putchar, not fputs, to output a single character.
9254 * ls.c (dired_dump_obstack): Likewise.
9255 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
9256 * stat.c (print_it): Likewise.
9258 2003-03-07 Jim Meyering <jim@meyering.net>
9260 * src/cp.c: Remove everything associated with mmap-stack.c.
9261 This reverts the two changes of 2003-02-21.
9262 * src/du.c: Remove everything associated with mmap-stack.c.
9263 This reverts the change of 2003-02-19.
9265 2003-03-06 Jim Meyering <jim@meyering.net>
9267 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
9268 CDPATH shell variable set could cause this test to fail.
9269 Reported by Karl Berry.
9271 2003-03-05 Jim Meyering <jim@meyering.net>
9275 * src/printf.c (print_esc): Remove pointless comparison of unsigned
9276 integer with zero, to avoid a warning from Intel's ecc.
9277 Reported by Nelson Beebe.
9279 * src/du.c (process_file): Sizes must all be of type uintmax_t.
9280 Otherwise, for files or totals that are too big, numbers would
9281 be truncated. Patch mostly by Michael Stone.
9282 Reported by Ingo Saitz as Debian bug #183210.
9284 * tests/du/8gb: New test for the above-fixed bug.
9285 * tests/du/Makefile.am (TESTS): Add 8gb.
9287 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
9288 rather than UTILS_OPEN_MAX - 10.
9290 2003-03-04 Jim Meyering <jim@meyering.net>
9292 * README: Refer new feature discussion to bug-coreutils@gnu.org,
9293 rather than bug-gnu-utils, now that the former is better known.
9294 Suggestion from Göran Uddeborg.
9296 * src/stat.c (usage): Capitalize consistently.
9297 Reported by Göran Uddeborg.
9299 * Makefile.maint (rel-files): Include $(signatures), so that
9300 those files are also copied into $(release_archive_dir).
9302 * src/df.c (find_mount_point): Call error here, now that restore_cwd
9304 * src/remove.c (AD_pop_and_chdir): Likewise.
9306 * tests/Makefile.am (check-root): Add fail-2eperm.
9308 2003-03-03 Jim Meyering <jim@meyering.net>
9310 * src/remove.c (remove_cwd_entries): Include the full filename of
9311 the offending file, not just the basename.
9313 * tests/misc/tty-eof: Set $ME properly.
9315 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
9316 Remove now-unused variables.
9317 (tag-prev-version, prev-cvs-tag): Likewise.
9319 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
9320 accurate diagnostic when failing to remove a file owned by some other
9321 user. Reported by Ivo Timmermans via Michael Stone.
9322 This fixes Debian bug# 178471.
9324 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
9325 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
9326 Based on a report from Ivo Timmermans.
9328 2003-03-02 Jim Meyering <jim@meyering.net>
9330 * src/copy.c (copy_internal) [un_backup]: When recovering from a
9331 failure to create a hard link, do not remove the entry associating
9332 the source dev/ino with the destination file name.
9333 * tests/mv/Makefile.am (TESTS): Add hard-3.
9334 * tests/mv/hard-3: New test, for the above-fixed bug.
9335 Inspired by a report from Iida Yosiaki.
9337 2003-03-01 Jim Meyering <jim@meyering.net>
9339 * src/df.c (print_header): Don't embed spaces in a separate `Type'
9340 header string. Instead, put `Filesystem' and `Type' headers in the
9341 same string, so translators can use horizontal space as needed.
9342 Reported by Jean Charles Delepine.
9344 2003-02-28 Jim Meyering <jim@meyering.net>
9346 * src/copy.c (copy_internal): When link fails because of an
9347 existing destination file, unlink that file and try again.
9348 Reported by Iida Yosiaki.
9350 * tests/mv/Makefile.am (TESTS): Add hard-2.
9351 * tests/mv/hard-2: New test for the above-fixed bug.
9352 Based on a test case from Iida Yosiaki.
9354 2003-02-26 Jim Meyering <jim@meyering.net>
9356 * tests/du/basic: Don't test du's -b option here. Directory byte
9357 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
9358 and IBM AIX 4.2. Reported by Nelson Beebe.
9360 2003-02-25 Jim Meyering <jim@meyering.net>
9362 * Makefile.maint (announcement): Now that ChangeLog entries
9363 are output by announce-gen, don't do it here.
9364 * announce-gen (print_changelog_deltas): New function.
9367 2003-02-22 Jim Meyering <jim@meyering.net>
9369 * announce-gen: New option: --release-type=TYPE
9370 * Makefile.maint (beta, major): New targets. Remove `release'.
9371 Put them all together on a line.
9372 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
9373 invocation of `announcement'.
9374 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
9376 * announce-gen: New option: --news=NEWS_FILE.
9377 Extract NEWS entries here, not via rules in Makefile.maint.
9378 * Makefile.maint (announcement): Now that NEWS entries are
9379 extracted by announce-gen, don't do it here.
9380 (news-r1, news-r2): Remove now-unused definitions.
9382 2003-02-21 Jim Meyering <jim@meyering.net>
9386 Merge in changes from autoconf's version of this file.
9387 * Makefile.maint (www-gnu): Define.
9388 (standards.texi-url_prefix): Use $(www-gnu).
9389 (make-stds.texi-url_prefix): Likewise.
9391 * src/cp.c: Include "mmap-stack.h".
9392 (main): Invoke `run' through a macro that (when possible) runs it
9393 with a large, mmap'd stack.
9395 * src/cp.c (run): New function, preparing for the above.
9396 Exit from this function, not from main
9399 * src/du.c: New option: --apparent-size.
9400 (enum) [APPARENT_SIZE_OPTION]: New member.
9401 (long_options): Add it.
9402 (usage): Describe it.
9404 ['b']: Set apparent_size.
9405 David Eisner reported that the behavior of --bytes had changed.
9406 Paul Eggert proposed the use of a new option, --apparent-size.
9408 * src/du.c (apparent_size): New global.
9409 (print_only_size): Reflect the fact that we're printing byte counts,
9410 not ST_NBLOCKSIZE-byte-block counts.
9411 (print_size): Call print_only_size rather than duplicating its code.
9412 (process_file): Accumulate byte counts, rather than block counts.
9414 * src/du.c (process_file): Always reset size_to_propagate_to_parent
9415 for --separate-dirs (-S).
9417 2003-02-20 Jim Meyering <jim@meyering.net>
9419 * Use automake-1.7.3. Regenerate dependent files.
9421 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
9422 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
9423 (usage) [%B]: Describe it.
9426 * src/du.c (process_file): Reorganize the code to use only
9427 one `sum' array, and change how -S works back to the way it was
9428 before 2003-01-31. Patch by Bruno Haible.
9430 * tests/du/basic: New test.
9431 * tests/du/Makefile.am (TESTS): Add basic.
9433 * tests/envvar-check: Add checks for the following:
9434 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
9436 * tests/Makefile.am: Rename phony target envvar-check to evar-check
9437 so as not to conflict with the distributed file by the same name.
9439 * src/du.c (process_file): Set info->skip before any possible return.
9441 Report correct usage for directories, not 0.
9442 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
9443 _before_ recording the dev/ino of a directory.
9444 Reported by Bruno Haible.
9446 Now, df always displays the device file name corresponding to the
9447 listed mount point under `Filesystem'. Before, for an unmounted
9448 block- or character-special file argument, it would display the
9449 command-line argument instead.
9450 * src/df.c (show_disk): Return a value indicating whether
9451 there was a match. Don't try to find a mount point here.
9452 (show_entry): If show_disk doesn't find a match, call show_point.
9454 2003-02-19 Jim Meyering <jim@meyering.net>
9456 * src/du.c: Include "mmap-stack.h".
9457 (du_files): Add prototype with ATTRIBUTE_NORETURN.
9458 Exit from this function, not from...
9460 Instead, if possible, invoke du_files through a macro that
9461 runs it with a large, mmap'd stack.
9463 * src/join.c (usage): Change wording in --help output:
9464 use FILENUM instead of `SIDE' and say what FILENUM means.
9465 Reported by Bernhard Gabler.
9467 * src/df.c (print_header): Rather than using a hard-coded literal
9468 string of spaces matching the length of the English `...Type' header,
9469 output the right number of spaces to match the selected translation.
9470 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
9472 * src/split.c (bytes_split): Remove unnecessary `else' after break.
9473 (lines_split): Likewise. and correct misleading indentation.
9475 * src/split.c: Include "full-read.h".
9476 (bytes_split, lines_split, line_bytes_split): Use full_read,
9477 not safe_read. The way split was using the latter, a short read
9478 could cause split to terminate before EOF.
9480 * tests/misc/tty-eof: Test all programs that can read stdin,
9481 requiring no arguments and that write to standard output.
9483 * tests/misc/tty-eof: New file. Renamed from ...
9484 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
9485 * tests/misc/Makefile.am (TESTS): Reflect renaming.
9487 2003-02-18 Jim Meyering <jim@meyering.net>
9489 cksum would perform an extra read after encountering EOF
9490 * src/cksum.c (cksum): Exit the loop upon EOF, too.
9491 Patch by Michael Bacarella.
9493 Test for the bug fixed today in cksum, md5sum, and sha1sum.
9494 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
9495 cat, cksum, md5sum, and sha1sum all in the same loop.
9497 2003-02-14 Jim Meyering <jim@meyering.net>
9499 * src/remove.c: Include "euidaccess.h".
9500 Remove declaration of euidaccess.
9502 2003-02-12 Jim Meyering <jim@meyering.net>
9504 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
9505 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
9507 2003-02-10 Jim Meyering <jim@meyering.net>
9509 * src/test.c: Don't include group-member.h.
9510 Include euidaccess.h.
9511 (eaccess): Rewrite function to set the real uid and gid temporarily
9512 to the effective uid and gid, then invoke 'access', and then set the
9513 real uid and gid back. On systems that lack setreuid or setregid,
9514 fall back on the kludges in euidaccess. Before, it would not work
9515 for e.g., files with ACLs, files that were marked immutable,
9516 or on file systems mounted read-only. Nelson Beebe raised the issue.
9517 Paul Eggert suggested the new implementation.
9519 2003-02-09 Jim Meyering <jim@meyering.net>
9521 * src/test.c (test_stat): Remove function. It's job is done (only
9522 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
9524 2003-02-08 Jim Meyering <jim@meyering.net>
9528 * tests/mv/part-symlink: Don't assume that the file owner username
9529 length is less than 9 in ls output: instead, omit that field
9530 altogether. Reported by, and suggested fix from, Ferdinand.
9532 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
9533 * tests/du/Makefile.am (TESTS): Add restore-wd.
9535 * src/rm.c: Correct now-invalid comment about cycle-detection.
9537 2003-02-06 Jim Meyering <jim@meyering.net>
9539 * NEWS: Add entries from old/*/NEWS
9540 from fileutils-4.1 through 4.1.11 and
9541 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
9545 * src/du.c (process_file): Don't return early for excluded files
9546 or for files whose dev/inode we've already seen.
9548 2003-02-05 Jim Meyering <jim@meyering.net>
9550 * tests/du/exclude: New file.
9551 * tests/du/Makefile.am (TESTS): Add exclude.
9553 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
9555 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
9556 Fix memory allocation arithmetic.
9558 2003-02-04 Jim Meyering <jim@meyering.net>
9560 `df /dev/block-or-char-device-file--not-mounted' now reports
9561 the name of the file system on which the file resides, usually `/'.
9562 Before, it would leave the `Mounted on' field blank.
9563 * src/df.c (show_disk): Move function to precede find_mount_point.
9564 (show_disk): Add parameter: STATP.
9565 If we don't find a matching device name, then resort to calling
9566 find_mount_point. Reported by Bob Proulx.
9568 2003-02-03 Andreas Schwab <schwab@suse.de>
9570 * tests/rm/cycle: Require non-root.
9571 * tests/rm/isatty: Likewise.
9573 2003-02-02 Jim Meyering <jim@meyering.net>
9577 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
9579 Ensure that there are no offending uses of `:'.
9580 * Makefile.maint (makefile_path_separator_check): New rule.
9581 (local-check): Add it to the list.
9583 2003-02-01 Jim Meyering <jim@meyering.net>
9585 * src/du.c (MAX_N_DESCRIPTORS): Define.
9587 * src/stat.c (G_fail): New global.
9588 (human_time): Diagnose failed localtime, not failed nstrftime.
9589 (main): Fail if G_fail is set.
9591 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
9593 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
9594 hard-coding the path-separator. Also double-quote the new PATH,
9595 to avoid problems when the path-separator is a semi-colon or when
9596 `pwd` contains e.g. a space.
9597 * tests/chgrp/Makefile.am: Likewise.
9598 * tests/chmod/Makefile.am: Likewise.
9599 * tests/chown/Makefile.am: Likewise.
9600 * tests/cp/Makefile.am: Likewise.
9601 * tests/dd/Makefile.am: Likewise.
9602 * tests/dircolors/Makefile.am: Likewise.
9603 * tests/du/Makefile.am: Likewise.
9604 * tests/expr/Makefile.am: Likewise.
9605 * tests/factor/Makefile.am: Likewise.
9606 * tests/fmt/Makefile.am: Likewise.
9607 * tests/install/Makefile.am: Likewise.
9608 * tests/ln/Makefile.am: Likewise.
9609 * tests/ls/Makefile.am: Likewise.
9610 * tests/ls-2/Makefile.am: Likewise.
9611 * tests/md5sum/Makefile.am: Likewise.
9612 * tests/misc/Makefile.am: Likewise.
9613 * tests/mkdir/Makefile.am: Likewise.
9614 * tests/mv/Makefile.am: Likewise.
9615 * tests/od/Makefile.am: Likewise.
9616 * tests/rm/Makefile.am: Likewise.
9617 * tests/rmdir/Makefile.am: Likewise.
9618 * tests/seq/Makefile.am: Likewise.
9619 * tests/sha1sum/Makefile.am: Likewise.
9620 * tests/shred/Makefile.am: Likewise.
9621 * tests/stty/Makefile.am: Likewise.
9622 * tests/sum/Makefile.am: Likewise.
9623 * tests/tail-2/Makefile.am: Likewise.
9624 * tests/touch/Makefile.am: Likewise.
9625 * tests/tsort/Makefile.am: Likewise.
9626 * tests/unexpand/Makefile.am: Likewise.
9628 2003-01-31 Jim Meyering <jim@meyering.net>
9630 * src/stat.c: Include "file-type.h"
9631 (print_human_type): Remove function.
9632 (human_access): Rename from print_human_access. Return a string.
9633 (human_time): Rename from print_human_time. Return a string.
9634 (print_stat): Arrange so that field width and an alignment specifier
9635 are honored for the %A, %F, %x, %y, and %z formats.
9636 [%F]: Use file_type; this gives slightly different file type strings,
9637 e.g., `directory' instead of `Directory' and `regular file' or
9638 `regular empty file' instead of `Regular file'.
9639 Prompted by a report from Richard Dawe that the uses of
9640 S_IFSOCK and S_IFIFO in print_human_time were not portable
9641 to systems using e.g., DJGPP.
9643 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
9645 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
9646 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
9648 2003-01-31 Jim Meyering <jim@meyering.net>
9650 * src/du.c (main): Upon processing an invalid option or an invalid
9651 --exclude-from or --max-depth option argument, don't exit right away,
9652 in case there are others. Rather record the failure and exit after
9653 processing other options.
9655 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
9656 tar archive easier to reproduce.
9658 Rewrite to perform directory traversal using nftw.
9660 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
9661 (AUTHORS): Add self.
9662 (opt_one_file_system): Move global into `main'.
9663 (path, xstat, exit_status): Remove declarations.
9664 (arg_length, suffix_length): New globals.
9665 (G_fail): New global, sort of like the old `exit_status'.
9666 (IS_FTW_DIR_TYPE): Define.
9667 (print_only_size): New function.
9668 (process_file): New function.
9669 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
9670 (str_trunc, pop_dir, count_entry): Likewise.
9671 (du_files): Rewrite to use nftw.
9673 2003-01-30 Jim Meyering <jim@meyering.net>
9675 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
9676 symlink-to-directory with -L, even without the trailing slash.
9678 2003-01-27 Jim Meyering <jim@meyering.net>
9680 * src/Makefile.am (check-misc): Check for st_blocks, too.
9682 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
9683 Reported by Richard Dawe.
9685 2003-01-27 Andreas Schwab <schwab@suse.de>
9687 * src/ls.c (quote_name): Add fourth parameter, width, into which to
9688 store the screen columns, and return the number of bytes instead.
9689 (print_dir): Pass NULL as fourth parameter of quote_name.
9690 (print_name_with_quoting): Likewise.
9691 (length_of_file_name_and_frills): Get the width from the fourth
9692 parameter of quote_name instead of return value.
9694 2003-01-27 Jim Meyering <jim@meyering.net>
9696 * src/ls.c (decode_switches): If `dired' is set without
9697 `format == long_format', then silently reset dired. This doesn't
9698 change the behavior of ls (all prior uses of dired were protected
9699 by `&& format == long_format'), and lets us...
9700 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
9701 (PUSH_CURRENT_DIRED_POS): Likewise.
9704 2003-01-22 Jim Meyering <jim@meyering.net>
9706 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
9707 * tests/du/Makefile.am (TESTS): Add no-x.
9709 2003-01-21 Jim Meyering <jim@meyering.net>
9711 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
9712 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
9713 it may still be a directory -- or not (e.g., with FreeBSD on an
9714 NFS-mounted file system), so resort to calling lstat to find out.
9715 Based on a patch by Michael van Elst.
9717 * tests/cp/same-file: Don't assume that the file owner username
9718 length is less than 9 in ls output: instead, omit that field
9719 altogether. Reported by, and suggested fix from, Ferdinand.
9721 2003-01-20 Jim Meyering <jim@meyering.net>
9723 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
9724 large format widths no longer cause strftime to infloop.
9726 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
9728 2003-01-19 Jim Meyering <jim@meyering.net>
9730 * src/readlink.c: Include "canonicalize.h".
9732 2003-01-18 Jim Meyering <jim@meyering.net>
9734 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
9736 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
9737 (long_options): Add option --dereference-command-line-symlink-to-dir.
9738 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
9739 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
9740 -d, -F, -l options is specified.
9741 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
9742 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
9743 Change --dereference-command-line (-H) to dereference *all*
9744 command line arguments, including broken symlinks.
9746 2003-01-15 Paul Eggert <eggert@twinsun.com>
9748 Change ls -H back to the way it was yesterday, since this is
9749 compatible with FreeBSD and the POSIX spec is confusing
9750 and somewhat contradictory.
9752 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
9753 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
9754 (long_options): Change the long option name back.
9755 (usage): Change the usage back.
9756 (gobble_file): When -H is specified, dereference a top-level
9757 arg even if it points to a non-directory.
9759 2003-01-15 Jim Meyering <jim@meyering.net>
9761 * src/ls.c (gobble_file): Fall back on using lstat when required:
9762 when --dereference (-L) is not specified, and
9763 - when operating on a dangling symlink
9764 - when operating on command-line-symlink-to-directories
9765 This fixes numerous problems. Here are examples:
9766 - `ls dangling-symlink' would fail with `no such file...'
9767 Now it prints `dangling-symlink'.
9768 - `ls -i symlink' would mistakenly print the inode of the referent.
9769 Now it prints the inode of the symlink. Likewise for --size (-s).
9770 Based on a patch from Michael Stone.
9771 Reported by Deepak Goel as Debian bug #173793.
9773 Rename ls's --dereference-command-line (-H)
9774 option to --dereference-command-line-symlink-to-dir.
9775 * src/ls.c [enum Dereference_symlink]
9776 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
9777 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
9778 (long_options): Rename the long option.
9779 (usage): Say that --dereference-... changes how ls treats
9780 only symlinks to directories specified on the command line.
9782 2003-01-14 Jim Meyering <jim@meyering.net>
9784 * tests/ls/dangle: New file/test, for the above fix.
9785 * tests/ls/inode: Another new file/test, for the above fix.
9786 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
9788 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
9789 so that ls --color would no longer highlight the names of files with
9790 the execute bit set when not specified on the command line.
9791 Patch by Michael Stone. Reported by Stephen Depooter as
9794 * tests/ls-2/tests (color-exe): New test, for the above fix.
9796 2003-01-13 Jim Meyering <jim@meyering.net>
9798 * tests/shred/exact: Also test for just fixed bug with --zero.
9800 * src/shred.c (long_opts): --zero does not require an argument.
9801 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
9803 2003-01-12 Jim Meyering <jim@meyering.net>
9805 * Makefile.maint (cvs-update): Skip any file with local modifications.
9807 * src/unexpand.c (usage): Document --first-only and mention that
9808 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
9810 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
9812 * src/df.c: Include "canonicalize.h".
9813 Use canonicalize_file_name unconditionally.
9815 2003-01-09 Jim Meyering <jim@meyering.net>
9817 * README: Add readlink.
9819 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
9821 * src/df.c: Include "xgetcwd.h".
9822 * src/pwd.c: Likewise.
9824 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
9826 * src/shred.c: Remove declaration of xstrdup.
9827 We already get it via xalloc.h which is included via system.h.
9829 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
9831 New program: readlink.
9833 * src/Makefile.am (bin_PROGRAMS): Add readlink.
9834 * src/readlink.c: New file.
9836 * man/readlink.x: New file.
9837 * man/Makefile.am (dist_man_MANS): Add readlink.1.
9838 (readlink.1): New rule.
9840 2003-01-09 Jim Meyering <jim@meyering.net>
9842 When selecting ranges of byte offsets (as opposed to ranges of fields)
9843 and when --output-delimiter=STRING is specified, output STRING between
9844 ranges of selected bytes.
9845 * src/cut.c (RANGE_START_SENTINEL): Define.
9846 (output_delimiter_specified): New global.
9847 (print_kth): Add parameter. Adjust all callers.
9848 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
9849 (cut_bytes): When requested, output STRING between ranges of
9851 (main): Make a diagnostic a little clearer.
9852 Based on a patch from Jan Nieuwenhuizen.
9854 * tests/cut/Test.pm: New tests for the above.
9856 * src/cut.c (set_fields): Make code agree with comment:
9857 Don't merge abutting ranges like 4- and 2-3. This makes no
9858 difference currently, but is required to support an upcoming change.
9860 2003-01-07 Jim Meyering <jim@meyering.net>
9862 * src/cut.c (set_fields): Fix typo in comment.
9864 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
9865 * tests/touch/Makefile.am (TESTS): Add not-owner.
9866 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
9867 Now, this tests only the nonexistent-directory diagnostic.
9868 Suggestion from Michael Stone.
9870 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
9872 2003-01-04 Jim Meyering <jim@meyering.net>
9874 * src/copy.h: Remove use of PARAMS.
9875 * src/remove.h: Likewise.
9876 * src/chown-core.h: Likewise.
9878 rm could be tricked into mistakenly reporting a cycle.
9879 * src/remove.c: [cycle_check_state]: New global.
9880 (remove_cwd_entries): Adapt to new semantics of cycle_check.
9881 (rm): Call cycle_check_init and cycle_check_free for each file.
9882 * tests/rm/cycle (rm): New test, for the above fix.
9883 * tests/rm/Makefile.am (TESTS): Add cycle.
9885 When rm detects a cycle, don't abort the entire command,
9886 but rather just the affected command line argument.
9887 * src/remove.c: Include <setjmp.h>
9888 (struct dirstack_state) [current_arg_jumpbuf]: New member.
9889 (remove_cwd_entries): Call longjmp if we detect a cycle.
9890 (rm): Call setjmp here.
9892 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
9893 Instead, include cycle-check.h and use it.
9895 * src/remove.h (struct dev_ino): Remove declaration.
9897 * src/remove.c (remove_cwd_entries): Fix typos in comment.
9899 Don't include trailing /. in diagnostics about directories.
9900 * src/remove.c (full_filename_): When FILENAME is just `.'
9901 and there is a nonempty directory-name part, don't append `/.'.
9902 * tests/rm/unread2: Remove trailing /. from diagnostic.
9903 * tests/rm/rm2: Likewise.
9905 * src/remove.c (struct dirstack_state): Define.
9906 To be used in place of these file-scoped globals ...
9907 (dir_stack, len_stack, Active_dir): Remove globals.
9908 (ds_init, ds_free): New functions.
9909 (full_filename): Define.
9910 (full_filename_): Rename from full_filename.
9912 Begin to make AD_* functions more generic.
9913 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
9914 (AD_push): Likewise.
9915 (AD_INIT_OTHER_MEMBERS): Define.
9916 (remove_dir): Define the `status' member manually after each
9917 call to AD_push or AD_push_initial.
9919 * src/Makefile.am (check-misc): New rule, to ensure that no more
9920 S_IS* macro definitions sneak into the code.
9921 (check): Depend on check-misc.
9923 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
9924 * src/du.c (count_entry) [S_ISLNK]: Don't define.
9925 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
9927 2003-01-03 Jim Meyering <jim@meyering.net>
9929 * src/true.c: Add copyright.
9930 (AUTHORS): I suppose I've written it.
9932 * src/Makefile.am (false.c): Make the generated file be read-only.
9934 2003-01-04 Jim Meyering <jim@meyering.net>
9936 * src/ls.c: Include "dev-ino.h".
9937 [struct dev_ino]: Remove declaration.
9939 2003-01-02 Jim Meyering <jim@meyering.net>
9941 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
9942 from mv: s/missing file arguments/missing file argument/.
9943 With --target-directory=DIR, cp and mv work with a single file argument.
9944 Reported by Karl Berry.
9946 * tests/rm/isatty: Enable this test.
9948 2002-12-31 Jim Meyering <jim@meyering.net>
9950 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
9951 (AD_push): Likewise.
9952 (AD_INIT_OTHER_MEMBERS): Define.
9953 (remove_dir): Define the `status' member manually after each
9954 call to AD_push or AD_push_initial.
9956 * src/ls.c [struct dev_ino]: Remove definition.
9957 Include "dev-ino.h" instead.
9959 2002-12-28 Jim Meyering <jim@meyering.net>
9961 * tests/du/Makefile.am (TESTS): Add no-deref.
9962 * tests/du/no-deref: New script.
9964 2002-12-23 Jim Meyering <jim@meyering.net>
9966 * src/remove.c (remove_cwd_entries): Fix typo in comment.
9968 2002-12-21 Jim Meyering <jim@meyering.net>
9970 * announce-gen: Generate MML-formatted announcement.
9971 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
9973 2002-12-20 Jim Meyering <jim@meyering.net>
9975 * src/touch.c (touch): Change the wording of a diagnostic so
9976 that it makes sense both when the file exists and when it doesn't.
9977 Suggestion from Michael Stone.
9979 2002-12-18 Jim Meyering <jim@meyering.net>
9981 * src/stty.c (valid_options): Declare to be static.
9983 2002-12-15 Jim Meyering <jim@meyering.net>
9985 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
9987 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
9988 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
9989 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
9990 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
9991 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
9993 * src/remove.c (PARAMS): Remove definition.
9994 * src/sys2.h: Likewise.
9996 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
9997 Include strftime.h instead.
9999 2002-12-14 Jim Meyering <jim@meyering.net>
10001 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
10003 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
10004 This is necessary at least for Irix6.5 when using c89.
10005 Reported by Nelson Beebe.
10007 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
10009 * tests/misc/cat-tty-eof: New test.
10011 * src/mknod.c (usage): Specify how major and minor mode numbers
10012 are interpreted. Report forwarded by Kristin E Thomas.
10013 * src/mknod.c: Remove now-redundant usage-specifying comment.
10015 2002-12-13 Jim Meyering <jim@meyering.net>
10019 * tests/du/trailing-slash: Allow for a directory of size `0'.
10020 That happens at least on file systems of type tmpfs on linux-2.4.18.
10022 * announce-gen: New script to begin replacing the commands
10023 associated with the rule here...
10024 * Makefile.maint (announcement): Invoke announce-gen.
10025 * Makefile.am (EXTRA_DIST): Add announce-gen.
10027 * tests/cp/preserve-2: New file/test, for latest fix.
10028 * tests/cp/Makefile.am (TESTS): Add preserve-2.
10030 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
10032 Fix a bug whereby cp would fail to parse an option like
10033 --preserve=mode,ownership.
10034 * src/cp.c (decode_preserve_arg): Advance `comma' to
10035 point the character following the comma.
10037 2002-12-11 Jim Meyering <jim@meyering.net>
10039 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
10040 in case it's already defined.
10042 2002-12-09 Jim Meyering <jim@meyering.net>
10044 * tests/touch/fail-diag: Don't get a test failure if /no exists.
10045 Instead, evoke a framework failure if /no-$$ exists.
10046 Reported by Michael Stone.
10048 2002-12-08 Jim Meyering <jim@meyering.net>
10050 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
10051 Define to rpl_lstat, so that even on systems like Solaris 5.8,
10052 du honors (per POSIX) the trailing slash on an argument referring
10053 to a symlink-to-directory.
10055 2002-12-06 Jim Meyering <jim@meyering.net>
10057 * Use autoconf-2.57. Regenerate dependent files.
10058 * Use automake-1.7.2. Regenerate dependent files.
10060 * src/ls.c (gobble_file): Also stat the file if it's a
10061 regular file and --indicator-style=classify (aka -F).
10062 Thanks to Ed Santiago for opening my eyes.
10064 * tests/ls/file-type: New file. Test for the above.
10065 A test to contrast ls -F and ls --indicator-style=file-type.
10066 * tests/ls/Makefile.am (TESTS): Add file-type.
10068 2002-12-04 Jim Meyering <jim@meyering.net>
10070 * tests/ls/follow-slink: Make sure the symlink was created.
10071 Richard Dawe reported that `ln -s link link' succeeds, but creates
10072 no file on systems running some version of the DJGPP libc.
10074 2002-12-03 Jim Meyering <jim@meyering.net>
10076 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
10077 since this package no longer panders to K&R compilers.
10079 2002-12-02 Jim Meyering <jim@meyering.net>
10081 * tests/du/slink: Skip this test if `.' is on a non-local file system.
10083 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
10084 something to replace.
10086 2002-12-01 Jim Meyering <jim@meyering.net>
10088 * src/stat.c: Don't include <string.h> or <ctype.h>.
10089 That's already done via system.h.
10090 * src/dircolors.c: Don't include <ctype.h>.
10092 2002-11-30 Jim Meyering <jim@meyering.net>
10094 * ls.c (gobble_file): Remove the block of code that caused
10095 `ls --color -F symlink-to-dir' to list the files in
10096 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
10097 like `ls -F symlink-to-dir') but with the addition of highlighting.
10098 Similarly, `ls --color -dF symlink-to-dir' would print
10099 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
10100 Reported by Jeff Sheinberg as Debian bug #168203.
10101 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
10103 ls is now more efficient: with certain options, it no longer needs
10104 to stat each directory entry on systems with valid dirent.d_type.
10105 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
10106 (main): Make --recursive set format_needs_type, not format_needs_stat.
10107 (gobble_file): Remove a FIXME comment, now that it's fixed.
10109 2002-11-24 Jim Meyering <jim@meyering.net>
10111 * src/du.c (du_files): Don't strip any trailing slash.
10112 Rewrite so that `/' is no longer represented internally as
10114 (count_entry): When appending a file name component,
10115 account for the fact that the current path may end in `/'.
10116 François Pinard reported that `du symlink-to-dir/' was not
10117 equivalent to `du symlink-to-dir/.'. Now it is.
10118 * tests/du/trailing-slash: New file/test, for the above fix.
10119 * tests/du/Makefile.am (TESTS): Add trailing-slash.
10121 2002-11-23 Jim Meyering <jim@meyering.net>
10123 * src/tac.c (output): Declare some local variables to be of type size_t,
10124 rather than `int' to avoid warnings from gcc.
10126 2002-11-21 Paul Eggert <eggert@twinsun.com>
10128 * src/ls.c (decode_switches): Use case-sensitive matching to
10129 decode the QUOTING_STYLE environment variable. This is more
10130 consistent with the documentation, and with --quoting-style.
10132 2002-11-21 Martin Buck <martin.buck@ascom.ch
10134 * src/stty.c (struct speeds): Add support for all baud rates defined
10137 2002-11-19 Jim Meyering <jim@meyering.net>
10139 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
10140 run in a UTF locale. Report and suggested fix by Bruno Haible.
10141 * tests/fmt/basic: Likewise.
10143 2002-11-17 Jim Meyering <jim@meyering.net>
10145 * configure.ac: Update via autoupdate.
10146 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
10148 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
10149 Reported by Hans Ginzel.
10151 2002-11-15 Jim Meyering <jim@meyering.net>
10153 * Makefile.cfg (gnu_rel_host): Define.
10154 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
10155 on whether $(VERSION) looks like a major release number.
10157 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
10158 (release): Rename from `alpha'.
10159 (alpha): Depend on release.
10161 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
10163 2002-11-14 Jim Meyering <jim@meyering.net>
10165 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
10166 (announcement): Use the new variable.
10168 * Makefile.maint: Sync with Bison, i.e.:
10169 (po-check): Scan .l and .y files instead of the
10170 .c and the .h files that they generate. This fixes the bug
10171 reported by Tim Van Holder in:
10172 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
10173 Look for N_ as well as for _. Try to avoid matching #define for
10177 2002-11-12 Jim Meyering <jim@meyering.net>
10179 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
10180 Replace sole use with equivalent `#ifdef S_ISLNK'.
10181 Inconsistency reported by Dmitry V. Levin.
10183 2002-11-11 Jim Meyering <jim@meyering.net>
10185 * src/stat.c (usage): Transform --help items output via s/ - / /,
10186 so that help2man produces properly formatted man pages.
10187 Reported by Herbert Xu as Debian bug #168400.
10189 2002-11-10 Jim Meyering <jim@meyering.net>
10191 * src/ls.c (sighandler): Handle SIGTSTP specially.
10192 Based on suggestions from Solar Designer and Dmitry V. Levin.
10195 * Makefile.cfg (cvs_files): Define. From autoconf.
10196 (local_updates): Likewise.
10198 * src/ls.c (restore_default_color_handler, sigtstp_handler):
10200 (sighandler): New function, based on the one in sort.c.
10201 (main): Use sigaction, if possible; otherwise signal.
10202 Handle these signals:
10203 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
10204 Don't register our handler if the signal is already being ignored.
10206 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
10207 * src/csplit.c (interrupt_handler): Likewise.
10208 * src/sort.c (sighandler): Likewise.
10209 (main): Declare `i' and `nsigs' to be unsigned, not int.
10211 2002-11-09 Jim Meyering <jim@meyering.net>
10213 ls --color: restore terminal text color upon signal.
10214 * src/ls.c: Include "full-write.h" and <signal.h>.
10215 (restore_default_color, restore_default_color_handler): New functions.
10216 (sigtstp_handler, put_indicator_direct): New functions.
10217 (main) [print_with_color]: Register signal handlers.
10218 Patch mostly by Solar Designer and Stanislav Ievlev.
10220 Update from autoconf.
10221 * Makefile.maint (AMTAR): Remove definition.
10222 (update, cvs-update, po-update, do-po-update): New rules.
10223 (wget-update): Update (thus renaming to cvs-update).
10224 (automake_repo): Use anoncvs@sources.redhat.com.
10226 2002-11-06 Jim Meyering <jim@meyering.net>
10228 * tests/misc/Makefile.am (TESTS): Add printf-hex.
10230 * tests/misc/printf: Be careful to test the code in this package,
10231 not the shell built-in function.
10233 * src/printf.c (print_esc): A hexadecimal escape sequence has
10234 at most two hex. digits, not three. Reported by Padraig Brady.
10235 (usage): Update description.
10236 * tests/misc/printf-hex: New file/test, for the above fix.
10238 2002-10-07 Paul Eggert <eggert@twinsun.com>
10240 Add support for locale-specific size indications (e.g.,
10241 thousands-separators) and for explicit size suffixes on output.
10243 * doc/coreutils.texi (Block size): Say that:
10244 This affects display format as well as block size.
10245 Fractional block counts are rounded up.
10246 ls file size blocksize defaults to 1.
10247 A block size spec preceded by ' generates thousands separators.
10248 A suffix without a preceding integer generates suffixes.
10249 (tail invocation): 32k -> 32 KiB.
10250 (What information is listed): ls -h is now equivalent to
10251 ls --block-size=human, and ls -H is now equivalent to
10252 ls --block-size=si. Displayed file size is now always affected by
10255 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
10256 lib/umaxtostr.c: New files, taken from GNU tar.
10258 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
10260 (EXTRA_DIST): Add inttostr.c.
10262 * lib/human.c, lib/human.h: Rewrite to support locale-specific
10263 notations like thousands separators.
10264 Specify what includer of include.h must include beforehand.
10265 (human_group_digits, human_suppress_point_zero, human_autoscale,
10266 human_base_1024, human_SI, human_B): New enum values.
10267 (human_readable): Rename from human_readable_inexact; put the
10268 options before the sizes. All uses changed. The old human_readable
10269 function has been removed; use inttostr.h instead.
10270 (human_options): Renamed from human_block_size, with new signature
10271 that allows block sizes up to UINTMAX_MAX. All callers changed.
10273 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
10274 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
10275 freestanding C89. No need to check for stdlib.h or string.h since
10276 autoconf does this now.
10278 * src/cksum.c (cksum): Use primitives from inttostr.h, not
10279 human.h, to print large numbers simply.
10280 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
10281 * src/dd.c (print_stats, main): Likewise.
10282 * src/df.c (print_header): Likewise.
10283 * src/factor.c (print_factors): Likewise.
10284 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
10285 * src/shred.c (dopass): Likewise.
10286 * src/sort.c (checkfp): Likewise.
10287 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
10288 * src/tail.c (xlseek): Likewise.
10289 * src/wc.c (write_counts, wc): Likewise.
10291 * src/df.c (human_output_opts): New var.
10292 (output_block_size): Now uintmax_t, not int, to handle larger
10293 block sizes. All uses changed.
10294 * src/du.c: Likewise.
10295 * src/ls.c: Likewise.
10297 * src/df.c (print_header): In the header line, prefer SI to human
10298 representation if it's shorter; if neither is shorter, try to
10299 intuit what the user would prefer.
10301 * src/expr.c (inttostr): Remove; use new imaxtostr library
10304 * src/ls.c (file_output_block_size): New var, to distinguish
10305 file sizes from other sizes.
10306 (decode_switches): Set it.
10308 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
10309 (dopass): When printing progress, use floor for what has been done
10310 so far (since we should be conservative there), and ceiling for
10311 what needs to be done (since that's what other programs use).
10313 2002-10-19 Jim Meyering <jim@meyering.net>
10315 * src/pinky.c (print_heading): Align TTY and Name headings.
10316 Reported by Karl Eichwalder.
10318 2002-10-18 Jim Meyering <jim@meyering.net>
10320 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
10321 Remove now-useless cast.
10322 (stdread): Remove function.
10323 (bytes_split): Use size_t instead of int.
10324 Use safe_read, not stdread.
10325 (lines_split): Likewise.
10326 Use memchr rather than a `while' loop.
10327 (line_bytes_split): Use size_t instead of int.
10328 Use safe_read, not stdread.
10329 (main): Add some FIXME comments to remind me to remove casts.
10331 * src/system.h (ST_BLKSIZE): Correct comment describing how to
10332 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
10334 2002-10-17 Jim Meyering <jim@meyering.net>
10336 Fix a problem that could make e.g., `cat' misbehave on systems which
10337 give invalid (unreasonably large) values for stat.st_blksize.
10338 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
10339 Reported by Petter Reinholdtsen.
10341 2002-10-14 Jim Meyering <jim@meyering.net>
10343 Specifying a printf conversion specifer as nl's separator string
10344 could cause nl to segfault.
10345 * src/nl.c (build_print_fmt): Don't include separator string
10346 in the printf format; it might contain `%'.
10347 Use a better bound on the length of the print_fmt buffer.
10348 (print_lineno): Print the separator here instead.
10349 Reported by Doug Coleman.
10351 * tests/misc/nl: New file/tests, including a test for the above.
10352 * tests/misc/Makefile.am (TESTS): Add nl.
10354 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
10355 * tests/misc/Makefile.am (TESTS): Add split-l.
10357 2002-10-13 Jim Meyering <jim@meyering.net>
10361 * src/du.c (usage): Tweak description of --dereference-args/-D.
10363 * src/du.c (count_entry): Also save cwd when dereferencing (via
10364 --dereference-args, -D) a command-line argument.
10365 Reported by Michal Svec. Based on a patch by Andreas Schwab.
10367 * src/Makefile.am (../AUTHORS): New target/rule.
10369 2002-10-12 Jim Meyering <jim@meyering.net>
10371 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
10372 of type size_t, since that's the way it's used and avoids a warning.
10374 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
10375 since that's how it's always used and avoids a new warning from gcc.
10376 (read_input): Adapt to new safe_read ABI.
10378 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
10381 * src/pinky.c (print_long_entry): fread returns size_t.
10382 Declare local `bytes' accordingly, to avoid warning.
10384 tail -c +N would perform an extra read after encountering EOF
10385 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
10386 * src/tail.c (start_bytes): Detect EOF, inform caller.
10387 (tail_bytes): Upon EOF in start_bytes, return immediately.
10388 (file_lines): Reorganize to use memrchr rather than an explicit loop.
10389 Adapt to new safe_read ABI.
10391 2002-10-11 Jim Meyering <jim@meyering.net>
10393 * tests/du/deref: New file/test, for the above fix.
10394 * tests/du/Makefile.am (TESTS): Add deref.
10396 2002-10-10 Jim Meyering <jim@meyering.net>
10398 * tests/ln/Makefile.am (TESTS): Add target-1.
10399 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
10401 2002-10-09 Jim Meyering <jim@meyering.net>
10403 * tests/cp/backup-is-src: Ensure that certain environment variables
10404 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
10406 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
10407 consume 4GB of disk space on systems without support for sparse files.
10408 Fix a logic error that'd make it `cat err' even though dd didn't fail.
10410 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
10411 Patch by steven@magelico.net, forwarded by Michael Stone.
10413 * tests/ls/dired: Ensure that ls produces English messages.
10414 Patch by Alexey Vyskubov, forwarded by Michael Stone.
10416 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
10418 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
10420 2002-10-08 Jim Meyering <jim@meyering.net>
10422 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
10423 Fix syntax in test: use =, not ==.
10424 Reported by Bob Proulx.
10425 Change all the rest like this: grep -lR "testing framework'" .\
10426 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
10428 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
10429 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
10430 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
10431 * src/wc.c (wc): Likewise.
10433 2002-10-07 Paul Eggert <eggert@twinsun.com>
10436 Don't advance the write pointer past the end of the write buffer.
10437 * src/sort.c (begfield, limfield): Likewise.
10439 2002-10-07 Jim Meyering <jim@meyering.net>
10441 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
10442 * src/head.c (head_bytes, head_lines): Likewise.
10444 2002-10-06 Jim Meyering <jim@meyering.net>
10446 * src/dd.c (scanargs): Ensure that specified block sizes (specified
10447 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
10448 (skip, dd_copy): Adapt to new safe_read ABI.
10450 * Makefile.maint (signatures): Define.
10452 (announcement): Depend on $(signatures).
10454 * Makefile.maint (announcement): Output all URLs for detached
10455 signatures, not just the last one from the previous loop.
10457 2002-10-05 Jim Meyering <jim@meyering.net>
10461 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
10462 don't recurse into directory, DIR. Prompted by a report from
10465 * tests/rm/i-no-r: New file/test, for the above fix.
10466 * tests/rm/Makefile.am (TESTS): Add i-no-r.
10468 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
10469 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
10471 2002-10-03 Jim Meyering <jim@meyering.net>
10473 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
10474 * src/df.c (AUTHORS): Likewise.
10475 * src/du.c (AUTHORS): Likewise.
10476 * src/tail.c (AUTHORS): Likewise.
10477 * src/touch.c (AUTHORS): Likewise.
10479 2002-10-02 Jim Meyering <jim@meyering.net>
10481 * Makefile.am (SUBDIRS): Remove `old'.
10482 (EXTRA_DIST): List the files in old/.
10483 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
10484 Suggestion from Akim Demaille.
10486 2002-10-01 Jim Meyering <jim@meyering.net>
10488 * src/sys2.h (SSIZE_MAX): Define.
10490 2002-09-30 Jim Meyering <jim@meyering.net>
10492 * src/csplit.c: Don't include stdlib.h here. It's already included
10495 2002-09-29 Jim Meyering <jim@meyering.net>
10497 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
10498 expression to avoid bogus warning from gcc.
10500 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
10501 (cat): Declare insize and outsize to be of type size_t, not int.
10502 Rearrange pointer/integer expressions to avoid bogus warnings.
10503 (main): Declare insize and outsize to be of type size_t, not int.
10505 * src/tail.c (parse_options): Give a sensible diagnostic for
10506 an invalid byte or line count. Reported by Mikko Tuumanen.
10508 * src/touch.c (main): Split a long line.
10510 * tests/du/Makefile.am (TESTS): Add slink.
10511 * tests/du/slink: New test for system.h change of 2002-08-31.
10513 In move mode, always first try to rename. Before, upon failure to
10514 rename a directory, this code would never attempt to rename any
10515 other file in that directory, but would thenceforth always copy.
10516 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
10517 may fail with EXDEV, yet renaming files within that directory to
10518 a newly-created destination directory succeeds.
10519 * src/copy.c (copy_internal): Remove local, move_mode;
10520 use x->move_mode instead. Based on a patch from Tom Haynes.
10522 2002-09-28 Jim Meyering <jim@meyering.net>
10524 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
10525 Factor out some duplication.
10527 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
10529 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
10531 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
10532 to avoid compiler warnings.
10534 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
10537 Fix things so `mkdir -p' can create very deep directories, e.g.,
10538 mkdir -p $(perl -e 'print "a/" x 40000') now works.
10539 * src/mkdir.c (main): For --parents (-p), call make_path with the
10540 entire directory name, so we don't ever require that file operations
10541 like stat or chmod be performed on the entire command line argument.
10542 * makepath.c (make_path): Restore umask *before* creating the final
10545 2002-09-27 Andreas Schwab <schwab@suse.de>
10547 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
10548 to avoid overflow. Reported by Hans Lermen.
10550 2002-09-26 Jim Meyering <jim@meyering.net>
10552 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
10554 2002-09-25 Jim Meyering <jim@meyering.net>
10556 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
10557 and add a cast, to avoid a warning about `signed and unsigned type in
10558 conditional expression'.
10560 2002-09-22 Jim Meyering <jim@meyering.net>
10562 * src/rmdir.c: Include "dirname.h", for declaration of
10563 strip_trailing_slashes.
10565 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
10566 Now they're defined through system.h.
10568 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
10569 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
10570 since it's already included from sys2.h via system.h.
10572 * Use automake-1.6f. Regenerate dependent files.
10574 * src/Makefile.am (PERL): Remove duplicate definition.
10576 fmt's -s, -t, -c options didn't work properly for long lines.
10577 Since get_line may end up calling put_paragraph (for long lines),
10578 be sure to set global, `other_indent', before it is used there.
10580 * src/fmt.c (set_other_indent): New function, factored out of...
10581 (get_paragraph): ... here. Call it.
10582 (get_line): Call set_other_indent before calling flush_paragraph,
10583 which calls fmt_paragraph, which in turn calls put_paragraph,
10584 which uses other_indent.
10586 * tests/fmt/Makefile.am (TESTS): Add long-line.
10587 * tests/fmt/long-line: New file/test, for the above fix.
10589 2002-09-21 Jim Meyering <jim@meyering.net>
10591 * src/od.c: No longer include deprecated <values.h>.
10592 It was required solely for now-removed reference to BITSPERBYTE.
10593 * src/install.c: Likewise.
10594 Suggestion from Bruno Haible.
10596 2002-09-06 Andreas Schwab <schwab@suse.de>
10598 `rmdir -p dir-specified-with-trailing-slash/' would fail.
10599 * src/rmdir.c (remove_parents): Strip trailing slashes.
10601 2002-09-20 Jim Meyering <jim@meyering.net>
10603 * tests/rmdir/t-slash: New file/test, for the above fix.
10604 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
10606 * Makefile.maint (announcement): Arrange to gpg-sign the message.
10607 Add a URL for each detached signature file.
10609 2002-09-07 Bruno Haible <bruno@clisp.org>
10611 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
10613 2002-09-18 Jim Meyering <jim@meyering.net>
10615 `od -t x8' used the wrong (`l'-prefixed) printf format.
10616 Likewise for the o8 and u8 formats.
10617 * src/od.c (ISPEC_TO_FORMAT): Define macro.
10618 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
10619 Reported by Arun Sharma.
10621 2002-09-17 Jim Meyering <jim@meyering.net>
10623 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
10624 From gettext's intl/loadmsgcat.c.
10626 * tests/od/x8: New file/test, for the above fix.
10627 * tests/od/Makefile.am (TESTS): Add x8.
10629 2002-09-15 Jim Meyering <jim@meyering.net>
10631 * Use autoconf-2.54. Regenerate dependent files.
10633 * src/csplit.c (get_format_width): Add cast to avoid
10634 warning about `signed and unsigned type in conditional expression'.
10636 2002-09-14 Jim Meyering <jim@meyering.net>
10638 * src/who.c (print_user): Change type of local to size_t
10639 to avoid warnings about `comparison between signed and unsigned'.
10640 * src/ptx.c (generate_all_output): Likewise.
10642 * src/dd.c (main, skip): Add casts to avoid warnings about
10643 `comparison between signed and unsigned'.
10645 * src/id.c (print_full_info, print_group_list): Add casts to avoid
10646 warnings about `signed and unsigned type in conditional expression'.
10648 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
10649 to avoid warnings about `comparison between signed and unsigned'.
10650 (split_3): Change parameter names to be readable and add comment.
10651 Clean up the test for whether a line may be ignored.
10653 2002-09-13 Jim Meyering <jim@meyering.net>
10655 * src/printf.c (main): Handle leading command line argument of `--'.
10656 Reported by Raul: DervishD <raul@pleyades.net>
10657 * tests/misc/printf: New file: test for the above.
10658 * tests/misc/Makefile.am (TESTS): Add printf.
10660 * src/date.c (usage): Explain that %S's range of [0..60] is required --
10661 rather than 0..59 -- to accommodate the occasional positive leap second.
10662 Reported by Richard Neill.
10664 2002-09-12 Jim Meyering <jim@meyering.net>
10666 * src/Makefile.am (nanosec_libs): Define.
10667 (sleep_LDADD, tail_LDADD): Use it here.
10669 Factor nanosleep-related code into ../lib/xnanosleep.c.
10670 * src/sleep.c: Include xnanosleep.h.
10671 Factor out fenv.h-related code.
10672 (timespec_subtract): Remove function.
10673 (main): Remove code that deals with computing start and stop times
10674 as well as the loop around nanosleep. Now that's in xnanosleep.c.
10676 Allow S (in --sleep-interval=S) to be a floating point value.
10677 * src/tail.c: Include xnanosleep.h and xstrtod.h.
10678 Move declaration of global variable, sleep_interval, to ...
10680 (usage): Update description of --sleep-interval option.
10681 (tail_forever): New parameter, sleep_interval. Update caller.
10682 Use xnanosleep, rather than sleep.
10683 (parse_options): New parameter, sleep_interval. Update caller.
10684 Use xstrtod, now that we accept floating point values.
10685 Prompted by a patch from Augey Mikus.
10687 2002-09-06 Jim Meyering <jim@meyering.net>
10689 * src/remove.c (prompt): Change comment to give a better note to
10690 translators. From Michael Piefel.
10692 2002-09-02 Jim Meyering <jim@meyering.net>
10694 * README: A good problem report/patch includes diffs against
10695 the most recent test release.
10697 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
10698 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
10700 * src/kill.c (print_table_row): Use an unsigned type for widths
10701 to avoid warning about comparison between signed and unsigned.
10702 (list_signals): Likewise.
10704 * src/od.c (skip): Add a cast to avoid warning about comparison
10705 between signed and unsigned.
10706 * src/install.c (get_ids): Likewise. Also rearrange range-checking
10707 comparisons to make them more readable.
10709 2002-09-01 Jim Meyering <jim@meyering.net>
10713 2002-08-31 Jim Meyering <jim@meyering.net>
10715 Symlinks were always reported as using 0 blocks.
10716 * src/system.h (ST_NBLOCKS): Don't depend on file type.
10717 This reverts the change of 2000-01-30.
10718 Based on a report and patch from Neil Brown via Michael Stone.
10719 This fixes Debian Bug#156358.
10721 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
10722 `exit (1)' to `exit (EXIT_FAILURE)', and
10723 `usage (1)' to `usage (EXIT_FAILURE)'.
10725 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
10726 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
10727 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
10728 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
10729 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
10730 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
10731 error never exits successfully.
10733 2002-08-29 Jim Meyering <jim@meyering.net>
10735 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
10736 when ignoring any return value.
10738 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
10739 failures. On some systems (at least EMC Celerra and Solaris5.8),
10740 this appears to be necessary.
10741 (is_empty_dir): Likewise. Also, always close directory handle.
10742 * src/ls.c (print_dir): Likewise.
10743 (print_dir): Rename local variable: reading -> dirp.
10744 Reported by Mike Coleman.
10746 2002-08-28 Jim Meyering <jim@meyering.net>
10748 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
10749 Give a diagnostic and fail if closedir fails.
10751 2002-08-26 Jim Meyering <jim@meyering.net>
10753 * Makefile.am (THANKS-to-translators): New rule.
10754 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
10755 * THANKStt.in: New file.
10757 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
10758 file-scoped global.
10759 (main): Register it with atexit.
10760 Close STDOUT_FILENO, to avoid a problem when writing to
10761 /dev/audio on at least Solaris 5.7 and 5.8 systems.
10762 Reported by Shing-Shong Shei.
10764 2002-08-25 Jim Meyering <jim@meyering.net>
10766 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
10767 * src/tac.c (main): Likewise.
10768 * src/tail.c (main): Likewise.
10769 * src/tee.c (main): Likewise.
10770 * src/tr.c (main): Likewise.
10771 * src/wc.c (main): Likewise.
10773 2002-08-20 Jim Meyering <jim@meyering.net>
10775 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
10777 2002-08-10 Paul Eggert <eggert@twinsun.com>
10779 * src/nohup.sh: Don't use "exec --"; it's not portable and
10780 shouldn't be needed.
10782 2002-08-09 Jim Meyering <jim@meyering.net>
10784 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
10785 (usage): Clarify help text for the -COLUMN option.
10786 Patch by Padraig Brady.
10787 * tests/pr/Test.pm [col-last]: New test for the above.
10789 * configure.ac: Start with version 4.5.1, chosen so that it's larger
10790 than the latest version numbers of the component packages.
10792 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
10793 programs in ../src.
10795 2002-08-08 Jim Meyering <jim@meyering.net>
10797 * src/date.c: Guard inclusion of <langinfo.h> with
10798 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
10799 * src/sort.c: Likewise.
10800 Patch by GOTO Masanori.
10802 2002-08-05 Paul Eggert <eggert@twinsun.com>
10804 Fix some minor time-related bugs with POSIX time arguments.
10805 Some valid time stamps were being rejected (notably -1, and
10806 time stamps before 1900 on 64-bit hosts). And some invalid
10807 time stamps were being accepted, e.g. September 31.
10809 * src/date.c (main): Adjust to posixtime signature change.
10810 * src/touch.c (main): Likewise. Remove unnecessary initialization.
10811 Use localtime, not posixtm, to warn about obsolete "touch".
10813 2002-08-05 Jim Meyering <jim@meyering.net>
10815 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
10817 2002-08-04 Jim Meyering <jim@meyering.net>
10819 * src/Makefile.am (check-README): New target/rule.
10820 (check): Depend on it.
10822 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
10824 2002-08-03 Jim Meyering <jim@meyering.net>
10826 * Makefile.am (SUBDIRS): Add old.
10827 * old/: New directory, containing legacy ChangeLog* and NEWS files
10828 from the fileutils, sh-utils, and textutils packages.
10830 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
10832 2002-08-02 Paul Eggert <eggert@twinsun.com>
10834 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
10836 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
10837 (hard_LC_COLLATE): New var.
10838 (different): Args are now char *, not const char *.
10839 Use xmemcoll instead of memcmp to compare lines, so that
10840 LC_COLLATE has effect. However, use memcmp if it is an
10842 (check_file): Do not include newline in comparison, so that
10843 xmemcoll has a byte to stomp on temporarily.
10844 (main): Set hard_LC_COLLATE.
10846 2002-07-29 Jim Meyering <jim@meyering.net>
10848 * Makefile.am (SUBDIRS): Remove djgpp, for now.
10850 2002-07-20 Jim Meyering <jim@meyering.net>
10852 * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
10853 into EXIT_FAILURE. Otherwise, false --help and false --version
10856 2002-07-08 Jim Meyering <jim@meyering.net>
10858 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
10859 rather than the hard-coded `sh-utils'.
10861 2002-07-01 Jim Meyering <jim@meyering.net>
10863 * configure.ac: Merge the three files from fileutils,
10864 textutils, and sh-utils.
10865 * Makefile.am: Likewise.
10866 * src/Makefile.am: Likewise.