1 2005-06-16 Paul Eggert <eggert@cs.ucla.edu>
5 * src/hostid.c (main): Don't print fewer than 8 digits, or spurious
6 leading "f"s. "f" problem reported by Tim Waugh.
9 2005-06-16 Jim Meyering <jim@meyering.net>
11 Don't embed `this'-style quotes in format strings.
12 * src/tr.c: Rather than this: error (..., "...`%s'...", arg);
13 do this: error (..., "...%s...", quote (arg));
14 * src/od.c, src/tr.c, src/csplit.c, src/date.c, src/hostname.c:
15 * src/join.c, src/ptx.c, src/seq.c, src/sort.c, src/split.c:
16 * src/split.c, src/tail.c: Likewise.
18 * src/sleep.c: Include "quote.h". Remove hard-coded quotes, as above.
19 * src/nice.c, src/printf.c, src/fold.c, src/pr.c: Likewise.
20 * src/factor.c, src/cat.c, src/expr.c, src/stty.c: Likewise.
22 * src/mv.c: Finally remove support for --version-control=S (-V).
23 It was deprecated nearly 6 years ago and has been warning
24 users to switch to --backup=S since fileutils-4.0j.
25 * src/cp.c, src/install.c, src/ln.c: Likewise.
27 2005-06-15 Jim Meyering <jim@meyering.net>
29 * src/install.c (main): Fix my typo: s/argv[optind]/file[i]/.
30 * tests/install/basic-1: Ensure that each `-d'-specified directory
31 is created. Ensure that rel-named dirs are not created when
34 * tests/mkdir/p-3: Add a test for just-fixed bug in mkdir-p.c.
36 2005-06-14 Paul Eggert <eggert@cs.ucla.edu>
38 Improve diagnostics for restore_cwd failure.
39 * src/install.c (main): Standardize on a diagnostic for
40 restore_cwd failure, and report errno.
41 (install_file_in_file_parents): Fail if restore_cwd fails and
42 one of the files is relative. This fixes a bug (albeit unlikely).
43 * src/mkdir.c (create_parents): Remove static var (now local to 'main').
44 (main): Standardize on a diagnostic for restore_cwd failure,
46 Don't bother to check cwd_errno unless create_parents.
47 Use mkdir rather than make_dir; it's simpler.
49 * src/install.c (main): Adjust to new make_dir_parents convention.
50 * src/mkdir.c (main): Likewise.
52 2005-06-14 Jim Meyering <jim@meyering.net>
54 * tests/mkdir/p-3: Ensure mkdir succeeds if the following argument
55 is an absolute directory name.
57 * Makefile.maint (my-distcheck): Add -Wall to the list of options that
58 are used with -Werror. This target is not intended for general use.
60 2005-06-13 Jim Meyering <jim@meyering.net>
62 * src/mkdir.c (main): Give a diagnostic for -- and skip -- each
63 relative directory name after make_dir_parents fails to restore
64 the working directory. Before, `mkdir -p' could create directories
65 in the wrong place in unusual circumstances.
66 * src/install.c (main): Likewise.
67 (install_file_in_file_parents): Update make_dir_parents caller.
68 * tests/mkdir/p-3: New test for today's mkdir.c/mkdir-p.c bug fixes.
69 * tests/mkdir/Makefile.am (TESTS): Add p-3.
71 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
73 Act on the Austin Group's response yesterday to XCU ERN 63; see
74 <http://www.opengroup.org/austin/docs/austin_260.txt>.
75 * NEWS: ls no longer outputs an extra space between mode and link count.
76 * doc/coreutils.texi: Remove the extra spaces in "ls -l" output.
77 * src/ls.c (any_has_acl): New var.
78 (clear_files): Clear it.
79 (gobble_file): Set it if a file has an ACL.
80 (print_long_format): Omit needless space unless some file has an ACL.
82 2005-06-10 Jim Meyering <jim@meyering.net>
84 * src/system.h (VERIFY_W_TYPEOF): Add parentheses.
86 2005-06-02 Jim Meyering <jim@meyering.net>
88 * src/sort.c (usage): Put `Ordering options:' line where it belongs.
90 2005-06-01 Paul Eggert <eggert@cs.ucla.edu>
92 Use "file name" when talking about file names, instead of "filename"
93 or "path", as per the GNU coding standards.
94 * src/basename.c: Don't use "path" or "filename".
95 * src/copy.c: Likewise.
96 * src/copy.h: Likewise.
97 * src/cp-hash.c: Likewise.
100 * src/install.c: Likewise.
101 * src/ls.c: Likewise.
102 * src/pinky.c: Likewise.
103 * src/pr.c: Likewise.
104 * src/pwd.c: Likewise.
105 * src/remove.c: Likewise.
106 * src/rmdir.c: Likewise.
107 * src/sort.c: Likewise.
108 * src/system.h: Likewise.
109 * src/tty.c: Likewise.
110 * src/who.c: Likewise.
111 * src/cp.c (parents_option): Renamed from flag_path. All uses changed.
112 (make_dir_parents_private): Renamed from make_path_private.
114 * src/cp.c (usage): Don't use "path" to describe a file name.
115 * src/readlink.c (usage): Likewise.
116 * src/rmdir.c (usage): Likewise.
117 * src/df.c: Don't include "path-concat.h"; not needed.
118 * src/install.c (install_file_in_file_parents): Renamed from
119 install_file_to_path. All uses changed.
120 * src/ln.c (FILE_BASENAME_CONCAT): Renamed from PATH_BASENAME_CONCAT.
122 * src/ls.c (make_link_name): Renamed from make_link_path.
124 * src/pwd.c (struct file_name): Renamed from struct Path.
126 (file_name_free): Renamed from path_free. All uses changed.
127 (file_name_init): Renamed from path_init. All uses changed.
128 (file_name_prepend): Renamed from path_prepend. All uses changed.
129 * src/rmdir.c (remove_empty_parents): Renamed from empty_paths.
131 (longopts): Add comment that --path is deprecated.
133 2005-05-31 Jim Meyering <jim@meyering.net>
135 * src/copy.c (chown_privileges, chown_failure_ok): Mark as `extern'.
136 This is a crutch so that `make distcheck's sc_tight_scope rule
137 knows that they really are deliberately declared that way.
139 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
141 Port to Solaris 10's rules for whether programs can chown files.
142 * src/copy.c [HAVE_PRIV_H]: Include <priv.h>.
143 (DO_CHOWN): Remove. Replaced by chown_failure_ok. All callers
145 (copy_internal): If chown failed, don't worry about what happened
146 to the mode bits; they can't have changed.
147 (chown_privileges, chown_failure_ok): New functions.
148 * src/copy.h: Add copyright notice.
149 (struct cp_options): Remove myeuid member. Add chown_privileges
151 (chown_privileges, chown_failure_ok): New function decls.
152 * src/cp.c (re_protect): Remove unnecessary call to geteuid.
153 Use chown_failure_ok rather than our own code.
154 * src/cp.c (cp_options_init): Use chown_privileges rather than geteuid.
155 * src/install.c (cp_option_init): Likewise.
156 * src/mv.c (cp_option_init): Likewise.
158 2005-05-29 Paul Eggert <eggert@cs.ucla.edu>
160 * src/chgrp.c (getgrnam) [!defined _POSIX_VERSION]: Remove decl.
161 * src/chown-core.c (getgrnam, getgrgid) [!defined _POSIX_VERSION]:
163 * src/cp.c (geteuid) [!defined _POSIX_VERSION]: Remove decl.
164 * src/id.c (getpwuid, getgrgid, getuid, getgid, geteuid, getegid)
165 [!defined _POSIX_VERSION]: Remove decls.
166 * src/install.c (getpwnam, getgrnam): Remove decl.
167 (getuid, getgid) [!defined _POSIX_VERSION]: Remove decls.
168 * src/md5sum.c (OPENOPTS, TEXT1T01, TEXTCNVT): Remove.
169 (digest_file): Use O_BINARY-using expr instead of OPENOPTS.
170 * src/system.h: Don't bother mentioning _POSIX_VERSION in comment.
171 * src/test.c: Include sys/param.h if it exists, not if _POSIX_VERSION
173 Don't include <sys/file.h>; no longer needed.
174 (getegid, geteuid): Remove no-longer-necessary decls.
176 * src/pathchk.c (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
177 Define to 256, not 255, as per modern POSIX.
179 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
181 * NEWS: dd seek=N now conforms to POSIX if the output isn't seekable.
182 * src/dd.c (skip): Return the number of records that were not
183 skipped due to encountering EOF.
184 (dd_copy): If the file wasn't seekable and EOF was encountered,
185 write zeros past EOF until the desired offset is reached.
187 * NEWS: expr and test now correctly compare integers of unlimited size.
188 (Also, correct a comment that claimed that expr detects integer
189 overflow; it does so only when converting from strings.)
190 * src/expr.c: Include strnumcmp.h, xstrtol.h.
191 (looks_like_integer): New function.
192 (toarith): Use it. Also, use xstrtoimax rather than rolling our
194 (eval2): Don't look for trouble if !evaluate; this simplifies things.
195 Compare numbers using string comparison, so that overflow is
197 * src/sort.c: Refactor so that others can use large-integer
198 comparison functions.
199 Include "strnumcmp.h".
200 (NEGATION_SIGN, NUMERIC_ZERO, fraccompare):
201 Remove; moved to strnumcmp.
202 (decimal_point): Now int, to simplify converison overhead with
203 new API. All uses changed.
204 (thousands_sep): Now -1 if there isn't one, as per new API.
206 (numcompare): Move contents to strnumcmp module, except for
208 * src/test.c: Include inttostr.h, strnumcmp.h.
209 (whitespace, digit, digit_value, integer_expected_error): Remove.
210 (is_int): Remove; replaced by...
211 (find_int): New function.
212 (binary_operator): Don't let integers overflow in comparisons;
213 return the correct answer instead. Simplify the code.
214 (unary_operator): Convert the integer ourself, since find_int
216 * tests/expr/basic (bigcmp): New test.
217 * tests/test/Test.pm (eq-6, gt-5, lt-5): New tests.
219 2005-05-26 Paul Eggert <eggert@cs.ucla.edu>
221 * NEWS: nohup now redirects a tty stdin to an unreadable fd
222 instead of closing it.
223 * doc/coreutils.texi (nohup invocation): Document this.
224 * src/nohup.c (main): Implement this.
226 2005-05-26 Jim Meyering <jim@meyering.net>
228 * src/expr.c (toarith): Fix a sign error introduced on 2005-01-14.
229 Reported by David Alan Gilbert.
230 * tests/expr/basic: Add tests using arithmetic on negative integers.
232 2005-05-19 Jim Meyering <jim@meyering.net>
234 * src/remove.c (AD_mark_helper, AD_mark_current_as_unremovable):
235 Remove inaccurate-but-harmless `const' attributes.
237 * src/join.c (decode_field_spec): Add an abort after
238 `error (EXIT_FAILURE, ...' to avoid a gcc warning in caller,
239 about variables being used uninitialized.
241 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
243 * configure.ac: Add copyright notice. gl_LIB_CHECK -> cu_LIB_CHECK.
244 * src/Makefile.am: Add copyright notice.
245 (factor_LDADD): Remove, as factor no longer needs sqrt.
246 * src/hostname.c: Remove test for HAVE_LIMITS_H; we can assume
247 it's always true now.
249 2005-05-16 Paul Eggert <eggert@cs.ucla.edu>
251 Fix Cygwin porting problem reported by Eric Blake.
252 * src/remove.c (DT_IS_DIR): Remove.
253 (DT_IS_KNOWN, DT_MUST_BE): New macros.
254 (remove_entry): Use them.
256 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
258 * src/remove.c: Include unlinkdir.h.
259 (UNLINK_CAN_UNLINK_DIRS): Remove.
260 (remove_entry): Use cannot_unlink_dirs () rather than
261 UNLINK_CAN_UNLINK_DIRS.
263 2005-05-14 Jim Meyering <jim@meyering.net>
265 Update FSF postal mail address.
266 * Makefile.maint, Makefile.cfg, gnupload
267 * src/basename.c, src/cat.c, src/checksum.h, src/chgrp.c
268 * src/chmod.c, src/chown-core.c, src/chown-core.h, src/chown.c
269 * src/chroot.c, src/cksum.c, src/comm.c, src/copy.c, src/copy.h
270 * src/cp-hash.c, src/cp-hash.h, src/cp.c, src/csplit.c, src/cut.c
271 * src/date.c, src/dcgen, src/dd.c, src/df.c, src/dircolors.c
272 * src/dirname.c, src/du.c, src/echo.c, src/env.c, src/expand.c
273 * src/expr.c, src/factor.c, src/fmt.c, src/fold.c, src/fs.h
274 * src/groups.sh, src/head.c, src/hostid.c, src/hostname.c, src/id.c
275 * src/install.c, src/join.c, src/kill.c, src/lbracket.c, src/link.c
276 * src/ln.c, src/logname.c, src/ls-dir.c, src/ls-ls.c, src/ls-vdir.c
277 * src/ls.c, src/ls.h, src/md5.c, src/md5sum.c, src/mkdir.c
278 * src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c, src/nl.c
279 * src/nohup.c, src/od.c, src/paste.c, src/pathchk.c, src/pinky.c
280 * src/pr.c, src/printenv.c, src/printf.c, src/ptx.c, src/pwd.c
281 * src/readlink.c, src/remove.c, src/remove.h, src/rm.c, src/rmdir.c
282 * src/seq.c, src/setuidgid.c, src/sha1sum.c, src/shred.c
283 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c
284 * src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac-pipe.c
285 * src/tac.c, src/tail.c, src/tee.c, src/test.c, src/touch.c
286 * src/tr.c, src/true.c, src/tsort.c, src/tty.c, src/uname.c
287 * src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c
288 * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c
290 2005-05-13 Jim Meyering <jim@meyering.net>
292 * NEWS: `rm -r' now removes all of the files it should, even on
293 systems with a buggy readdir affecting file systems inaccessible
296 In some unusual circumstances `rm -r' would fail to remove --
297 or even consider -- all entries in a directory with more than 254
298 (SunOS) or 338 (Darwin) entries. This could cause trouble even on
299 other types of systems when using an affected file system via e.g.,
300 NFS. The underlying cause was a bug in readdir on those systems.
301 Coreutils-5.2.1 and earlier used a configure-time test designed
302 to detect precisely those problem systems, but it would detect
303 the problem and enable remove.c's work-around code only when its
304 configure-time test was run on a losing file system. Obviously,
305 it couldn't detect a problem if the offending file system wasn't
306 tested or even mounted at coreutils configure time. Now, rm itself
307 performs a minimal-cost run-time test to detect the problem.
309 * src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Define.
310 (remove_cwd_entries): When readdir returns NULL for a directory from
311 which we've removed more than CONSECUTIVE_READDIR_UNLINK_THRESHOLD
312 entries, call rewinddir and then resume the readdir/unlink loop.
313 (UNLINK_CAN_UNLINK_DIRS): Rename from ROOT_CAN_UNLINK_DIRS.
315 2005-05-12 Paul Eggert <eggert@cs.ucla.edu>
317 * NEWS: nohup now closes stdin if it is a terminal, unless
318 POSIXLY_CORRECT is set. This fixes a glitch noted by Wayne Pollock in
319 <https://www.opengroup.org/sophocles/show_mail.tpl?
320 source=L&listname=austin-group-l&id=8341>.
321 * doc/coreutils.texi (nohup invocation): Document this.
322 * src/nohup.c (main): Implement this.
324 2005-05-12 Jim Meyering <jim@meyering.net>
326 * src/date.c: Assume `free (NULL)' works.
327 * src/dd.c: Likewise.
329 * src/dircolors.c:Likewise.
330 * src/head.c: Likewise.
331 * src/ls.c: Likewise.
332 * src/md5sum.c: Likewise.
333 * src/pr.c: Likewise.
334 * src/sort.c: Likewise.
336 2005-05-10 Jim Meyering <jim@meyering.net>
338 * tests/touch/not-owner: Skip this test if the user running it
339 owns `/' or has write access to it.
341 * src/copy.c (abandon_move): Remove erroneous UNWRITABLE check.
342 This makes `mv -i --reply=no f1 f2' work as expected (in not
343 performing the move operation). But note that specifying `-i'
344 after `--reply=no' does *not* work.
345 Tiny patch from Vlada Macek.
347 * tests/mv/reply-no: New file. Test for the above fix.
348 * tests/mv/Makefile.am (TESTS): Add reply-no.
350 * tests/ls-2/tests: Don't print PATH to stderr.
352 2005-05-08 Paul Eggert <eggert@cs.ucla.edu>
354 * NEWS: cp, ln, mv, rm no longer discard white space when intepreting
357 2005-05-06 Paul Eggert <eggert@cs.ucla.edu>
359 * NEWS: dd has new iflag= and oflag= flags "binary" and "text".
360 * src/dd.c (flags, usage): Add support for "binary" and "text".
362 2005-05-04 Paul Eggert <eggert@cs.ucla.edu>
364 * NEWS: chmod -w now complains if it differs from chmod a-w.
365 * src/chmod.c: Include quotearg.h.
366 (diagnose_surprises): New var.
367 (process_file): Diagnose surprises. Simplify the logic a bit,
369 (main): Prepare to diagnose surprises. Remove useless code for
371 * tests/chmod/Makefile.am (TESTS): Add umask-x.
372 * tests/chmod/umask-x: New file.
374 2005-05-02 Paul Eggert <eggert@cs.ucla.edu>
376 * NEWS: ls --indicator-style=directory renamed to ls
377 --indicator-style=slash, to avoid confusion with ls --directory.
378 * src/ls.c (usage): Likewise.
379 (slash): Renamed from directory_only. All uses changed.
381 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
383 * NEWS: "chmod +1 foo" is now diagnosed.
385 2005-04-29 Paul Eggert <eggert@cs.ucla.edu>
387 * NEWS: ls -p now marks only directories. New option
388 --indicator-style=directory equivalent to -p.
389 * doc/coreutils.texi (ls invocation): Document this.
390 Also, mention ">" is for doors.
391 * src/ls.c (enum indicator_style): New constant directory_only,
393 (indicator_style_args, indicator_style_types): Set it appropriately.
394 (decode_switches, gobble_file, print_type_indicator):
395 (length_of_file_name_and_frills):
396 Implement the change described in NEWS.
397 (decode_switches): Quote ">", too.
398 (usage): Update to match the new behavior. Describe ">".
399 * tests/ls/file-type: Test for new behavior. Omit -1 option.
400 The "ls --color" test wasn't being checked; add a check for
401 "ls --color=auto" instead.
403 * tests/head/Test.pm: Don't set _POSIX2_VERSION; no longer needed.
404 * tests/misc/split-fail: Likewise.
405 * tests/pr/Test.pm: Likewise.
406 * tests/sort/Test.pm: Fix comment to match new behavior of "sort".
407 * tests/tail/Test.pm (tv): Rename tests from obs to obs-plus
408 if they use file names starting with +.
409 (test_vector): Don't set _POSIX2_VERSION if obs but not obs-plus.
410 * tests/uniq/Test.pm (tv, test_vector): Likewise.
412 The following was partly derived from a tiny change by Eric Blake:
413 * tests/misc/nice: Don't use 'set -'. It's not portable to strict
414 POSIX 1003.1-2001 hosts. Also, don't set _POSIX2_VERSION.
415 * tests/mkdir/perm: Don't use 'set -'. Simplify test construction.
416 Work even if the underyling system attaches ACLs to new dirs.
417 * tests/mv/part-hardlink: Don't use 'set -'.
418 * tests/stty/row-col-1: Don't use 'set -'.
420 2005-04-28 Paul Eggert <eggert@cs.ucla.edu>
422 * NEWS: Document fixes described below.
423 * src/chmod.c (change, umask_value): New static vars.
424 (reference_file): Move this static var to inside "main".
425 (process_file, process_files): Remove CHANGES arg; now taken from
426 static var. All uses changed.
427 (usage): Fix incorrect description of MODE operand.
428 (main): For invalid mode usages, output a brief usage message.
429 Adjust to new modechange API.
430 * install.c (main): Adjust to new modechange API.
431 Also, free the mode_change object when done.
432 * mkdir.c (main): Likewise.
433 * mkfifo.c (main): Likewise.
434 * mknod.c (main): Likewise.
435 * tests/chmod/equal-X: Check for =xX bug.
436 * tests/chmod/equals: Check for =u bug.
437 * tests/chmod/usage: Check for u+gr and ug,+x bugs.
439 2005-04-26 Paul Eggert <eggert@cs.ucla.edu>
441 Restore support for usages like "head -1" and "tail -1",
442 even when conforming to POSIX 1003.1-2001.
443 Fix bug with "POSIXLY_CORRECT=1 fold file -3".
444 join now supports a NUL field separator, e.g., "join -t '\0'".
445 join now detects and reports incompatible options, e.g.,
447 * NEWS: Document this.
448 * src/date.c: Remove posixver.h and its uses.
449 (COMMON_SHORT_OPTIONS): Remove.
450 (short_options): New constant.
451 (short_options, usage): -I now always takes an optional arg.
452 * src/expand.c: Remove posixver.h and its uses.
453 (shortopts): New constant. -DIGIT now always takes an optional arg.
454 (main): Revamp parsing of -DIGIT to let parse_tab_stops handle it.
455 Don't complain about -DIGIT.
456 * src/fold.c: Remove posixver.h and its uses.
457 (shortopts): New constant. -DIGIT now always takes an optional arg.
458 (main): Don't preprocess arg list; that was buggy. Use method
460 * src/head.c: Remove posixver.h and its uses.
461 (header_mode_option): Remove.
462 (main): Don't complain about obsolete -NUM args.
463 * src/join.c: Remove posixver.h and its uses.
464 (obsolete_usage): Remove.
465 (join_field_1, join_field_2): Initialize to SIZE_MAX to indicate
466 they haven't been set yet.
467 (tab): Now int, not char. Initialize to -1 to indicate white space
468 separates columns, so that we can use NUL as a separator.
470 (OBSOLETE_LONG_OPTIONS, get_option): Remove.
471 (string_to_join_field): Remove ERR_MSG_FMT arg; a single format
472 suffices. Use xstrtoul for sizes; it suffices.
473 (decode_field_spec): Report an error and exit on failure. Return void,
475 (add_field_list): Likewise.
476 (set_join_field): New function.
477 (enum operand_status): New enum.
478 (add_file_name): New args OPERAND_STATUS, JOPTION_COUNT,
479 PREV_OPTC_STATUS, OPTC_STATUS to handle the bewildering array of
480 possibilities with obsolete option parsing.
481 (main): Use it. Do not depend on POSIX version.
482 Check for conflicting options. Parse obsolete options -j1 and -j2
483 so that it is a pure extension to POSIX 1003.1-2001.
484 Allow '-t\0' to specify a NUL tab, stealing the code from 'sort'.
485 * src/nice.c: Remove posixver.h and its uses.
486 (main): Always support -NUM option.
487 * src/od.c: Remove posixver.h and its uses.
488 (short_options): New constant, which always supports -w[num].
489 (COMMON_SHORT_OPTIONS): Remove.
490 * src/pr.c: Remove posixver.h and its uses.
491 (short_options): New constant, which always supports -S[string].
492 (COMMON_SHORT_OPTIONS): Remove.
493 * src/sort.c: Remove posixver.h and its uses.
494 (short_options): New constant, which always supports -y arg.
495 (COMMON_SHORT_OPTIONS): Remove.
496 (main): Redo workaround for Solaris compatibility with -y.
497 This change isn't visible to the user; it just cleans up the
498 code so that we don't need posixver.h.
499 * src/split.c: Remove posixver.h and its uses.
500 (main): Don't complain about -NUM option.
501 * src/tail.c (parse_obsolete_option): Don't complain about -NUM.
502 * src/unexpand.c: Remove posixver.h and its uses.
503 (main): Don't complain about -TAB.
504 * src/uniq.c (main): Don't complain about -NUM.
506 2005-04-22 Paul Eggert <eggert@cs.ucla.edu>
508 * src/nohup.c (main): If getopt fails, exit with status 127,
509 not status 1. POSIX requires this.
510 * NEWS: Document this.
512 * src/nice.c (main): Report proper program name when getopt finds
513 trouble. Problem reported by Behdad Esfahbod.
515 * NEWS: Fix bug with "mkdir -m =+x dir"; the umask was being ignored
516 when the "+x" was being evaluated.
517 * mkdir.c (main): Compile mode with MODE_MASK_ALL and initial umask.
518 * mkfifo.c (main): Likewise.
519 * mknod.c (main): Likewise.
520 * tests/mkdir/perm: Test for the above bug.
522 2005-04-20 Paul Eggert <eggert@cs.ucla.edu>
524 Port test cases to Microsoft-Windows-related environments,
525 following suggestions from Eric Blake.
526 * tests/install/Makefile.am (TESTS_ENVIRONMENT): Add EXEEXT.
527 * tests/install/basic-1: Undo previous change.
528 (dd, dd2): New vars, which use $EXEEXT. All uses of dd and dd2 changed.
529 * tests/install/trap: Undo previous change.
530 (sig): New var. Use it insted of "trap '' CHLD".
531 Append $EXEEXT to executable name.
533 "fetish" -> "coreutils" in more places.
534 * tests/Coreutils.pm: Renamed from tests/Fetish.pm.
535 (package Coreutils): Renamed from package Fetish. All uses changed.
536 * tests/Makefile.am (EXTRA_DIST): Add Coreutils.pm and
539 2005-04-19 Paul Eggert <eggert@cs.ucla.edu>
541 * tests/mv/setup (dot_mount_point): Use stat -L, in case the
542 directory is actually a symbolic link. Problem reported by
545 * tests/mv/mv-special-1: Use test -p to test for fifos, rather
546 than the (incorrect) test -f and the (inadequate) ls. ls is
547 inadequate because on some hosts a buggy mv will create a file of
548 the wrong type (problem reported by Eric Blake). Skip this test
549 if test -p doesn't work.
551 * tests/chmod/setgid: Use numeric group ids, not symbolic group names,
552 since the latter can have shell metacharacters in them (e.g., spaces).
553 This follows up to the 2005-01-17 patch, which missed this occurrence.
555 2005-04-18 Paul Eggert <eggert@cs.ucla.edu>
557 "fetish" -> "coreutils" in several places.
558 * Makefile.cfg (ftp): Remove fetish.sf.net.
559 * Makefile.maint (emit_upload_commands): Likewise.
560 * src/Makefile.am (LDADD, $(PROGRAMS)): fetish -> coreutils.
561 * tests/group-names (COREUTILS_GROUPS): Renamed from FETISH_GROUPS.
562 * tests/chmod/setgid (FETISH_GROUP): Renamed from COREUTILS_GROUP.
564 * tests/install/basic-1: Use "cat", not "test", to test for
565 ../../src/dd. Problem reported by Eric Blake.
567 2005-04-18 Jim Meyering <jim@meyering.net>
569 * src/dd.c: Don't include stat-macros.h directly. system.h does that.
571 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
573 Work around a couple of "make check" failures reported for Cygwin
574 and ash by Eric Blake.
575 * tests/install/basic-1: Skip this test if ../../src/dd isn't readable.
576 * tests/install/trap: Skip this test if "trap '' CHLD" doesn't work.
578 2005-04-16 Jim Meyering <jim@meyering.net>
580 * src/dd.c (S_TYPEISSHM): Remove definition.
581 Get the definition by including "stat-macros.h", instead.
583 2005-04-14 Paul Eggert <eggert@cs.ucla.edu>
585 Fix test suite problems reported by Eric Blake on Cygwin.
586 * tests/mv/mv-special-1: Ignore chatter about when files are removed,
587 since POSIX doesn't require rename to fail across file systems.
588 * tests/mv/setup (dot_mount_point): Use stat rather than df, as
590 (other_partition_tmpdir): Remove df from name as that would be
593 2005-04-14 Jim Meyering <jim@meyering.net>
595 * src/chown-core.c: Correct typo, fchmod -> fchown, in a comment.
597 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
599 * src/ls.c (usage): "uid" -> "user ID".
601 2005-04-12 Jim Meyering <jim@meyering.net>
603 * src/tsort.c (tsort): Use "%s" as the format string,
604 rather than a diagnostic or a file name.
606 * src/comm.c (compare_files): Remove declaration of unused local.
608 * src/chown-core.c (chopt_free): Mark parameter as unused.
610 2005-04-11 Paul Eggert <eggert@cs.ucla.edu>
612 * man/chown.x: Reword to match user manual.
613 * man/id.x: Likewise.
614 * src/setuidgid.c (usage): Use "user ID", not "UID", and similarly
616 * src/whoami.c (usage, main): Likewise.
618 Add bulletproofing for cases where stdin, stdout, or stderr are closed.
619 * src/comm.c: Include stdio-safer.h.
620 (compare_files): Exit right away on I/O error rather than continuing
621 and producing confusing output and error messages.
622 Return void, not int; all callers changed.
623 Use fopen_safer to avoid confusion with file descriptors.
624 * src/copy.c: Include unistd-safer.h.
625 (copy_reg): Use fd_safer.
626 * src/csplit.c: Include stdio-safer.h.
627 (input_desc): Remove unnecessary static initialization.
628 (set_input_file): Use STDIN_FILENO, not 0.
629 (create_output_file): Use fopen_safer.
630 * src/dircolors.c (dc_parse_file): Don't assume fopen does not
632 * src/head.c (head_file): Don't assume open does not return 0.
633 * src/join.c: Include stdio-safer.h.
634 (main): Use fopen_safer. Simplify the resulting code.
635 * src/md5sum.c (digest_file, digest_check):
636 Don't assume that fopen does not return stdin.
637 * src/nohup.c: Include unistd-safer.h.
638 (main): Don't dup stderr to stdin or stdout by mistake.
639 * src/od.c (check_and_close): Don't assume fopen does not return stdin.
640 * src/paste.c (paste_serial): Likewise.
641 * src/pr.c: Include stdio-safer.h.
642 (open_file): Use fopen_safer.
643 (close_file): Don't assume fopen does not return stdin.
644 * src/ptx.c (main): Don't assume fopen returns stdout after closing
645 stdout. Use freopen instead.
646 * src/shred.c: Include unistd-safer.h.
647 (wipename): Use fd_safer on directory file descriptor.
648 (wipefile): Remove special case for /dev/fd/* on older hosts.
649 It didn't work in general, and wasn't documented.
651 * src/sort.c: Include unistd-safer.h.
652 (create_temp_file): Use fd_safer.
653 (xfclose): Don't assume fileno (stdin) == STDIN_FILENO, etc.
654 * src/split.c: Include unistd-safer.h.
655 (cwrite): Use fd_safer. Replace mystery constant 0666 with symbolic
656 version, as POSIX requires.
657 * src/sum.c (bsd_sum_file, sysv_sym_file):
658 Use same pattern as elsewhere for checking for stdin.
659 * src/tac.c: Include unistd-safer.h.
660 (copy_to_temp): Use fd_safer.
661 (tac_file): Don't assume fopen cannot return stdin.
662 * src/tail.c: Include unistd-safer.h rather than fcntl-safer.h.
663 (recheck, tail_file): Use fd_safer rather than open_safer.
664 * src/tee.c: Include stdio-safer.h.
665 (tee): Use fopen_safer.
666 * src/touch.c: Include unistd-safer.h.
667 (touch): Use fd_safer.
668 * src/tsort.c (have_read_stdin): Remove; no longer needed. All uses
670 (tsort): Do not assume fopen can't return stdin.
671 Close stdin before returning. All uses changed.
672 * src/unexpand.c (next_file): Don't assume fopen cannot return stdin.
673 * src/uniq.c: Include stdio_safer.h.
674 (check_file): Don't assume fopen cannot return stdin or stdout.
676 2005-04-09 Jim Meyering <jim@meyering.net>
678 * src/dd.c (quit): Define with ATTRIBUTE_NORETURN.
680 Now that close_stdout closes standard output unconditionally,
681 these workarounds for dd and cat are no longer necessary.
682 * src/dd.c (close_stdout_wrapper): Remove function.
683 (main): Call atexit with close_stdout, instead.
684 * src/cat.c (close_stdout_wrapper): Likewise.
685 Don't close STDOUT_FILENO explicitly; close_stdout does it.
687 * src/system.h (__attribute__): Readability nit:
689 # define __attribute__(x)
691 # define __attribute__(x) /* empty */
693 2005-04-09 Jim Meyering <jim@meyering.net>
695 * src/rm.c (usage): Mention that --recursive removes listed
696 directories too, not just their contents.
697 Say that by default, rm does not remove directories.
699 * src/pr.c: Don't include "timespec.h". system.h does that.
700 * Makefile.maint (sc_system_h_headers): Propagate exit status
703 2005-04-08 Paul Eggert <eggert@cs.ucla.edu>
705 * NEWS: Document that dd no longer treats QUIT or PIPE specially,
706 and when conforming to POSIX no longer treats USR1 specially.
707 Document that dd no longer dumps core when handling signals.
708 * src/system.h (RETSIGTYPE): Remove; no longer needed. All uses
710 * src/csplit.c (SA_NOCLDSTOP): Define to 0 if not defined.
712 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
713 (delete_all_files): New arg IN_SIGNAL_HANDLER, to avoid undefined
714 behavior when called from a signal handler. All uses changed.
715 (main) [!defined SA_NOCLDSTOP]:
716 Use siginterrupt to specify that system calls should be interrupted.
717 * src/dd.c: Do not include safe-read.h or full-write.h; no longer needed.
718 (process_signals): Add forward decl.
719 (SA_NOCLDSTOP, sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]:
721 (siginterrupt) [! HAVE_SIGINTERRUPT]: New macro.
722 (SA_NODEFER) [!defined SA_NODEFER]: New macro.
723 (SA_RESETHAND) [!defined SA_RESETHAND]: New macro.
724 (caught_signals, interrupt_signal, info_signal_count, catch_siginfo):
726 (usage): Mention -USR1 versus -INFO.
727 (cleanup): Don't invoke print_stats; the caller must do it now.
729 (quit): Process signals just before exiting.
730 (interrupt_handler): Simply record the signal and return.
731 (siginfo_handler): Simply increment the signal counter and return.
732 (install_handler): Remove, replacing with:
733 (install_signal_handlers, process_signals, iread, iwrite):
734 New functions. All callers to safe_read and full_write replaced
735 by iread and iwrite. All callers to install_handler replaced by
737 * src/ls.c (SA_NOCLDSTOP): Define to 0 if not defined.
739 (siginterrupt) [! HAVE_SIGINTERRUPT]: New macro.
740 (main) [! SA_NOCLDSTOP]: Use it.
741 * src/shred.c: Remove all uses of signals; modern hosts have
742 /dev/random and don't need this gorp.
743 Do not include signal.h.
744 (env, sigill_handler, isaac_seed_machdep): Remove. All uses removed.
745 * src/sort.c (SA_NOCLDSTOP): Define to 0 if not defined.
747 (siginterrupt) [! HAVE_SIGINTERRUPT]: New macro.
748 (main) [! SA_NOCLDSTOP]: Use it.
750 * src/dd.c: Do not include inttostr.h, no longer needed.
751 (print_stats, main): Rewrite and simplify formats to use PRIuMAX
752 instead of umaxtostr.
753 (print_stats): Work even in languages that have special
754 forms for two of things, for r_truncate and w_bytes. We can't
755 fix delta_s in this way, since ngettext doesn't support floating-point.
756 (main): Rewrite to avoid casts.
758 2005-04-07 Jim Meyering <jim@meyering.net>
760 Placate gcc-4's -Wuninitialized.
761 * src/md5sum.c (digest_check) [lint]: Initialize hex_digest to NULL.
762 * src/test.c (binary_operator) [lint]: Initialize lt and rt to 0.
764 * src/test.c (is_int, age_of, binop): Declare `char *' parameters to
766 (binop): Move function definition to precede first use so we can...
767 (binop): ...remove prototype.
769 2005-04-05 Paul Eggert <eggert@cs.ucla.edu>
771 * man/Makefile.am (.x.1): Remove "COMMAND.td/" from examples.
772 * src/basename.c (usage): Add examples.
773 * src/cat.c (usage): Likewise.
774 * src/chgrp.c (usage): Likewise.
775 * src/chown.c (usage): Likewise.
776 * src/dirname.c (usage): Likewise.
778 2005-04-05 Jim Meyering <jim@meyering.net>
780 * src/nice.c (usage): Mention that some shells provide a
781 built-in function by the same name.
782 * src/nohup.c (usage): Likewise.
783 * src/printenv.c (usage):Likewise.
785 2005-04-04 Dmitry V. Levin <ldv@altlinux.org>
787 * src/tee.c (tee): When closing files, do not close stdout,
788 leave this job to close_stdout() instead.
789 * configure.ac (AC_CONFIG_FILES): Add tests/tee/Makefile.
790 * tests/Makefile.am (SUBDIRS): Add tee.
791 * tests/tee/Makefile.am: New file.
792 * tests/tee/.cvsignore: Likewise.
793 * tests/tee/{basic,dash}: New tee tests.
795 2005-04-04 Jim Meyering <jim@meyering.net>
797 * src/echo.c (usage): Mention that some shells provide a
798 built-in function by the same name.
799 * src/kill.c (usage): Likewise
800 * src/printf.c (usage): Likewise.
801 * src/pwd.c (usage): Likewise.
802 * src/stat.c (usage): Likewise.
803 * src/test.c (usage): Likewise.
804 * src/true.c (usage):
805 * src/system.h (USAGE_BUILTIN_WARNING): New macro.
807 * man/echo.x: Remove `DESCRIPTION' section, now that --help includes it.
808 * man/printf.x: Likewise.
809 * man/pwd.x: Likewise.
811 2005-04-03 Jim Meyering <jim@meyering.net>
813 * src/pr.c (main): Fix off-by-one error.
814 pr -$(perl -e 'print "0"x63 . 1') would write one byte beyond the
815 end of a malloc'd buffer.
817 2005-04-01 Jim Meyering <jim@meyering.net>
819 * src/pr.c (main): Free column_count_string when done with it.
821 Don't let pr treat +1:-1 like +1:18446744073709551615.
822 * src/pr.c (strtoumax): Remove declaration.
823 (first_last_page): Use xstrtoumax in place of strtoumax,
824 so we don't interpret a negative page number (e.g., in an option
825 like --pages=1:-1) as valid.
826 * tests/pr/Test.pm (neg-page): Add a test for this.
828 2005-03-30 Paul Eggert <eggert@cs.ucla.edu>
830 * src/pinky.c (short_pinky): Adjust to read_utmp signature change.
831 * src/uptime.c (uptime): New arg OPTIONS. All uses changed.
832 * src/users.c (users): Likewise.
833 * src/who.c (who): Likewise.
834 * src/uptime.c (main): Check PIDs when invoked with zero arguments.
835 * src/users.c (main): Likewise.
836 * src/who.c (main): Likewise. Also with two arguments.
837 Omit duplicate code in 2-arg case.
838 (UT_PID): Moved to ../lib/readutmp.h.
840 2005-03-29 Jim Meyering <jim@meyering.net>
842 * src/system.h (ptr_align): Declare `ptr' parameter to be a
843 `const' pointer, since this function never writes through it.
845 * src/uname.c: Indent cpp directives to reflect nesting.
847 2005-03-28 Jim Meyering <jim@meyering.net>
849 * src/seq.c (get_width_format) [HAVE_RINT && HAVE_MODF && HAVE_FLOOR]:
850 Add `void' to make this an ANSI-style function declaration.
851 * src/remove.c (ds_init): Likewise.
852 * src/pr.c (print_sep_string): Likewise.
854 * src/stty.c (speeds): Declare this array to be static.
855 * src/Makefile.am (sc_tight_scope): Adjust to catch any
856 new declarations like that of stty.c's `speeds'.
858 * src/system.h (GETOPT_HELP_OPTION_DECL): Use NULL, not `0'.
859 (GETOPT_VERSION_OPTION_DECL): Likewise.
860 * src/chown.c (long_options): Likewise.
861 * src/chgrp.c (long_options): Likewise.
862 * src/chmod.c (long_options): Likewise.
863 * src/cp.c (sparse_type_string, reply_args, decode_preserve_arg):
865 * src/chown-core.c (chopt_init): Likewise.
866 * src/comm.c (long_options): Likewise.
867 * src/copy.c (copy_reg): Likewise.
868 * src/csplit.c (extract_regexp): Likewise.
869 * src/cut.c (longopts): Likewise.
870 * src/date.c (time_spec_string): Likewise.
871 * src/df.c (find_mount_point, show_point): Likewise.
872 * src/expr.c (docolon): Likewise.
873 * src/fmt.c (long_options): Likewise.
874 * src/ls.c (time_style_args, indicator_style_args, long_options)
875 (format_args, sort_args, time_args, decode_switches)
876 (gobble_file): Likewise.
877 * src/md5sum.c (long_options): Likewise.
878 * src/mv.c (reply_args): Likewise.
879 * src/paste.c (longopts): Likewise.
880 * src/pinky.c (print_entry): Likewise.
881 * src/pr.c (long_options): Likewise.
882 * src/ptx.c (long_options, format_args): Likewise.
883 * src/readlink.c (longopts): Likewise.
884 * src/sort.c (long_options, mergefps): Likewise.
885 * src/stat.c (long_options): Likewise.
886 * src/tac.c (main): Likewise.
887 * src/tail.c (follow_mode_string): Likewise.
888 * src/touch.c (longopts, time_args): Likewise.
889 * src/uniq.c (delimit_method_string): Likewise.
890 * src/uptime.c (print_uptime): Likewise.
891 * src/who.c (print_user): Likewise.
893 2005-03-27 Jim Meyering <jim@meyering.net>
895 * src/dcgen: Simplify further, clean up.
896 Add a standard-output-closing global destructor.
898 * src/wheel-gen.pl: Use the same global destructor as dcgen.
900 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
902 * src/dcgen: Squeeze multiple blanks into one. Output a simple
903 array of adjacent strings rather than a more complicated data
904 structure; this saves space in the dircolors executable.
905 * src/dircolors.c (parse_line): Use char *, not unsigned char *.
907 (dc_parse_stream, main): Avoid casts.
908 Adjust to simpler data structure generated by new dcgen.
910 2005-03-25 Eric Blake <ebb9@byu.net> (tiny change)
912 * src/ls.c (usage): Document usage of LS_COLORS.
914 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
916 * src/dircolors.hin: Add "TERM cygwin".
918 2005-03-25 Jim Meyering <jim@meyering.net>
920 * src/system.h (DECIMAL_DIGIT_ACCUMULATE): Reverse the sense of
921 the return value, and update callers:
922 * src/cut.c (set_fields): Update use of DECIMAL_DIGIT_ACCUMULATE.
923 * src/expand.c (parse_tab_stops, main): Likewise.
924 * src/split.c (main): Likewise.
925 * src/unexpand.c (parse_tab_stops, main): Likewise.
926 * src/uniq.c (main): Likewise.
928 2005-03-22 Jim Meyering <jim@meyering.net>
930 * build-aux: New directory. Renamed from config.
931 * configure.ac: Reflect renaming: config -> build-aux.
932 * Makefile.am (dist-hook): Likewise.
933 * Makefile.maint: Likewise.
934 * Makefile.cfg (cvs_files): Likewise.
935 * .x-sc_sun_os_names: Likewise.
936 * .x-sc_trailing_blank: Likewise.
938 * src/ls.c (get_funky_string): Use '\a', rather than 7, for
939 portability to EBCDIC hosts.
941 2005-03-20 Jim Meyering <jim@meyering.net>
943 * src/pr.c (init_header): Add missing `%' in new format string.
944 (init_header): Use zero-filled `.%09d' format, not space-filled `.%9d'.
946 2005-03-19 Jim Meyering <jim@meyering.net>
948 * src/Makefile.am (pr_LDADD): Now that pr uses gettime, add
949 $(LIB_CLOCK_GETTIME) to get the required -lrt on newer Linux systems.
951 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
953 * NEWS: pr -D "FORMAT" now accepts the same formats that
955 * src/pr.c: Include strftime.h, timespec.h.
956 (init_header): Obtain and format nanosecond part of time stamp.
958 * NEWS: nohup now ignores the umask when creating nohup.out.
959 nohup now closes stderr if it is a terminal and stdout is closed.
960 * src/nohup.c (main): Likewise. Be a little more paranoid about
961 return values; e.g., check for any negative return from open.
962 Assume free (NULL) works.
963 Close file descriptor leak when redirecting standard output to a file.
965 2005-03-17 Jim Meyering <jim@meyering.net>
967 * src/cut.c (set_fields): Use DECIMAL_DIGIT_ACCUMULATE macro,
968 in place of functionally-equivalent code.
969 * src/expand.c (parse_tab_stops, main): Likewise.
970 * src/split.c (main): Likewise.
971 * src/unexpand.c (parse_tab_stops, main): Likewise.
972 * src/uniq.c (main): Likewise.
973 * src/od.c: Use VERIFY macro in place of an equivalent open-coded
975 * src/system.h (VERIFY, VERIFY_EXPR, DECIMAL_DIGIT_ACCUMULATE):
978 Before, this command would make uniq skip 11 fields and print
980 $ _POSIX2_VERSION=1 ./uniq -f1 -1 <(seq --format='1 %g' 2)
983 * src/uniq.c (main): Interpret `uniq -f1 -1' like `uniq -f1',
984 not like `uniq -f11'.
986 2005-03-15 Jim Meyering <jim@meyering.net>
988 Both `pr -0' and e.g., `pr -03' would evoke `column count too large'.
989 `pr -0' should give a better diagnostic and `pr -03' should be
990 equivalent to `pr -3'.
991 * src/pr.c (parse_column_count): Change return type to void.
992 Call error (EXIT_FAILURE, ... for an invalid string.
993 (main): Allocate space for column_count_string using malloc.
994 Accumulate all old-style column-count digits before converting.
995 When the number of columns is specified via both old-style,
996 (e.g., -3), and a long option (--columns=5), ensure that only
997 the last one specified takes effect.
998 * tests/pr/Test.pm: Add tests for the above.
1000 2005-03-15 Corinna Vinschen <corinna@vinschen.de> (tiny change)
1002 * src/copy.c (copy_reg): Copy regular files in binary mode.
1004 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
1006 * NEWS: Restate why ls limits time stamp lengths.
1008 2005-03-12 Jim Meyering <jim@meyering.net>
1010 Add a little infrastructure to help prevent future bugs like the
1012 * src/stat.c (xstrcat): New function.
1013 (print_statfs, print_stat): Add buf_len parameter and convert all
1014 uses of strcat to xstrcat. Update callers.
1015 (print_it): Call print_func with buf_len parameter.
1017 Invoking stat -c FMT with a lone format directive of %s, %f, %h, %s,
1018 could cause a buffer overrun error.
1019 * src/stat.c (print_it): Allocate 2 more bytes, to accommodate our
1020 conversion of the stat %s format string to the longer printf %llu one.
1021 Patch from Guochun Shi.
1023 2005-03-11 Paul Eggert <eggert@cs.ucla.edu>
1025 * src/ls.c (TIME_STAMP_LEN_MAXIMUM): New constant.
1026 (long_time_expected_width, print_long_format): Use it, to avoid
1027 some possible denial-of-service attacks.
1028 * NEWS: Document this.
1030 2005-03-11 Jim Meyering <jim@meyering.net>
1032 Prompt once again for `mv -i A B' when A and B are hard links
1033 to the same file. This fixes a bug introduced by my 2003-04-04
1034 (coreutils-5.0.1) change. Reported by Thomas Wolff via Eric Blake.
1035 * src/copy.c (abandon_move): New function, factored out of
1036 copy_internal, now that this code is being used from two places.
1037 (copy_internal): Perform the same interactive-related test for
1038 whether it's alright to proceed and (usually) overwrite the
1040 * tests/mv/i-4: Add tests for the above.
1042 Don't segfault for a very long date format string, e.g.,
1043 ls -ld --time-style=+%99999999H .
1044 * src/ls.c (long_time_expected_width): Use x2nrealloc, not alloca,
1045 so format string abuse cannot provoke stack overflow.
1046 (print_long_format): Likewise.
1048 Don't segfault for a long header date string, e.g.,
1049 echo a|pr -D +%9999999A
1050 * src/pr.c (init_header): Use x2nrealloc, rather than alloca.
1051 Don't bother with fixed-sized initial buffer; always use x*alloc.
1053 * src/pr.c (init_header): Use slightly clearer INT_BUFSIZE_BOUND
1054 in place of equivalent INT_STRLEN_BOUND + 1.
1055 * src/expr.c (tostring, printv): Likewise.
1057 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
1059 * src/system.h: Include intprops.h.
1060 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_STRLEN_BOUND): Remove;
1061 they are now defined in intprops.h.
1063 2005-03-09 Jim Meyering <jim@meyering.net>
1065 * TODO: Remove entry about named pipes. It was fixed in 5.3.0.
1067 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
1069 * src/date.c (usage): Redo to match recent documentation changes.
1070 Don't bother documenting which usages are GNU extensions; the list
1071 wasn't correct, and is better left to the printed manual anyway.
1073 2005-03-06 Jim Meyering <jim@meyering.net>
1075 Factor out column-count processing.
1076 * src/pr.c: Include "inttostr.h".
1077 (parse_column_count): New function.
1078 (main): Use the new function for both old-style, -9, and long,
1079 --columns=-9, options.
1081 * src/cksum.c: Remove `register' keyword.
1082 * src/cut.c: Likewise.
1083 * src/dd.c: Likewise.
1084 * src/env.c: Likewise.
1085 * src/factor.c: Likewise.
1086 * src/fmt.c: Likewise.
1087 * src/fold.c: Likewise.
1088 * src/id.c: Likewise.
1089 * src/logname.c: Likewise.
1090 * src/ls.c: Likewise.
1091 * src/pr.c: Likewise.
1092 * src/printf.c: Likewise.
1093 * src/shred.c: Likewise.
1094 * src/sort.c: Likewise.
1095 * src/sum.c: Likewise.
1096 * src/test.c: Likewise.
1097 * src/tsort.c: Likewise.
1098 * src/uniq.c: Likewise.
1099 * src/wc.c: Likewise.
1100 * src/whoami.c: Likewise.
1102 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
1104 * src/Makefile.am (nanosec_libs): Remove $(LIB_XANOSLEEP); no
1107 2005-03-01 Jim Meyering <jim@meyering.net>
1109 * src/copy.c (copy_internal): Change test of source type from
1110 !S_ISREG to S_ISLNK. Reported by Paul Eggert in
1111 http://lists.gnu.org/archive/html/bug-coreutils/2004-10/msg00050.html.
1113 2005-02-28 Jim Meyering <jim@meyering.net>
1115 * NEWS: Mention that xnanosleep fixes sleep failure on linux-2.6.8.1.
1117 2005-02-21 Paul Eggert <eggert@cs.ucla.edu>
1119 * src/Makefile.am (dd_LDADD, shred_LDADD): Add $(LIB_GETHRXTIME).
1120 (nanosec_libs): Add $(LIB_XNANOSLEEP). Needed for newer GNU/Linux
1121 hosts with clock_gettime.
1123 2005-02-20 Paul Eggert <eggert@cs.ucla.edu>
1125 * NEWS: Describe user-visible change to dd.
1126 * src/Makefile.am (dd_LDADD, shred_LDADD, nanosec_libs):
1127 Remove $(LIB_CLOCK_GETTIME). These functions now use
1129 * src/dd.c: Include gethrxtime.h, xtime.h.
1130 (start_time): Now of type xtime_t, not struct timespec.
1131 (print_stats, main): Use gethrxtime rather than gettime.
1132 * src/ls.c (time): Remove obsolete decl.
1133 (get_current_time): gettimeofday always returns 0, so don't
1135 * src/shred.c: Include gethrxtime.h.
1136 (isaac_seed): Use gethrxtime rather than a mishmash.
1137 * src/touch.c (time): Remove obsolete decl.
1139 * tests/misc/split-fail: Don't assume that the current host
1140 supports integers wider than 32 bits. Fix comment typo.
1141 * tests/od/x8: Likewise.
1143 * src/chown-core.c (enum RCH_status): Remove trailing comma,
1144 as it's not valid in standard C89.
1146 2005-02-15 Jim Meyering <jim@meyering.net>
1148 * src/stat.c (human_fstype): Add case/definition for S_MAGIC_XFS
1149 so that file systems of type `xfs' are recognized as such.
1150 * src/fs.h: Regenerate.
1151 Reported by Bernd Eckenfels.
1152 * src/stat.c (human_fstype): Likewise for S_MAGIC_JFS/jfs.
1153 * src/fs.h: Regenerate.
1154 Reported by Andreas Schwab.
1156 * src/nice.c (NZERO) [NZERO == 0]: Undefine and define to 20,
1157 to work around the invalid definition from Darwin 7.7.0.
1158 Test failure reported by Sébastien Maret.
1160 2005-02-14 Paul Eggert <eggert@cs.ucla.edu>
1162 * src/sort.c (mergefps): Use binary search rather than linear one
1163 when comparing new line to lines already in main memory.
1164 Idea suggested by James Lemley.
1166 2005-02-09 Jim Meyering <jim@meyering.net>
1168 * src/copy.c (valid_options): Add an assertion that
1169 not both hard_link and symbolic_link are set.
1171 2005-02-08 Paul Eggert <eggert@cs.ucla.edu>
1173 * NEWS: Document stat -f -c %S, plus changes to default formats.
1174 * doc/coreutils.texi (stat invocation): Normalize terminology,
1175 capitalization, and sort order to match --help output. Mention %c
1176 for file systems. Add new -f -c format %S, and document %s versus %S;
1177 problem reported by Jeroen van Wolffelaar.
1178 * src/stat.c (usage): Likewise.
1179 (STATFS_FRSIZE): New macro.
1180 (print_statfs): Use it, for stat -f -c %S.
1181 (do_statfs): Change default formats to output %S.
1183 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
1185 * src/system.h: Include "memrchr.h".
1186 (memrchr) [!HAVE_DECL_MEMRCHR]: Remove decl.
1188 2005-02-02 Jim Meyering <jim@meyering.net>
1190 * tests/du/8gb: Also adjust the test (s/64/128/) to detect
1191 systems that don't support sparse files.
1192 Check for $2 -ge 128, rather than $2 = 128, in case
1193 there is a file system type that doesn't support sparse files,
1194 yet for which metadata takes up additional space.
1195 Both reported by Andreas Schwab.
1197 2005-02-01 Eric Blake <ebb9@byu.net> (tiny change)
1199 * tests/du/8gb: Create a larger test file, so we properly
1200 detect that sparse files can be created on NTFS under cygwin.
1202 2005-01-30 Jim Meyering <jim@meyering.net>
1204 * src/head.c (elide_tail_bytes_pipe): Correct wording in diagnostic.
1206 * src/stty.c: Remove unnecessary parentheses in all #if directives.
1208 2005-01-29 Eric Blake <ebb9@byu.net> (tiny change)
1210 * .cvsignore: Ignore config.cache and config.status.lineno.
1211 * src/stty.c [VSWTCH]: Some systems, like Cygwin, use VSWTC
1212 instead of VSWTCH, for use with CSWTCH.
1214 2005-01-29 Eric Blake <ebb9@byu.net> (tiny change)
1216 * tests/Makefile.am (.PHONY): Add check-root and root-hint.
1217 * tests/rwx-to-mode: Ignore ACL designation.
1218 * tests/setgid-check: Likewise.
1219 * tests/chown/separator: Quote user and group names.
1221 2005-01-24 Jim Meyering <jim@meyering.net>
1223 * src/cp.c (usage): Merge the descriptions of --no-dereference and -P.
1224 Suggestion from Johan Boule.
1226 2005-01-17 Eric Blake <ebb9@byu.net> (tiny change)
1228 * src/Makefile.am (all_programs.list): Strip $(EXEEXT) and remove
1230 * man/Makefile.am (all_programs): Revert previous patch; updated
1231 all_programs.list fixes this.
1232 (.x.1): No need to add $(EXEEXT).
1234 2005-01-03 Corinna Vinschen <corinna@vinschen.de> (tiny change)
1236 * src/system.h: Use S_BLKSIZE value for ST_NBLOCKSIZE where
1239 2005-01-22 Jim Meyering <jim@meyering.net>
1241 * Makefile.maint (v_etc_file): The version string has moved to
1242 version-etc-fsf.c, search that new file, not version-etc.c.
1244 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
1246 * tests/group-names: Use numeric group ids, not symbolic group names,
1247 since the latter can have shell metacharacters in them (e.g., spaces).
1248 Problem reported by Eric Blake.
1249 * tests/chgrp/basic: Assume groups are numeric, not symbolic.
1250 * tests/chgrp/deref: Likewise.
1251 * tests/chgrp/posix-H: Likewise.
1252 * tests/chgrp/recurse: Likewise.
1254 2005-01-15 Jim Meyering <jim@meyering.net>
1256 * src/shred.c (isaac_seed) [HAVE_GETHRTIME]: #if-0 this block,
1257 because just calling gethrtime evokes an `illegal instruction'
1258 failure when compiled with Sun's c89 on Solaris 8 and 9.
1259 Reported by Nelson Beebe.
1261 * src/shred.c (isaac_seed) [HAVE_GETHRTIME]: Don't call ISAAC_SEED
1262 twice with the same value of `t'.
1263 Replace nested #if-#else blocks with #if-#elif-#elif chain.
1265 2005-01-14 Jim Meyering <jim@meyering.net>
1267 The test, tests/tail/f-1, failed on powerpc-apple-darwin7.7.0.
1268 * src/tail.c (IS_TAILABLE_FILE_TYPE): Adjust definition also to include
1269 sockets, since that's what you get when reading from a command-line-
1270 supplied pipe on Darwin 7.7.
1271 (IS_PIPE_LIKE_FILE_TYPE): Define.
1272 (main): Use new IS_PIPE_LIKE_FILE_TYPE rather than simply S_ISFIFO.
1273 Reported by Nelson Beebe.
1274 This same change is also required on NetBSD/sparc-1.5.
1275 Reported by Adrian Bunk.
1277 * src/expr.c (toarith): Rewrite to detect/diagnose integer overflow,
1278 rather than suffering silently.
1279 Before, expr would silently overflow and wrap around:
1280 $ expr 9223372036854775808 = 0 # $(echo 2^63|bc)
1282 Now it detects the problem and exits nonzero:
1283 $ ./expr $(echo 2^63|bc) = 0
1284 ./expr: 9223372036854775808: integer is too large
1286 * tests/chown/separator (id_gn): Exit 77, not 1, for a test-framework
1287 failure, so that doesn't cause `make check' to stop. Nelson Beebe
1288 reported that this test would fail with the diagnostic,
1289 `cannot find name for group ID 10', on one of his systems.
1291 2005-01-13 Jim Meyering <jim@meyering.net>
1293 * src/test.c (is_int): Don't overflow when evaluating integer
1294 constants. Before, ./test $(echo 2^64|bc) -eq 0 && echo FAIL
1297 * tests/Fetish.pm (run_tests): Add code (if-0'd out) to detect
1298 names of temporary files that would clash on 8.3 file systems.
1299 * tests/mk-script (validate): Likewise.
1301 2005-01-12 Jim Meyering <jim@meyering.net>
1303 * tests/dd/skip-seek: Shorten test names to accommodate 8.3 systems.
1305 * tests/tr/Test.pm (repeat-xC): Change test name from
1306 `repeat-Compl', to avoid 8.3 conflict with `repeat-compl'.
1307 Reported by Eric Blake.
1308 (repeat-000): Rename to `repeat-zeros' for the same reason.
1310 2005-01-11 Jim Meyering <jim@meyering.net>
1312 * configure.ac: Update version to 5.3.1.
1314 2005-01-11 Eric Blake <ebb9@byu.net>
1316 * src/Makefile.am (check-README, check-AUTHORS): Account for $(EXEEXT).
1317 * man/Makefile.am (all_programs): Account for $(EXEEXT).
1319 2005-01-11 Jim Meyering <jim@meyering.net>
1321 * src/unexpand.c (add_tab_stop): Properly diagnose a tabstop list
1322 with decreasing values.
1324 * src/expand.c (main): Likewise.
1325 * src/unexpand.c (main): Check for overflow in tabstop values
1326 specified via the obsolete form. E.g., now this command fails:
1327 _POSIX2_VERSION=1 ./unexpand -$(echo '2^64+1'|bc)
1328 Before it would act like `_POSIX2_VERSION=1 ./unexpand -1'.
1329 * tests/unexpand/basic-1 (obs-ovflo): New test for this.
1331 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
1333 Respond to POSIX interpretations about pathchk -p dated 2005-01-06.
1334 * NEWS: Document the changes.
1335 * doc/coreutils.texi (pathchk invocation): Likewise.
1336 * src/pathchk.c (PORTABILITY_OPTION): New constant.
1337 (longopts, usage, main, validate_file_name):
1338 Add support for new -P option.
1339 Reject empty file names (unless -p is not specified and the
1340 current system allows empty file names).
1341 Change --portability so that is now equivalent to -p -P.
1342 Don't test whether file name is too long, if it is known to exist.
1343 (no_leading_hyphen): New function.
1344 * tests/misc/pathchk1: Add tests for empty file names and
1347 2005-01-08 Jim Meyering <jim@meyering.net>
1351 `pr --columns=N' was not equivalent to `pr -N' when also using
1354 * src/pr.c (main): Set `explicit_columns' for --columns=N,
1355 not just for -N. This bug has existed since the introduction
1356 of the --columns=N option on 1998-08-15.
1357 * NEWS: Document this.
1358 * tests/pr/Test.pm (test_vector): For each -N test, automatically
1359 create a new test vector using --columns=N.
1361 2005-01-07 Paul Eggert <eggert@twinsun.com>
1363 * src/pr.c (main): Check for column count overflow with
1364 usages like "pr -2147483648".
1366 2005-01-07 Jim Meyering <jim@meyering.net>
1368 * src/pr.c (init_fps): Use xnmalloc, rather than xmalloc.
1370 2005-01-06 Jim Meyering <jim@meyering.net>
1372 * README: List the precise HP-UX version numbers that are affected.
1373 Suggestion from Bob Proulx.
1375 * Makefile.maint (sc_changelog): Specify find's `-maxdepth 2'
1376 predicate before `-name ChangeLog' to avoid a harmless warning
1379 2005-01-05 Jim Meyering <jim@meyering.net>
1381 * tests/help-version: Punt on the uptime test, since it fails when
1382 it can't get boot time, and I don't want that to stop `make check'.
1384 * src/du.c (process_file): Evaluate exclusion rules against
1385 the entire file name, not just the last component.
1386 Reported by Robert Lindgren.
1387 * tests/du/exclude: Test for this.
1388 * NEWS: Document this.
1390 Ensure that tests/Makefile.am's check-root actions stay up to date.
1391 * Makefile.maint (sc_root_tests): New rule.
1392 (syntax-check-rules): Add it to the list.
1394 2005-01-04 Jim Meyering <jim@meyering.net>
1396 * man/shred.x: Change one-line summary to reflect that shred does
1397 not remove files by default. Suggestion from Helen Faulkner in
1398 http://bugs.debian.org/288552
1400 * README: Request VERBOSE=yes output when reporting test failures.
1401 Other minor changes.
1403 * tests/Makefile.am (check-root): Update.
1405 2005-01-03 Paul Eggert <eggert@cs.ucla.edu>
1407 * src/system.h: Undo previous change; we now use Autoconf.
1409 2005-01-03 Jim Meyering <jim@meyering.net>
1411 * tests/stty/row-col-1: Don't set rows or columns to zero, to avoid
1412 a bug in the TIOCGWINSZ ioctl on at least Solaris5.9 systems. Setting
1413 either (or both) to zero would succeed, but subsequent `stty size'
1414 would say `no size information for this device' due to the ioctl
1415 failing with EINVAL.
1417 * src/system.h: If PRIdMAX, PRIoMAX, PRIuMAX, and PRIxMAX are
1418 not all defined and either ULONG_MAX or ULLONG_MAX is not defined,
1419 then fail at compile-time rather than let tools like od produce
1420 invalid results at run time.
1422 2004-12-21 Jim Meyering <jim@meyering.net>
1424 * src/csplit.c (usage): Say the default names are `xx00, xx01, ...',
1425 not `xx01, xx02, ...'.
1426 Reported by Matt Kraai in http://bugs.debian.org/286605
1428 * tests/misc/split-fail: Avoid spurious failure on x86 Solaris5.9
1431 2004-12-20 Paul Eggert <eggert@cs.ucla.edu>
1433 * src/split.c (usage): Mention default size. Suggested by Dan Jacobson.
1435 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
1437 * NEWS: Mention that one should eval "`dircolors`" rather than
1440 2004-12-17 Jim Meyering <jim@meyering.net>
1442 * tests/mv/hard-link-1: Rearrange to use newer trap-handling code,
1443 so temporary directories aren't left behind upon e.g., interrupt.
1445 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
1447 * src/ls.c (print_dir): Use "%s: not listing already-listed
1448 directory", not "not listing already-listed directory: %s", to
1449 format already-listed directories, to be consistent with other
1450 diagnostics involving file names and colons.
1452 2004-12-15 Jim Meyering <jim@meyering.net>
1454 * src/Makefile.am (__LDADD): Define, so that building `[' on
1455 Solaris still uses the -lgen library that it requires in order
1456 to get a definition of eaccess.
1458 2004-12-14 Jim Meyering <jim@meyering.net>
1460 tac would exit immediately upon I/O or temp-file creation failure.
1461 Now it continues on, processing any remaining command line arguments.
1463 * src/tac.c: Include quotearg.h.
1464 Use quotearg_colon in most diagnostics.
1465 (copy_to_temp): Rewrite not to exit upon I/O or temp-file-creation
1466 failure. Before, this command (with /full/tmp being a full partition)
1467 TMPDIR=/full/tmp ./tac /proc/modules tac.c
1468 would exit immediately upon the write error while trying to copy
1469 non-seekable /proc/modules to the full partition. Now it still
1470 reports the failure but continues on with the remaining file.
1471 (tac_nonseekable): Return false also if copy_to_temp fails.
1472 [DONT_UNLINK_WHILE_OPEN]: Add a FIXME comment explaining that
1473 using atexit like this is wrong.
1474 * NEWS: Document this.
1475 * tests/misc/tac-continue: New test for this.
1476 * tests/misc/Makefile.am (TESTS): Add tac-continue.
1478 * tests/chown/basic: Add a few more tests.
1480 2004-12-13 Paul Eggert <eggert@cs.ucla.edu>
1482 * src/ls.c (gobble_file): Change arg name to be command_line_arg
1483 rather than explicit_arg, for consistency with copy.c.
1484 (extract_dirs_from_files): Remove ignore_dot_and_dot_dot arg, since
1485 it is deducible from dirname arg. All callers changed.
1486 (extract_dirs_from_files, print_dir, queue_directory):
1487 Add command_line_arg arg. All callers changed.
1488 (struct pending): Add command_line_arg member.
1489 (main): Use NULL rather than 0 when appropriate.
1490 (set_exit_status, file_failure): New functions.
1491 (queue_directory): Store command_line_arg into new structure.
1492 (print_dir, gobble_file, get_link_name):
1493 Use file_failure to report problems in accessing files,
1494 so that the exit status is set consistently.
1495 (print_dir): Simplify readdir failure code yet again.
1496 If closedir fails, report "closing directory" rather than "reading
1498 (xstrcoll): Use set_exit_status to set status on failure.
1499 * tests/ls-2/tests (no-a-isdir-b): This now exits with status 2,
1502 2004-12-11 Jim Meyering <jim@meyering.net>
1504 Avoid a race condition vulnerability in chown, when used with
1505 --from=O:G and without the (-h) --no-dereference option.
1506 * src/chown-core.c (restricted_chown): New function.
1507 (change_file_owner): Call it.
1508 Reported by Ulrich Drepper.
1509 * NEWS: Mention this.
1511 2004-12-09 Paul Eggert <eggert@cs.ucla.edu>
1513 * ls now exits with status 1 on minor problems, 2 if serious trouble.
1514 * NEWS: Document this.
1515 * src/ls.c (LS_MINOR_PROBLEM, LS_FAILURE): New constants.
1516 All uses of EXIT_FAILURE replaced with LS_FAILURE, unless
1518 (main): Initialize exit failure to LS_FAILURE.
1519 (print_dir, gobble_file, get_link_name, xstrcoll):
1520 Set exit status to LS_MINOR_PROBLEM if the failure is minor.
1521 (print_dir): Do not give up on entire directory merely because readdir
1523 (usage): Explain exit status.
1524 * tests/help-version: ls and variants now exit with status 2
1527 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
1529 * NEWS: Document new UTC+HH:MM date syntax, and put date changes
1532 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
1534 * src/factor.c (factor): Don't list 1 as a factor of 1.
1535 Problem reported by Thomas Folz-Donahue.
1537 2004-12-06 Jim Meyering <jim@meyering.net>
1539 * tests/du/files0-from: Sanitize environment.
1540 Otherwise, e.g., BLOCKSIZE=k would cause a failure, and that
1541 setting is the default (exported from /etc/profile) on at least one
1543 * tests/du/no-deref: Likewise.
1544 * tests/cp/symlink-slash: Likewise.
1545 * tests/ls/symlink-slash: Likewise
1547 2004-12-05 Jim Meyering <jim@meyering.net>
1549 * tests/tail/Test.pm (err-6) ["tail -c"]: Avoid test failure when
1550 _POSIX2_VERSION=199209 is in the environment, or when building on
1553 2004-12-04 Jim Meyering <jim@meyering.net>
1555 * NEWS: Mention cut's new --complement option.
1557 2004-10-01 Paolo Bonzini <bonzini@gnu.org>
1559 * cut.c (complement, COMPLEMENT_OPTION): New.
1560 (longopts): Add --complement.
1561 (usage): Say not that -b, -c, and -f `print' fields,
1562 but rather that they `select' fields for printing.
1563 Describe the new --complement option.
1564 (mark_range_start): Extracted from set_fields.
1565 (print_kth): Support --complement.
1566 (compare_ranges): New function.
1567 (set_fields): Rewrite the part that populates range_start_ht,
1568 merging it with the part that populates printable_field.
1569 (main): Handle --complement.
1571 2004-12-03 Paul Eggert <eggert@cs.ucla.edu>
1573 * src/tail.c (tail_file): Set errnum to -1 if the initial "tail"
1574 failed. This works around an assertion failure reported by
1576 http://lists.gnu.org/archive/html/bug-coreutils/2004-12/msg00012.html
1578 2004-12-02 Jim Meyering <jim@meyering.net>
1580 With using --color and with LS_COLORS saying not to color
1581 executables, don't stat every file.
1582 * src/ls.c (is_colored): New function.
1583 (gobble_file): Use it.
1584 (main): Use it here, in place of too-strict tests against NULL:
1585 if either ORPHAN or MISSING was set to 0 from LS_COLORS, the
1586 old test would fail.
1588 2004-12-01 Paul Eggert <eggert@cs.ucla.edu>
1590 * src/comm.c (compare_files): Assume setlocale exists.
1591 * src/join.c (keycmp): Likewise.
1592 * src/seq.c (decimal_point): Treat like sort. Now char.
1594 (main): Assume localeconv exists. Use same code as sort.
1595 * src/sort.c (C_DECIMAL_POINT): Remove. Use changed to '.'.
1596 Assume setlocale exists.
1597 (thousands_sep): Renamed from th_sep.
1598 (IS_THOUSANDS_SEP): Remove. All uses replaced by comparisons.
1599 (NONZERO): Parenthesize use of arg.
1600 (numcompare): Avoid duplicate loads. Use ISDIGIT as boolean, for
1601 consistency. Avoid unnecessary negation by reversing
1603 (main): Rewrite localeconv call to match seq.c.
1604 * src/system.h: Assume locale.h exists.
1605 (HAVE_SETLOCALE): Remove.
1606 * src/uniq.c (different): Assume setlocale exists.
1608 * src/ls.c (sort_files): Minor cleanup. Remove an unnecessary
1609 'volatile' on a local variable. Rewrite to avoid unnecessary
1610 double-assignment to 'func' in the usual case where strcoll does
1613 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
1615 * src/pinky.c (gethostname): Remove decl.
1616 (scan_entries): Use IS_USER_PROCESS instead of by-hand code.
1617 * src/uptime.c (print_uptime): Use IS_USER_PROCESS and
1618 UT_TYPE_BOOT_TIME instead of by-hand code.
1619 * src/users.c (list_entries_users): Use IS_USER_PROCESS
1620 instead of by-hand code.
1621 * src/who.c (USER_PROCESS, RUN_LVL, INIT_PROCESS, LOGIN_PROCESS,
1622 DEAD_PROCESS, BOOT_TIME, NEW_TIME, UT_TYPE_UNDEF, UT_TYPE): Remove.
1623 (IS_USER_PROCESS): Move to ../lib/readutmp.h.
1624 (UT_TYPE_RUN_LVL, UT_TYPE_INIT_PROCESS, UT_TYPE_LOGIN_PROCESS,
1625 UT_TYPE_DEAD_PROCESS, UT_TYPE_NEW_TIME): New macros.
1626 (gethostname): Remove decl.
1627 (list_entries_who, scan_entries): Use the new macros defined above,
1628 for consistency with pinky, uptime, and users.
1630 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
1632 Fix problem reported by Scott S. Tinsley for HP-UX 11.11 using
1633 HP's ANSI C compiler. Declaring int functions causes warnings on
1634 some modern systems and shouldn't be needed to compile on ancient
1636 * src/copy.h (stat, lstat, rename): Remove decls.
1637 * src/install.c (stat): Remove decl.
1638 * src/ln.c (link, symlink): Remove decls.
1640 2004-11-25 Jim Meyering <jim@meyering.net>
1642 * man/help2man: Import help2man-1.35.1.
1643 * man/Makefile.am (.x.1): Remove now-unnecessary use of
1644 locally-added --program-name=NAME option. Now, help2man gets
1645 the name from the [NAME] section (i.e. from our .x file).
1646 * man/install.x: Use `install', not `ginstall' in the one-line
1647 description. Reported by Brendan O'Dea.
1648 * man/sha1sum.x: Use `sha1sum', not `shasum'.
1650 2004-11-24 Jim Meyering <jim@meyering.net>
1652 Since the changes of 2004-05-22, the u.saved_cwd member at
1653 the bottom of the active-directory stack was no longer
1654 strictly necessary. This change removes that member and uses
1655 the newer cwd_state parameter for the final restore_cwd.
1657 * src/remove.c (struct AD_ent) [u]: Remove now-unnecessary union.
1658 [dev_ino]: Rename from `a'.
1659 (AD_pop_and_chdir): Add a parameter to play the role of just-removed
1660 bottom-of-stack cwd-state member.
1661 (AD_pop_and_chdir): No longer return boolean. Adjust caller.
1662 (AD_push_initial): Remove CWD parameter. Adjust caller.
1664 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
1666 Minor performance improvements and cleanups for "touch".
1667 * src/touch.c (posix_date): Remove; not needed as a static var.
1669 (touch): Use new futimens function to operate more efficiently
1670 in some cases. Don't stat/fstat existing file when
1671 (!amtime_now && change_times == (CH_ATIME | CH_MTIME)); the
1672 old time stamps aren't needed in that case.
1673 (main): change_times is int, not bool. Simplify test for
1676 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
1678 * src/install.c (usage): Avoid usage that runs afoul of Docbook
1679 translation. Problem reported by Eric S. Raymond.
1681 Restore dd's noctty flag, reverting the change of 2004-04-08.
1682 POSIX does not allow "dd" to use O_NOCTTY by default.
1683 * NEWS: Add noctty flag to dd.
1684 * doc/coreutils.texi (dd invocation): Likewise.
1685 * src/dd.c (flags, usage, main): Likewise.
1687 2004-11-19 Alfred M. Szmidt <ams@gnu.org>
1689 * src/ls.c (usage): Clarified description of --no-group (-G),
1690 --human-readable (-h), --inode (-i), --size (-s), --time,
1693 2004-11-19 Jim Meyering <jim@meyering.net>
1695 * src/ls.c (usage): Clarify description of --author.
1696 Tweak indentation so that help2man creates better nroff.
1697 Reported by Dan Jacobson.
1699 * src/uniq.c (check_file): Don't check stdout for errors here.
1701 * src/pwd.c (find_dir_entry): Update comment to match reality.
1703 2004-11-18 Jim Meyering <jim@meyering.net>
1705 * src/pwd.c (robust_getcwd): Correct the comment: this function
1706 constructs the directory name. The caller prints it.
1708 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
1710 * src/stat.c (STATFS): New macro, for portability to Solaris 9.
1711 (do_statfs): Use it.
1713 * src/basename.c, src/chroot.c, src/cksum.c, src/dd.c, src/dirname.c,
1714 src/factor.c, src/hostid.c, src/hostname.c, src/link.c, src/logname.c,
1715 src/nohup.c, src/printenv.c, src/pwd.c, src/setuidgid.c, src/sleep.c,
1716 src/sync.c, src/tsort.c, src/unlink.c, src/uptime.c, src/users.c,
1717 src/whoami.c, src/yes.c (main): Use getopt_long rather than getopt.
1718 * src/readlink.c (main): argv is not const.
1720 * src/cut.c (usage): Improve documentation along the lines suggested
1722 * src/echo.c (usage): Likewise.
1723 * src/expr.c (usage): Likewise.
1725 * src/dircolors.hin: Add putty, screen-bce.
1727 * src/pinky.c (print_entry): Fix memory leak.
1728 * src/who.c (print_user): Likewise.
1730 2004-11-15 Paul Eggert <eggert@cs.ucla.edu>
1732 * NEWS: New dd operand "status=noxfer".
1733 * src/dd.c (C_ASCII, C_EBCDIC, C_IBM, C_BLOCK, C_UNBLOCK,
1734 C_LCASE, C_UCASE, C_SWAB, C_NOERROR, C_NOTRUNC, C_SYNC, C_TWOBUFS,
1735 C_NOCREAT, C_EXCL, C_FDATASYNC, C_FSYNC): Now constants, not
1737 (STATUS_NOXFER, statuses): New constants.
1738 (usage, print_stats, scanargs): Add support for status=noxfer.
1739 (usage): Update status output to match new behavior.
1740 (print_stats): Always output complete byte count.
1741 Put space between numbers and units, as SI requires.
1742 Use ngettext so that i18n can use plurals for "byte" and "second".
1743 Don't multiply by 1e-9 (inexact); divide by 1e9 (which is exact).
1744 (iflag_error_msgid, oflag_error_msgid): Remove; replace uses by
1746 * tests/dd/skip-seek (@Tests): Use status=noxfer to avoid
1747 problems with regression testing.
1749 2004-11-14 Paul Eggert <eggert@cs.ucla.edu>
1751 * NEWS: dd now outputs total bytes, seconds, and bytes per second.
1752 * src/Makefile.am (dd_LDADD): Add $(LIB_CLOCK_GETTIME).
1753 * src/dd.c: Include "human.h".
1754 (w_bytes, start_time): New vars.
1755 (usage): Document new I/O statistics output
1756 (print_stats): Output new I/O statistics.
1757 (cleanup): Do statistics after closing stdin and stdout, so that
1758 the times are more accurate.
1759 (write_output, dd_copy): Count output bytes.
1760 (main): Get initial value of clock.
1762 2004-11-14 Jim Meyering <jim@meyering.net>
1764 Backslash-escape `-'s in email addresses, so that they are
1765 rendered properly in UTF-locales.
1766 * man/help2man (escape_hyphens): New function.
1767 (main): Call it on email addresses.
1769 * src/sort.c (zaptemp): Mark new diagnostic for translation.
1771 * tests/misc/close-stdout: New file. Test today's closeout.c change.
1772 * tests/misc/Makefile.am (TESTS): Add close-stdout.
1774 2004-11-13 Jim Meyering <jim@meyering.net>
1776 * src/test.c (usage): Put the description of `[-n] STRING'
1777 on two lines, one for `-n STRING' and one for `STRING' so that
1778 help2man properly escapes the `-'. Otherwise, the hyphen is
1779 rendered inappropriately in UTF-8 locales.
1780 Reported by Uwe Zeisberger in http://bugs.debian.org/281069.
1782 2004-11-12 Paul Eggert <eggert@cs.ucla.edu>
1784 * NEWS: Document the following changes.
1786 * src/sort.c: Avoid O(N**2) behavior when there are many temporary
1788 (temptail): New variable, so that we can easily append to list.
1789 (create_temp_file): Create new files at end of list, so that
1790 searching the list has O(N*NMERGE) behavior instead of O(N**2).
1791 (zaptemp): Update temptail if needed.
1792 (mergefps, merge): Accept new arg that counts temp files, and keep it
1793 up to date as we create and remove temporaries. This is for
1794 efficiency, so that we don't call zaptemp so often.
1795 All callers changed.
1796 (sort): Don't create array in reverse order, since the list of
1797 temporaries is now in the correct order.
1799 (zaptemp): Protect against race condition: if 'sort' is
1800 interrupted in the middle of zaptemp, it might unlink the
1801 temporary file twice, and the second time this happens the file
1802 might already have been created by some other process.
1804 (zaptemp): Warn if a temporary file is not removed.
1806 (create_temp_file): Use offsetof for clarity.
1807 (die): Move it up earlier, to clean up the code a bit.
1809 * src/pr.c (strtoumax): Declare if not declared.
1810 (skip_to_page, first_page_number, last_page_number, page_number,
1811 first_last_page, print_header):
1812 Use uintmax_t for page numbers.
1813 (first_last_page): Remove unnecessary forward declaration.
1814 Do not modify arg (it is now a const pointer).
1815 Return a true if successful, false (without print a diagnostic)
1817 (main): If +XXX does not specify a valid page range, treat it
1818 as a file name. This follows the response to Open Group XCU ERN 41
1819 <http://www.opengroup.org/sophocles/show_mail.tpl?source=L&listname=austin-group-l&id=7717>,
1820 which says the behavior is allowed.
1821 (skip_to_page): When starting page number exceeds page count,
1822 print both numbers in the diagnostic.
1823 (print_header): Detect page number overflow.
1825 2004-11-07 Jim Meyering <jim@meyering.net>
1827 * src/uname.c [__APPLE__]: Include <mach/machine.h> and <mach-o/arch.h>.
1828 (main) [__APPLE__]: Get the processor type via syscall rather than
1829 hard-coding "powerpc". From Toby Peterson.
1831 * src/sort.c (merge): Remove declarations of now-unused variables.
1833 2004-11-06 Paul Eggert <eggert@cs.ucla.edu>
1835 * src/sort.c (first_same_file): Remove. Move most of the code to....
1836 (avoid_trashing_input): New function.
1837 (merge): Avoid some silly merges, e.g., copying a single file to
1838 a temporary file when there are exactly 17 input files to merge.
1839 Take a count of temporary files rather than a max_merge arg.
1842 2004-11-06 Jim Meyering <jim@meyering.net>
1844 * src/sort.c (xfclose): Don't close stdout here (just flush it),
1845 since close_stdout now closes stdout unconditionally.
1847 2004-11-05 Paul Eggert <eggert@cs.ucla.edu>
1849 * src/sort.c (inittables, sort_buffer_size, getmonth, mergefps,
1850 first_same_file, merge, sort, main): Use size_t for indexes to arrays.
1851 This fixes some unlikely havoc-wreaking bugs (e.g., more than INT_MAX
1853 (getmonth, keycompare, compare): Rewrite to avoid need for alloca,
1854 thus avoiding unchecked stack overflow in some cases. As a side
1855 effect this improve the performance of "sort -M" by a factor of 4
1858 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
1860 * src/stty.c: Include "vasprintf.h" since we use vasprintf now.
1862 * src/Makefile.am (check-AUTHORS): Don't assume \? works in a sed
1863 expression; it's not portable. Problem reported by Albert Chin.
1864 Don't invoke a program more than once.
1865 * src/groups.sh (version): New variable, containing author info,
1866 for benefit of AUTHORS check. Use it when acting on --version option.
1867 * AUTHORS: Remove duplicate lines. Remove bogus "chroot:"
1870 * src/system.h: Don't #define and #undef getopt around <stdlib.h>,
1871 as this breaks the new regime that does "#define getopt rpl_getopt".
1872 Problem reported by Albert Chin for Solaris 9 with Sun cc in:
1873 http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00019.html
1874 I suppose this may cause problems on ancient hosts with
1875 incompatible getopt declarations, but we'll cross that bridge if
1876 the problem gets reported to us by someone who can test the fix.
1878 2004-11-03 Jim Meyering <jim@meyering.net>
1880 * src/tac.c: quote(...) file names in diagnostics.
1882 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
1884 * NEWS: Document getdate changes.
1886 2004-10-29 Jim Meyering <jim@meyering.net>
1888 * src/tac.c (tac_file): Remove temporary prototype and move this
1889 function `down' so that it precedes definition of tac_nonseekable.
1891 `tac /proc/modules' would print nothing
1892 Reported by Harald Dunkel in http://bugs.debian.org/278604.
1894 * src/tac.c (copy_to_temp): Renamed from save_stdin, since
1895 now it copies a general file descriptor, not just stdin.
1896 (tac_nonseekable): Renamed/adapted from tac_stdin.
1897 (tac_file): Get fd via `open' directly rather than via fopen/fileno,
1898 since we never used the stream. Perform "-" to stdin mapping here
1899 rather than in main. Determine whether a file is seekable,
1900 by trying to `lseek' to its end, and dispatch to tac_seekable or
1901 tac_nonseekable accordingly.
1902 (main): Rewrite argument handling now that it uses only tac_file.
1903 * NEWS: Mention it here.
1905 2004-10-21 Jim Meyering <jim@meyering.net>
1907 * tests/mv/leak-fd: New file.
1908 * tests/mv/Makefile.am (TESTS): Add it.
1909 * tests/rm/dot-rel: New file.
1910 * tests/rm/Makefile.am (TESTS): Add it.
1912 Correct my patch of 2004-10-18.
1913 * src/remove.c (rm): Destroy the saved_cwd here (via cwd_state),
1914 if necessary, not in remove_dir. Otherwise, removing multiple
1915 `.'-relative nonempty directories no longer worked.
1917 2004-10-20 Paul Eggert <eggert@cs.ucla.edu>
1919 * src/fmt.c (usage): Improve description of --prefix.
1920 Problem reported by Edward Welbourne.
1922 * man/uniq.x: Change summary so that it doesn't imply that
1923 uniq writes to its input file. Problem reported by
1926 2004-10-18 Jim Meyering <jim@meyering.net>
1928 Plug a leak that would cause a cross-device mv to fail when
1929 operating on too many command-line-specified nonempty directories.
1930 * src/remove.c (remove_dir): Destroy the `struct saved_cwd' on the
1931 top of the stack before returning. This usually closes the file
1932 descriptor that was used to return to the original working directory.
1933 Reported by Cyril Bouthors in
1934 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/3048
1935 * NEWS: Mention it here.
1937 * src/pathchk.c (validate_file_name): Give a more descriptive
1938 diagnostic when pathconf fails. This also avoids an unwarranted
1939 warning from gcc-3.3.5 about a format not being a string literal.
1941 * src/sleep.c (main): Remove declaration of unused local, c.
1942 * src/printenv.c (main): Likewise.
1943 * src/logname.c (main): Likewise.
1944 * src/uptime.c (main): Likewise, for optc.
1945 * src/tsort.c (main): Likewise, for opt.
1947 2004-10-17 Paul Eggert <eggert@cs.ucla.edu>
1949 * AUTHORS: Add self to pathchk.
1950 * src/pathchk.c (AUTHORS): Add self.
1951 Change "path" to "file name" whenever possible.
1952 Remove usage comment, as it was a duplication of the code or doc.
1953 Include <wchar.h> if available.
1954 (mbrlen, mbstate_t) [! (HAVE_MBRLEN && HAVE_MBSTATE_T)]: Define.
1955 (NEED_PATHCONF_WRAPPER, PATH_MAX, PATH_MAX_FOR, NAME_MAX,
1956 pathconf_wrapper, portable_chars, dir_ok): Remove.
1957 (NAME_MAX_MINIMUM, PATH_MAX_MINIMUM): New macros.
1958 (pathconf, _PC_NAME_MAX, _PC_PATH_MAX): Define if nonexistent.
1959 (portable_chars_only): New arg FILELEN.
1960 Don't assume ASCII; we might be on an EBCDIC host.
1961 Don't assume unibyte locale in diagnostic.
1962 (component_start, component_len): New functions.
1963 (validate_file_name): Renamed from validate_path. All uses changed.
1964 Pretty much a complete rewrite.
1965 Don't make copy of file arg. Always append trailing slash to
1966 pathconf arg, just in case it's a symlink (this is pure paranoia;
1967 we don't know of any hosts where the trailing slash is required).
1968 Use size_t instead of long int when possible.
1969 Avoid need to call pathconf in most practical cases.
1970 Don't use euidaccess several times to test searchability;
1971 just use lstat once. Reword diagnostic to put the (often very long)
1974 2004-10-15 Paul Eggert <eggert@cs.ucla.edu>
1976 * src/printf.c (usage): Mention Unicode, and use H for hex digits.
1978 2004-10-13 Jim Meyering <jim@meyering.net>
1980 * NEWS: Mention today's fts.c fix.
1982 2004-10-13 Paul Eggert <eggert@cs.ucla.edu>
1984 * tests/stty/row-col-1: Set LC_ALL=C.
1986 2004-10-12 Jim Meyering <jim@meyering.net>
1988 * src/dircolors.hin: Add .flac and .mpc as audio suffixes.
1989 From Jesus Climent in http://bugs.debian.org/276149.
1991 2004-10-05 Paul Eggert <eggert@cs.ucla.edu>
1993 * src/ls.c (ignore_mode): Renamed from ignore, to avoid shadowing
1994 problems. All uses changed.
1996 2004-10-05 Jim Meyering <jim@meyering.net>
1998 * .x-sc_trailing_blank: Add an exclusion for config/texinfo.tex,
1999 since Karl says its trailing blanks are there to stay :-)
2001 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
2003 * src/expr.c (NEW, OLD): Remove, partly to avoid
2004 reference to obsolescent macro XMALLOC.
2005 All uses replaced by xmalloc and free.
2007 2004-09-28 Jim Meyering <jim@meyering.net>
2009 * src/tail.c (usage): Clarify: --retry works only with --follow=name.
2010 Reported by Nik A. Melchior in http://bugs.debian.org/273781.
2012 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
2014 * src/od.c (format_address_paren): c is optional, so don't output
2017 2004-09-26 Paul Eggert <eggert@cs.ucla.edu>
2019 Add support for ls --hide. Idea suggested by Bardur Arantsson.
2020 * NEWS: Document this.
2021 * src/ls.c (file_ignored): Renamed from file_interesting, with
2022 inverted return value. Accept the file name, not a struct dirent *.
2023 All uses changed. Avoid the expense of calling fnmatch if the
2024 file is ignorable due to leading '.'.
2025 (all_files, really_all_files): Removed; replaced by:
2026 (ignore): New variable. All uses changed.
2027 (IGNORE_DEFAULT, IGNORE_DOT_AND_DOTDOT, IGNORE_MINIMAL, HIDE_OPTION):
2029 (hide_patterns): New variable.
2030 (long_options, decode_switches, file_ignored, usage):
2031 Add support for --hide.
2032 (patterns_match): New function.
2033 (usage): Replace "hide" with "ignore" in explanation, to avoid
2036 2004-09-25 Paul Eggert <eggert@cs.ucla.edu>
2038 * src/ls.c (gobble_file, print_long_format): Don't assume that
2039 human-readable output has a byte count equal to its column width;
2040 this isn't always true in locales where the radix character is not
2042 (format_user_or_group): Revamp code to match the above fix;
2043 this avoids the (very faint) possibility of integer overflow.
2045 2004-09-24 Paul Eggert <eggert@cs.ucla.edu>
2047 * NEWS: Mention that "chmod -r -w x" now works as expected.
2048 * src/chmod.c (main): Revamp option processing to support this.
2049 * tests/chmod/Makefile.am (TESTS): Add 'usage'.
2050 * tests/chmod/usage: New set of tests for usage like that.
2052 2004-09-24 Jim Meyering <jim@meyering.net>
2054 * Makefile.maint (CVS_LIST): Use --types=AFGM option so that
2055 it lists only cvs-controlled regular files.
2057 * src/csplit.c (xalloc_die): Declare to be `extern', not `static'
2058 to avoid a warning from gcc-3.4.1. Reported by Paul Eggert.
2060 2004-09-23 Paul Eggert <eggert@cs.ucla.edu>
2062 * Makefile.maint (CVS_LIST): New macro.
2063 (sc_space_tab, sc_prohibit_atoi_atof, sc_file_system,
2064 sc_prohibit_jm_in_m4, sc_system_h_headers, sc_sun_os_names,
2065 sc_trailing_blank, po-check): Use it instead of the
2066 nonstandard "cvsu --list".
2068 * src/tail.c (parse_obsolete_option): Bring back support
2069 for obsolete option followed by non-obsolete, or by more
2070 than one file. When obsolete, conform to SUSv2 rather than
2071 original POSIX 1003.2-1992, as SUSv2 corrected the case of
2072 "tail -c". Add support for the SUSv2 "b" modifier.
2073 * NEWS: Mention the above.
2074 * tests/tail/Test.pm: New test case obs-b to check the above.
2075 err-[134] no longer need _POSIX2_VERSION=199209.
2076 Fix comments to match revised behavior.
2078 2004-09-22 Jim Meyering <jim@meyering.net>
2080 * Use automake-1.9.2. Regenerate dependent files.
2082 * src/remove.c (struct dirstack_state) [current_arg_jumpbuf]:
2083 Improve the comment.
2085 Clean up scoping etc. so that some make `distcheck' tests pass.
2086 * src/csplit.c (xalloc_die): Declare to be static.
2087 * src/chown-core.c (chown_files): Declare as `extern'.
2088 * src/cp-hash.c (remember_created): Likewise.
2089 * src/copy.c (copy): Likewise.
2090 * src/checksum.h (enum) [ALG_MD5]: Define to be 1, not 0.
2092 * src/id.c, src/nl.c, src/expand.c: Remove trailing blanks.
2093 * src/unexpand.c: Likewise.
2095 * src/Makefile.am (check-AUTHORS): New rule.
2096 (check): Depend on it.
2099 * Makefile.maint (syntax-check-rules): Remove duplicate sc_tight_scope.
2100 (sc_system_h_headers): Also exclude copy.h; it includes <stdbool.h>.
2102 2004-09-22 Paul Eggert <eggert@cs.ucla.edu>
2104 * src/ls.c (decode_switches): Don't compare a short value
2105 to SIZE_MAX: GCC sometimes complains.
2107 2004-09-21 Paul Eggert <eggert@cs.ucla.edu>
2109 * NEWS: The following commands now reject unknown options:
2110 basename dirname factor hostname link nohup sync unlink yes
2111 Also, pathchk no longer accepts trailing options.
2113 * src/basename.c: Include <getopt.h>.
2114 * src/chroot.c: Likewise.
2115 * src/dirname.c: Likewise.
2116 * src/factor.c: Likewise.
2117 * src/hostid.c: Likewise.
2118 * src/hostname.c: Likewise.
2119 * src/nohup.c: Likewise.
2120 * src/pwd.c: Likewise.
2121 * src/setuidgid.c: Likewise.
2122 * src/sync.c: Likewise.
2124 * src/basename.c (main): Reject unknown options.
2125 * src/dirname.c (main): Likewise.
2126 * src/factor.c (main): Likewise.
2127 * src/hostid.c (main): Likewise.
2128 * src/hostname.c (main): Likewise.
2129 * src/link.c (main): Likewise.
2130 * src/nohup.c (main): Likewise.
2131 * src/pwd.c (main): Likewise.
2132 * src/setuidgid.c (main): Likewise.
2133 * src/sync.c (main): Likewise.
2134 * src/unlink.c (main): Likewise.
2135 * src/yes.c (main): Likewise.
2137 * src/cat.c (main): Remove unused "case 0".
2138 * src/chgrp.c (main): Likewise.
2139 * src/chmod.c (main): Likewise.
2140 * src/chown.c (main): Likewise.
2141 * src/comm.c (main): Likewise.
2142 * src/cp.c (main): Likewise.
2143 * src/csplit.c (main): Likewise.
2144 * src/cut.c (main): Likewise.
2145 * src/date.c (main): Likewise.
2146 * src/df.c (main): Likewise.
2147 * src/du.c (main): Likewise.
2148 * src/env.c (main): Likewise.
2149 * src/expand.c (main): Likewise.
2150 * src/fold.c (main): Likewise.
2151 * src/head.c (main): Likewise.
2152 * src/id.c (main): Likewise.
2153 * src/install.c (main): Likewise.
2154 * src/join.c (main): Likewise.
2155 * src/ln.c (main): Likewise.
2156 * src/ls.c (decode_switches): Likewise.
2157 * src/mkdir.c (main): Likewise.
2158 * src/mkfifo.c (main): Likewise.
2159 * src/mknode.c (main): Likewise.
2160 * src/mv.c (main): Likewise.
2161 * src/nl.c (main): Likewise.
2162 * src/paste.c (main): Likewise.
2163 * src/pinky.c (main): Likewise.
2164 * src/pr.c (main): Likewise.
2165 * src/ptx.c (main): Likewise.
2166 * src/readlink.c (main): Likewise.
2167 * src/rm.c (main): Likewise.
2168 * src/rmdir.c (main): Likewise.
2169 * src/seq.c (main): Likewise.
2170 * src/shred.c (main): Likewise.
2171 * src/split.c (main): Likewise.
2172 * src/sum.c (main): Likewise.
2173 * src/tac.c (main): Likewise.
2174 * src/tail.c (main): Likewise.
2175 * src/tee.c (main): Likewise.
2176 * src/touch.c (main): Likewise.
2177 * src/tr.c (main): Likewise.
2178 * src/tty.c (main): Likewise.
2179 * src/uname.c (main): Likewise.
2180 * src/unexpand.c (main): Likewise.
2181 * src/wc.c (main): Likewise.
2182 * src/who.c (main): Likewise.
2184 * src/chroot.c (main): Use getopt where it suffices, not getopt_long.
2185 * src/cksum.c (main): Likewise.
2186 * src/dd.c (main): Likewise.
2187 * src/logname.c (main): Likewise.
2188 * src/printenv.c (main): Likewise.
2189 * src/sleep.c (main): Likewise.
2190 * src/tsort.c (main): Likewise.
2191 * src/uptime.c (main): Likewise.
2192 * src/users.c (main): Likewise.
2193 * src/whoami.c (main): Likewise.
2195 * src/du.c (long_options): Standardize on NULL vs 0.
2196 * src/rm.c (long_opts): Likewise.
2198 * src/logname.c (long_options): Remove.
2199 * src/printenv.c (long_options): Likewise.
2200 * src/sleep.c (long_options): Likewise.
2201 * src/tsort.c (long_options): Likewise.
2202 * src/uptime.c (longopts): Likewise.
2203 * src/users.c (longopts): Likewise.
2204 * src/whoami.c (long_options): Likewise.
2206 * src/pathchk.c (longopts): Add --help, --version.
2207 (main): Use longopts rather than parse_long_options.
2208 * src/stty.c (longpts, main): Likewise.
2210 * src/pathchk.c (main): Don't reorder arguments, so that
2211 we can check weird file names.
2213 * src/readlink.c: Don't include "long-options.h".
2214 * src/sort.c: Likewise.
2215 * src/stty.c: Likewise.
2217 * src/split.c (verbose): Now bool, not int.
2218 (VERBOSE_OPTION): New enum.
2219 (longopts, main): Use it.
2221 * tests/factor/basic: Adjust to new wording in diagnostic
2222 that results from the above changes.
2224 2004-09-21 Jim Meyering <jim@meyering.net>
2226 * man/rm.x: Say "the response is affirmative" rather than "the
2227 response begins with y or Y", so that the documentation is
2228 accurate in non-English locales. Problem reported by Munzir Taha.
2230 2004-09-19 Paul Eggert <eggert@cs.ucla.edu>
2232 * src/echo.c (main): Don't pass NULL to strcmp when
2233 POSIXLY_CORRECT and given no arguments.
2235 * src/md5sum.c (STRING_OPTION): Remove.
2236 (long_options, main): Remove support for undocumented and
2237 obsolete --string option, as suggested in the 1996-09-26 patch.
2238 * NEWS: Document this.
2240 * tests/rm/fail-eperm: Don't try to remove writeable files in a
2241 sticky /tmp directory, as SVR4-like systems (e.g., Solaris 9) let
2242 you remove such files. Problem reported by Bert Fischer in:
2243 http://lists.gnu.org/archive/html/bug-coreutils/2004-09/msg00074.html
2245 2004-09-18 Paul Eggert <eggert@cs.ucla.edu>
2247 * src/md5sum.c (STATUS_OPTION, STRING_OPTION): New enums.
2248 (long_options, main): Use them instead of magic numbers 2 and 1.
2249 For --string, optarg can't possibly be NULL.
2251 * src/dd.c (usage): Distinguish between options and operands.
2252 (scanargs): Don't mess with argc, argv; getopt_long handles this now.
2253 Say "operands" for operands, not "options".
2254 (main): Use getopt_long, so that "dd --" works as POSIX requires.
2255 * tests/dd/misc: Check for "dd --".
2257 * src/chroot.c (main): Reject unknown options instead of
2258 interpreting them as a directory to chroot to.
2260 * src/cksum.c: Remove obsolete comment about POSIX 1003.2/D11.2.
2261 The current standard (POSIX 1003.1-2004) is correct.
2262 (crc_remainder) [defined CRCTAB]: Renamed from "remainder" to avoid
2263 collision with builtin function.
2264 (main) [defined CRCTAB]: Output in lowercase hexadecimal, and
2265 output the first 0 as 8 digits, to make it easier to compare to
2266 the text of the standard. Output crctab to be a const array.
2267 (crctab): Use result of above changes.
2268 (long_options): Remove; not needed if empty.
2269 (main): getopt_long can't return 0 here, so simplify the code.
2271 2004-09-13 Jim Meyering <jim@meyering.net>
2273 * src/Makefile.am (localedir.h): Don't redirect directly to target.
2275 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
2277 * src/id.c (print_full_info): Don't exit with failure status simply
2278 because a user or group number can't be turned into a name.
2279 Problem reported by Felipe Kellermann in:
2280 http://lists.gnu.org/archive/html/bug-coreutils/2004-09/msg00081.html
2282 2004-09-12 Jim Meyering <jim@meyering.net>
2284 * Makefile.maint (my-distcheck): When building with -Werror, also
2287 2004-09-10 Paul Eggert <eggert@cs.ucla.edu>
2289 * NEWS: "tail" now handles obscure POSIX 1003.2-1992 cases better.
2290 * src/tail.c (parse_obsolete_option): Renamed from
2291 parse_obsolescent_option, since the options are obsolete now.
2292 Remove bool *arg; just exit if there's an error. Revamp to follow
2293 POSIX 1003.2-1992 more precisely, to handle cases like "tail -
2294 file" and "tail -10 -- file" correctly when we are conforming to
2296 (main): Adjust to this change.
2297 * tests/tail/Test.pm (test_vector): minus-* requires
2298 _POSIX2_VERSION=199209 now, to work correctly if there is
2299 an input file. err-1 and err-3 no longer errors if there
2302 2004-09-09 Paul Eggert <eggert@cs.ucla.edu>
2304 * src/test.c (usage): Document -r, -w, -x more carefully.
2306 2004-09-08 Paul Eggert <eggert@cs.ucla.edu>
2308 * src/test.c (usage): Document "test" (with no args) and "[ ]".
2309 Document that -h and -L don't dereference.
2311 * NEWS: Document that "tr xy -z" now works as per POSIX.
2312 Sort the descriptions.
2313 * src/tr.c (main): Don't reorder options.
2314 * tests/tr/Test.pm (fowler-1): New test case.
2316 2004-09-06 Paul Eggert <eggert@cs.ucla.edu>
2318 * src/touch.c (main): Fix POSIX-conformance bug: "touch --
2319 MMDDhhmm file" must be treated like "touch MMDDhhmm file" when
2320 conforming to pre-2001 POSIX.
2321 * NEWS: Document this.
2322 * tests/touch/obsolescent: Test for this bug. Also, set
2323 _POSIX2_VERSION=199209 and POSIXLY_CORRECT=1 so that it's
2324 a better test for obsolescent features.
2326 * src/sort.c (main): Emulate Solaris 8 and 9 "sort -y", so that
2327 "sort -y abc" is like "sort abc" whereas "sort -y 100" is like
2330 * src/od.c: Several changes for POSIX and FreeBSD compatibility.
2331 (COMMON_SHORT_OPTIONS): Add -B, -D, -e, -F, -H, -I, -L, -O, -s, -X.
2332 (long_options, main): --strings is now -S, not -s.
2333 (usage): Reflect the usage changes.
2334 (parse_old_offset): Do not issue a diagnostic on failure;
2335 callers now do this as necessary.
2336 (main): Support POSIX syntax. Remove unused case 0 from getopt_long.
2337 Add support for new short options (many undocumented) for
2338 compatibility with FreeBSD. Remove FIXME for -s; it's now
2339 POSIX-compatible. Default format is now oS, not o2.
2340 * NEWS: Describe the above.
2342 2004-09-05 Paul Eggert <eggert@cs.ucla.edu>
2344 * src/stty.c (valid_options): Remove.
2345 (main): Fix some bugs in handling invalid option-combinations
2347 (recover_mode): Arg is now char const *, not char *.
2348 (main): Use STDIN_FILENO, not 0.
2349 Simplify option-parsing code a tad.
2350 * tests/stty/basic-1: Check for the fixed bugs.
2352 2004-09-03 Paul Eggert <eggert@cs.ucla.edu>
2354 * src/stat.c (HAVE_STRUCT_STATXFS_F_TYPE): Fix typo that prevented
2355 it from ever being nonzero. Reported by Pozsar Balazs in:
2356 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00189.html
2357 (human_fstype): Add ramfs, squashfs, sysfs.
2358 Reported by Pozsar Balazs in:
2359 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00188.html
2360 (human_fstype): Return char const *, not char *.
2361 Simplify internals a bit, and avoid casts.
2363 * src/dd.c (usage): "alternated EBCDIC" -> "alternate EBCDIC".
2364 (bit_count): Remove. All uses changed to....
2365 (multiple_bits_set): New function.
2366 (scanargs): Use it, and check separately for each set of
2367 incompatible options, to improve diagnostics.
2369 (apply_translations): Move checks for incompatible options
2370 to scanargs, so that they're done consistently.
2372 2004-09-02 Paul Eggert <eggert@cs.ucla.edu>
2374 Output correct errno-related diagnostic on "paste" I/O errors.
2375 * src/paste.c (write_error, xputchar): New functions.
2376 (paste_parallel): Use correct errno value after input error.
2377 (paste_parallel, paste_serial): Report errno value after output error.
2379 Port to diet libc. Problem reported by Felix von Leitner in:
2380 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00171.html
2381 * src/paste.c (dummy_closed, CLOSED, dummy_endlist, ENDLIST): Remove;
2382 it's not portable C to assume FILE is a complete type.
2383 (paste_parallel): Use index test instead of ENDLIST, and NULL
2386 2004-08-24 Paul Eggert <eggert@cs.ucla.edu>
2388 POSIX-conformance fixes for "expand" and "unexpand".
2389 Also, consistently use "tab stop" rather than "tabstop".
2390 * NEWS: Document fixes.
2391 * src/expand.c: Revamp to resemble the new unexpand.c better.
2392 (usage): -i does not convert tabs after non-tabs.
2393 (add_tab_stop): Renamed from add_tabstop. All uses changed.
2394 (parse_tab_stop): Renamed from parse_tabstop. All uses changed.
2395 (validate_tab_stop): Renamed from validate_tabstop. All uses changed.
2396 (next_file, main): Check fclose against 0, not EOF.
2397 (expand): Remove unnecessary casts.
2398 Add another loop nesting level, for lines, so that per-line variables
2399 are initialized cleanly.
2400 Revamp tab checking. Check for write error immediately, rather
2401 than just once at the end of the program.
2402 * src/unexpand.c: Lkewise (for the expand.c changes).
2403 (TAB_STOP_SENTINEL): Remove.
2404 (tab_size): Now size_t, not uintmax_t, since we need to store
2405 the sequences of blanks.
2406 (max_column_width): New var.
2407 (usage): Say "blank" where POSIX requires this.
2408 (add_tab_stop): Calculate maximum column width.
2409 (unexpand): Store the pending blanks, instead of merely counting them.
2410 Follow POSIX's rules about -a requiring two blanks before a tab stop.
2411 Get rid of internal label and goto.
2412 * tests/unexpand/basic-1: Fix infloop-3 to match POSIX.
2413 Add blanks-1 through blanks-13.
2415 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
2417 * NEWS: "chown : file", "chown '' file", and "chgrp '' file" now
2418 succeed without changing the uid and gid, like FreeBSD.
2419 * src/chgrp.c (parse_group): Return gid_t rather than storing it
2420 through a pointer. Treat "chgrp '' file" as a no-op change,
2422 (main): Set chopt.group_name to NULL if the group is the empty
2424 * src/chown-core.c (describe_change): Describe changes to -1:-1
2425 without using "to OWNERSHIP" phrase.
2426 * src/chown.c (usage): "chown '' file" is now allowed.
2427 (main): Do not set user name to the empty string if the group
2429 * tests/chgrp/basic: Test "chgrp '' file".
2430 * tests/chown/Makefile.am (TESTS): Add separator.
2431 * tests/chown/separator: New file, partly taken from
2432 Dmitry V. Levin's suggestion in
2433 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
2435 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
2437 * tests/install/basic-1: Test for the -d regression.
2439 2004-08-11 Dmitry V. Levin <ldv@altlinux.org>
2441 * src/install.c (main): Fix -d regression introduced with
2442 --target-directory support at 2004-06-25.
2444 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
2446 * src/copy.c (copy_internal): When preserving links, unlink
2447 a destination with link count greater than one. This is so
2448 that commands like "cp -a" don't get confused when copying into
2449 a destination that already contains many hard links. Problem
2450 reported by Tim Waugh in:
2451 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00053.html
2453 2004-08-10 Paul Eggert <eggert@cs.ucla.edu>
2455 Convert all files to UTF-8.
2456 * tests/fmt/basic (8-bit-pfx): Use UTF-8, not Latin-1.
2457 * tests/sort/Test.pm (16a): Likewise.
2458 * tests/uniq/Test.pm (8): Likewise.
2459 * tests/misc/printf-hex: Use ASCII, not Latin-1.
2461 * NEWS: Document "sort -o -" and "tee -" POSIX-conformance fixes.
2462 * src/shred.c (usage): "-" is an operand, not an option.
2463 * src/sort.c (die, xfopen, mergefps, first_same_file, merge):
2464 A null file arg means standard output.
2465 (main): "-o -" means to write to a file named "-",
2466 not to standard output.
2467 * src/tee.c (usage, tee): "tee -" writes to standard output, not
2468 to a file named "-".
2470 2004-08-10 Dmitry V. Levin <ldv@altlinux.org>
2472 * src/install.c (change_timestamps): Fix int->bool conversion
2473 bugs introduced on 2004-07-29.
2475 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
2477 * src/shred.c (wipename): Work even if the directory is writeable
2478 and not readable. Prefer write access, since this should work
2479 better with fdatasync.
2481 * src/csplit.c (xalloc_die): New function.
2482 (main): Remove now-obsolete initialization of xalloc_fail_func.
2484 * src/md5sum.c: Adjust to sha->sha1 renaming.
2486 2004-08-08 Dmitry V. Levin <ldv@altlinux.org>
2489 * src/readlink.c (canonicalize_fname): Remove unneeded proxy function.
2490 (can_mode): Make variable local.
2492 2004-08-07 Paul Eggert <eggert@cs.ucla.edu>
2494 * src/system.h (O_BINARY) [!O_BINARY && defined O_BINARY]:
2495 Do not define, to avoid annoying compiler messages on QNX 6.3.
2496 Problem reported by Johan in:
2497 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00050.html
2499 2004-08-04 Paul Eggert <eggert@cs.ucla.edu>
2501 * src/system.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX):
2502 Define to a concatenation of string literals, not to an expression;
2503 needed for concatenation contexts.
2504 (INTMAX_MAX, INTMAX_MIN): New macros.
2506 * src/stat.c (print_stat): Don't assume st_ino / st_dev fits in
2507 unsigned long; this isn't true for st_ino on Solaris 9.
2509 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
2511 * src/uname.c: Do not depend on HAVE_SYSCTL when deciding
2512 whether to include files. Include <sys/param.h> if
2513 HAVE_SYS_PARAM_H (not HAVE_SYSCTL).
2514 (main) [defined __POWERPC__]: Add a kludge to work around a
2515 Mac OS X bug, so that uname -p defaults to "powerpc" if
2516 sysctl ((int[]) {CTL_HW, HW_MACHINE_ARCH}, 2, buffer, &bufsize, 0, 0)
2517 fails. Problem reported by Petter Reinholdtsen in:
2518 http://lists.gnu.org/archive/html/bug-gnu-utils/2003-02/msg00201.html
2520 * src/uniq.c (hard_LC_COLLATE, ignore_case, different, check_file,
2521 main): Use bool for booleans.
2522 (writeline, check_file): Use uintmax_t for line counts.
2523 (check_file): Check for and report line number overflow,
2525 * src/wc.c (iswspace, wc): Use to_uchar rather than a cast.
2526 (print_lines, print_words, print_chars, print_bytes, print_linelength,
2527 have_read_stdin, wc, wc_file, main):
2528 Use bool for booleans.
2529 (exit_status): Remove.
2530 (wc, wc_file): Return bool status. All callers changed.
2531 * src/who.c (scan_entries): 0 -> STDIN_FILENO.
2532 * src/whoami.c (main): Print uids using unsigned long int, not
2535 * src/unexpand.c: Int cleanup and minor reorganization to be more
2537 Include quote.h, xstrndup.h.
2538 (TAB_STOP_SENTINEL): Increase from INT_MAX to INTMAX_MAX.
2539 (convert_entire_line, have_read_stdin, parse_tabstops, next_file,
2541 Use bool for booleans.
2542 (tab_size, tab_list, add_tabstop, validate_tabstops, unexpand):
2543 Use uintmax_t for column counts.
2544 (first_free_tab, validate_tabstops, unexpand): Use size_t for sizes.
2545 (add_tabstop, parse_tabstops, main): Don't reserve UINTMAX_MAX
2547 (parse_tabstops): Don't use ISBLANK on possibly-signed char.
2548 Detect overflow in tab stop string.
2549 (next_file, main): Use EXIT_FAILURE/EXIT_SUCCESS instead of 1/0.
2550 (unexpand): Concatenate input files the same way expand does.
2552 * src/touch.c (no_create, use_ref, posix_date, amtime_now,
2553 touch, main): Use bool for booleans.
2554 (main): Avoid integer overflow when given more than INT_MAX
2556 * src/tsort.c (struct item, n_strings): Use size_t for sizes.
2557 (have_read_stdin, count_items, scan_zeros, detect_loop,
2558 recurse_tree, walk_tree, tsort, main):
2559 Use bool for booleans.
2560 (exit_status): Remove.
2561 (tsort): Return a success flag instead of storing into a global.
2563 * src/tty.c (silent, main): Use bool for booleans.
2564 (main): 0 -> STDIN_FILENO.
2565 * src/uname.c (print_element): Use bool for booleans.
2567 * src/test.c (TRUE, FALSE, SHELL_BOOLEAN, TRUTH_OR, TRUTH_AND):
2568 Remove. All uses replaced by C99 boolean primitives.
2569 (TEST_TRUE, TEST_FALSE): New constants, for readability.
2570 (test_unop, binop, unary_operator, binary_operator, two_arguments,
2571 three_arguments, posixtest, expr, term, and, or, is_int, age_of,
2572 one_argument, main): Use bool for booleans.
2573 (advance, unary_advance): Now inline procedures rather than a macros.
2574 (is_int): Renamed from isint, to avoid namespace clash with ctype.h.
2575 (term, and, or): When it's easy, loop instead of recursing.
2576 (term): Avoid integer overflow if there are INT_MAX-3 args (!).
2577 (binary_operator, unary_operator): Simplify by systematically rewriting
2578 true==FOO to FOO (where FOO is a boolean).
2579 (unary_operator): Don't consider a file to be a regular file
2580 merely because its mode&S_IFMT is zero. Just use S_ISREG.
2581 Remove unnecessary casts. Remove ifdefs for things like
2582 S_ISSOCK that are no longer needed, since stat-macros.h always
2585 * src/tac-pipe.c (buf_init_from_stdin, find_bol, tac_mem):
2586 Use bool for booleans.
2587 (buf_init_from_stdin, buf_free, find_bol, print_line):
2588 Use size_t for sizes.
2589 * src/tac.c (separator_ends_record, tac_seekable, tac_file,
2590 tac_stdin, tac_stdin_to_mem, main): Use bool for booleans.
2591 (match_length, G_buffer_size, tac_seekable, main): Use size_t for sizes.
2592 (tac_seekable): Use ptrdiff_t for pointer subtraction.
2593 Report an error if the result is out of range.
2594 (tac_seekable, main): Check for integer overflow in buffer size
2596 (main): Remove unnecessary casts.
2598 * src/su.c (run_shell): Pass a new n_additional_args arg, so that
2599 the callee doesn't have to count 'em. All callers changed.
2600 Don't allocate more space for the arg vector than we'll need.
2601 Use memcpy to copy the args rather than rolling our own loop.
2602 Use size_t for sizes.
2603 (fast_startup, simulate_login, change_environment, log_su,
2604 correct_password, restricted_shell, main): Use bool for booleans.
2605 (longopts): Don't assume change_environment is an int.
2606 Use NULL, not 0, for pointers.
2607 (xsetenv): New function, replacing xputenv and concat.
2608 All callers changed.
2609 (elements): Remove; no longer needed.
2610 (log_su, correct_passwd, main): Prefer !x to x==NULL.
2611 (log_su): 2 -> STDERR_FILENO.
2612 (modify_environment, main): Don't assume that getenv's returned value
2613 has an indefinite lifetime.
2614 (modify_environment): Allocate a larger environ.
2615 (main): Remove an impossible 'case 0'; if it happens now, it'll
2616 get diagnosed. Don't assume getpwnam results outlive endpwent.
2617 Check for null or empty pw_name, pw_dir and for null pw_passwd.
2619 * src/stty.c (VA_START): Remove. All callers now use va_start.
2620 (_POSIX_VDISABLE): Remove unnecessary cast.
2621 (struct control_info, visible): Use cc_t for control chars.
2622 (struct control_info): Use size_t for sizes.
2623 (recover_mode, set_mode, display_speed, display_window_size,
2624 valid_options, main, display_changed):
2625 Use bool for booleans.
2626 (integer_arg): Return unsigned long int, not long int.
2627 Accept new max arg; all callers changed, to specify a maximum
2628 value for integer parameters instead of silently overflowing.
2629 (wrap): Do not overrun the stack buffer if the output contains
2630 more than 1024 bytes. Instead, malloc a buffer.
2631 (main): Remove a "what is this?!?" FIXME. Nobody knows what it is.
2632 Remove unnecessary casts.
2633 (set_control_char): Allow int values only up to cc_t range.
2634 (screen_columns): Don't reject INT_MAX.
2635 (display_changed, display_all, display_speed, recover_mode):
2636 Don't assume cc_t fits in int.
2638 * src/remove.h: Add copyright notice.
2639 (struct rm_options): Use bool for booleans.
2640 * src/rmdir.c (empty_paths, ignore_fail_on_non_empty, verbose,
2641 errno_rmdir_non_empty, remove_parents, main): Likewise.
2642 * src/sum.c (have_read_stdin, bsd_sum_file, sysv_sum_file,
2644 (main): Don't dump core if invoked with argv[0]==NULL.
2645 * src/tee.c (tee, append, ignore_interrupts, main, tee):
2646 Use bool for booleans.
2647 (tee): Use ssize_t for read returns.
2649 * src/ptx.c: Add a FIXME mentioning that there are many
2650 unchecked integer overflows in this file.
2651 (gnu_extensions, auto_reference, input_reference, right_reference,
2652 ignore_case, initialize_regex, fix_output_parameters,
2653 output_one_roff_line, output_one_text_line, output_one_dumb_line, main):
2654 Use bool for booleans.
2655 (SKIP_SOMETHING, compare_words, digest_break_file,
2656 find_occurs_in_text, fix_output_parameters):
2657 Use to_uchar instead of a caset.
2658 (print_field): Rewrite to avoid cast.
2660 * src/printf.c (posixly_correct): Use bool for booleans.
2661 (verify, main): Use EXIT_FAILURE/EXIT_SUCCESS instead of 1/0.
2662 (STRTOX): Rewrite to avoid casts.
2663 (print_esc_char): Arg is char, not int.
2664 * src/readlink.c (canonicalize): Remove. All uses now merely inspect
2666 (no_newline, verbose): Use bool for booleans.
2667 (can_mode): Now of type int; use -1 to denote otherwise-uninitialized.
2668 * src/shred.c (struct Options, main): Use bool for booleans.
2669 (isaac_seed_data, fillpattern, wipefile): Rewrite to avoid casts.
2670 * src/split.c (cwrite, bytes_split, lines_split, line_bytes_split):
2671 Use bool for booleans.
2672 * src/stat.c (G_fail): Remove.
2673 (print_statfs): Print various gotta-be-nonnegative values using
2674 unsigned long int, not long int or int.
2675 (do_statfs, do_stat): Return a boolean success flag.
2676 (do_stat, main): Use bool for booleans.
2678 * src/pr.c: Add a FIXME mentioning that there are many
2679 unchecked integer overflows in this file.
2680 (TRUE, FALSE): Remove. All uses replaced by true and false.
2681 (struct COLUMN, read_line, print_page, print_stored, open_file,
2682 skip_to_page, init_fps, parallel_files, align_empty_cols,
2683 empty_line, FF_only, explicit_columns, extremities, keep_FF,
2684 print_a_FF, print_a_header, use_form_feed, have_read_stdin,
2685 print_across_flag, storing_columns, balance_columns,
2686 truncate_lines, join_lines, untabify_input, failed_opens,
2687 numbered_lines, skip_count, use_esc_sequence, use_cntrl_prefix,
2688 double_space, ignore_failed_opens, use_col_separator,
2689 pad_vertically, last_line, main, init_parameters, skip_read,
2690 read_line, print_stored):
2691 Use bool for booleans.
2692 (struct COLUMN, char_to_clump, store_char, print_char):
2694 (clump_buff, print_clump): Use char[], not int[], for an array whose
2695 elements are always chars.
2696 (first_last_page, main, getoptarg, balance, add_line_number,
2697 char_to_uclump): Remove unnecessary casts.
2698 (init_parameters): Allocate chars, not ints, for clump_buff.
2699 (print_char): Use to_uchar before invoking ISPRINT.
2700 (char_to_clump): Convert to unsigned char before invoking ISPRINT.
2702 * src/nohup.c (main): Use bool for booleans.
2703 * src/paste.c (paste_parallel, paste_serial, main): Likewise.
2704 * src/pathchk.c (validate-path, main, portable_chars_only): Likewise.
2705 (portable_chars_only): Use to_uchar rather than a cast.
2706 * src/printenv.c (main): Use bool for booleans.
2707 Do not assume that the environ has at most one matching entry
2708 for each option (integer overflow was possible otherwise).
2710 * src/od.c (FMT_BYTES_ALLOCATED): Now an enum, not a decimal
2711 constant. Do not assume PRIdMAX etc. are strings of length 3 or
2713 (struct tspec): Use it. fmt_string is now an array, not
2714 a pointer, as there's little point to the indirection here.
2715 (struct tspec, flag_dump_strings,
2716 traditional, flag_pseudo_start, limit_bytes_to_format,
2717 abbreviate_duplicate_blocks, have_read_stdin, simple_strtoul,
2718 decode_one_format, open_next_file, check_and_close,
2719 decode_format_string, skip, write_block, read_char, read_block,
2720 parse_old_offset, dump, dump_strings, main):
2721 Use bool for booleans.
2722 (struct tspec): Use void *, not char *, for generic pointers.
2723 (bytes_to_oct_digits, bytes_to_signed_dec_digits,
2724 bytes_to_unsigned_dec_digits, bytes_to_hex_digits):
2725 Use char, not unsigned int, since char suffices.
2726 (print_s_char, print_char, print_s_short, print_short,
2727 print_int, print_long, print_long_long, print_float,
2728 print_double, print_long_double): Rewrite to avoid casts.
2729 These now take void * arguments, instead of char *.
2730 Use the same body for all functions, except for the choice
2731 of type. Assume C89 to simplify handling of signed char.
2732 (dump_hexl_mode_trailer, print_named_ascii, print_ascii):
2733 Rewrite to avoid casts.
2734 (print_named_ascii, print_ascii): Now takes void *, not char *.
2735 (decode_one_format): Use int for printf field widths, not
2736 unsigned int. Pass void * to subsidiary printers,
2737 not char *. Simplify handling of floating-point formats
2738 by factoring out common code dealing with precision and field width.
2739 (decode_format_string): Avoid need for temporary copy of
2740 each decoded struct tspec.
2741 (get_lcm): Remove unnecessary cast.
2742 (main): Fix bug where more than INT_MAX failed decodes were ignored.
2744 2004-08-02 Paul Eggert <eggert@cs.ucla.edu>
2746 * src/nl.c (TRUE, FALSE): Remove; all uses changed to true, false.
2747 (enum number_format): Remove.
2748 (FORMAT_RIGHT_NOLZ, FORMAT_RIGHT_LZ, FORMAT_LEFT): Now strings,
2750 (DEFAULT_SECTION_DELIMITERS): Now an array constant, not a macro.
2751 (section_del): Now const.
2752 (print_fmt): Remove.
2753 (starting_line_number, page_incr, blank_join, line_no,
2754 print_lineno, proc_text, main):
2755 Use intmax_t for line numbers.
2756 (reset_numbers, have_read_stdin, build_type_arg, nl_file, main):
2757 Use bool for booleans.
2758 (lineno_format): Now a string, not an enum value.
2759 (build_print_fmt): Remove. All calls removed. This work is
2760 now done within print_lineno.
2761 (build_type_arg): Use size_t for sizes.
2762 (print_lineno): Check for line number overflow.
2763 (proc_text, main): Remove unnecessary cast.
2765 * src/ln.c (symbolic_link, interactive, remove_existing_files,
2766 verbose, hard_dir_link, dereference_dest_dir_symlinks,
2767 do_link, main): Use bool for booleans.
2769 * src/ls.c (struct fileinfo, file_interesting,
2770 extract_dirs_from_files, color_symlink_as_referent,
2771 FILE_OR_LINK_MODE, sort_reverse, print_owner, print_group,
2772 numeric_ids, print_block_size, dired, print_with_color,
2773 check_symlink_color, print_inode, recursive, immediate_dirs,
2774 all_files, really_all_files, qmark_funny_chars,
2775 print_dir_name, format_needs_stat, format_needs_type, visit_dir,
2776 main, decode_switches, parse_ls_color, print_dir, file_interesting,
2777 gobble_file, make_link_path, basename_is_dot_or_dotdot,
2778 extract_dirs_from_files, print_long_format):
2779 Use bool for booleans.
2780 (dir_defaulted): Remove; no longer needed.
2781 (main): Use int to count files, since it suffices for argv.
2782 Rewrite to avoid need for dir_defaulted.
2783 (main, print_dir, gobble_file, get_link_name,
2785 Set exit status to EXIT_SUCCES/EXIT_FAILURE rather than 0/1.
2786 (decode_switches): Put back check for ws.ws_col <= SIZE_MAX.
2787 Remove unnecessary cast to int. Use int instead of unsigned
2788 int to count from 0 to 1.
2789 (get_funky_string, print_type_indicator): Use char for bytes, not int.
2790 (make_link_path): Use NULL for null pointers.
2791 (quote_name): Use to_uchar instead of cast.
2793 * src/id.c (use_name, main, print_user, xgetgroups, print_group_list,
2794 print_full_info): Use bool for booleans.
2795 (problems): Remove, replacing with....
2796 (ok): New var (inverted from old sense).
2797 (print_user, print_group, print_full_info):
2798 Print uids/gids with %lu, not %u.
2799 (xgetgroups): Don't run out of memory if getgroups or getugroups
2801 * src/setuidgid.c (main): Print uids/gids with %lu, not %ld.
2803 * src/factor.c (wheel_tab): Use unsigned char instead of unsigned
2804 int, since it suffices.
2805 (factor, print_factors): Use size_t for sizes.
2806 (print_factors, do_stdin, main): Use bool for booleans.
2807 * src/fold.c (TAB_WIDTH): New macro; use it instead of "8".
2808 (fold_file, main): Use bool for booleans.
2809 (fold_file, main): Use size_t for sizes.
2810 (main): Allow -w options up to SIZE_MAX - TAB_WIDTH - 1, instead
2811 of prohibiting widths greater than INT_MAX.
2812 * src/head.c (presume_input_pipe, print_headers, have_read_stdin,
2813 write_header, elide_tail_bytes_pipe, elide_tail_bytes_file,
2814 elide_tail_lines_pipe, elide_tail_lines_seekable,
2815 elide_tail_lines_file, head_bytes, head_lines, head, head_file,
2816 string_to_integer, main):
2817 Use bool for booleans.
2818 (main): Rewrite to avoid cast.
2820 * src/csplit.c (struct line): Use size_t for sizes.
2821 (main): Remove unnecessary cast.
2822 * src/cut.c (cut_fields): Use to_uchar rather than a cast.
2823 * src/cut.c (cut_file, main): Use bool for booleans.
2824 * src/date.c (show_date, rfc_format, batch_convert, main): Likewise.
2825 * src/env.c (main): Likewise.
2826 * src/expr.c (nextarg): Likewise.
2827 * src/env.c (main): Remove unused and nonstandard envp arg.
2829 * src/fmt.c (COST, MAXWORDS): Add a comment describing some of
2830 fmt's arbitrary limits.
2831 (TRUE, FALSE): Remove; all uses changed to (true, false).
2832 (main): Use bool for booleans.
2833 Limit maximum width to MAXCHARS / 2. Use xstrtoul, not xstrtol,
2835 (copy_rest): Remove unnecessary cast.
2836 (get_prefix): Rewrite to avoid cast.
2837 (check_punctuation): Use char *, not unsigned char *; C89 requires
2838 this. Avoid off-by-one buffer read overrun when line is empty.
2839 (flush_paragraph): Don't assume wptr-parabuf is <= INT_MAX.
2840 Remove unnecessary casts.
2841 * tests/fmt/basic (wide-1, wide-2, bad-suffix): Adjust to above
2844 * src/expand.c (convert_entire_line, have_read_stdin, parse_tabstops,
2845 next_file, expand, main):
2846 Use bool for booleans.
2847 (tab_size, tab_list, add_tabstop, parse_tabstops, validate_tabstops,
2849 Use uintmax_t for column counts.
2850 (add_tabstop): Don't reserve -1 (now UINTMAX_MAX) as a special value.
2851 All callers changed.
2852 (parse_tabstops): Don't pass a negative char to isblank.
2853 Avoid memory leak with large tab stops.
2854 (validate_tabstops, expand): Don't assume number of tab stops is
2856 (next_file, main): Use EXIT_SUCCESS/EXIT_FAILURE rather than 0/1 when
2857 storing values into exit_status.
2858 (expand): Use same pattern as unexpand for reading chars.
2859 Report an error when input line is too long, instead of silently
2860 screwing up. Do not mishandle tab stops when backspacing left
2863 * src/dircolors.c (have_read_stdin, append_quoted,
2864 dc_parse_stream, dc_parse_file, main): Use bool for booleans.
2865 (dc_parse_stream): Use enum for state, rather than int.
2866 Use ssize_t to store getline result.
2868 * src/dd.c (translation_needed, parse_integer, scanargs,
2869 apply_translations, char_is_saved, swab_buffer, skip_via_lseek):
2870 Use bool for booleans.
2871 (translate_buffer): Use to_uchar rather than a cast.
2872 (swab_buffer, copy_simple, copy_with_unblock):
2873 Use size_t for sizes.
2875 * src/seq.c (equal_width, valid_format, main): Use bool for booleans.
2876 * src/sleep.c (apply_suffix): Likewise.
2877 * src/tail.c (struct File_spec, reopen_inaccessible_files, count_lines,
2878 forever, from_start, print_headers, have_read_stdin, valid_file_spec,
2879 write_header, file_lines, pipe_lines, pipe_bytes, recheck,
2880 tail_forever, tail_bytes, tail_lines, tail, tail_file,
2881 parse_obsolescent_option, parse_options, main): Likewise.
2882 * src/sleep.c (apply_suffix): Invert sense of result.
2883 Use int (not unsigned int) for multiplier, as this generates better
2884 code with some compilers. Simplify code a bit.
2885 * src/tail.c (struct File_spec, max_n_unchanged_stats_between_opens,
2886 parse_options): Use uintmax_t, not unsigned int or unsigned long int,
2888 (tail_bytes, tail_lines): Redo test of return value (-1, 0, 1) to
2889 make it a bit clearer.
2891 * src/hostname.c: Include "xgethostname.h".
2892 (xgethostname): Remove decl; xgethostname.h has it.
2893 (sethostname) [!defined(HAVE_SETHOSTNAME) && defined(HAVE_SYSINFO)
2894 && defined (HAVE_SYS_SYSTEMINFO_H) && defined(HAVE_LIMITS_H)]: Use
2895 prototypes rather than K&R form. Assume any negative value from
2896 sysinfo denotes failure, not just -1.
2897 (main): Simplify use of sethostname.
2899 * src/pinky.c (include_idle, include_heading, include_fullname,
2900 include_project, include_plan, include_home_and_shell, do_short_format,
2901 include_where, main): Use bool for booleans.
2902 (count_ampersands, create_fullname, scan_entries, short_pinky):
2903 Use size_t for sizes.
2904 (create_fullname): Check for overflow in size calculations.
2905 (idle_string): Don't assume that the number of idle days
2906 is less than 10**8 and/or INT_MAX/(24*60*60).
2907 (main): No need to pass a non-NULL last arg to getopt_long.
2908 * src/uptime.c (print_uptime, uptime): Use size_t for sizes.
2909 (print_uptime): Remove unused local variable.
2910 (main): No need to pass a non-NULL last arg to getopt_long.
2911 * src/users.c (list_entries_users, users): Use size_t for sizes.
2912 (list_entries_users): Use char for bytes.
2913 (main): No need to pass a non-NULL last arg to getopt_long.
2914 * src/who.c (do_lookup, short_list, short_output, include_idle,
2915 include_heading, include_mesg, include_exit, need_boottime,
2916 need_deadprocs, need_login, need_initspawn, need_clockchange,
2917 need_runlevel, need_users, my_line_only, main): Use bool for booleans.
2918 (print_runlevel): Use unsigned char for bytes.
2919 (list_entries_who, scan_entries, who): Use size_t for sizes.
2920 (main): No need to pass a non-NULL last arg to getopt_long.
2922 * src/install.c (isdir): Remove decl.
2923 (install_file_to_path): Rely on make_path to fail if the destination
2924 is not a directory, by passing preserve_existing==true to it.
2925 Hence we no longer need to call isdir.
2926 Free dest_dir immediately when it's no longer needed, rather than
2927 waiting until the end of the function.
2928 (copy_file): Don't bother calling isdir, as copy will do the
2929 right thing if the destination is a directory.
2931 * src/du.c (fts_debug, opt_all, apparent_size, opt_count_all,
2932 print_grand_total, opt_separate_dirs, hash_ins, process_file, main):
2933 Use bool for booleans.
2934 (max_depth): Now size_t, not int, to avoid an arbitrary limit
2935 of INT_MAX on depth.
2936 (G_fail): Remove: no longer needed, now that the relevant
2937 functions return bool.
2938 (process_file): Use return value to signal success rather than
2939 setting a global. Remove first_call static var; not needed, since
2940 we can look at n_alloc. Use size_t for depths. Remove FIXME
2941 about size_t casts, as it's now fixed. Use xnrealloc rather
2942 than the obsolescent XREALLOC. Don't bother to check whether
2943 reallocation is needed unless level > prev_level.
2944 (du_files): Invert sense of result, for consistency with
2945 other coreutils code. All callers changed.
2946 (main): Allow --max-depth values up to SIZE_MAX.
2948 * src/df.c (inode_format, show_all_fs, show_local_fs,
2949 show_listed_fs, posix_format, require_sync, print_type,
2950 selected_fstype, excluded_fstype, show_dev, show_point, main):
2951 Use bool for booleans.
2952 (df_readable, show_dev): Use UINTMAX_MAX instead of -1.
2953 (show_dev, show_point, main):
2954 Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
2955 Don't assume disk name lengths are <= INT_MAX.
2956 Rewrite pct calculation to avoid cast.
2957 (show_point): Don't assume resolved length is <= SSIZE_MAX.
2959 * src/cut.c (hash_int) [!defined UINTPTR_MAX]: Use size_t
2960 instead of uintptr_t.
2961 * src/shred.c (UINT_MAX_32_BITS): Remove.
2962 (word32): Remove. All uses changed to uint32_t.
2963 (isaac_seed_data): Remove unnecessary cast.
2964 * src/system.h (ptr_align): Use size_t; in practice, this is just as
2965 good as uintptr_t in checking for alignments, and has fewer
2966 configuration hassles.
2968 * src/Makefile.am (localedir.h): Make it readonly; this
2969 undoes part of the 2004-07-27 patch.
2971 2004-07-30 Paul Eggert <eggert@cs.ucla.edu>
2973 * src/sort.c (UCHAR): Remove; all uses changed to to_uchar.
2974 (IS_THOUSANDS_SEP): Use bool when appropriate.
2975 (numcompare, main): Use char, not int, when the value is always a char.
2976 (numcompare): Remove "register"; compilers are smart enough these days.
2977 * src/system.h (errno, CHAR_BIT): Remove decls;
2978 no longer needed now we assume C89 or better.
2979 Include <inttypes.h> before <stdint.h>, as it's the
2980 Autoconf-recommended pattern.
2981 (to_uchar): New inline function, moved here from tr.c.
2982 Use full names for int types, e.g. "long int" rather than "long".
2983 * src/tr.c (to_uchar): Remove; now in system.h.
2984 (is_char_class_member): Use bool when appropriate.
2986 * src/mkdir.c (create_parents, main): Use bool when appropriate.
2987 (main): Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
2989 2004-07-29 Paul Eggert <eggert@cs.ucla.edu>
2991 * src/mkfifo.c (main): Use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1.
2993 * src/chmod.c (recurse, force_silent, process_file, process_files,
2994 main): Use bool when appropriate.
2995 * src/cksum.c (cksum, main): Likewise.
2996 * src/comm.c (hard_LC_COLLATE, only_file_1, only_file_2, both,
2997 compare_files, main): Likewise.
2999 * src/copy.h (struct cp_options): Likewise.
3000 * src/copy.c (copy_internal, is_ancestor, copy_dir, copy_reg,
3001 same_file_ok, seen_file, copy_internal, valid_options, copy): Likewise.
3002 * src/cp-hash.h (remember_created): Likewise.
3003 * src/cp-hash.c (remember_created): Likewise.
3004 * src/cp.c (struct dir_attr, flag_path, remove_trailing_slashes,
3005 re_protect, make_path_private, target_directory_operand, do_copy,
3006 cp_option_init, decode_preserve_arg, main): Likewise.
3007 * src/install.c (isdir, change_timestamps, change_attributes,
3008 copy_file, install_file_to_path, install_file_in_dir,
3009 install_file_in_file, strip_files, dir_arg, cp_option_init, main,
3010 change_attributes, change_timestamps): Likewise.
3011 * src/mv.c (remove_trailing_slashes, rm_option_init,
3012 cp_option_init, do_move, movefile, main): Likewise.
3013 * src/remove.c (right_justify), full_filename_, AD_pop_and_chdir,
3014 AD_push, prompt, remove_dir): Likewise.
3015 * src/rm.c (rm_option_init, main): Likewise.
3017 * src/remove.c (top_dir, pop_dir, full_filename_):
3018 Use size_t for sizes.
3019 * src/cp.c (target_directory_operand): Do not clear *NEW_DST if stat
3020 succeeds. It's not necessary in that case, as *NEW_DST is always
3022 (do_copy): Rewrite slightly to avoid need for "unreachable" comment.
3023 (main): Use EXIT_SUCCESS, EXIT_FAILURE instead of 0, 1.
3024 * src/rm.c (main): Likewise.
3026 md5sum, sha1sum integer cleanups.
3028 * src/checksum.h: Don't include config.h, sys/types.h, stdio.h:
3030 (ALG_UNSPECIFIED): Remove.
3031 (ALG_MDT): Don't make it equal to CHAR_MAX + 1; this isn't necessary.
3032 * src/md5.c: Don't include any files other than checksum.h.
3033 * src/sha1sum.c: Likewise.
3034 * src/md5sum.c (OPENOPTS, have_read_stdin, status_only, warn,
3035 bsd_split_3, split_3, hex_digits, digest_file, digest_check, main):
3036 Use bool when appropriate.
3037 (digest_check): Increase limit of number of input lines to
3038 UINTMAX_MAX from INT_MAX. Diagnose any overflows of this counter.
3039 Use ngettext instead of hard-to-i18nize hardcoded stuff for plurals.
3041 2004-07-28 Paul Eggert <eggert@cs.ucla.edu>
3043 * src/cat.c (exit_status): Remove. Now done by passing a boolean
3045 (simple_cat, cat): Return true if successful. All callers changed.
3046 (simple_cat, cat, main): Use bool for booleans.
3047 (simple_cat): Use size_t for sizes.
3048 (cat, main): Use the same names for parameters that we use for
3049 long options, to avoid confusion. This inverts the sense of the
3050 show_tabs (formerly output_tabs) and number_nonblank
3051 (formerly numbers_at_empty_lines) variables.
3052 (main): Don't mess up (due to integer overflow) if we are given
3053 INT_MAX - INT_MIN + 1 options.
3054 [O_BINARY]: Don't invoke isatty unless the other options require it.
3055 (main): When deciding whether to use simple_cat, don't worry
3056 about binary option; it's irrelevant.
3058 * src/dcgen: Remove comments, trailing white space, and empty
3059 lines from the output strings, to save space.
3060 Use a narrower type like 'unsigned char' for line lengths, if
3062 Make the output variables static, not extern.
3064 * src/chgrp.c (parse_group): Require base 10 when parsing
3066 (main): int -> bool when appropriate.
3067 * src/chown.c (main): Likewise.
3068 * src/chown-core.c: Include inttostr.h.
3069 (UINT_MAX_DECIMAL_DIGITS, uint_to_string): Remove.
3070 (gid_to_name, uid_to_name): Use imaxtostr/umaxtostr
3071 instead of uint_to_string).
3072 (describe_change): Instead of an int flag, use a char *
3073 auxiliary; this avoids the need for casts.
3074 Assume free (NULL) works.
3075 (change_file_owner): Return true/false, not 0/-1, since
3076 we don't set errno. All callers changed.
3077 Use bool when appropriate.
3078 (chown_files): Likewise.
3079 * src/chown-core.h (chown_files): Likewise.
3081 * tests/chown/basic: Test for proper handling of uids like
3082 "010", which must be parsed as decimal.
3084 * tests/misc/pwd: Don't assume that Perl's getpwd agrees with our
3085 pwd when there are multiple names for the working directory
3086 (which can happen with an automounter, sigh).
3088 * src/Makefile.am ($(SCRIPTS)): Don't depend on Makefile;
3089 this causes Solaris 8 'make' to refuse to build "groups".
3090 (localedir.h): Don't depend on Makefile: this causes Solaris
3091 8 'make' to build localedir.h unnecessarily. The dependence
3092 on Makefile is ineffective anyway, since $(localedir) might
3093 change even if Makefile hasn't.
3095 * src/remove.c (remove_dir): If we can't save the state of the
3096 working directory, pretend we started from "/", not ".".
3097 This avoids a bug on hosts like Solaris that don't let you
3098 remove the working directory.
3100 2004-07-27 Paul Eggert <eggert@cs.ucla.edu>
3102 * src/printf.c (strtiomax, strtoumax): Declare if not already
3103 declared: this fixes a portability bug with Solaris 8 + GCC.
3104 (STRTOX): Parenthesize use of macro arg as expression.
3105 (vstrtoimax, vstrtoumax, vstrtold): Remove now-unnecessary
3107 * configure.ac: Check for declaration of strtoumax, for
3110 * src/Makefile.am (cp_LDADD, ginstall_LDADD, mv_LDADD,
3111 pathchk_LDADD, rm_LDADD, test_LDADD): New vars, for eaccess.
3113 * tests/readlink/can-e: Don't assume that we can remove the
3114 working directory: this isn't possible under Solaris 8, say.
3115 * tests/readlink/can-f: Likewise.
3116 * tests/readlink/can-m: Likewise.
3118 * src/copy.c (copy_internal): find_backup_file_name no longer
3119 returns NULL, so don't bother to check for this.
3120 * src/cp.c (do_copy): Likewise.
3121 * src/ln.c (do_link): Likewise.
3123 2004-07-25 Paul Eggert <eggert@cs.ucla.edu>
3125 * src/nice.c (GET_NICE_VALUE): Renamed from GET_PRIORITY.
3127 (NZERO): New macro, if system doesn't define it already.
3128 (usage): Distinguish priorities from nice values.
3129 Don't assume NZERO is 20.
3130 (main): Use bool instead of int where appropriate.
3131 If user specifies an adjustment out of range, always truncate it
3132 to an inrange value instead of sometimes giving an error message
3134 Do not assume that -1 is an error return from "nice" or
3135 "getpriority", as it might be the current nice value minus NZERO.
3136 If nice/setpriority fails with errno == EPERM, go ahead and run
3137 the command anyway; POSIX requires this.
3139 * src/pathchk.c: Include euidaccess.h.
3140 (dir_ok): Use euidaccess, not access.
3141 * src/test.c (R_OK, W_OK, X_OK, FOK): Remove; system.h defines them.
3142 (eaccess): Remove. All users changed to use euidaccess instead.
3144 2004-07-24 Paul Eggert <eggert@cs.ucla.edu>
3146 * src/uptime.c (print_uptime) [defined BOOT_MSG]:
3147 Don't assume ut_line is null-terminated.
3148 * src/who.c (print_line): New arguments USERLEN and LINELEN,
3149 since USER and LINE might not be null terminated. All callers
3152 2004-07-23 Paul Eggert <eggert@cs.ucla.edu>
3154 Fix bug with "tail -f" reported by Rob Holland in
3155 <http://lists.gnu.org/archive/html/bug-coreutils/2004-07/msg00054.html>.
3156 Also, remove the undocumented and unsupported-since-2000
3157 --max-consecutive-size-changes options. Fix another related bug:
3158 "tail" got confused if stdin, stdout, or stderr were closed.
3159 Also, use output buffering even with "tail -f".
3161 * NEWS: Document this, plus yesterday's patch.
3162 * doc/coreutils.texi (tail invocation): "size has remained the same"
3163 -> "file has not changed", which is more accurate for fifos.
3164 * src/tail.c: Include fcntl-safer.h.
3165 (COPY_TO_EOF): Set to UINTMAX_MAX, not OFF_T_MAX (which was wrong).
3166 (COPY_A_BUFFER): New macro.
3167 (struct File_spec): New members mtime, mode, blocking.
3168 Remove member n_consecutive_size_changes.
3169 (DEFAULT_MAX_N_CONSECUTIVE_SIZE_CHANGES,
3170 max_n_consecutive_size_changes_between_opens,
3171 MAX_CONSECUTIVE_SIZE_CHANGES_OPTION): Remove.
3172 (long_options, tail_forever, parse_options):
3173 Remove (non-)support for --max-consecutive-size-changes.
3174 (record_open_fd): New function.
3175 (recheck, tail_file): Use it. Don't assume that stdin is open.
3176 (dump_remainder): Add support for new COPY_A_BUFFER special value.
3177 Treat errno==EAGAIN like EOF, since it might be a nonblocking read.
3178 (recheck): New arg BLOCKING, specifying whether to use blocking reads.
3180 (n_live_files): Remove, replacing with...
3181 (any_live_files): New function. All uses changed.
3182 (tail_forever): Use nonblocking I/O unless we know that blocking I/O
3183 is safe; this avoids some hangs when reading from a fifo.
3184 Avoid invoking fstat or sleep when using blocking I/O.
3185 Do not check for changes to size if the file is not a regular file,
3186 as the size is undefined in that case.
3187 Check for changes to mtime or mode, too; this works for non-regular
3189 (tail_forever, main): Redo fflush strategy to work even when input
3190 is nonblocking. Don't use unbuffered output; just flush when needed.
3192 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
3194 * src/tail.c (main): Ignore -f if no file operand is specified
3195 and standard input is a pipe.
3196 * doc/coreutils.texi (tail invocation): Do not ignore -f for
3197 all pipes, just for when standard input is a pipe and no
3198 file operand is specified.
3199 * tests/tail/Test.pm: Reinstate f-1 test, since we now pass.
3200 Add a new commented-out f-2 test, which we still fail.
3201 (test_vector): All f-* tests are special cases, not just f-1.
3203 2004-07-12 Paul Eggert <eggert@cs.ucla.edu>
3205 * src/uptime.c: Include c-strtod.h.
3206 (print_uptime): Use c_strtod instead of setlocale and sscanf.
3207 Use long int rather than int to count days (for 64-bit hosts),
3208 and check for arithmetic overflow when converting double to time_t.
3210 2004-07-11 Paul Eggert <eggert@cs.ucla.edu>
3212 * src/printf.c (vstrtold): Renamed from vstrtod.
3213 Now returns long double. All uses changed.
3214 (print_direc): Use "L" length modifier when printing floating point
3215 numbers, since we're now printing long double.
3217 2004-07-06 Paul Eggert <eggert@cs.ucla.edu>
3219 printf cleanup, to avoid undefined behavior, to add support for
3220 formats that Bash supports, and to support wide integers like
3223 * NEWS: Document this.
3224 * src/printf.c (UNSPECIFIED): Remove. All uses now replaced by
3225 booleans, so that we don't reserve any values for precision or
3227 (STRTOX): Use prototype, not K&R-style definition.
3228 (vstrtoimax): Renamed from xstrtol (to avoid confusion with xstrtol
3229 in ../lib), with type change to intmax_t.
3231 (vstrtoumax): Renamed from xstrtoul, with type change to uintmax_t.
3233 (vstrtod): Renamed from xstrtod. All uses changed.
3234 (print_direc): Use boolean arg instead of special value to indicate
3235 a missing precision or width. LENGTH no longer includes
3236 length modifiers or conversion character. New arg CONVERSION
3237 now specifies conversion character.
3238 Use intmax_t-width formatting for integers (like Bash).
3239 Add support for C99 %a, %A, %F (like Bash).
3240 Add support for field width with %c (POSIX requires this).
3241 Add a FIXME for lack of support for field width and precision
3243 Add support for '\'', '0' flags.
3244 Check for invalid combinations of flags, field width, precision,
3245 and conversion, to prevent use of undefined behavior.
3246 Allow multiple length modifiers, for formats like "%lld" (like Bash).
3247 Add support for C99 'j', 't', 'z' length modifiers (like Bash).
3248 In error message, output entire invalid conversion specification,
3249 instead of merely outputting % followed by the conversion char.
3250 * tests/misc/printf: Add tests for the above.
3252 2004-04-03 Dmitry V. Levin <ldv@altlinux.org>
3254 Change "readlink -f" to be more compatible with prior implementations.
3255 Add more canonicalize options, -e and -m.
3256 Add comprehensive tests for all readlink modes.
3258 * m4/canonicalize.m4 (AC_FUNC_CANONICALIZE_FILE_NAME):
3259 Do not add canonicalize.c here.
3261 * src/readlink.c (longopts): Add new options.
3262 (usage): Document them.
3263 (canonicalize_fname): New proxy function.
3264 (main): Handle new options.
3265 * doc/coreutils.texi (readlink invocation): Document new
3266 "readlink -f" behaviour and new canonicalize options, -e and -m.
3268 * configure.ac (AC_CONFIG_FILES): Add tests/readlink/Makefile.
3269 * tests/Makefile.am (SUBDIRS): Add readlink.
3270 * tests/readlink/Makefile.am: New file.
3271 * tests/readlink/{rl-1,can-e,can-f,can-m}: New readlink tests.
3272 * tests/misc/Makefile.am (TESTS): Remove basic readlink test.
3273 * tests/misc/readlink: Remove file.
3275 2004-07-04 Jim Meyering <jim@meyering.net>
3277 * src/copy.c (copy_internal): Add a FIXME comment.
3279 2004-07-02 Paul Eggert <eggert@cs.ucla.edu>
3281 * src/copy.c (copy_dir): Assume path_concat returns non-NULL.
3282 * src/cp.c (do_copy): Likewise.
3283 * src/mv.c (movefile): Likewise.
3285 * src/cp.c (make_path_private): 2nd arg is now size_t, not int,
3286 to avoid problem when path_concat dir name is longer than 2 GiB (!).
3288 * src/nohup.c (main): Don't pass NULL first argument to path_concat.
3289 This cleans up the semantics a bit, as we no longer try to open the
3292 2004-07-01 Paul Eggert <eggert@cs.ucla.edu>
3294 * NEWS: Add short names -t and -T for --target-directory
3295 and --no-target-directory options, respectively.
3297 * src/cp.c (NO_TARGET_DIRECTORY_OPTION, TARGET_DIRECTORY_OPTION):
3298 Remove. All uses changed to 'T' and 't', respectively.
3299 * src/install.c, src/ln.c, src/mv.c: Likewise.
3301 * src/cp.c (long_opts, usage, do_copy, main): Add -t and -T as
3302 aliases for --target-directory and --no-target-directory,
3304 * src/install.c (long_options, main, usage): Likewise.
3305 * src/ln.c, src/mv.c: Likewise.
3307 2004-07-01 Jim Meyering <jim@meyering.net>
3309 * Makefile.maint (sc_file_system): New target.
3310 (syntax-check-rules): Add it.
3311 .x-sc_file_system: New file.
3312 * Makefile.am (EXTRA_DIST): Add it.
3314 * man/sync.x: Use "file system" rather than "filesystem".
3315 * man/stat.x, man/df.x: Likewise.
3317 2004-06-30 Paul Eggert <eggert@cs.ucla.edu>
3319 * src/df.c (usage, main): Output "file system" rather than
3321 * src/du.c (usage): Likewise.
3322 * src/shred.c (usage): Likewise.
3323 * src/stat.c (usage): Likewise.
3324 * src/stat.c (long_options, usage): Rename "--filesystem" to
3325 "--file-system". But keep the old name around, for compatibility
3328 2004-06-29 Paul Eggert <eggert@cs.ucla.edu>
3330 Add support for --no-target-directory option.
3332 * NEWS: Document it.
3333 * doc/coreutils.texi (Common options, Target directory, cp
3334 invocation, install invocation, mv invocation, ln invocation):
3336 (link invocation): Explain how to rewrite link using ln now
3337 that we have --no-target-directory.
3338 (ln invocation): Explain that --no-target-directory subsumes
3340 (unlink invocation): Modify wording to match new wording in
3343 * src/cp.c (NO_TARGET_DIRECTORY_OPTION): New constant.
3344 (long_opts, usage, do_copy, main): Add support for
3345 --no-target-directory,
3346 * src/install.c (NO_TARGET_DIRECTORY_OPTION, long_options, main,
3348 * src/ln.c (NO_TARGET_DIRECTORY_OPTION, long_options, usage,
3350 * src/mv.c (NO_TARGET_DIRECTORY_OPTION, long_options, usage,
3352 * src/mv.c (enum): Sort values.
3354 2004-06-29 Jim Meyering <jim@meyering.net>
3356 Don't let verbose-mode output from a subshell obscure actual differences.
3357 * tests/rm/inaccessible: Turn off command-echoing just before
3358 invoking subshell, then turn it back on if VERBOSE=yes afterward.
3360 2004-06-25 Paul Eggert <eggert@cs.ucla.edu>
3362 Add support for 'install --target-directory', an option
3363 that has been documented for years but not implemented (!).
3364 * doc/coreutils.texi (install invocation): Document
3365 --target-directory in synopsis, too.
3366 * src/install.c (TARGET_DIRECTORY_OPTION): New var.
3367 (long_options, main, usage): Add --target-directory.
3368 (target_directory_operand): New function, stolen from mv.c.
3369 (main): Use it. Check for -d and --target-directory.
3370 Alter wording of diagnostics to match other programs.
3372 2004-06-28 Jim Meyering <jim@meyering.net>
3374 * src/cp.c (usage): Fix copy+paste error in description of
3375 --target-directory: s/move/copy/. From Paul Jarc.
3377 2004-06-27 Paul Eggert <eggert@cs.ucla.edu>
3379 Use more-consistent rules among cp, ln, and mv when dealing with
3380 last operands that are (or look like) directories.
3382 * src/cp.c (target_directory_operand): New, nearly-common function,
3383 It reports an error if the destination appears to be a directory
3384 (e.g., because it has a trailing slash) but is not.
3385 * src/ln.c, src/mv.c: Likewise.
3386 * src/cp.c (do_copy): Use it.
3387 * src/ln.c (main): Likewise.
3388 * src/mv.c (main): Likewise.
3390 * src/cp.c (do_copy): Don't assume argc is positive.
3391 Don't bother to lstat dest, since copy() will do that for us.
3392 Use "const" to avoid the need for cast.
3394 * src/cp.c (do_copy): Don't output a usage message because of file
3395 problems (e.g., an operand is not a directory). Use it only for
3396 syntax. Standardize on "target %s is not a directory" for the
3398 * src/ln.c (main): Likewise.
3399 * src/mv.c (main): Likewise.
3401 * src/cp.c (do_copy): Remove test for trailing slash, since
3402 target_directory_operand now does this.
3403 * src/ln.c (main): Likewise.
3404 * src/mv.c (movefile): Likewise.
3406 * src/cp.c (main): Reject multiple target directories.
3407 Check whether a specified target is a directory when parsing the
3408 options, using stat. This gives more-accurate diagnostics.
3409 * src/ln.c (main): Likewise.
3411 * src/ln.c (isdir): Remove decl; no longer needed.
3412 * src/mv.c (isdir, lstat): Likewise.
3414 * src/ln.c (do_link): New arg dest_is_dir. All uses changed.
3415 Don't check the destination ourself; rely on dest_is_dir.
3416 This way we can avoid lstatting the destination in the
3417 usual case, and in the worst case we lstat 1, not 3 times.
3418 Don't bother to unlink unless link failed; this saves a syscall.
3419 Remove unnecessary backup_succeeded flag;
3420 it was identical to "dest_backup != NULL".
3422 * src/ln.c (main): Use int to count to argc, not unsigned int.
3423 This handles negative operand counts.
3424 * src/mv.c (main): Likewise.
3426 * src/mv.c (do_move): Don't call hash_init; expect the caller to
3427 do it, for consistency with cp.c and ln.c. All callers changed.
3428 (movefile): dest_is_dir parameter is now bool, not int.
3429 (main): Standardize on "missing destination file operand after %s"
3430 for the diagnostic, for consistency with cp.c.
3432 * tests/mv/diag: Don't assume "mv --target=nonexistentdir"
3433 will complain about the arg count.
3434 Adjust to new (briefer) diagnostics.
3435 * tests/cp/fail-perm: Add a test to verify that we get the new
3436 diagnostic when failing to copy through a symlink-to-inaccessible-dir.
3438 2004-06-27 Paul Eggert <eggert@cs.ucla.edu>
3440 Fix a bug: formerly, if d/x was a directory and x a file, "ln x
3441 d/" incorrectly created a link d/x/x. It also saves some system
3444 * NEWS: Document the fix.
3446 * src/ln.c (main): Don't append basename to dest if this
3447 results in an existing directory name.
3448 * tests/ln/misc: See whether a trailing slash is followed too far.
3450 2004-06-26 Jim Meyering <jim@meyering.net>
3452 * src/printf.c (main): When given no arguments, print the standard
3453 "missing operand\nTry printf --help..." message -- to be consistent.
3455 2004-06-26 Jim Meyering <jim@meyering.net>
3457 * src/mknod.c (main): Add \n at the end of message output via fprintf.
3459 2004-06-25 Jim Meyering <jim@meyering.net>
3461 * tests/ln/misc: Add test for ln subscript error.
3463 2004-06-23 Paul Eggert <eggert@cs.ucla.edu>
3465 * src/ln.c (do_link): Remove unnecessary call to lstat.
3466 (main): Avoid subscript error when the destination is "".
3468 2004-06-23 Jim Meyering <jim@meyering.net>
3470 * tests/*: Replace all occurrences of `(exit N); exit' with
3471 `(exit N); exit N'. Otherwise, those many tests could exit with
3472 improper exit status when exiting via e.g., a trapped interrupt.
3473 Thanks to a report from Bob Proulx.
3475 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
3477 * src/who.c (idle_string, print_user): New arg boottime,
3478 specifying the most recent boot time. All uses changed.
3479 (idle_string) Consider a line to be "old" if it hasn't been used
3480 since the last boot time. Watch out for overflow when computing
3481 times, and for times in the future.
3482 (idle_string): Record latest boot time.
3484 2004-06-22 Jim Meyering <jim@meyering.net>
3486 * src/test.c (usage): Correct description of `-t FD'. The file
3487 descriptor, FD, is no longer optional. Reported by Ton Nijkes.
3489 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
3491 The 2004-06-19 fix for who and pinky was incomplete, as ctime
3492 has undefined behavior if the year precedes -999 or follows 9999.
3493 Since we have to stop using ctime anyway, we might as well use
3494 strftime and fix the FIXME, and support internationalized dates.
3496 * NEWS: Document the new behavior.
3497 * src/who.c: Include "hard-locale.h".
3498 (time_format, time_format_width): New vars.
3499 (time_string, print_line): Use them.
3501 (time_string): Use localtime + strftime instead of
3502 ctime, to avoid problems with years before -999 or after 9999.
3503 * src/pinky.c: Likewise.
3505 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
3507 Fix bug: GNU 'ls' didn't count columns correctly if user or group
3508 names contained multibyte characters where the column count
3509 differed from the byte count. This patch also corrects
3512 * src/ls.c (format_user_or_group): New function, which counts
3514 (format_user, format_group): Use it.
3515 (format_user_or_group_width): New function, which counts columns
3517 (format_user_width, format_group_width): Use it.
3519 2004-06-21 Jim Meyering <jim@meyering.net>
3521 * tests/priv-check: Quote "$PATH" in PATH=$PATH.
3522 Suggestion from Andreas Schwab.
3524 * tests/priv-check: When running as root, be sure to propagate
3525 PATH through to the process we exec as non-root.
3526 Reported by michael@aplatform.com.
3528 * src/mknod.c (main): Don't segfault when calculating the
3529 expected number of operands for `mknod NAME'.
3531 2004-06-20 Jim Meyering <jim@meyering.net>
3533 * src/dd.c (input_seek_errno): Declare file-scoped variable as static.
3535 2004-06-20 Paul Eggert <eggert@cs.ucla.edu>
3537 * src/basename.c (main):
3538 Standardize on the diagnostics given when someone gives
3539 too few operands ("missing operand after `xxx'") or
3540 too many operands ("extra operand `xxx'").
3541 Include "quote.h" and/or "error.h" if it wasn't already being included.
3542 * src/chgrp.c (main): Likewise.
3543 * src/chmod.c (main): Likewise.
3544 * src/chown.c (main): Likewise.
3545 * src/chroot.c (main): Likewise.
3546 * src/comm.c (main): Likewise.
3547 * src/cp.c (do_copy): Likewise.
3548 * src/csplit.c (main): Likewise.
3549 * src/date.c (main): Likewise.
3550 * src/dircolors.c (main): Likewise.
3551 * src/dirname.c (main): Likewise.
3552 * src/du.c (main): Likewise.
3553 * src/expr.c (main): Likewise.
3554 * src/hostid.c (main): Likewise.
3555 * src/hostname.c (main): Likewise.
3556 * src/id.c (main): Likewise.
3557 * src/install.c (main): Likewise.
3558 * src/join.c (add_file_name, main): Likewise.
3559 * src/link.c (main): Likewise.
3560 * src/ln.c (main): Likewise.
3561 * src/logname.c (main): Likewise.
3562 * src/md5sum.c (main): Likewise.
3563 * src/mkdir.c (main): Likewise.
3564 * src/mkfifo.c (main): Likewise.
3565 * src/mknod.c (main): Likewise.
3566 * src/mv.c (main): Likewise.
3567 * src/nohup.c (main): Likewise.
3568 * src/od.c (main): Likewise.
3569 * src/pathchk.c (main): Likewise.
3570 * src/ptx.c (main): Likewise.
3571 * src/readlink.c (main): Likewise.
3572 * src/rm.c (main): Likewise.
3573 * src/rmdir.c (main): Likewise.
3574 * src/seq.c (main): Likewise.
3575 * src/setuidgid.c (main): Likewise.
3576 * src/shred.c (main): Likewise.
3577 * src/sleep.c (main): Likewise.
3578 * src/sort.c (main): Likewise.
3579 * src/split.c (main): Likewise.
3580 * src/stat.c (main): Likewise.
3581 * src/test.c (beyond, main): Likewise.
3582 * src/touch.c (main): Likewise.
3583 * src/tr.c (main): Likewise.
3584 * src/tsort.c (main): Likewise.
3585 * src/tty.c (main): Likewise.
3586 * src/uname.c (main): Likewise.
3587 * src/uniq.c (main): Likewise.
3588 * src/unlink.c (main): Likewise.
3589 * src/uptime.c (main): Likewise.
3590 * src/users.c (main): Likewise.
3591 * src/who.c (main): Likewise.
3592 * src/whoami.c (main): Likewise.
3594 * tests/basename/basic: Adjust to new diagnostics.
3595 * tests/du/files0-from: Likewise.
3596 * tests/expr/basic: Likewise.
3597 * tests/mv/diag: Likewise.
3598 * tests/tsort/basic-1: Likewise.
3600 2004-06-20 Jim Meyering <jim@meyering.net>
3602 * src/ln.c: Remove declaration of yesno.
3603 Instead, include yesno.h.
3604 * src/copy.c: Likewise.
3606 * src/remove.c: Remove declaration of yesno.
3607 Instead, include yesno.h.
3608 (top_dir): Remove now-unnecessary cast of obstack_base.
3609 (pop_dir): Likewise.
3610 (full_filename_): Likewise.
3612 2004-06-19 Paul Eggert <eggert@cs.ucla.edu>
3614 Don't dump core if ctime returns NULL; this is possible on
3615 hosts with 64-bit time_t and 32-bit int.
3616 * src/who.c: Include "inttostr.h".
3617 (time_string): If ctime fails, print the raw time as an integer
3618 instead of dumping core.
3619 * src/pinky.c: Likewise, as follows:
3620 Include "inttostr.h".
3621 (time_string): New function, copied from who.c.
3622 (print_entry): Use it.
3624 2004-06-19 Paul Eggert <eggert@cs.ucla.edu>
3626 * src/who.c (print_line): Don't truncate user names at 8 bytes.
3627 Problem reported by Guido Leenders in:
3628 http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00056.html
3629 * NEWS: document this.
3631 2004-06-19 Jim Meyering <jim@meyering.net>
3633 * src/system.h (case_GETOPT_VERSION_CHAR): Switch back to
3634 using GNU_PACKAGE (from PACKAGE) once again. This restores
3635 `GNU' to the parenthesized package name in --version output.
3636 Before, the first argument from AC_INIT, `GNU coreutils', would
3637 be propagated to the PACKAGE variable. Now, `GNU ' is trimmed.
3638 Reported by Richard Stallman.
3640 2004-06-17 Jim Meyering <jim@meyering.net>
3642 * src/tr.c (to_uchar): Rename function from `uchar'. The latter
3643 would clash with a typedef in Tru64's <sys/types.h>. From Albert Chin.
3645 2004-06-15 Paul Eggert <eggert@cs.ucla.edu>
3647 * NEWS: Remove more special cases for POSIXLY_CORRECT when POSIX
3648 allows the GNU behavior. "--" is now supported by chroot, hostid,
3649 hosname, pwd, sync, yes.
3650 * doc/coreutils.texi (yes invocation, false invocation,
3651 true invocation): Document this.
3652 * src/chroot.c (main): Handle "--".
3653 * src/hostid.c (main): Likewise.
3654 * src/hostname.c (main): Likewise.
3655 * src/pwd.c (main): Likewise.
3656 * src/sync.c (main): Likewise.
3657 * src/yes.c (main): Likewise.
3658 * src/true.c (main): Recognize --help and --version even if
3659 POSIXLY_CORRECT is set.
3660 * src/yes.c (main): Likewise.
3662 2004-06-09 Paul Eggert <eggert@cs.ucla.edu>
3664 * NEWS: Remove special cases for POSIXLY_CORRECT when POSIX allows
3666 * doc/coreutils.texi (pr invocation, unlink invocation): Document this.
3667 * src/ls.c (decode_switches): Pay attention to TABSIZE even if
3668 POSIXLY_CORRECT is set. POSIX reserves upper-case environment
3669 variables to the implementation, so it's OK for ls to depend on
3671 * src/pr.c: Include "hard-locale.h".
3672 (main): When in a non-POSIX locale, ignore POSIXLY_CORRECT, since
3673 POSIX specifies the behavior only in the POSIX locale.
3674 * src/printf.c (print_esc): Support \x, \u, \U even if POSIXLY_CORRECT,
3675 since POSIX says the behavior is unspecified here.
3676 * src/tail.c (parse_obsolescent_option): Support multiple file operands
3677 even if POSIXLY_CORRECT, since POSIX does not require a diagnostic.
3678 * src/printf.c (main): Recognize --help, --version even if
3679 POSIXLY_CORRECT. POSIX does not specify any options, but it
3680 does not prohibit options either, so "printf" is like "expr" here.
3681 * src/unlink.c (main): Likewise.
3682 * tests/misc/printf: Adjust to the new semantics for \x if
3685 2004-06-14 Jim Meyering <jim@meyering.net>
3687 * tests/misc/pwd: New test, for fix of 2004-04-19.
3688 * tests/misc/Makefile.am (TESTS): Add pwd.
3689 (BUILD_SRC_DIR): Define BUILD_SRC_DIR.
3691 * src/copy.c: Remove declaration of euidaccess.
3692 Instead, include "euidaccess.h".
3694 2004-06-13 Paul Eggert <eggert@cs.ucla.edu>
3696 * src/who.c (PIDSTR_DECL_AND_INIT): Don't assume pid_t fits in int.
3697 (UT_ID) [!HAVE_STRUCT_XTMP_UT_ID]: Remove bogus comment,
3698 as (sizeof "??") reliably returns 3.
3699 (print_line): Guard against idle and pid being too long
3700 (which is possible when printing headers).
3701 (print_user): Allocate enough bytes for idlestr. Use IDLESTR_LEN.
3702 Avoid unnecessary cast of sizeof to int.
3703 (make_id_equals_comment): Do not assume that UT_ID returns
3704 a string; it might return a non-null-terminated array.
3705 Use strncat instead. It's not very often where strncat is
3706 exactly what you want, but this is one of those rare cases.
3708 2004-06-11 Paul Eggert <eggert@cs.ucla.edu>
3710 * src/who.c (list_entries_who): Don't output a trailing space.
3712 2004-06-09 Jim Meyering <jim@meyering.net>
3714 * src/touch.c (usage): Improve wording in description of the
3715 --time=WORD option. Reported by Dan Jacobson.
3717 * src/chown-core.c (change_file_owner): Change names of parameters
3718 old_uid and old_gid to required_uid and required_gid respectively.
3720 * src/chmod.c (mode_changed): Return false, not 0, now that the
3721 function returns `bool'.
3723 2004-06-08 Paul Eggert <eggert@cs.ucla.edu>
3725 Adjust chmod and chown to be similar if -c or -v are given. In
3726 particular, a no-op chown is no longer reported as a change; this
3727 reverts to previous behavior. Also, fix both commands so that -v
3728 report failures even if the failure is not due to the chmod or
3731 * src/chmod.c (CH_NOT_APPLIED): New constant.
3732 (describe_change): Handle it.
3733 (process_file): Use it, if a symlink wasn't changed.
3734 (mode_changed): Return bool, not int. Accept new argument
3735 NEW_MODE; all callers changed. This lets us avoid statting the
3736 file unless the new mode has unusual bits.
3737 (process_file): Return -1 on error. With -v, report all errors
3738 verbosely, not just some.
3740 * src/chown-core.c (change_file_owner): Return -1 on error, not
3741 1 sometimes and -1 on others. Our caller ORs together our results,
3742 and (-1 | 1) == 0 on ones-complement hosts.
3743 With -v report all errors verbosely, not just some.
3744 Fix bug when chopt->root_dev_ino && !chopt->affect_symlink_referent:
3745 file_stats wasn't set properly in that case.
3747 * tests/chgrp/basic: Adjust to above changes.
3749 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
3751 * tests/chgrp/basic: Test that chgrp -h does not fail on
3752 symlinks, even on hosts where that's not supported.
3753 Test that if -R is specified without -H or L, -h is assumed.
3754 Test that chown() is not optimized away.
3756 2004-05-18 Paul Eggert <eggert@cs.ucla.edu>
3758 Several fixes to chgrp and chown for compatibility with POSIX and BSD:
3760 Check for incompatible options. When -R and --dereference are
3761 both used, then either -H or -L must also be used. When -R and -h
3762 are both used, then -P must be in effect.
3764 -H, -L, and -P have no effect unless -R is also specified.
3765 If -P and -R are both specified, -h is assumed.
3767 Do not optimize away the chown() system call when the file's owner
3768 and group already have the desired value. This optimization was
3769 incorrect, as it failed to updated the last-changed time and reset
3770 special permission bits, as POSIX requires.
3772 Do not report an error if the owner or group of a
3773 recursively-encountered symbolic link cannot be updated because
3774 the file system does not support it.
3776 * NEWS: Document the above.
3778 * src/chgrp.c (main): Check for incompatible options. -R --dereference
3779 requires either -H or -L, and -R -h requires -P. If -H, specify
3780 FTS_PHYSICAL as well as FTS_COMFOLLOW; this is faster. Make this
3781 file as much like chown.c as possible.
3782 * src/chown.c (main): Likewise.
3784 * src/chown-core.c (change_file_owner): Use ent->fts_statp only if
3785 needed. Chown a directory only after chowning its children; this
3786 avoids problems if the new directory ownership doesn't permit
3787 access to the children. Dereference symlinks before doing
3788 ROOT_DEV_INO_CHECK, not after, so that we catch symlinks to /.
3789 Do not optimize away the chown() system call when the file's owner
3790 and group already have the desired value. POSIX does not permit
3791 this optimization. Rely on chown and lchown to do the right
3792 thing with symlinks and/or -1 arguments, now that we have wrappers
3793 to do this. Use ENOTSUPP not ENOSYS, and ignore all ENOTSUPP
3794 errors, not just command-line errors.
3795 (chown_files): Pass FTS_NOSTAT to xfts_open if we don't need file status.
3797 * src/system.h (ENOTSUP): Remove.
3799 * tests/chgrp/basic: Use chown --from to discover whether the
3800 group changed, since chgrp now changes unconditionally. This
3801 complicates the sed script a bit. Do not specify --dereference,
3802 since it's the default (and we want to test this). Adjust output
3803 to match the fact that chgrp no longer optimizes the case of
3804 changing a file's group to the same value as before.
3805 * tests/chgrp/posix-H: Do not attempt to combine -h and -H; these
3806 options are incompatible, and their behavior is undefined with POSIX.
3807 (changed, not_changed): Adjust to match the fact that -h is no longer
3808 specified. Sort names.
3809 * tests/chown/deref: Adjust error-diagnostic spelling to match new
3812 2004-06-07 Paul Eggert <eggert@cs.ucla.edu>
3814 * src/uname.c (main): Fix typo introduced on 2003-05-10 that
3815 prevented a diagnostic of any operands.
3817 2004-06-08 Jim Meyering <jim@meyering.net>
3819 * src/shred.c (direct_mode): Turn it on/off with directio, too.
3821 2004-06-07 Jim Meyering <jim@meyering.net>
3823 Enable direct-mode I/O (bypassing the buffer cache), if possible.
3824 Prompted by a suggestion from Kalle Olavi Niemitalo
3825 in http://bugs.debian.org/207035.
3826 * src/shred.c (direct_mode): New function.
3827 (do_wipefd): Turn on direct-mode I/O.
3828 (dopass): If a file's first write fails with EINVAL,
3829 turn off direct-mode I/O and retry the write.
3831 2004-06-05 Paul Eggert <eggert@cs.ucla.edu>
3833 * src/tr.c (main): "tr -d a b" is now a fatal error even if
3834 POSIXLY_CORRECT is set. The POSIX SYNOPSIS does not allow this
3837 2004-06-04 Paul Eggert <eggert@cs.ucla.edu>
3839 * src/shred.c (dopass): Don't subtract 1 from the offset after
3840 a write error. Problem reported by Jon Peatfield in:
3841 http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00020.html
3843 2004-06-02 Paul Eggert <eggert@cs.ucla.edu>
3845 Fix bug reported by Buciuman Adrian in
3846 <http://mail.gnu.org/archive/html/bug-coreutils/2003-08/msg00105.html>
3847 where 'dd' created a file that was too large. The bug was that dd
3848 assumed that the input file offset does not advance after a failed
3849 read; but POSIX says that the input file offset is undefined after
3852 * src/dd.c (MAX_BLOCKSIZE): New macro.
3853 (input_seekable, input_seek_errno, input_offset,
3854 input_offset_overflow): New vars.
3855 (scanargs): Reject block sizes greater than MAX_BLOCKSIZE.
3856 (advance_input_offset): New function.
3857 (skip_via_lseek): Set errno to zero when reporting our failure,
3858 so that we don't report based on garbage errno.
3859 (skip): If fdesc is standard input, advance the input offset.
3860 Do not quit if reading, and if noerror was specified;
3861 POSIX seems to require this.
3862 If read fails on output file, report the earlier lseek failure
3863 instead; this fixes a FIXME in dd_copy.
3864 (advance_input_after_read_error): New function.
3865 (dd_copy): Use it, instead of assuming that failed reads
3866 do not advance the file pointer. Advance input offset
3867 after nonfailed reads. Advance only a partial block if
3868 the previous read (before the failed read) succeeded, and
3869 do not generate an output block of zeros in this case.
3870 (main): Determine initial input offset, seekability of input,
3871 and error if it wasn't seekable.
3873 2004-06-02 Jim Meyering <jim@meyering.net>
3875 rm (without -f) could hang unnecessarily when attempting to
3876 remove a symlink to a file on an off-line NFS-mounted partition.
3877 Reported by David Howells in https://bugzilla.redhat.com/124699.
3878 * src/remove.c (write_protected_non_symlink): New function.
3879 Don't invoke euidaccess on symlinks.
3880 (prompt): Use write_protected_non_symlink rather than using
3881 euidaccess directly, being careful not to call lstat twice for a file.
3883 Fix a bug in how the --output-delimiter=D option works with
3884 abutting byte or character ranges. Reported by David Krider in
3885 http://lists.gnu.org/archive/html/bug-coreutils/2004-05/msg00132.html
3886 * src/cut.c (print_kth): Remove special case for open-ended range.
3887 (set_fields): Record the range start index for an interval even
3888 when it abuts another interval on its low side.
3889 Also record the range start index of the longest right-open-interval.
3890 * tests/cut/Test.pm: Add tests of --output-delimiter=S with
3891 abutting and overlapping byte ranges.
3893 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
3895 Some POSIX-conformance cleanups for tr.
3897 * src/tr.c (posix_pedantic): Remove; no longer needed since
3898 we need to test this in just one place now.
3899 (usage): Mention -C.
3900 (unquote): Note that \055, \n, etc are escaped.
3901 Do not worry about POSIXLY_CORRECT when warning about ambiguous
3903 \ at end of string stands for itself.
3904 Do not diagnose invalid backslash escapes: POSIX says the behavior
3905 is unspecified in this case, so we don't need to diagnose it.
3906 (main): Add support for -C (currently an alias for -c).
3907 Do not diagnose 'tr [:upper:] [:upper:], as POSIX does not require
3909 * tests/tr/Test.pm: New tests bs-055, bs-at-end, repeat-Compl.
3910 Fix comment for range-a-a.
3912 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
3914 Improve the efficiency (and in one case, correctness) of code
3915 that reads symlinks.
3917 * src/copy.c (copy_internal): Don't use alloca, as it can mess up
3918 royally if the link length is long (e.g., GNU/Hurd). Use
3919 xreadlink instead, it's safer. Don't bother to read the link if
3920 it's the wrong size. Add a FIXME because this area is a bit murky
3922 * src/ls.c (get_link_name): Update use of xreadlink.
3923 * src/readlink.c (main): Likewise.
3924 * src/stat.c (print_stat): Likewise.
3926 2004-06-01 Jim Meyering <jim@meyering.net>
3928 * src/env.c (main): Prefer the notation `STREQ (a, b)'
3929 over `!strcmp (a, b)'.
3930 * src/sort.c (main, sort_buffer_size): Prefer the notation
3931 `STREQ (a, b)' over `strcmp (a, b) == 0'.
3932 * src/date.c (batch_convert): Likewise.
3933 * src/expr.c (nextarg): Likewise.
3934 * src/su.c (correct_password, restricted_shell, main): Likewise.
3935 * src/ptx.c (swallow_file_in_memory, main): Likewise.
3936 * src/test.c (binary_operator, and, or, main): Likewise.
3938 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
3940 * NEWS: echo compatibility cleanup.
3941 * doc/coreutils.texi (echo invocation): Document the changes.
3942 * src/echo.c (V9_ECHO): Remove; always enabled.
3943 (DEFAULT_ECHO_TO_XPG): Renamed from V9_DEFAULT, so that
3944 we use the same naming convention as bash. Now an enum,
3946 (usage): Reword to mention -e/-E more accurately.
3947 Mention \0NNN (the POSIX syntax) rather than \NNN (nonstandard).
3948 (hextobin): New function.
3949 (main): Use bool rather than int for local vars when appropriate.
3950 Do not allow options if POSIXLY_CORRECT, unless we are using
3951 BSD semantics and the first argument is "-n".
3952 Don't pass unnecessary extra arg to parse_long_options.
3953 do_v9 now defaults to DEFAULT_ECHO_TO_XPG, not to allow_options.
3954 Do not look for options if !allow_options.
3955 Use size_t rather than int when appropriate.
3956 Open-code option test rather than using strrchr.
3957 Use faster test for "-".
3958 Avoid redundant argc test.
3959 Add support for \x, for Bash compatibility.
3960 Use e.g. '\a' rather than '\007', for portability to EBCDIC hosts.
3961 When '\c' is encountered, stop printing immediately, as POSIX
3963 Add support for \xhh syntax.
3964 Add support for \0ooo syntax; POSIX requires this.
3966 2004-06-01 Jim Meyering <jim@meyering.net>
3968 * Use automake-1.8b. Regenerate dependent files.
3970 2004-05-31 Jim Meyering <jim@meyering.net>
3972 * tests/Makefile.am.in (TESTS_ENVIRONMENT): Define PATH to include
3973 the build src/ directory -- at the front.
3974 ($(srcdir)/$x-tests): Depend on Makefile.am.
3975 Use $x as the program name, except when it would be `test' (test is
3976 the sole program tested via mk-script that is also a shell built-in).
3977 In that case, use the old ../../src/$x.
3979 2004-05-30 Jim Meyering <jim@meyering.net>
3981 Work around HPUX /bin/cc compiler bug that is exposed, now that
3982 sets are arrays of type `bool'. More details here:
3983 http://lists.gnu.org/archive/html/bug-gnulib/2004-05/msg00094.html
3984 FIXME: verify that the above URL points to the right message
3986 * src/tr.c (card_of_complement): Use cleaner `sizeof in_set'
3987 rather than `N_CHARS * sizeof(in_set[0])'. Using HPUX's /bin/cc
3988 (aC++/ANSI C B3910B A.05.55 [Dec 04 2003]) on an ia64-hp-hpux11.22
3989 system, those two expressions are not the same (256 vs. 1024).
3990 The effect of this problem was that `tr -c x y' would fail:
3991 tr: when not truncating set1, string2 must be non-empty
3992 (set_initialize): Remove unnecessary initialization of the `in_set'
3993 buffer; that initialization triggered the same compiler bug as above.
3995 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
3997 tr cleanup, mostly having to do with integer type ranges.
4000 * tests/tr/Test.pm: Add a few tests for the below. Alas, most of
4001 the test cases wouldn't be portable, or would take too much CPU
4004 * src/tr.c (N_CHARS, N_CHAR_CLASSES): Now an enum, not a macro.
4005 This is safe since the code already assumes N_CHARS fits in int.
4006 (Filter): Remove: we want to prototype everything.
4007 (ORD, CHR): Remove. All uses removed. Some replaced with:
4008 (uchar): New function. All places where a char must be converted
4009 to an unsigned char are now done this way, not by ad-hoc methods.
4010 (count): New type. Use it whenever counts or states are needed.
4011 (BEGIN_STATE): Increase from INT_MAX - 1 (which was bogus, anyway,
4012 since we used it in an unsigned int context) to UINTMAX_MAX - 1.
4013 (REPEAT_COUNT_MAXIMUM): New macro. Use it in place of BEGIN_STATE
4014 whenever appropriate.
4015 (NOT_A_CHAR): Remove global macro; now a local enum.
4016 (UL_LOWER, UL_UPPER, UL_NONE): No longer specify values, since
4017 the rest of the code no longer depends on them.
4018 (class_ok): Remove; all uses changed to use inline comparisons.
4019 (RE_NO_TYPE): Remove; wasn't used or needed.
4020 (struct List_element): normal_char and equiv_code are now unsigned
4022 first_char, last_char, and the_repeated_char are now unsigned char,
4023 not unsigned int. repeat_count is now count, not size_t.
4025 (struct Spec_list): state is now count, not unsigned int.
4026 lengthis now count, not size_t.
4027 n_indefinite_repeats is now size_t, not int.
4028 has_equiv_class, has_char_class, and has_restricted_char_class
4029 are now bool, not int. All uses changed.
4030 (struct E_string): s is now char *, not unsigned char *.
4031 escaped is now bool *, not int *. All uses changed.
4032 (ES_MATCH): Remove macro, replacing with:
4033 (es_match): New inline function. All uses changed.
4034 (squeeze_repeats, complement, posix_pedantic, truncate_set1,
4035 translating): Now bool, not int.
4036 (io_buf): Now char array, not unsigned char.
4037 (SET_TYPE): Remove. All uses replaced with bool.
4038 (is_equiv_class_member, unquote, append_range, append_char_class,
4039 append_equiv_class, find_closing_delim, star_digits_closebracket,
4040 build_spec_list, parse_str, homogeneous_spec_list):
4041 Now returns bool, not int. All uses changed.
4042 (is_equiv_class_member): Now inline.
4043 (is_equiv_class_member, is_char_class_member, make_printable_str,
4044 append_normal_char, append_range, append_repeated_char,
4046 Args are now of proper integer type.
4047 (unquote, look_up_char_class, make_printable_str,
4048 append_equiv_class, build_spec_list, squeeze_filter):
4049 Avoid unsigned char *p; gently convert *p to unsigned char instead.
4050 (unquote, get_spec_stats): Do not jump past declarations and then
4051 use them; C doesn't allow this in portable programs.
4052 (make_printable_str): Check for overflow in size calculations.
4053 (xmemdup): Remove. All uses rewritten.
4054 (find_bracketed_repeat): Args are now of proper pointer-to-integer
4055 type. Do not reject [c*0]. Use xstrtoumax, not xstrtoul.
4056 (find_bracketed_repeat, star_digits_closebracket): Check that the
4057 digits are not escaped.
4058 (build_spec_list): Don't bother to copy opnd_str; not needed.
4059 (build_spec_list, get_next): Simplify internal logic a bit.
4060 (card_of_complement): Fix bug due to char overflow.
4061 (get_spec_stats): Don't assume len fits into int.
4062 Check for integer overflow. Use abort() rather than assert(0).
4063 (string2_extend): Fix subscript error: is_char_class_member (..., 255)
4065 (squeeze_filter): READER is never null now; simplify code.
4066 READER arg now has a simpler type. Remove unnecessary casts.
4067 (squeeze_filter, main): Calls to fwrite improperly checked result
4068 against zero, rather than against requested size.
4069 (plain_read): New function.
4070 (read_and_delete, read_and_xlate):
4071 Remove unused filter arg, and don't worry about hit_eof.
4072 Simplify by using plain_read.
4073 (set_initialize): Args are bool and bool *, not int and SET_TYPE *.
4074 (main): Always pass a non-null procedure to squeeze_filter.
4075 Rewrite so that class_ok isn't needed.
4077 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
4079 * src/shred.c (dosync): Ignore EBADF errors, as IRIX 6.5
4080 fdatasync reports EBADF when syncing (unwritable) directories.
4081 Problem reported by Albert Chin-A-Young in:
4082 http://lists.gnu.org/archive/html/bug-coreutils/2004-05/msg00165.html
4084 2004-05-29 Jim Meyering <jim@meyering.net>
4086 * tests/chown/deref: Fix typo: use ls -ldo, not ls -ldg.
4087 Patch from Albert Chin.
4089 * src/ptx.c (text_buffer_maxend): Remove declaration of unused variable.
4091 * src/remove.c (push_dir): Merge declaration and adjacent assignment
4092 into a single statement.
4094 2004-05-28 Jim Meyering <jim@meyering.net>
4096 * src/remove.c (AD_mark_helper): Eliminate an unnecessary comparison.
4098 2004-05-22 Jim Meyering <jim@meyering.net>
4100 rm -r would get a failed assertion when run from an inaccessible
4101 directory and with two or more command line arguments including an
4102 absolute-named directory followed by a relative-named directory.
4104 * src/remove.h (struct rm_options) [require_restore_cwd]: New member.
4105 * src/remove.c (struct cwd_state): Define.
4106 (AD_pop_and_chdir): Redesign interface so that a restore_cwd failure
4107 can be detected by the caller. Instead of returning a malloc'd
4108 directory name, communicate it to caller via a new parameter, and
4109 return an indication of whether restore_cwd failed. Update caller.
4110 Eliminate an unnecessary call to AC_stack_top.
4111 (remove_dir): Change type of cwd_state parameter to `struct cwd_state'
4112 so we can now communicate to caller whether/how functions like
4113 restore_cwd have failed. Update caller.
4114 (rm_1): Fail if we've failed to restore the working directory
4115 and the name of the next file to remove is `.'-relative.
4116 (rm): Fail if the require_restore_cwd flag is true and we've
4117 failed to restore the working directory.
4118 * src/mv.c (rm_option_init): Initialize new member,
4119 x->require_restore_cwd.
4120 * src/rm.c (rm_option_init): Likewise.
4122 2004-05-21 Jim Meyering <jim@meyering.net>
4124 * tests/rm/inaccessible: New test for the above fix.
4125 * tests/rm/Makefile.am (TESTS): Add inaccessible.
4127 * src/remove.c (rm): Use free rather than XFREE.
4128 (remove_dir): Use xmalloc, not XMALLOC.
4129 (ds_init): Likewise.
4131 2004-05-20 Jim Meyering <jim@meyering.net>
4133 * Makefile.maint (sc_unmarked_diagnostics): Now that the unmarked
4134 diagnostics in shred.c have been fixed, don't exempt shred.c from
4137 * src/shred.c: Use translatable diagnostics, e.g.
4138 change "%s: remove" to _("%s: failed to remove") and
4139 change "%s: close" to _("%s: failed to close").
4141 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
4143 * src/shred.c (names): Bring back lower-case letters, "_", and
4144 ".". But continue to omit +, =, %, @, #, as they're either
4145 shell metacharacters (for some shells) or are not in some
4146 character sets, or (in the case of '%') must be a
4147 metacharacter somewhere.
4149 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
4151 * src/cut.c (cut_fields): Adjust to new signature of getndelim2.
4153 2004-05-17 Jim Meyering <jim@meyering.net>
4155 * src/shred.c (incname): Decrement `len' only once per loop iteration.
4157 chgrp and chown now dereference symlinks by default, per POSIX.
4158 Reported by Michal Politowski as http://bugs.debian.org/249177.
4160 * src/chown-core.c (chopt_init): Affect each symlink referent by default.
4161 * src/chown.c (usage): Update to reflect this.
4162 * src/chgrp.c (usage): Likewise.
4163 * NEWS: Describe the change.
4164 Adapt tests accordingly.
4165 * tests/chgrp/basic: Use -h where necessary to retain semantics.
4166 * tests/chgrp/deref: Likewise.
4167 * tests/chgrp/posix-H: Likewise.
4169 2004-05-15 Paul Eggert <eggert@cs.ucla.edu>
4171 In shred, check for errors from fdatasync more carefully. If
4172 fdatasync fails with errno==EINVAL, it means this implementation
4173 does not support synchronized I/O for this file. Do not report
4174 this as an error, as (for example) AIX 5.2 fdatasync reports it
4175 for raw disk devices. Problem reported by Albert Chin in
4176 <http://mail.gnu.org/archive/html/bug-gnu-utils/2004-05/msg00028.html>.
4178 Check for write errors, though: the old code ignored them.
4179 Improve error checking in a few other cases, too (e.g., close of a
4182 Also, change several 'int' values to 'bool', so that the error
4183 checking is a bit clearer. Similarly, change unsigned values
4184 to size_t where appropriate.
4186 * src/shred.c: Include "dirname.h".
4187 (datasync) [!HAVE_FDATASYNC]: Remove.
4188 (dosync): New function.
4189 (dopass): Use it. Return 1 on write error, -1 on other error.
4190 All callers changed. Report write error if dosync does.
4191 (do_wipefd, wipefd, wipename, wipefile): Return bool (true/false),
4192 not int (0/-1). All callers changed. Return false if there's a
4194 (incname): Return bool (true/false), not int (0/1). Accept
4195 size_t length, not unsigned. All callers changed. Do not
4196 bother checking for non-digits; it can't happen. Replace
4197 recursion with iteration.
4198 (wipename): Use dir_name, base_name, etc. instead of assuming
4199 Unix file names. Use size_t for length, not unsigned.
4200 Report error if unlink or close fails.
4201 (wipename, main): Use bool for booleans.
4203 (names): Use only digits and uppercase letters, for greater
4206 2004-05-16 Jim Meyering <jim@meyering.net>
4208 * tests/chown/deref: New test for the yesterday's change.
4209 * tests/chown/Makefile.am (TESTS): Add deref.
4211 2004-05-15 Jim Meyering <jim@meyering.net>
4213 chown --dereference did nothing when the owner/group of a
4214 symlink matched the desired owner/group. Reported by David Malone.
4215 Also reported in 1999 as http://bugs.debian.org/39642.
4217 * src/chown-core.c (change_file_owner): When --dereference has
4218 been specified, and when processing a symlink, stat it to get the
4219 owner and group of the referent.
4221 2004-05-14 Jim Meyering <jim@meyering.net>
4223 * man/pwd.x, man/echo.x, man/printf.x: Fix typo:
4224 s/supercede/supersede/ reported by Andrew Fabbro.
4226 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
4228 Improve performance of `sort -m' on large files, at the cost of
4229 making some contrived examples unsafe. POSIX allows this
4230 optimization. Performance problem reported by Jonathan Baker in
4231 <http://mail.gnu.org/archive/html/bug-coreutils/2004-05/msg00071.html>.
4233 * src/sort.c (first_same_file): Do not treat input pipes
4234 differently from other files.
4235 * doc/coreutils.texi (sort invocation): Document that "sort -m -o F"
4236 might write F before reading all the input.
4239 2004-05-12 Paul Eggert <eggert@cs.ucla.edu>
4241 * src/od.c (print_ascii, dump_strings): Use e.g. '\a' rather than
4242 '\007', for portability to EBCDIC hosts.
4243 * src/printf.c (print_esc_char): Likewise.
4244 * src/tr.c (unquote, make_printable_str): Likewise.
4246 2004-05-12 Jim Meyering <jim@meyering.net>
4248 * src/remove.c (AD_pop_and_chdir): Move lstat-`.' into if-block
4249 where the result is used. This avoids one unnecessary lstat call
4250 per command line argument.
4252 2004-05-12 Paul Eggert <eggert@cs.ucla.edu>
4254 Don't assume that "make -C" works; Solaris "make" doesn't have -C.
4256 * src/Makefile.am (all_programs.list): New rule, copied from
4257 man/Makefile.am and tests/Makefile.am, except that we use the
4258 system tr rather than ./tr and we don't use tr -s.
4259 * tests/Makefile.am (all_programs): Use it.
4260 * man/Makefile.am (all_programs): Likewise. Renamed from programs,
4261 for consistency. All uses changed.
4263 2004-05-11 Jim Meyering <jim@meyering.net>
4265 * tests/rm/unread3: New test, for the above fix and today's
4266 lib/save-cwd.c improvement.
4267 * tests/rm/Makefile.am (TESTS): Add unread3.
4269 * src/rm.c: Don't include "save-cwd.h". It's no longer used.
4271 2004-05-10 Jim Meyering <jim@meyering.net>
4273 * tests/install/trap: New file. Test for bug fix of 2004-04-18.
4274 * tests/install/Makefile.am (TESTS): Add trap.
4276 * src/remove.c (AD_push): Don't use errno in diagnostic about
4279 Remove these generated files from CVS.
4280 * tests/cut/cut-tests, tests/date/date-tests, tests/join/join-tests:
4281 * tests/ls/ls-tests, tests/pr/pr-tests, tests/tac/tac-tests:
4282 * tests/tail/tail-tests, tests/test/test-tests, tests/tr/range-tests:
4283 * tests/tr/tr-tests, tests/wc/wc-tests:
4285 2004-05-09 Jim Meyering <jim@meyering.net>
4287 * src/tr.c (unquote): Use xcalloc rather than xmalloc and
4288 a loop initializing the just-allocated memory to zero.
4290 2004-05-08 Jim Meyering <jim@meyering.net>
4292 * tests/rm/no-give-up: New file; check for today's fix.
4293 * tests/rm/Makefile.am (TESTS): Add no-give-up.
4295 2004-05-08 Paul Eggert <eggert@cs.ucla.edu>
4297 Fix bug where "rm" gave up too easily, reported by Dan Jacobsen in
4298 <http://mail.gnu.org/archive/html/bug-coreutils/2004-05/msg00013.html>.
4300 * src/remove.c (remove_entry): Check for errno values like ENOENT
4301 that show the file cannot be directory, instead of for errno
4302 values like EPERM that show the file might be a directory. This
4303 is necessary because, when a single unlink() call has multiple
4304 reasons to fail, it can set errno to any of those reasons; it's
4305 only the rare errno value like ENOENT that excludes all the other
4306 possible reasons to fail even when the file is a directory.
4307 (remove_cwd_entries): Don't attempt chdir if the file is known
4308 to not be a directory.
4309 (remove_dir): Use the same method that remove_cwd_entries uses
4310 (for some reason they differed). Don't assert that saved_errno
4311 must be EPERM; it might be just about anything.
4313 2004-05-06 Jim Meyering <jim@meyering.net>
4315 * src/id.c (xgetgroups): Use xnmalloc, rather than xmalloc.
4316 Don't add `1' to the buffer size (it was to protect against malloc
4317 implementations that fail to allocate a buffer of size zero).
4318 That is no longer necessary, since we use a malloc wrapper
4321 * src/wc.c (get_input_fstatus): Use xnmalloc, rather than xmalloc.
4322 * src/head.c (elide_tail_bytes_pipe): Likewise.
4323 * src/df.c (main): Likewise.
4324 * src/shred.c (do_wipefd): Likewise.
4325 * src/users.c (list_entries_users): Likewise.
4326 * src/tail.c (main): Likewise.
4327 * src/md5sum.c (main): Likewise.
4329 2004-04-29 Paul Eggert <eggert@cs.ucla.edu>
4331 * src/df.c (show_disk, show_point): If several filesystems are
4332 mounted on the same mount point, prefer the last one, not the first.
4333 Problem reported by Christian Jones in
4334 <http://mail.gnu.org/archive/html/bug-coreutils/2004-04/msg00200.html>.
4335 (show_disk): Remove unused statp arg. Return bool, not int.
4336 (show_point): Rewrite to avoid gotos. Use the same algorithm
4337 for lofs and dummies for each pass through the mount table,
4338 rather than subtly different algorithms (which are probably
4341 2004-05-03 Jim Meyering <jim@meyering.net>
4343 * Makefile.am (EXTRA_DIST): Add m4/ChangeLog, now that we no longer
4346 2004-05-01 Jim Meyering <jim@meyering.net>
4348 When chown or chgrp is modifying the referent of a symlink,
4349 use the chown(2) function, if possible.
4350 * src/chown-core.c (change_file_owner): Don't hard-code the
4351 open/fchown/close kludge here. Use `chown' instead.
4352 The chown function works just fine on conforming systems.
4353 Other systems now go through the new chown wrapper that
4354 resorts to the old kludge.
4356 * src/chown-core.c (change_file_owner): Add a comment.
4358 2004-04-27 Jim Meyering <jim@meyering.net>
4360 * src/ptx.c: Make over 40 global extern variables `static'.
4361 (syntax_table, re_syntax_table): Remove declarations of two unused
4362 variables (they were exposed by the above change).
4364 * src/du.c (G_fail, opt_nul_terminate_output): Declare `static'.
4365 * src/ln.c (backup_type): Likewise.
4367 * src/remove.c (rm): Add `extern' keyword.
4368 * src/cp-hash.c (forget_created, remember_created)
4369 (src_to_dest_lookup, remember_copied, hash_init, forget_all): Likewise.
4370 * src/copy.c (dest_info_init, src_info_init, copy): Likewise.
4371 * src/chown-core.c (chopt_init, chopt_free, gid_to_name)
4372 (uid_to_name, chown_files): Likewise.
4374 * src/Makefile.am (sc_tight_scope): New rule.
4375 * Makefile.maint (sc_tight_scope): New rule.
4376 (syntax-check-rules): Add it.
4378 2004-04-26 Jim Meyering <jim@meyering.net>
4380 * Use automake-1.8.4. Regenerate dependent files.
4382 * src/sort.c (limfield): Make a comment clearer.
4384 2004-04-25 Paul Eggert <eggert@twinsun.com>
4386 Fix POSIX-conformance bug: "sort -k 3,3.5b" is supposed to skip
4387 leading blanks when computing the location of the field end;
4388 it is not supposed to skip trailing blanks. Solaris 8 "sort"
4389 does conform to POSIX. Also fix the documentation to clarify
4390 this and related issues.
4392 * doc/coreutils.texi (sort invocation): Mention -k earlier, so
4393 that the options are in alphabetical order. Describe how -b works
4394 more-accurately; this involves fixing some examples, too. Mention
4395 what happens if the start field falls after an end field or after
4396 a line end. Warn about using -k without -b, -g, -M, -n, or -t.
4397 Add an example of how to sort IPv4 addresses and Apache Common
4398 Log Format dates. Remove a duplicate example.
4399 (Putting the tools together): Use separate options rather
4400 than agglomerating them.
4401 * src/sort.c (limfield): Use skipeblanks, not skipsblanks, to
4402 decode whether to skip leading blanks.
4403 (trailing_blanks): Remove.
4404 (fillbuf, getmonth, keycompare): Don't trim trailing blanks.
4406 * tests/pr/Test.pm: Fix typo in env_default comment.
4407 * tests/sort/Test.pm: Likewise.
4408 (18c, 18d): Reverse the order of output lines, so that the
4409 test cases conform to POSIX.
4411 2004-04-22 Paul Eggert <eggert@twinsun.com>
4413 More signal-handling cleanup for ls.c. Do not allow signals to
4414 happen between arbitrary output bytes, as the
4415 restore-default-color sequence can bollix up multibyte chars or
4416 color-change sequences in the ordinary output. Instead, process
4417 signals only between printing a file name and changing the color
4418 back to non_filename_text color. That way, if the signal handler
4419 changes the color (to the default), 'ls' will change it back when
4420 'ls' continues (after being suspended).
4422 Also, do not bother with signal-handling unless stdout is a
4423 controlling terminal; this lets stdio buffer better when "ls
4424 --color" is piped or sent to a file.
4426 * src/ls.c (sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]: New macros.
4427 Do not include "full-write.h"; no longer needed.
4428 (tcgetpgrp) [! HAVE_TCGETPGRP]: New macro.
4429 (put_indicator_direct): Remove. All callers changed to use
4431 (caught_signals, interrupt_signal, stop_signal_count): New vars.
4432 (restore_default_color): Don't bother checking for put_indicator
4434 (sighandler): Don't handle SIGTSTP; that's another handler now.
4435 Simply set interrupt_signal to the signal, then exit.
4436 (stophandler, process_signals): New functions.
4437 (main): Don't output any color changes until _after_ the signal
4438 handlers are set up. This fixes a race condition where 'ls'
4439 could be interrupted while initializing colors, and leaving the
4440 terminal in an undesirable state.
4441 Don't mess with signal-handling if standard output is not a
4442 controlling terminal.
4443 When exiting, restore the default color, then restore the
4444 default signal handling, then act on any signals that weren't
4446 Do not print //DIRED// etc. in colors; this avoids the need
4447 to catch signals when printing them.
4448 (print_name_with_quoting): Process signals just before switching
4449 color back to non_filename_text.
4451 2004-04-23 Jim Meyering <jim@meyering.net>
4453 Avoid segfault on systems for which SIZE_MAX != (size_t) -1.
4454 * src/ls.c (quote_name): Use SIZE_MAX, not -1, in calls
4455 of quotearg_buffer. Patch by Mikulas Patocka.
4457 2004-04-18 Paul Eggert <eggert@twinsun.com>
4459 tee ignored SIGPIPE, but POSIX doesn't allow this.
4461 * src/tee.c (main): Do not ignore SIGPIPE, as POSIX 1003.1-2001
4462 does not allow this. This undoes the 1996-10-24 patch.
4464 2004-04-18 Paul Eggert <eggert@twinsun.com>
4466 Signal-handling cleanup for coreutils. Here are the highlights:
4468 - csplit sometimes failed to remove files when interrupted.
4469 - csplit didn't clean up if two signals arrived nearly simultaneously.
4470 - install -s would infloop on System V if SIGCHLD was ignored.
4471 - ls could incorrectly restore color if multiple signals
4472 arrived nearly simultaneously.
4474 * src/csplit.c (sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]:
4476 (filename_space, prefix, suffix, digits, files_created, remove_files):
4478 (caught_signals): New var.
4479 (cleanup): Block signals while deleting all files.
4480 (cleanup_fatal, handle_line_error, regexp_error):
4481 Mark with ATTRIBUTE_NORETURN.
4482 (create_output_file, close_output_file, interrupt_handler):
4483 Block signals while changing the number of output files,
4484 to fix some race conditions.
4485 (delete_all_files): Do nothing if remove_files is zero.
4486 Clear files_created.
4487 (main): Don't mess with signals until after argument processing
4490 * src/csplit.c (main): Rewrite signal-catching code to make it
4491 similar to other coreutils programs. When processing signals,
4492 block all signals that we catch, but do not block signals that we
4493 don't catch. Avoid problems with unsigned int warnings.
4494 * src/ls.c (main): Likewise.
4495 * src/sort.c (main): Likewise.
4497 * src/csplit.c (interrupt_handler):
4498 Use void, not (obsolete) RETSIGTYPE.
4499 * src/shred.c (sigill_handler, isaac_seed_machdep): Likewise.
4501 * src/csplit.c (interrupt_handler) [defined SA_NOCLDSTOP]:
4502 Use simpler "signal (sig, SIG_DFL)" rather than sigaction equivalent.
4503 * src/ls.c (sighandler) [defined SA_NOCLDSTOP]: Likewise.
4504 * src/sort.c (sighandler) [defined SA_NOCLDSTOP]: Likewise.
4505 * src/nohup.c (main) [!defined _POSIX_SOURCE]: Likewise, except
4507 * src/tee.c (main) [!defined _POSIX_SOURCE]: Likewise.
4509 * src/install.c: Include <signal.h>.
4510 (main) [defined SIGCHLD]: Set SIGCHLD handler to the default, if -s is
4511 given, since System V fork+wait does not work if SIGCHLD is ignored.
4513 * src/ls.c (sighandler) [!defined SA_NOCLDSTOP]: Reset signal
4514 handler to self, not to SIG_IGN, since SIGTSTP can be received
4516 (main): Use SA_RESTART, as that is simpler than checking for EINTR
4517 failures all over the place.
4519 2004-04-20 Jim Meyering <jim@meyering.net>
4521 * src/remove.c (is_empty_dir): Clarify comment.
4523 * man/help2man: Accept new option: --program-name=NAME, so that we
4524 can override the one in --version output. This is needed solely
4525 so that test.1 doesn't refer to `[' as the program name.
4526 Reported by Benjamin Cutler as http://bugs.debian.org/205251.
4527 * man/Makefile.am (.x.1): Use help2man's new --program-name option.
4529 * src/pwd.c: Don't include pathmax.h; system.h already does it.
4531 * src/cut.c (cut_fields): Free buffer upon getndelim2 failure.
4533 2004-04-19 Jim Meyering <jim@meyering.net>
4535 * src/shred.c (isaac_seed_start) [AVOID_USED_UNINITIALIZED_WARNINGS]:
4536 Initialize a buffer to avoid warnings from tools like valgrind.
4538 * Makefile.maint (sc_trailing_blank): New rule.
4539 (syntax-check-rules): Add it.
4540 * .x-sc_trailing_blank: New file.
4542 Make pwd work even if the resulting name is so long that getcwd fails.
4543 * src/pwd.c: (path_free, path_init, path_prepend): New functions.
4544 (nth_parent, find_dir_entry, robust_getcwd): New functions.
4545 (main): First try getcwd, then, upon failure, robust_getcwd.
4547 2004-04-18 Jim Meyering <jim@meyering.net>
4549 * src/who.c (print_user): Use xrealloc here, rather than
4550 unchecked realloc. Remove anachronistic casts.
4552 * src/remove.c (full_filename_): Don't leak upon failed realloc.
4554 * src/system.h (readdir_ignoring_dot_and_dotdot): New inline function,
4556 * src/remove.c (readdir_ignoring_dotdirs): Move function to system.h,
4557 renaming it. Update uses.
4559 2004-04-17 Jim Meyering <jim@meyering.net>
4561 * configure.ac: Depend on automake-1.8.3.
4563 * src/join.c (add_file_name): Declare function to be `static'.
4564 (string_to_join_field): Likewise.
4565 * src/remove.c (ds_init, ds_free): Likewise.
4567 * Makefile.maint (sc_prohibit_jm_in_m4): New rule.
4568 (syntax-check-rules): Add to the list.
4570 2004-04-13 Paul Eggert <eggert@twinsun.com>
4572 Use page-aligned buffers whenever we bother to do I/O using buffer
4573 sizes that are tailored for the files.
4575 * src/cat.c: Include getpagesize.h.
4576 * src/copy.c: Likewise.
4577 * src/shred.c: Likewise.
4578 * src/split.c: Likewise.
4579 * src/cat.c (main): Align I/O buffers to page boundaries.
4580 * src/copy.c (copy_reg): Likewise.
4581 * src/shred.c (dopass): Likewise.
4582 * src/split.c (main): Likewise.
4583 * src/dd.c (ROUND_UP_OFFSET, PTR_ALIGN): Remove.
4584 All uses replaced by ptr_align.
4585 * src/od.c (gcd, lcm): Remove; now in system.h.
4586 * src/system.h (gcd, lcm, ptr_align): New functions, moved from od.c.
4588 2004-04-14 Jim Meyering <jim@meyering.net>
4590 Remove m4/Makefile.am: it's no longer needed, with newer automake
4591 * configure.ac (AC_CONFIG_FILES): Remove m4/Makefile.in from the list.
4592 * Makefile.am (SUBDIRS): Remove `m4' from the list.
4594 2004-04-13 Jim Meyering <jim@meyering.net>
4596 * configure.ac: Change `jm_' in AC_DEFINE'd names to `gl_'.
4598 2004-03-27 Paul Eggert <eggert@twinsun.com>
4600 * NEWS: cp -pu and mv -u (when copying) now take the destination
4601 file system time stamp resolution into account.
4602 * doc/coreutils.texi (mv invocation): Document this.
4603 (cp invocation): Document -u (it was missing!) with new behavior.
4605 * src/copy.c: Include "utimecmp.h".
4606 (copy_internal): Compare time stamps using utimecmp rather than
4609 2004-04-09 Jim Meyering <jim@meyering.net>
4611 * Makefile.maint (.re-list): New rule/file, to replace
4612 hard-coded list of header file names.
4613 (sc_system_h_headers): Use the new file.
4614 Don't look for sys2.h anymore.
4616 * src/system.h: Include new "stat-macros.h" rather than hard-coding
4617 all of its macro definitions -- the list was slightly out of date.
4618 Suggestion from Dmitry V. Levin.
4620 2004-04-08 Paul Eggert <eggert@cs.ucla.edu>
4622 * NEWS: Remove noctty flag from dd. Suggested by Philippe Troin.
4623 * doc/coreutils.texi (dd invocation): Likewise.
4624 * src/shred.c (O_NOCTTY): Remove redundant decl.
4625 * src/dd.c (flags, usage): Remove noctty flag.
4626 (main): Always use O_NOCTTY when opening files.
4628 2004-04-08 Jim Meyering <jim@meyering.net>
4630 * src/dd.c (dd_copy): Mark two diagnostics for translations.
4631 (set_fd_flags): Undo part of today's change: it's a little
4632 cleaner -- and more efficient in the common case -- to go
4633 ahead and OR in the -1 when fcntl fails.
4635 * Makefile.maint (sc_dd_max_sym_length): New target.
4636 (syntax-check-rules): Add it.
4638 * src/md5sum.c (PROGRAM_NAME) [algorithm == ALG_SHA1]:
4639 Correct spelling: s/shasum/sha1sum. Reported by Jesse Kornblum.
4641 * src/dd.c (set_fd_flags): Don't OR in -1 when fcntl fails.
4642 Rename parameter, flags, to avoid shadowing global.
4643 (LONGEST_SYMBOL): Tweak comment.
4645 2004-04-07 Paul Eggert <eggert@twinsun.com>
4647 * NEWS: New dd conv= symbols nocreat, excl, fdatasync, fsync,
4648 and new dd options iflag= and oflag=.
4649 * src/dd.c (usage): Likewise.
4650 * src/Makefile.am (dd_LDADD, shred_LDADD): Add fdatasync's lib.
4651 * src/dd.c (fdatasync) [!HAVE_FDATASYNC]: New macro.
4652 (C_NOCREAT, C_EXCL, C_FDATASYNC, C_FSYNC): New macros.
4653 (input_flags, output_flags): New vars.
4654 (LONGEST_SYMBOL): New macro.
4655 (struct symbol_value): Renamed from struct conversion. Members
4656 symbol and value renamed from convname and conversion. The
4657 symbol value is now an array instead of a pointer; this saves
4658 a bit of space and time in practice. All uses changed.
4659 (conversions): Add nocreat, excl, fdatasync, fsync. Now const.
4660 (flags): New constant array.
4661 (iflag_error_msgid, oflag_error_msgid): New constants.
4662 (parse_symbols): Renamed from parse_conversion and generalized
4663 to handle either conversion or flag symbols.
4664 (scanargs): Adjust uses of parse_symbols accodingly. Add
4665 support for iflag= and oflag=. Reject attempts to use
4666 both excl and nocreat.
4667 (set_fd_flags): New function.
4668 (dd_copy): Just return X rather than calling quit (X), since our
4669 caller invokes quit with the returned value. Add support for
4670 fdatasync and fsync.
4671 (main): Add support for iflag=, oflag=, and new conv= symbols.
4672 * src/system.h (O_DIRECT, O_DSYNC, O_NDELAY, O_NOFOLLOW,
4673 O_RSYNC, O_SYNC): Define to 0 if not already defined.
4675 * NEWS: Remove duplicate mention of BLOCKSIZE.
4677 2004-04-02 Andreas Schwab <schwab@suse.de>
4679 * src/stty.c: Add support for IUTF8 input flag.
4681 2004-04-06 Jim Meyering <jim@meyering.net>
4683 * src/system.h (makedev) [mkdev && !makedev]: Define in terms of mkdev.
4684 Interix spells it `mkdev'. Reported by Mark Funkenhauser.
4686 2004-04-04 Jim Meyering <jim@meyering.net>
4688 A specified format is no longer automatically newline terminated.
4689 If you want a newline at the end of your format, use `\n'.
4690 * src/stat.c (print_it): Don't print a newline at the end of
4692 (do_statfs): Add a newline at end of each default format string.
4694 2004-03-30 Paul Eggert <eggert@twinsun.com>
4696 * src/nohup.c (main): Adjust to new calling convention
4697 for set_cloexec_flag.
4699 2004-03-31 Jim Meyering <jim@meyering.net>
4701 * tests/Fetish.pm (run_tests): Remove `.orig' file.
4702 Remove debugging diagnostic.
4704 Specifying an invalid --width=N (-w) or --gap-size=N (-g)
4705 would not elicit an error.
4706 * src/ptx.c: Include "xstrtol.h" and "quotearg.h".
4707 (main): Don't use atoi. Use xstrtoul instead.
4709 2004-03-30 Jim Meyering <jim@meyering.net>
4711 * Makefile.maint (sc_prohibit_atoi_atof): New rule.
4712 (syntax-check-rules): Add it.
4713 * .x-sc_prohibit_atoi_atof: New file.
4715 2004-03-29 Jim Meyering <jim@meyering.net>
4717 * tests/du/files0-from: Use new OUT_SUBST directive, so that this
4718 test is not sensitive to system-dependent block size differences.
4719 Prompted by a report of Solaris 8 differences from Paul Eggert.
4721 * tests/Fetish.pm: Accept new directives: OUT_SUBST, ERR_SUBST.
4722 Rename `%tmp' to `%actual'. Reverse order of last two args to
4723 _compare_files (to $actual, $expected) so as to match declaration.
4725 2004-03-28 Paul Eggert <eggert@twinsun.com>
4727 Fix some gotchas encountered when porting to Solaris 8, using
4728 the Forte 6u2 compiler.
4730 * src/hostname.c [HAVE_SETHOSTNAME && !defined sethostname]:
4731 Declare sethostname, since no Solaris header does it.
4732 * src/who.c: Include "vasprintf.h", for asprintf.
4734 2004-03-28 Jim Meyering <jim@meyering.net>
4737 * src/du.c (process_file): Don't record dev/inode for directories.
4739 Under some circumstances, without -c, du would mistakenly count the
4740 space of hard-linked files, not just the first one it encountered.
4741 Reported by Anthony Thyssen.
4742 * src/du.c (du_files): Don't ever clear the set of `seen' dev/inodes.
4744 * src/du.c: Rename global `print_totals' to `print_grand_total'.
4746 * src/du.c (main): Rearrange filtering loop to be a tiny bit
4749 * src/chown-core.c: Don't include savedir.h -- no longer needed.
4750 * src/chmod.c: Likewise.
4752 2004-03-25 Jim Meyering <jim@meyering.net>
4754 * src/du.c (main): Remove now-unused declaration of `i'.
4756 2004-03-24 Paul Eggert <eggert@twinsun.com>
4758 * src/du.c (main): Filter out file names of length zero before
4759 invoking fts, so that they don't cause fatal errors.
4761 2004-03-25 Jim Meyering <jim@meyering.net>
4763 * tests/du/files0-from (zero-len): Add a test for the above.
4765 2004-02-25 Paul Eggert <eggert@twinsun.com>
4767 * NEWS: New environment var BLOCKSIZE.
4768 * lib/human.c (humblock): Support BLOCKSIZE as well as BLOCK_SIZE.
4769 * tests/envvar-check: Test for it. Factor the code to simplify it.
4771 2004-03-23 Paul Eggert <eggert@twinsun.com>
4773 * NEWS: Shorten the du --files0-from announcement, and say
4774 "NUL-terminated" rather than "NUL-separated".
4775 * src/du.c (EXPECTED_BYTES_PER_FILE_NAME, DEFAULT_PROJECTED_N_FILES):
4777 (usage): Say "NUL-terminated", not "NUL-separated".
4778 (main): Check for I/O error when istream is closed.
4779 Allow --files0-from=F even if F is empty; this specifies no files.
4780 (du_files): Now that we allow the list of files to be empty,
4782 * tests/du/files0-from: Adjust to above changes to src/du.c.
4784 2004-03-24 Jim Meyering <jim@meyering.net>
4786 * tests/tail-2/assert: Avoid race condition that could cause
4787 spurious failure. Based on a patch from Andreas Schwab.
4789 2004-03-23 Jim Meyering <jim@meyering.net>
4791 * src/du.c (main): Free the hash table, too.
4793 2004-03-22 Jim Meyering <jim@meyering.net>
4795 * man/Makefile.am (.x.1): Remove --info-page= option, reverting
4796 the change of 2004-01-22. I can no longer reproduce the problem
4797 that prompted that change, and `info coreutils pr' would display the
4798 `printing text' section of the manual, not the one on `pr invocation'.
4800 * tests/du/files0-from (nul-1, nul-2): Adjust expected diagnostics
4801 to match corrected output.
4803 * src/du.c: Include "readtokens0.h" rather than "readtokens.h".
4804 (main): Use readtoken0 functions rather than readtokens.
4805 Don't use errno when diagnosing readtokens0 failure.
4806 Fix off-by-one error in the token number reported in a diagnostic.
4807 (du_files): Return bool, rather than int.
4808 (main): Call readtokens0_free.
4810 2004-03-21 Jim Meyering <jim@meyering.net>
4812 * src/remove.c (ds_free): Plug a small leak.
4814 * tests/Fetish.pm: Fix typo in comment.
4816 2004-03-07 Jim Meyering <jim@meyering.net>
4818 * NEWS: du accepts a new option --files0-from=FILE, where FILE
4819 contains a list of NUL-separated file names.
4821 * src/du.c: Include "readtokens.h".
4822 (usage): Describe the new option, and adjust the `Usage':
4823 with this option, no FILE may be specified on the command line.
4824 (main): Handle the new option.
4826 * tests/du/files0-from: New tests, for the above.
4827 * tests/du/Makefile.am (TESTS): Add files0-from.
4829 * src/factor.c (do_stdin): Reflect changes in use of readtoken.
4830 * src/tsort.c (tsort): Likewise.
4832 2004-02-29 Paul Eggert <eggert@twinsun.com>
4834 * NEWS: Add support for a new notation @N to get_date to represent
4835 the time stamp with numeric value N. Improve support for
4836 fractional time stamps. date's -d and -f options now accept them.
4837 Likewise for touch -t. date has a new option --iso-8601=ns.
4839 * doc/coreutils.texi (touch invocation):
4840 Describe use of fractional seconds.
4841 (date invocation, Options for date): Likewise.
4842 * doc/getdate.texi (General date syntax, Time of day items): Likewise.
4843 * doc/coreutils.texi (date invocation): Mention effect of LC_TIME.
4844 (Options for date): Describe new --iso-8601=ns option.
4846 * doc/getdate.texi: Add copyright notice. Change getdate to
4847 get_date when talking about the function name.
4848 (Seconds since the Epoch): New section, containing the time_t
4849 info moved from Date input formats section, along with new
4850 info about the @ syntax. Mention negative time stamps,
4851 fractional time stamps, and leap seconds.
4852 (General date syntax): Modernize examples a bit to reflect new
4854 (General date syntax, Relative items in date strings):
4855 Use ' rather than " to quote formats.
4856 (Time of day items): Add an example with fractional seconds.
4857 Describe fractional-second syntax.
4859 * src/Makefile.am (touch_LDADD): New macro, since `touch' now
4860 needs clock_gettime.
4862 * src/date.c (enum Time_spec): New enum TIME_SPEC_NS.
4863 (time_spec_string, time_spec, show_date): Support it.
4864 (usage): Remove description of -ITIMESPEC, as it's obsolete and
4865 confusing. Mention --iso-8601=ns.
4866 (batch_convert): getline returns ssize_t, not int.
4868 * src/touch.c (newtime): Now an array of two timespecs, one
4869 for access and one for modification.
4870 (ref_stats): Remove.
4871 (get_reldate): Use get_date's parameter profile.
4872 (touch, main): Adjust to above changes.
4873 (main): Work even if tm_year == INT_MAX (so long as long int is wider).
4874 Use gettime instead of gettimeofday, for new get_date signature.
4876 * tests/date/Test.pm (test_vector): New tests epoch, ns-10, ns-max32,
4879 2004-03-15 Jim Meyering <jim@meyering.net>
4881 * Makefile.maint (alpha beta major): `Make' the emit_upload_commands
4882 target before updating $(prev_version_file).
4884 * tests/misc/date-sec: New file, to test for just-fixed bug in date.
4885 See today's change in lib/getdate.y.
4886 * tests/misc/Makefile.am (TESTS): Add date-sec.
4888 2004-03-14 Jim Meyering <jim@meyering.net>
4890 * announce-gen (print_changelog_deltas): Use `.sig' suffix for
4891 signature files, not `.asc'. Reported by angico@yahoo.com.
4893 2004-03-13 Jim Meyering <jim@meyering.net>
4895 * src/cp.c (do_copy): Tweak wording in a diagnostic.
4896 Suggestion from Karl Berry.
4897 Include "quoatearg.h".
4898 (do_copy): Use quotearg_colon (not quote) for diagnostics
4899 that begin with `"%s:'.
4901 * src/nl.c (usage): Specify that nl uses _basic_ regular expressions.
4902 Suggestion from Dan Jacobson.
4904 2004-03-12 Jim Meyering <jim@meyering.net>
4908 Sometimes, when source and destination partition are different,
4909 mv mistakenly fails to preserve a hard link. Reported by IIDA Yosiaki.
4911 * src/copy.c: When moving a set of N hard-linked files between
4912 partitions, via two or more command line arguments where the
4913 command line argument containing the Nth link contains no other
4914 link to that same file, mv would mistakenly copy the file, rather
4915 than hard-linking it to the other(s). That happens because when the
4916 final link is processed, its link count has been reduced to 1 since
4917 the other links have been `copied' to the destination partition
4918 and the source links have been removed.
4919 (copy_internal): When in move mode, use the source dev/inode
4920 pair to look up destination name even when st_nlink == 1.
4921 * src/cp-hash.c (src_to_dest_lookup): New function.
4922 * src/cp-hash.h (src_to_dest_lookup): Add prototype.
4923 * tests/mv/part-hardlink: New file. Test for the above fix.
4924 * tests/mv/Makefile.am (TESTS): Add part-hardlink.
4926 * announce-gen: Sync with autoconf.
4928 * tests/ls/time-1: Exit 77 (not 1) if we can't set up for the test.
4929 This was triggered on a Linux-2.2.19 system using a file system
4930 NFS-mounted from some sort of Sun.
4932 2004-03-11 Jim Meyering <jim@meyering.net>
4934 * Use automake-1.8.3. Regenerate dependent files.
4936 2004-03-10 Jim Meyering <jim@meyering.net>
4938 * tests/du/deref-args: Also convert sizes in the 70-79 kB range,
4939 so that this test works with SELinux-enabled systems.
4940 Based on a patch from Tim Waugh.
4942 `join -1 x' would give a misleading diagnostic
4943 * src/join.c (string_to_join_field): Report that a non-numeric field
4944 number is invalid, rather than `so large that it is not representable'.
4945 * tests/join/Test.pm (invalid-j): New partial test for the above fix.
4947 2004-03-06 Jim Meyering <jim@meyering.net>
4949 cp --sparse=always sparse-image-file.img /dev/hda1 could
4950 produce an invalid copy on the destination device.
4952 * src/copy.c (copy_reg): Even with --sparse=always, try to
4953 make `holes' only if the destination is a regular file.
4954 Reported by Szakacsits Szabolcs.
4956 2004-03-03 Paul Eggert <eggert@twinsun.com>
4958 * src/nohup.c (main): Don't invoke set_cloexec_flag with
4959 a file descriptor of -1.
4961 2004-03-02 Dmitry V. Levin <ldv@altlinux.org>
4963 * src/nohup.c: Include "cloexec.h".
4964 (main): Set the copy of stderr to close on exec.
4966 2004-03-01 Paul Eggert <eggert@twinsun.com>
4968 * configure.ac: Include <signal.h> when checking for strsignal,
4969 sys_siglist, and friends. Problem reported by Tony Leneis in
4970 <http://mail.gnu.org/archive/html/bug-coreutils/2004-02/msg00136.html>.
4972 2004-02-25 Paul Eggert <eggert@twinsun.com>
4974 * tests/du/deref-args, tests/du/exclude, tests/du/slash:
4975 * tests/du/trailing-slash: Run envvar-check in case BLOCK_SIZE
4978 2004-02-23 Paul Eggert <eggert@twinsun.com>
4980 * NEWS: Document how chown's USER.GROUP argument is now parsed.
4982 2004-02-23 Jim Meyering <jim@meyering.net>
4984 * src/seq.c (usage): Remove stray space after \n in --help output.
4986 2004-02-22 Jim Meyering <jim@meyering.net>
4988 * src/du.c (usage): Separate -H and --si. Say that the meaning
4989 of -H will soon change to that of --dereference-args (-D).
4991 2004-02-21 Jim Meyering <jim@meyering.net>
4993 * src/comm.c (usage): Tell what comm does when there are no options.
4994 Reword in terms of FILE1 and FILE2 rather than `left file' and
4995 `right file'. Suggestion from Dan Jacobson.
4997 2004-02-15 Paul Eggert <eggert@twinsun.com>
4999 Fix some POSIX-conformance bugs in expr.
5001 * NEWS: document the following changes to src/expr.c.
5002 * doc/coreutils.texi (expr invocation): Likewise.
5003 Document what forms integers may take, and say "integer"
5004 consistently instead of "number". Warn about operands
5005 that "expr" can misinterpret, and how to work around the
5007 * src/expr.c (eval, eval7, eval6, eval5, eval4, eval3, eval2, eval1):
5008 Accept a bool argument specifying whether to evaluate the
5009 expression. This is to allow short-circuit evaluation. All
5011 (null): Report that a string is zero even if it has
5012 a form like "-0" or "00".
5013 (eval1, eval): Use short-circuit evaluation for | and &.
5014 (eval): Return 0 if both arguments are null or zero, instead
5015 of returning the first argument.
5016 * tests/expr/basic: Add some tests for the above.
5018 2004-02-17 Jim Meyering <jim@meyering.net>
5022 `make check' from a build inside a chroot environment would fail
5023 * tests/help-version: Specify an argument (`/') for df, in the
5024 unusual event that there is no valid entry in /etc/mtab.
5025 Likewise for id: add the -u option, so we don't get spurious
5026 failures when there are no user or group names.
5029 * src/sort.c (usage) [-u]: Add punctuation so that the description in
5030 the help2man-generated (line-joined) man page is more readable.
5031 Reported by Tim Waugh.
5032 [-T]: Add a semicolon, for the same reason.
5034 2004-02-15 Jim Meyering <jim@meyering.net>
5036 * Makefile.am (dist-hook): Qualify target with $(srcdir)/ prefix.
5038 2004-02-11 Jim Meyering <jim@meyering.net>
5040 * tests/Makefile.am.in ($(srcdir)/Makefile.am): Use more portable
5041 $(srcdir)/../Makefile.am.in, rather than $<.
5042 Suggestion from Michael Elizabeth Chastain.
5044 2004-02-10 Jim Meyering <jim@meyering.net>
5046 * config/install-sh: Make this script executable.
5047 * Makefile.am (dist-hook): New target, to ensure that config/install-sh
5048 is executable. Otherwise, on systems that lack a suitable install
5049 binary, `make install' would fail, because of the way this script
5050 is invoked (without `$SHELL ' prefix).
5051 Reported by Bob Proulx.
5053 2004-02-08 Jim Meyering <jim@meyering.net>
5057 * tests/rm/rm5: Avoid triggering a bug in OSF/Tru64's sed
5058 that would cause an unwarranted test failure.
5059 * tests/rm/rm3: Likewise.
5061 2004-02-07 Jim Meyering <jim@meyering.net>
5063 Remove xstat function pointer member. The way it was used was not
5064 portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
5065 inline `stat' and `lstat' functions, thus making the tests of
5066 `xstat == lstat' in copy.c always fail.
5067 * src/copy.h (struct cp_options) [xstat]: Remove member.
5069 * src/copy.c (copy_dir): Set `.dereference' member, not .xstat.
5070 (copy_internal): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.
5071 Use `x->dereference == DEREF_NEVER' in place of `x->xstat == lstat'.
5072 (valid_options): Remove now-obsolete FIXME comments.
5074 * src/cp.c (re_protect): Use `XSTAT (x, ...)' in place of
5075 `*(x->xstat) (...)'.
5076 (do_copy): Declare/use local xstat rather than x->xstat.
5077 (main): Remove code that set x.xstat.
5078 * src/mv.c (cp_option_init): Don't initialize xstat member.
5079 * src/install.c (cp_option_init): Likewise.
5081 * Makefile.cfg (gnu_ftp_host-alpha, etc.): Un-factor .gnu.org suffix,
5082 so that emit_upload_commands can use these variables, too.
5084 2004-02-06 Jim Meyering <jim@meyering.net>
5086 * tests/rm/deep-1: Remove `du' stack space test.
5087 Apparently, `ulimit -s N' isn't portable enough.
5088 This test will be restored (with a guard against losing ulimit)
5089 in its own file later.
5091 * tests/rm/deep-1 (deep): Remove progress-style diagnostics,
5092 since this test doesn't take long enough to merit them.
5093 Run du on $tmp (the containing dir), not $deep, the full path to leaf.
5095 * Makefile.maint (signatures): Remove definition.
5096 Now, automake's gnupload handles this.
5097 (%.sig: %): Remove now-unused rule.
5098 (rel-files): Use automake's $(DIST_ARCHIVES), rather than
5099 `$(distdir).tar.bz2 $(distdir).tar.gz'.
5100 (emit-upload-commands): Adjust to use gnupload.
5102 2004-02-05 Jim Meyering <jim@meyering.net>
5104 * src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP): Remove definitions.
5105 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5106 Now, those are all defined in timespec.h.
5109 * src/date.c: Don't include timespec.h, now that system.h does it.
5111 2004-02-02 Paul Eggert <eggert@twinsun.com>
5113 Don't dump core if localtime returns NULL (possible on
5114 hosts with 64-bit time_t and 32-bit int).
5115 * src/date.c: Include "inttostr.h".
5116 (batch_convert, main):
5117 If time conversion fails, exit with nonzero status.
5118 (show_date): Return int to report conversion failure.
5119 Print the time as an int if localtime fails.
5120 * src/uptime.c: Print "??" if the current clock can't
5121 be converted by localtime. This won't happen until the year
5122 2*31 + 1900, but we don't want to dump core even if the current
5123 clock has the wrong value.
5125 * src/stat.c: Include "inttostr.h".
5126 (human_time): Print the date/time as a number of seconds since the
5127 epoch if it can't be converted by localtime. This is better than
5128 just saying "invalid", and is consistent with what "ls" does.
5129 Don't dump core if the year has more than 48 digits; this isn't
5130 possible on any contemporary host, but we might as well do it right.
5132 2004-01-31 Paul Eggert <eggert@twinsun.com>
5134 * src/stat.c (human_time): Accept time rather than
5135 pointer-to-const-time parameter, for clarity. All callers changed.
5137 2004-02-02 Jim Meyering <jim@meyering.net>
5139 * src/stat.c (do_stat): Remove extra trailing newline from
5140 default formats. Reported by Nelson H. F. Beebe.
5142 Print actual fractional seconds in time stamps, not just `.00000000'.
5143 * src/stat.c (human_time): Add and use new parameter, t_ns.
5144 (print_stat): Update callers.
5145 * src/ls.c (TIMESPEC_NS): Remove definition.
5146 * src/system.h (TIMESPEC_NS): Define here, instead, now that stat.c
5147 also uses this macro.
5148 Nelson H. F. Beebe noticed that ls --full-time printed nonzero
5149 fractional seconds for files on an XFS file system, but that stat's
5150 fractional seconds were always zero.
5152 2004-01-28 Paul Eggert <eggert@twinsun.com>
5154 * src/seq.c (print_numbers): Use 'double' for loop index, not
5155 'int', to avoid problems with integer overflow. On almost all
5156 machines 'double' works in every case where 'int' works, and
5157 it works on other cases besides.
5159 2004-01-27 Jim Meyering <jim@meyering.net>
5161 * src/seq.c (usage): Mention that if INCREMENT is omitted,
5162 it defaults to 1, even when FIRST is larger than LAST.
5163 Reword so as not to exclude the possibility that INCREMENT be zero.
5165 2004-01-25 Jim Meyering <jim@meyering.net>
5169 * Makefile.maint (signatures): Comment out definition.
5171 2004-01-23 Jim Meyering <jim@meyering.net>
5173 * Makefile.maint (header_regexp): Add exitfail.
5175 * man/Makefile.am (EXTRA_DIST): Add help2man.
5176 Reported by Nelson H. F. Beebe.
5178 * man/Makefile.am (.x.1): Prefix help2man invocation with `$(PERL) --'
5179 so it works on systems with Perl installed somewhere other than in
5182 * src/paste.c (paste_parallel): Declare local, chr, to be of type
5183 `int', not `char', since it must hold EOF. This bug would make
5184 paste infloop on some systems. Test failures reported by
5185 Nelson H. F. Beebe and Christian Krackowizer.
5187 2004-01-22 Jim Meyering <jim@meyering.net>
5189 * tests/rmdir/fail-perm: New file. Test for just-fixed rmdir bug.
5190 * tests/rmdir/Makefile.am (TESTS): Add fail-perm.
5192 * man/help2man: Fix it so using --info-page='coreutils PROG' works.
5193 * man/Makefile.am (.x.1): Invoke our own (tweaked) copy of help2man.
5194 Use --info-page='coreutils PROG' option.
5195 Now, readlink.1 refers the user to `info coreutils readlink'
5196 rather than to `info readlink'. Reported by Matt Swift.
5198 2004-01-21 Paul Eggert <eggert@twinsun.com>
5200 Exit status cleanup.
5202 * src/basename.c (usage): Use EXIT_SUCCESS, not 0, for clarity.
5203 * src/cat.c, src/chgrp.c, src/chmod.c, src/chown.c, src/chroot.c,
5204 * src/cksum.c, src/comm.c, src/cp.c, src/csplit.c, src/cut.c,
5205 * src/date.c, src/dd.c, src/df.c, src/dircolors.c, src/dirname.c,
5206 * src/du.c, src/echo.c, src/env.c, src/expand.c, src/expr.c,
5207 * src/factor.c, src/fmt.c, src/fold.c, src/head.c, src/hostid.c,
5208 * src/hostname.c, src/id.c, src/install.c, src/join.c, src/kill.c,
5209 * src/link.c, src/ln.c, src/logname.c, src/ls.c, src/md5sum.c,
5210 * src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c,
5211 * src/nl.c, src/nohup.c, src/od.c, src/paste.c, src/pathchk.c,
5212 * src/pinky.c, src/pr.c, src/printenv.c, src/printf.c, src/pwd.c,
5213 * src/rm.c, src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c,
5214 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c,
5215 * src/su.c, src/sum.c, src/sync.c, src/tac.c, src/tail.c, src/tee.c,
5216 * src/test.c, src/touch.c, src/tr.c, src/tsort.c, src/tty.c,
5217 * src/uname.c, src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c,
5218 * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c: Likewise.
5220 * src/cat.c (usage): Don't bother normalizing exit status
5221 since the arg is already the correct exit status now.
5222 * src/cksum.c, src/comm.c, src/csplit.c, src/cut.c,
5223 * src/dircolors.c, src/expand.c, src/fmt.c, src/fold.c, src/head.c,
5224 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c,
5225 * src/pr.c, src/split.c, src/sum.c, src/tac.c, src/tail.c, src/tr.c,
5226 * src/tsort.c, unexpand.c, src/src/uniq.c, src/src/wc.c: Likewise.
5228 * src/chown.c (main): Removed unused local 'fail'.
5230 * src/chroot.c (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE):
5233 * src/chroot.c (main): Initialize exit_failure to EXIT_FAIL.
5234 * src/env.c, src/nice.c, src/su.c: Likewise.
5235 * src/nohup.c (main): Likewise, to NOHUP_FAILURE.
5236 * src/setuidgid.c (main): Likewise, to SETUIDGID_FAILURE.
5237 * src/expr.c (main): Use initialize_exit_failure rather than
5238 setting exit_failure directly; this optimizes away redundant
5240 * src/printenv.c, src/sort.c, src/test.c, src/tty.c: Likewise.
5242 * src/chroot.c (main): Exit with status 1 rather than 127
5243 if chroot itself fails, as per documentation.
5245 * src/chroot.c (main): Use EXIT_ENOENT and EXIT_CANNOT_INVOKE
5246 rather than roll-your-own symbols or integers.
5247 * src/env.c (main): Likewise.
5248 * src/nohup.c (main): Likewise.
5249 * src/su.c (run_shell): Likewise.
5251 * src/cp.c (exit_status): Remove static var....
5252 (main): Making it local here instead. Use =, not |=, to set it.
5254 * src/cut.c (FATAL_ERROR, main): Exit with status EXIT_FAILURE,
5256 * src/date.c (batch_convert, main): Likewise.
5257 * src/dd.c (dd_copy): Likewise.
5258 * src/pr.c (first_last_page, main, getoptarg): Likewise.
5259 * src/tr.c (main): Likewise.
5260 * src/date.c (main): Don't assume EXIT_FAILURE == 1, as
5261 POSIX doesn't require it.
5262 * src/dd.c (write_output, skip, dd_copy): Likewise.
5263 * src/df.c (main): Likewise.
5264 * src/id.c (main): Likewise.
5265 * src/install.c (main): Likewise.
5266 * src/ln.c (main): Likewise.
5267 * src/ls.c (main): Likewise.
5268 * src/mv.c (main): Likewise.
5269 * src/shred.c (main): Likewise.
5271 * src/env.c (main): Exit with status 1, not 2, on errors detected
5273 * src/hostname.c (main): Likewise.
5274 * src/nl.c (main): Likewise.
5275 * src/stty.c (main): Likewise.
5277 * src/expr.c (EXPR_FAILURE): Renamed from EXPR_ERROR, for
5278 consistency with the other programs' naming conventions.
5281 * src/factor.c (main): Do not report a usage error simply
5282 because stdin has bad numbers.
5284 * src/id.c (problems): Now a boolean int, not a counter,
5285 so that we don't have to worry about int overflow. All uses changed.
5286 * src/touch.c (err): Likewise.
5288 * src/md5sum.c (main): Use int, not size_t, to store boolean int.
5290 * src/mkfifo.c (main): Exit with status 1, not 4, if not implemented.
5291 * src/mknod.c: Likewise.
5293 * src/nice.c (main): Exit with status EXIT_FAIL, not EXIT_FAILURE,
5294 on error; this is in case EXIT_FAILURE is unusual.
5295 * src/su.c (main): Likewise.
5297 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE): Remove; all uses
5298 changed to EXIT_CANNOT_INVOKE.
5300 * src/printenv.c (PRINTENV_FAILURE): New constant.
5301 (main): Exit with status PRINTENV_FAILURE, not EXIT_FAILURE, on
5302 command-line syntax problems.
5304 * src/rmdir.c (remove_parents): Don't set 'fail' to a negative number.
5305 (main): Avoid integer overflow when seeing whether errors occurred.
5307 * src/seq.c (print_numbers): Now returns void, not (zero) int.
5308 All callers changed.
5309 (main): Remove unused local variable 'errs'. Always exit successfully
5310 if we reach the end.
5312 * src/setuidgid.c (SETUIDGID_FAILURE): Renamed from FAIL_STATUS,
5313 for consistency with other programs here. All uses changed.
5314 (main): Use 'error' to exit rather than invoking 'exit' here.
5316 * src/sort.c: Don't include <assert.h>.
5317 (SORT_OUT_OF_ORDER, SORT_FAILURE): Now enums, not macros.
5318 (usage): Don't use 'assert'.
5319 (main): Remove redundant assignment to exit_failure.
5321 * src/system.h (EXIT_FAIL, EXIT_CANNOT_INVOKE, EXIT_ENOENT):
5323 (initialize_exit_failure): New inline function.
5324 Include exitfail.h here, since we refer to exit_failure.
5325 All callers changed to not include exitfail.h.
5327 * src/tty.c (TTY_FAILURE, TTY_WRITE_ERROR): New enum values;
5328 substitute them for the corresponding integer constants.
5330 * tests/help-version (expected_failure_status_date): Remove, as
5331 'date' is now normal.
5332 (expected_failure_status_nohup): New var.
5334 2004-01-21 Jim Meyering <jim@meyering.net>
5336 * tests/touch/relative: Remove `command' syntax.
5337 Thanks to Nelson H. F. Beebe and Paul Eggert.
5339 * tests/touch/relative: Test only year/month/day, not hours/min/sec,
5340 so as to avoid problems with systems using TAI clocks.
5341 Although it's no longer necessary, set TZ=UTC0 also for the
5342 initial touch command. Reported by Paul Jarc here:
5343 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/1504
5345 2004-01-20 Diego Biurrun <diego@biurrun.de>
5347 * src/dircolors.hin: Add .mov to the list of media files.
5349 2004-01-19 Paul Eggert <eggert@twinsun.com>
5351 * tests/touch/relative: Use TZ=UTC0, not TZ=utc (which isn't
5352 portable). Problem reported by Christian Krackowizer. Also, use
5353 +0000 rather than +0 to specify a time zone, as the documentation
5354 requires four digits.
5356 2004-01-19 Jim Meyering <jim@meyering.net>
5358 * tests/mv/hard-4: Run envvar-check in case SIMPLE_BACKUP_SUFFIX is set.
5359 * tests/mv/backup-is-src: Likewise.
5360 Problem reported by Peter Horst
5362 2004-01-17 Jim Meyering <jim@meyering.net>
5364 * announce-gen (print_changelog_deltas): Use .sig suffix, not .asc.
5368 2003-12-15 Paul Eggert <eggert@twinsun.com>
5370 * NEWS, doc/coreutils.texi: touch -r and -d can now both be specified,
5371 with -r specifying the origin for -d.
5372 * src/touch.c (flexible_date): Remove static var.
5373 (get_reldate): New function.
5374 (main): Use it, to implement this new behavior.
5376 2004-01-16 Jim Meyering <jim@meyering.net>
5378 * tests/touch/relative: New test for the above.
5379 * tests/touch/Makefile.am (TESTS): Add relative.
5381 2004-01-13 Jim Meyering <jim@meyering.net>
5383 * src/system.h: Include contents of sys2.h.
5384 * src/sys2.h: Remove file.
5385 * src/Makefile.am (noinst_HEADERS): Remove sys2.h.
5387 * Use automake-1.8.2. Regenerate dependent files.
5389 * Update to gettext-0.13.1.
5390 * configure.ac: Use gettext-0.13.1.
5391 * .x-sc_space_tab: Add m4/po.m4 to the list of exceptions.
5393 2004-01-12 Jim Meyering <jim@meyering.net>
5395 * Makefile.maint (%.sig): Use .sig suffix rather than .asc.
5397 * Makefile.maint (po-check): Ensure that cvsu works before using it.
5398 Reported by Alexandre Duret-Lutz.
5400 * src/tail.c (main): Warn about following stdin only when it's a tty.
5402 * configure.ac: Use gl_DEFAULT_POSIX2_VERSION.
5404 2004-01-10 Jim Meyering <jim@meyering.net>
5406 * tests/misc/stat-fmt: Use backticks, not `$()' notation.
5408 2004-01-09 Jim Meyering <jim@meyering.net>
5410 * configure.ac: Quote underquoted `jm_DUMMY_1' to avoid new warning.
5412 2004-01-08 Jim Meyering <jim@meyering.net>
5414 * src/stat.c (human_fstype): Use %lx, not %x format for `unsigned long'.
5415 From Andreas Schwab.
5417 * tests/Makefile.am (TESTS_ENVIRONMENT): Remove `/vg' (prerelease test
5418 remnant) from PATH component. That would cause tests in this directory
5419 not to run the just-built binaries, but rather whatever happened
5420 to be in one's PATH. Reported by Christian Krackowizer.
5422 2004-01-04 Jim Meyering <jim@meyering.net>
5424 * src/csplit.c (new_control_record): Use x2nrealloc
5425 rather than xrealloc.
5427 * src/cp.c (re_protect): Use ASSIGN_STRDUPA rather than
5429 (make_path_private): Likewise.
5431 2004-01-03 Jim Meyering <jim@meyering.net>
5433 * src/paste.c: Use `bool' (not int) as the type for a few
5435 (collapse_escapes): Rewrite to set globals rather than modifying
5437 Use size_t (not int) for all counters and related index variables.
5438 (paste_parallel): Remove needless complexity of
5439 using xrealloc in the loop; just allocate the buffers up front.
5440 Free the two temporary buffers.
5441 Move declarations of locals `down' into scope where used.
5442 (paste_serial): Remove `register' attributes.
5443 (main): Simplify delim-related code.
5444 Free `delims', now that it's malloc'd.
5446 2004-01-02 Jim Meyering <jim@meyering.net>
5448 * src/chroot.c: Include "quote.h".
5449 (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): Define.
5450 (main): Exit with status of 127, not 1, for too-few-args,
5451 chroot failure, or chdir failure.
5452 Give a better diagnostic upon execvp failure.
5454 * src/du.c (usage): Mention that, with its current meaning,
5457 * src/tail.c (main): Warn about following stdin when it's a tty.
5458 Fail when following by name but no names are specified.
5460 2003-12-30 Jim Meyering <jim@meyering.net>
5462 * src/fold.c (main): Use memcpy, not strcpy.
5464 * src/copy.c (copy_internal): Use ASSIGN_STRDUPA rather than
5467 2003-12-28 Jim Meyering <jim@meyering.net>
5469 * src/unexpand.c (n_tabs_allocated): New global.
5470 (add_tabstop): Use x2nrealloc rather than xrealloc.
5471 * src/expand.c: Likewise.
5473 * tests/misc/expand: New file.
5474 * tests/misc/Makefile.am (TESTS): Add expand.
5476 * src/sort.c (add_temp_dir): Use x2nrealloc rather than xrealloc.
5477 (fillbuf): Use x2nrealloc rather than xrealloc.
5478 (sort): Use xnmalloc rather than xmalloc.
5481 2003-12-27 Jim Meyering <jim@meyering.net>
5483 * src/tee.c (tee): Use xnmalloc rather than xmalloc.
5485 2003-12-29 Paul Eggert <eggert@twinsun.com>
5487 * NEWS: Remove support for join -j1 FIELD, -j2 FIELD, and -o LIST1
5488 LIST2 in POSIX 1003.1-2001 hosts, as required by POSIX.
5490 * doc/coreutils.texi (join invocation): Remove documentation
5491 accordingly. Document that -t makes all separators significant.
5493 * src/join.c: Include posixver.h.
5494 (obsolete_usage): New var.
5495 (longopts): Put obsolete options first.
5496 (OBSOLETE_LONG_OPTIONS): New constant.
5497 (get_option, add_file_name): New functions.
5498 (main): Use them to support new behavior.
5499 (usage): Remove documentation for -j1 FIELD and -j2 FIELD.
5500 Do not mark -j FIELD as obsolescent; it is longstanding
5501 UNIX tradition and is a valid extension to POSIX.
5503 * tests/join/Test.pm (tv): Avoid obsolete -o usage.
5505 2003-12-28 Paul Eggert <eggert@twinsun.com>
5507 * src/join.c (add_field_list): Don't use alloca with unbounded
5508 size; just modify the argument, which is no longer const *.
5510 Various other minor cleanups, mostly to avoid the need for casts.
5512 (extract_field): Renamed from ADD_FIELD, as it's now a function.
5514 (struct field.beg): Now char *, not unsigned char const *. All
5515 uses changed. It shouldn't be const since xmemcoll writes on its
5517 (extract_field): Likewise, for 2nd arg.
5518 (keycmp): Remove now-unnecessary cast of xmemcoll args.
5520 (is_blank): New function, to avoid need to cast arg to unsigned char.
5521 (extract_field): Use it.
5523 (xfields): Rewrite pretty much from scratch.
5525 (hard_LC_COLLATE): Now bool, not int.
5526 (get_line, getseq, add_field_list): Now returns bool, not int.
5527 (decode_field_spec, add_field_list): Return true on success (not
5528 false), for consistency with the rest of the code. All uses changed.
5530 (tab): Now char, not unsigned char. This wasn't 100% necessary
5531 but is slightly cleaner.
5532 (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler.
5534 (empty_filler): Now const *.
5536 (make_blank): Remove; wasn't needed. Remove all calls.
5537 (main): Don't set uni_blank.nfields; zero is fine.
5539 2003-12-27 Jim Meyering <jim@meyering.net>
5541 * src/join.c: Include "quote.h".
5542 (min, max): Remove definitions.
5543 Make a few function parameters and corresponding
5544 locals `const'. Use bool for boolean variables.
5545 Use size_t (not int) for all counters and related index variables.
5546 (prjoin): Remove now-useless assertion.
5547 (string_to_join_field): New function.
5548 (main): Accept join fields as large as SIZE_MAX.
5549 (keycmp): Rename `min' to MIN and max to MAX.
5551 2003-12-26 Jim Meyering <jim@meyering.net>
5553 fold -s didn't work on e.g., alpha-based systems.
5554 * src/fold.c (fold_file): Adjust types (int->size_t) so that using
5555 x2nrealloc works properly on systems with differing sizes for int
5556 and size_t. Reported by Nelson Beebe.
5558 * src/fold.c: Use `bool' (not int) as the type for a few
5561 2003-12-23 Paul Eggert <eggert@twinsun.com>
5563 * src/ls.c (length_of_file_names_and_frills):
5564 Remove forward decl; not needed.
5565 (print_file_name_and_frills, length_of_file_name_and_frills):
5566 With -m, don't output spaces before inum or size.
5567 (print_with_commas): Don't output space just before newline.
5569 2003-12-24 Jim Meyering <jim@meyering.net>
5571 * tests/ls/Makefile.am (TESTS): Add m-option.
5572 * tests/ls/m-option: New file. Test for above fixes.
5574 2003-12-20 Jim Meyering <jim@meyering.net>
5578 * src/pr.c: Change type of global, buff_allocated, to size_t.
5580 * src/join.c [struct seq]: Change types of members count and alloc
5581 from `int' to `size_t'.
5583 * tests/Makefile.am (root-hint): Tweak wording.
5585 * src/du.c: Accept new option (-0, --null) that makes it so each
5586 output line is NUL-terminated rather than newline-terminated.
5588 * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync.
5589 Reported by Volker Paul.
5590 * tests/dd/Makefile.am (TESTS): Add unblock-sync.
5591 * tests/dd/unblock-sync: New test for the above.
5593 2003-12-19 Jim Meyering <jim@meyering.net>
5595 * tests/misc/nohup: Double quote back-ticked expression,
5596 in case it ends up having an unexpected value.
5598 * tests/ls/no-arg: Use ls's -1 option in both runs.
5600 * src/du.c (fts_debug): New global.
5601 (FTS_CROSS_CHECK, DEBUG_OPT): Define.
5602 (main): Make fts use FTS_TIGHT_CYCLE_CHECK.
5603 (main) [DU_DEBUG]: Accept -d option.
5605 2003-12-18 Jim Meyering <jim@meyering.net>
5607 * src/ls.c (format_user): Increment dired_pos via two statements,
5608 `dired_pos += width; dired_pos++;' rather than one,
5609 `dired_pos += width + 1;' since the latter could conceivably overflow.
5610 (format_group): Likewise.
5613 * configure.ac: Require automake-1.8.
5615 2003-12-12 Jim Meyering <jim@meyering.net>
5617 * Use automake-1.8. Regenerate dependent files.
5619 2003-12-08 Jim Meyering <jim@meyering.net>
5621 * Makefile.maint (news-date-check): New rule.
5622 (alpha beta major): Depend on it.
5624 2003-12-03 Paul Eggert <eggert@twinsun.com>
5626 * NEWS: ls -l (and similar options) now adjust all columns to
5627 fit the data. Generalized from a suggestion by Leah Q for file sizes.
5628 * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
5629 (format_user_width, format_group_width, unsigned_file_size,
5630 format_group): New functions.
5631 (block_size_width): Renamed from block_size_size.
5632 (inode_number_width, nlink_width, owner_width, group_width,
5633 author_width, major_device_number_width, minor_device_number_width,
5634 file_size_width): New vars.
5635 (clear_files): Initialize them.
5636 (gobble_file): Set them. Don't ceiling block_size_width to 7.
5637 (print_long_file): Use them.
5638 (gobble_file): Use a new local variable 'f' to make the code
5639 smaller and more consistent with other functions.
5640 (format_user): Output to stdout, not to a buffer, so that we
5641 don't have to worry about buffer overrun. Update dired_pos.
5642 (print_long_file): Don't put owner, group, author into buffer;
5643 just print them directly. Don't assume link counts and
5644 major and minor numbers fit into unsigned long int.
5645 * tests/cp/same-file, tests/mv/part-symlink: Don't assume that
5646 'ls' output is fixed-width.
5648 2003-12-02 Jim Meyering <jim@meyering.net>
5650 * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h.
5652 2003-11-27 Jim Meyering <jim@meyering.net>
5654 * Use automake-1.7f. Regenerate dependent files.
5656 2003-11-24 Paul Eggert <eggert@twinsun.com>
5658 Parse floating-point operands and options in the C locale.
5659 POSIX requires this for printf, and we might as well be
5660 consistent elsewhere (tail, sleep, seq).
5662 * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer
5663 needed now that we assume C89. Include "c-strtod.h".
5664 (xstrtod): Call c_strtod, not strtod.
5665 * src/sleep.c: Include "c-strtod.h".
5666 (main): Update xstrtod call to include new argument, c_strtod.
5667 * src/seq.c (scan_double_arg): Likewise.
5668 * src/tail.c (parse_options): Likewise.
5670 2003-11-24 Jim Meyering <jim@meyering.net>
5672 * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM).
5673 Reported by Mark Conty.
5675 2003-11-22 Jim Meyering <jim@meyering.net>
5677 * Makefile.maint (sc_xalloc_h_in_src): Remove rule. Subsumed by...
5678 (sc_system_h_headers): Do this test only if sys2.h exists.
5680 2003-11-20 Jim Meyering <jim@meyering.net>
5682 * tests/help-version: Ensure that the bug-reporting address is
5683 included in the --help output for every program.
5684 * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.
5686 * src/ptx.c (usage): Output bug-reporting address.
5687 Reported by Dan Jacobson.
5689 2003-11-19 Jim Meyering <jim@meyering.net>
5691 * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted
5692 on the join fields. Suggestion from Bruce Robertson.
5694 2003-11-18 Jim Meyering <jim@meyering.net>
5696 `od -c -w9999999' could segfault
5697 * src/od.c (dump): Use xnmalloc/free, not alloca.
5699 2003-11-16 Jim Meyering <jim@meyering.net>
5701 * Use autoconf-2.59. Regenerate dependent files.
5703 * tests/du/hard-link: Minor tweak: use mkdir -p.
5705 Fix read-from-free'd-buffer error detected by valgrind.
5706 * src/csplit.c (remove_line): Don't return a pointer to data in
5707 a freed buffer. Instead, arrange to free the buffer on the
5710 * tests/misc/csplit: New test for above fix.
5712 2003-11-11 Jim Meyering <jim@meyering.net>
5714 * src/ls.c (extract_dirs_from_files): Avoid useless copy operations.
5715 This avoids a warning from valgrind about memcpy with overlapping
5716 source and destination.
5718 * configure.ac: Require automake-1.7.8.
5720 2003-11-09 Jim Meyering <jim@meyering.net>
5722 * Use automake-1.7.9. Regenerate dependent files.
5724 * src/rm.c: Support new options: --preserve-root and --no-preserve-root.
5725 * src/chown.c: Likewise.
5727 * src/chown-core.c: Include "root-dev-ino.h".
5728 (chopt_init): Initialize new member.
5729 (change_file_owner): Support rm's new --preserve-root option.
5731 * src/remove.c: Include "root-dev-ino.h".
5732 (remove_cwd_entries): Remove now-obsolete FIXME comment.
5733 (remove_dir): Support rm's new --preserve-root option.
5735 * src/chown.c: Include "root-dev-ino.h".
5736 Add new options: --preserve-root and --no-preserve-root.
5738 * src/chmod.c: Include "root-dev-ino.h".
5739 (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
5740 ROOT_DEV_INO_WARN macros.
5741 (get_root_dev_ino): Remove function definition, now that it's
5742 been moved to a separate file.
5743 (usage): Describe new options.
5745 * src/mv.c (rm_option_init): Initialized new member.
5747 * src/remove.h: Include "dev-ino.h".
5748 (struct rm_options): Add new member: root_dev_ino.
5749 * src/chown-core.h: Include "dev-ino.h".
5750 (struct Chown_option): Add new member: root_dev_ino.
5752 2003-11-06 Jim Meyering <jim@meyering.net>
5754 * src/paste.c (paste_parallel): Use `sizeof *var' rather than
5755 hard-coding `sizeof FILE*'.
5757 2003-11-05 Dennis Smit <ds@nerds-incorporated.org>
5759 * src/wc.c (main): Free `fstatus' so there is no confusion about
5760 whether it's leaked or not.
5761 * src/who.c (who): Likewise for `utmp_buf'.
5763 2003-11-05 Paul Eggert <eggert@twinsun.com>
5765 Fix 'cut' problems with size_t overflow and unsigned int.
5766 More generally, resize integer variables to fit use more precisely.
5767 * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens.
5768 (struct range_pair): Make members to be of type size_t, not unsigned.
5769 (max_range_endpoint, eol_range_start): Now size_t, not unsigned.
5770 (suppress_non_delimited, output_delimiter_specified,
5771 have_read_stdin, print_kth, set_fields): Now bool, nt int.
5772 (delim): Now unsigned char, not int.
5773 (mark_printable_field, is_printable_field, is_range_start_index,
5774 set_fields, set_fields, cut_bytes, cut_fields):
5775 Use size_t, not unsigned, for field and byte counts.
5776 (hash_int): Use uintptr_t, not unsigned, for pointers converted
5777 to integers. This squeezes more info out of them.
5778 (set_fields, cut_bytes, cut_fields, main):
5779 Use bool, not int, for booleans.
5780 (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc.
5782 2003-11-05 Paul Eggert <eggert@twinsun.com>
5784 * man/Makefile.am (check-programs-vs-x):
5785 Work even if $(programs) contains '$'.
5786 Work even if 'missing=1' in environment.
5787 Don't report an error simply because $(programs) outputs nothing.
5789 2003-11-05 Jim Meyering <jim@meyering.net>
5791 * Use autoconf-2.58. Regenerate dependent files.
5793 * src/tr.c (spec_init): Fix typo in last change.
5795 * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in
5796 call to variadic version_etc function, so that it works even on systems
5797 for which sizeof char* != sizeof int.
5798 * src/true.c (main): Likewise.
5799 * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c:
5800 * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c:
5801 * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c:
5802 * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c:
5803 Similarly, cast NULL to `(char *)' in call to variadic function,
5804 parse_long_options, so that it works even on systems for which
5805 sizeof char* != sizeof int.
5806 A similar problem was reported by Harti Brandt in
5807 http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html.
5809 * src/users.c (users): Free `utmp_buf' explicitly so that people
5810 don't mistake this for a real leak.
5811 Patch by Dennis Smit <ds@nerds-incorporated.org.
5813 2003-11-04 Paul Eggert <eggert@twinsun.com>
5815 * README: Document _POSIX2_VERSION.
5817 2003-11-04 Jim Meyering <jim@meyering.net>
5819 * src/tac.c (memrchr): Remove #if-0'd function.
5820 (tac_stdin_to_mem): Clean up #if-0'd code.
5822 * src/od.c (decode_format_string): Remove unnecessary casts.
5823 Use more maintainable `sizeof *var'.
5824 (main): Call decode_format_string rather than decode_one_format,
5825 now that `spec' may be NULL.
5827 * src/chmod.c (AUTHORS): Add my name.
5829 * src/split.c (next_file_name): Use `sizeof *var' rather than
5830 hard-coding `sizeof size_t'.
5832 * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...).
5834 * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc,
5835 to avoid potential overflow in pointer arithmetic.
5836 (set_fields): Use not `1', but rather `sizeof *printable_field' as
5837 second argument to xcalloc.
5838 * src/od.c (decode_format_string, dump_strings): Use x2nrealloc
5839 rather than xrealloc.
5840 * src/date.c (show_date): Likewise.
5841 * src/join.c (ADD_FIELD, initseq, getseq): Likewise.
5842 * src/pr.c (store_char): Likewise.
5843 * src/fold.c (fold_file): Likewise.
5845 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
5846 type changes (unsigned int -> size_t) in hash.c.
5847 * src/cp-hash.c (src_to_dest_hash): Likewise.
5848 * src/du.c (entry_hash): Likewise.
5849 * src/ls.c (dev_ino_hash): Likewise.
5850 * src/cut.c (hash_int): Likewise. Declare function as static.
5852 2003-11-03 Jim Meyering <jim@meyering.net>
5854 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
5855 * tests/misc/fold: Fail the test immediately if we're not running
5856 the expected version of fold.
5858 2003-11-02 Jim Meyering <jim@meyering.net>
5860 * src/tr.c (append_normal_char, append_range, append_char_class)
5861 (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var'
5862 rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable
5863 and usually shorter.
5864 * src/copy.c (copy_internal): Likewise.
5865 * src/join.c (initseq, add_field, make_blank): Likewise.
5866 * src/od.c (main): Likewise.
5867 * src/cp.c (make_path_private): Likewise.
5868 * src/tsort.c (new_item, record_relation): Likewise.
5870 * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise.
5871 (main): Also remove anachronistic cast of xmalloc return value.
5872 * src/ptx.c (alloc_and_compile_regex, main): Likewise.
5873 (main): Also remove anachronistic cast of xmalloc return value.
5874 * src/sort.c (inittables): Likewise.
5875 (sort): Also Split a long line.
5877 2003-10-25 Jim Meyering <jim@meyering.net>
5879 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
5880 type changes (unsigned int -> size_t) in hash.c.
5881 * src/cp-hash.c (src_to_dest_hash): Likewise.
5882 * src/du.c (entry_hash): Likewise.
5883 * src/ls.c (dev_ino_hash): Likewise.
5884 * src/cut.c (hash_int): Likewise. Declare function as static.
5886 2003-10-21 Jim Meyering <jim@meyering.net>
5888 Don't fail when run with VERBOSE=yes.
5889 * tests/chgrp/basic: Do `set +x' before starting the subshell
5890 from which we invoke chgrp. Otherwise, the output from the
5891 VERBOSE=yes-induced `set -x' would result in spurious differences.
5892 Reported by Russel Coker via Michael Stone.
5894 2003-10-19 Jim Meyering <jim@meyering.net>
5896 chmod now uses fts to perform a directory traversal when -R is
5897 specified. Before, it operated on full path names, and as such
5898 would encounter the PATH_MAX (often 4096) limit.
5900 * src/chmod.c: Include "xfts.h".
5901 (process_file): Rename from change_file_mode.
5902 Adapt to be used with fts.
5903 (process_files): New function.
5905 2003-10-18 Jim Meyering <jim@meyering.net>
5907 * tests/du/deref-args: Ensure that du -D now dereferences all
5908 symlinks specified on the command line, not just those that
5909 reference directories.
5911 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
5912 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
5913 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
5914 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
5915 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
5916 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
5917 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
5918 * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
5919 of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
5920 Update the call to parse_long_options so that `AUTHORS, NULL' are the
5922 * src/true.c (main): Append NULL to version_etc argument list.
5923 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
5925 2003-10-17 Andreas Schwab <schwab@suse.de>
5927 * tests/mk-script: Get $srcdir from first parameter instead of
5929 (main): Update usage.
5931 * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as
5932 first argument of mk-script.
5933 ($(srcdir)/Makefile.am): Likewise. Prepend $(srcdir) to target.
5935 2003-10-17 Jim Meyering <jim@meyering.net>
5937 * src/mv.c (usage): Tweak descriptions of -i and -f so that the
5938 generated `man' page is more readable. Suggestion from Dan Jacobson.
5940 * src/chown-core.c (change_file_owner): Handle the cases in
5941 which fts_info indicates an error with the given entry.
5943 * src/du.c (main): Simply assign to bit_flags.
5944 Don't bother with bit arithmetic.
5946 * tests/chmod/no-x: New file.
5947 * tests/chgrp/no-x: New file.
5948 * tests/chmod/Makefile.am (TESTS): Add no-x.
5949 * tests/chgrp/Makefile.am (TESTS): Likewise.
5951 * src/du.c: Include "xfts.h".
5952 (du_files): Use xfts_open, rather than fts_open.
5953 * src/chown-core.c (chown_files): Likewise.
5955 2003-10-16 Jim Meyering <jim@meyering.net>
5957 * src/chgrp.c (main): Simply assign to bit_flags.
5958 Don't bother with bit arithmetic.
5959 * src/chown.c (main): Likewise.
5960 Rename a couple of local variables.
5961 Remove unnecessary casts.
5963 * src/tail.c (start_bytes): Rename local, remainder, to avoid
5964 gcc's warning about shadowing a global.
5966 2003-10-15 Jim Meyering <jim@meyering.net>
5968 chown and chgrp now accept POSIX-mandated -H, -L, -P options and
5969 use fts to perform a directory traversal when -R is specified.
5970 Before, they operated on full path names, and as such would
5971 encounter the PATH_MAX (often 4096) limit.
5972 They are more efficient. For example, before, chgrp -R would
5973 take almost 5 seconds to change about 2000 directories and fail
5974 (with `File name too long'), while now it succeeds on a hierarchy
5975 of depth 20,000 in 1/10 the time.
5977 * src/chown.c: Include "userspec.h" and "fts_.h".
5978 (WRITTEN_BY): Add my name.
5979 (getpwnam, getgrnam, getgrgid): Remove declarations.
5980 (endpwent): Remove definition.
5982 (main): Handle new options.
5983 Call new function, chown_files rather than change_file_owner.
5985 * src/chgrp.c: Include "fts_.h".
5986 (WRITTEN_BY): Add my name.
5987 (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of
5990 (main): Handle new options.
5991 Call new function, chown_files rather than change_file_owner.
5993 Rewrite to iterate through hierarchies using fts rather than
5994 via explicit recursion.
5995 * src/chown-core.c: Include "fts_.h"
5996 (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
5997 on a single file at a time.
5998 (chown_files): New function.
5999 * src/chown-core.h [enum Dereference_symlink]: Remove declaration.
6000 [struct Chown_option] (recurse, force_silent): Change type to `bool'.
6001 [struct Chown_option] (dereference): Remove member with ambiguous name.
6002 [struct Chown_option] (affect_symlink_referent): New member.
6003 (chown_files): New prototype.
6005 * tests/chgrp/recurse: Update tests accordingly.
6006 * tests/chgrp/posix-H: New tests for the above.
6007 * tests/chgrp/Makefile.am (TESTS): Add posix-H.
6009 * src/ln.c (usage): Clarify that --directory, -d, -F probably won't
6010 work even for superuser. Suggestion from Dan Jacobson.
6012 2003-10-14 Paul Eggert <eggert@twinsun.com>
6014 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
6016 * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h,
6017 lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib.
6018 * src/sort.c (parse_field_count): Handle the case where overflow
6019 and invalid suffix char are both reported.
6021 2003-10-14 Jim Meyering <jim@meyering.net>
6023 * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the
6024 warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
6027 2003-10-13 Paul Eggert <eggert@twinsun.com>
6029 Fix to avoid a denial-of-service attack if the display width is
6030 enormous. Also, clean up the code a bit by removing duplicate code.
6032 * src/ls.c (init_column_info): Remove forward decl; no longer needed.
6033 (calculate_columns): New function, that contains code that used
6034 to be common to print_many_per_line and print_horizontal.
6035 (print_many_per_line, print_horizontal): Use it.
6036 (decode_switches): Set max_idx here, not in calculate_columns.
6037 (print_current_files): Don't call init_column_info; calculate_columns
6039 (init_column_info): Don't allocate a lot more space than is needed
6040 to represent the current set of files. Allocate all the new
6041 size_t cells in one call to xnmalloc, rather than a row at a time.
6043 2003-10-13 Jim Meyering <jim@meyering.net>
6045 * src/ls.c (init_column_info): Add another FIXME comment.
6047 2003-10-13 Paul Eggert <eggert@twinsun.com>
6049 Fix address-arithmetic bug in 'ls', reported by Georgi Guninski.
6050 Remove several arbitrary limits on hosts where int cannot represent
6053 * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent,
6054 nfiles, files_index, tabsize, line_length, struct column_info.line_len,
6055 struct column_info.col_arr[0], max_idx):
6056 Now size_t, not int.
6057 (get_funky_string): Return bool indicating success, instead of
6058 a negative count to indicate failure. Store number of columns
6059 through new parameter OUTPUT_COUNT; that way, they can never
6060 go negative. Change equals_end from int to bool. All uses
6062 (struct column_info.valid_len): Now bool, not int. All uses changed.
6063 (dired_dump_obstack, get_funky_string, clear_files,
6064 extract_dirs_from_files, print_current_files,
6065 print_many_per_line, print_horizontal, init_column_info,
6066 put_indicator, length_of_file_name_and_frills,
6067 print_with_commas): Use size_t, not int, for local variables
6069 (decode_switches): Decode sizes using xstrtoul, not xstrtol.
6070 Check for TIOCGWINSZ returing negative values (or values greater
6072 (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
6074 Use xmalloc and xnmalloc, not XMALLOC.
6075 (gobble_file): Use xnrealloc, not XREALLOC.
6076 (print_color_indicator): Remove now-unnecessary cast to size_t.
6078 2003-10-12 Paul Eggert <eggert@twinsun.com>
6080 * tests/du/no-x: Change wording of diagnostic to match latest du.c.
6081 * tests/sort/sort-tests: Remove from CVS; assume that people
6082 brave enough to check coreutils out from CVS can rebuild it.
6084 2003-10-12 Jim Meyering <jim@meyering.net>
6086 New options: --preserve-root and --no-preserve-root.
6087 * src/chmod.c (change_file_mode): Honor new option.
6088 (change_file_mode): Strip trailing slashes on directory
6089 argument passed to change_dir_mode.
6090 (get_root_dev_ino): New function.
6091 (main): Initialize global, root_dev_ino.
6093 * src/copy.c (copy_internal): Don't #ifdef-out simple uses of
6094 S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined
6096 * src/chmod.c (change_file_mode): Likewise.
6098 2003-10-08 Jim Meyering <jim@meyering.net>
6100 * src/csplit.c (main): Remove obsolete FIXME.
6102 2003-10-07 Jim Meyering <jim@meyering.net>
6104 * Use automake-1.7.8. Regenerate dependent files.
6106 2003-09-29 Paul Eggert <eggert@twinsun.com>
6110 * doc/coreutils.texi (csplit invocation):
6111 The regexp offset need not have a sign; POSIX requires support
6112 for signless offets.
6114 Be more careful about int widths. For example, remove some
6115 arbitrary limits by replacing 'unsigned' with 'size_t',
6116 'uintmax_t', etc. Use standard bool rather than a homegrown type.
6117 * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
6118 * src/csplit.c (FALSE, TRUE, boolean): Remove. All uses changed
6119 to <stdbool.h> usage.
6120 (struct control): offset is now intmax_t, not int.
6121 repeat_forever is now bool, not int.
6122 (struct cstring): len is now size_t, not unsigned int.
6123 (struct buffer_record): bytes_alloc, bytes_used, num_lines are now
6124 size_t, not unsigned. start_line, first_available are now
6125 uintmax_t, not unsigned.
6126 (hold_count, control_used): Now size_t, not unsigned.
6127 (last_line_number, current_line, bytes_written):
6128 Now uintmax_t, not unsigned.
6129 (save_to_hold_area, red_input, keep_new_line, record_line_starts,
6130 create_new_buffer, get_new_buffer, load_buffer, find_line,
6131 process_regexp, split_file, new_control_record, extract_regexp,
6132 get_format_width, get_format_prec, max_out):
6133 size args, locals, and returned values are now size_t, not unsigned
6135 (get_first_line_in_buffer, find_line, write_to_file,
6136 handle_line_error, process_line_count, regexp_error, process_regexp,
6138 File line, byte, and repetition counts are now uintmax_t, not unsigned.
6139 (check_for_offset): Don't require a sign before the offset.
6140 Use xstrtoimax to do the real work.
6141 (extract_regexp): Remove harmful cast of size to unsigned.
6142 256 -> 1<<CHAR_BIT, for clarity.
6143 (get_format_flags): Return at most 3, to avoid worries about overflow.
6145 (bytes_to_octal_digits): Remove.
6147 (cleanup): Don't check whether output_stream is NULL, since
6148 close_output_file does that for us.
6150 (new_line_control, create_new_buffer): Use "foo *p = xmalloc
6151 (sizeof *p);" instead of the more long-winded alternatives.
6153 (get_new_buffer): Use O(1) algorithm for resizing a buffer
6154 to a much larger size, instead of an O(N) algorithm.
6156 (process_regexp): Use plain NULL rather than casted 0.
6158 (make_filename): Use %u, not %d, to format unsigned file number.
6160 (new_control_record): Use xrealloc exclusively, since it handles
6163 (extract_regexp): Change misspelled word in diagnostic.
6165 (get_format_width): Even if a minimum field width is specified,
6166 allow room for enough octal digits to represent the value of
6167 the maximum representible integer. This fixes a potential
6168 buffer overrun. Calculate this room at compile-time, not
6169 at run-time; this removes the need for bytes_to_octal_digits.
6170 Check for overflow; this removes a FIXME.
6172 (get_format_prec): Don't allow precision to be signed; it's
6173 not ANSI. Check for overflow. Remove hardcoded "11" as
6174 default precision; this fixes a potential buffer overrun
6175 on hosts with wider size_t.
6177 (get_format_conv_type): Change local variable to be of type
6178 unsigned char, not int; this removes a potential subscript
6179 violation on hosts where char is signed.
6181 (max_out): Replace "for (;*p;)" with more-standard "while (*p)".
6182 Allow "%%" in format. Don't overflow when
6183 counting lots of percents.
6185 (usage): Default sprintf format is %02u, not %d.
6187 2003-10-05 Jim Meyering <jim@meyering.net>
6189 * src/chown-core.c (change_file_owner): Remove set-but-not-used local.
6191 * src/du.c (du_files): Mark diagnostic for translation.
6193 2003-10-04 Jim Meyering <jim@meyering.net>
6195 * src/du.c (du_files): Ignore any failure of fts_close.
6196 Give better diagnostics for failed fts_open.
6198 * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition.
6200 Deprecate existing use of -H (aka --si).
6201 * src/du.c (enum) [HUMAN_SI_OPTION]: New member.
6202 [long_options]: Use HUMAN_SI_OPTION, not 'H'.
6203 (main): Warn that the meaning of -H will soon change to be
6206 2003-10-03 Jim Meyering <jim@meyering.net>
6208 * src/du.c: Accept --no-dereference (-P).
6210 2003-10-02 Jim Meyering <jim@meyering.net>
6212 * tests/du/trailing-slash: Adjust for slightly different output.
6214 Rewrite du.c to use fts.
6215 * src/du.c: Include "fts_.h", not ftw.h.
6216 (opt_dereference_arguments, arg_length, suffix_length): Remove globals.
6217 (IS_FTW_DIR_TYPE): Remove definition.
6218 (IS_DIR_TYPE): Define.
6219 (is_symlink_to_dir): Remove now-unnecessary function.
6220 (process_file, du_files): Rewrite to use fts.
6222 * tests/du/inaccessible-cwd: Ensure that even when run from an
6223 inaccessible directory, du can still operate on accessible
6224 directories elsewhere.
6225 * tests/du/Makefile.am (TESTS): Add inaccessible-cwd.
6227 * tests/rm/deep-1: Ensure that du can process a hierarchy
6228 of depth 400 while using no more than 50KB of stack space.
6230 2003-10-01 Akim Demaille <akim@epita.fr>
6232 * announce-gen (print_news_deltas): New function, extracted from main.
6233 (main): Make `news_file' an array.
6234 Use '...=s' => \@var for --news and --url-directory specs.
6235 Before there were a couple of portability problems.
6237 2003-09-28 Jim Meyering <jim@meyering.net>
6239 * Makefile.maint (sc_cast_of_alloca_return_value): New rule.
6240 (syntax-check-rules): Add it.
6242 * src/copy.c: Remove unnecessary cast of alloca, since now it's
6243 guaranteed to be (void *).
6244 * src/cp.c: Likewise.
6245 * src/join.c: Likewise.
6246 * src/ln.c: Likewise.
6247 * src/ls.c: Likewise.
6248 * src/od.c: Likewise.
6249 * src/sys2.h (ASSIGN_STRDUPA): Likewise.
6251 2003-09-27 Jim Meyering <jim@meyering.net>
6253 Don't exhaust virtual memory when processing large inputs.
6254 Fix this by removing csplit's internal free-list management;
6255 instead rely on malloc for that.
6257 * src/csplit.c (free_list): Remove global.
6258 (clear_all_line_control): Remove function.
6259 (get_new_buffer): Always use create_new_buffer to obtain a
6260 new buffer, rather than searching free_list.
6261 (free_buffer): Just call free.
6262 Reported by Nikola Milutinovic.
6264 2003-09-26 Jim Meyering <jim@meyering.net>
6266 * man/rm.x: Also list `chattr' in SEE ALSO section.
6267 Suggestion from Mark Hubbart.
6269 2003-09-25 Jim Meyering <jim@meyering.net>
6271 * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now
6272 that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them.
6274 * Use autoconf-2.57d. Regenerate dependent files.
6276 2003-09-24 Jim Meyering <jim@meyering.net>
6278 Minor efficiency tweak.
6279 * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
6280 (do_link): Likewise.
6282 2003-09-23 Jim Meyering <jim@meyering.net>
6284 * src/paste.c (paste_serial): Save errno after input error,
6285 to report proper errno value.
6286 Based on a patch from Paul Eggert.
6288 * src/tee.c (tee): Adjust fwrite arguments so that the return
6289 value is the number of bytes written.
6291 2003-09-16 Paul Eggert <eggert@twinsun.com>
6293 Don't assume ferror sets errno. Bug reported by Bruno Haible.
6295 * src/comm.c (compare_files): Save errno after input error,
6296 to report proper errno value.
6297 * src/fold.c (fold_file): Likewise.
6298 * src/od.c (check_and_close, skip, read_char, read_block): Likewise.
6299 * src/unexpand.c (unexpand): Likewise.
6301 * src/csplit.c (close_output_file): Don't report bogus errno value
6302 after ferror discovers an output error. We don't know the proper
6303 errno value, since it might have been caused by any of a whole
6304 bunch of calls, and it might have been trashed in the meantime.
6305 Fixing this problem will require much more extensive changes;
6306 in the meantime just say "write error".
6307 * src/od.c (check_and_close, dump, dump_strings): Likewise.
6308 * src/uniq.c (check_file): Likewise.
6310 * src/join.c (get_line): Report error right away if I/O fails,
6311 so that the proper errno value is used.
6312 * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise.
6313 * src/tee.c (tee): Likewise.
6314 * src/uniq.c (check_file): Likewise.
6316 * src/od.c (skip): If a read fails, don't retry it later, so
6317 that we report the proper errno.
6319 * src/tac.c (tac_mem): Don't return a value; nobody uses it.
6321 * src/tee.c (tee): Once a write failure has occurred, don't bother
6322 writing anything more to that stream.
6324 * src/uniq.c (check_file): Check for ferror (stdout) even if
6327 * src/yes.c (UNROLL): Remove.
6328 (main): Exit immediately when write failure is detected.
6329 Simplify code by assigning to argv when argc == 1.
6331 2003-09-21 Paul Eggert <eggert@twinsun.com>
6333 * src/ptx.c: Switch encoding from Latin-1 to UTF-8.
6334 (WRITTEN_BY): Change "Franc,ois" (actually using
6335 c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
6338 2003-09-19 Jim Meyering <jim@meyering.net>
6340 `du -D symlink-to-dir' would mistakenly omit the slash in
6341 lines like this: 24 symlink-to-dir/subdir
6342 * src/du.c (process_file): Fix offset calculation.
6343 Reported by Jeff Sheinberg as Debian bug #211591;
6344 http://bugs.debian.org/205251
6346 * tests/du/deref-args: New file/test for the above.
6347 * tests/du/Makefile.am (TESTS): Add deref-args.
6349 * src/du.c (process_file): Remove useless disjunct.
6351 * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
6353 * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
6354 Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
6355 Mark each WRITTEN_BY string as translatable.
6357 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
6358 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
6359 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
6360 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
6361 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
6362 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
6363 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
6364 * who.c, whoami.c, yes.c: Revert yesterday's changes.
6365 Instead, a subsequent change will embed `Written by ' in
6366 each string along with the author names.
6368 * src/true.c: Revert yesterday's changes.
6369 * src/sys2.h: Likewise.
6371 2003-09-18 Jim Meyering <jim@meyering.net>
6373 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
6374 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
6375 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
6376 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
6377 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
6378 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
6379 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
6380 * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
6381 comma-separated list of strings and/or update the call to
6382 parse_long_options so that `AUTHORS, NULL' are the last parameters.
6383 * src/true.c (main): Append NULL to version_etc argument list.
6384 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
6386 * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
6387 shadowing the math function name. Also rename loga to log_a.
6389 2003-09-14 Jim Meyering <jim@meyering.net>
6391 * src/factor.c (print_factors): Give a separate diagnostic
6392 for numbers that are too large, but otherwise valid.
6393 Reported by Dániel Varga.
6395 2003-09-10 Jim Meyering <jim@meyering.net>
6397 * Use automake-1.7.7. Regenerate dependent files.
6399 * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
6400 of `fmt -1'. Using the just-built tr is a little cleaner.
6401 Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
6402 * man/Makefile.am (programs, check-x-vs-1): Likewise.
6404 2003-09-09 Jim Meyering <jim@meyering.net>
6406 * src/copy.c: Alphabetize includes.
6407 Remove duplicate inclusion of "same.h".
6409 2003-09-08 Jim Meyering <jim@meyering.net>
6411 * Makefile.maint (GZIP_ENV): Remove --rsyncable.
6412 Didn't give enough of a benefit, mainly because it's not yet
6417 * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
6418 (check-programs-vs-x): Fail if $(programs) is empty.
6420 * src/remove.c: Add a comment.
6422 2003-09-07 Jim Meyering <jim@meyering.net>
6424 * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
6425 Don't define. These symbols are no longer used.
6427 * tests/misc/tty-eof: Write ^D as \cD.
6428 Complete the change of 2003-08-02.
6430 * Makefile.maint (po-check): Use cvsu, so that a temporary source
6431 file in lib/ or src/ doesn't induce an unwarranted failure.
6432 Add a kludge to filter out the sole generated source file that
6433 also has translatable messages: src/false.c.
6435 2003-09-06 Jim Meyering <jim@meyering.net>
6437 * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
6438 (parse_options): Give a diagnostic for (but still accept) the
6439 deprecated --allow-missing option.
6441 2003-09-04 Paul Eggert <eggert@twinsun.com>
6443 Don't ignore -S if input is a pipe. Bug report by Michael McFarland in
6444 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
6446 * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the
6447 size_bound ourselves. if an input file is a pipe and the user
6448 specified a size, use that size instead of trying to guess the
6449 pipe size. This has the beneficial side effect of avoiding the
6450 overhead of default_sort_size in that case. All callers changed.
6451 (sort): Remove static var size; now done by sort_buffer_size.
6453 2003-09-05 Jim Meyering <jim@meyering.net>
6455 * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files.
6457 * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
6458 to start, rather than just .1. Upon failure, print unexpected state.
6460 2003-09-04 Paul Eggert <eggert@twinsun.com>
6462 * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
6463 SAFE_READ_ERROR to tmp->nbytes.
6464 * src/tail.c (pipe_lines, pipe_bytes): Likewise.
6466 * src/head.c (struct linebuffer): Change nbytes and nlines
6467 from unsigned int to size_t. unsigned int is safe (after the
6468 2003-09-03 patch) but size_t is cleaner.
6469 * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
6470 (pipe_bytes): Likewise for local variable 'i', which was 'int'.
6472 Standardize on BUFSIZ as opposed to other macro names and values.
6473 * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ.
6474 * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
6475 stdio.h has always defined it,
6476 and other code already assumes it's defined.
6477 * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
6478 (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
6479 (io_buf): IO_BUF_SIZE -> BUFSIZ.
6481 2003-09-04 Paul Eggert <eggert@twinsun.com>
6483 * src/seq.c (step): Default to 1.
6484 (print_numbers): Allow the output to be empty.
6485 (main): The default step is 1, even if LAST < FIRST;
6486 as per documentation.
6487 * tests/seq/basic (onearg-2): Output should be empty.
6489 2003-09-05 Jim Meyering <jim@meyering.net>
6491 * Makefile.cfg (wget_files): Temporarily disable, until master
6492 versions are restored to ftp.gnu.org.
6494 * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
6496 Make seq's --width (-w) option work properly even when the
6497 endpoint requiring the larger width is negative and smaller than
6499 * src/seq.c (get_width_format): Include `-' in the set of bytes
6500 allowed in a `simple' number (no decimal point, no exponent).
6501 Reported by Patrick Mauritz.
6503 2003-09-02 Paul Eggert <eggert@twinsun.com>
6505 * NEWS: sort -t '\0' now uses a NUL tab.
6506 sort option order no longer matters, unless POSIX requires it.
6507 * src/sort.c (usage): Say "blanks" instead of "whitespace",
6508 Similar fixes for many comments.
6509 (TAB_DEFAULT): New constant, so that we can support NUL as
6510 the field separator.
6511 (tab): Now int, not char. Initialize to TAB_DEFAULT.
6512 (specify_sort_size): If multiple sizes are specified, use the largest.
6513 (begfield, limfield): Support NUL tab char.
6514 (set_ordering): Do not let -i override -d.
6515 (main): Report an error if incompatible -o or -t options are given.
6516 Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
6518 2003-09-05 Jim Meyering <jim@meyering.net>
6520 * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
6522 2003-09-03 Andreas Schwab <schwab@suse.de>
6524 Bug report and patch here:
6525 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
6526 * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
6527 * src/head.c (elide_tail_lines_pipe): Likewise.
6529 2003-09-03 Jim Meyering <jim@meyering.net>
6531 * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
6532 small amount of code from him was first moved to lib/human.c, and was
6533 subsequently rewritten entirely.
6534 * src/df.c (AUTHORS): Likewise.
6536 2003-08-22 Lawrence Teo <lcteo@uncc.edu>
6538 * src/md5sum.c (split_3): Accept the BSD format for generic
6539 message digest modes. Currently works with BSD's MD5 and SHA1
6540 formats since these are the two algorithms presently used in
6541 coreutils. Updated comments to reflect this change.
6542 (bsd_split_3): Updated comments.
6544 * tests/md5sum/basic-1: New test to make sure that
6545 `md5sum --check' doesn't accept the BSD SHA1 format (adapted
6546 from `check-bsd' test in tests/sha1sum/basic-1).
6548 * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
6549 --check exit status and BSD SHA1 format (adapted from tests
6550 in tests/md5sum/basic-1).
6552 2003-08-30 Jim Meyering <jim@meyering.net>
6554 * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
6556 When source and destination arguments refer to the same file, reside
6557 on a partition (e.g. VFAT) on which distinct names may refer to the
6558 same directory entry (often due to variations in case), and when the
6559 link count for the file is 1, mv no longer unlinks the file. Instead,
6560 it gives the expected diagnostic that the source and destination are
6561 the same. WARNING: this is an incomplete fix. If the file happens
6562 to have a link count of 2 or greater, such an erroneous mv command
6563 will still unlink it.
6564 Although that is not possible on vfat or umsdos, it is possible on
6565 other file system types, e.g., ntfs, and hpfs.
6566 * src/copy.c (same_file_ok): Invoke same_name (which might still
6567 return false for names that refer to the same directory entry)
6568 only if the link count is 2 or more.
6569 * tests/mv/vfat: Show how to demonstrate the above problem.
6570 This test is not run.
6571 * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
6573 2003-08-27 Jim Meyering <jim@meyering.net>
6575 * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
6576 who's -l option has been eliciting an unconditional warning about
6577 this impending change since sh-utils-2.0.12 (April 2002).
6579 * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
6580 This would happen for nonempty files not ending with a newline.
6581 Reported by Dan Jacobson.
6582 * tests/misc/paste-no-nl: New file. Test for above-fixed bug.
6583 * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
6585 * src/stat.c (print_it): Avoid buffer overrun that would
6586 occur when the user-specified format string ends with `%'.
6587 Patch by Tommi Kyntola.
6588 * tests/misc/stat-fmt: New file. Test for above-fixed bug.
6589 * tests/misc/Makefile.am (TESTS): Add stat-fmt.
6591 2003-08-26 Jim Meyering <jim@meyering.net>
6593 Apply changes from bison.
6594 * GNUmakefile (SHELL): Define to `sh', if necessary.
6596 * Makefile.maint (WGETFLAGS): Define to `-C off'.
6597 Update all uses of $(WGET).
6599 2003-08-22 Akim Demaille <akim@epita.fr>
6601 * Makefile.cfg (local-checks-to-skip): New.
6602 * Makefile.maint (local-check): Rename as...
6603 (local-checks-available): this.
6606 2003-08-26 Akim Demaille <akim@epita.fr>
6608 * announce-gen (print_changelog_deltas): Neutralize "<#" as
6609 "<\#" to avoid magic from Gnus when posting parts of this script.
6611 2003-08-25 Jim Meyering <jim@meyering.net>
6613 * src/stat.c (main): Warn about use of deprecated `-l' option.
6615 2003-08-22 Jim Meyering <jim@meyering.net>
6617 * src/stat.c (do_stat): For link count at end of line, use %h format,
6618 instead of %-5h. The latter would make stat emit trailing spaces.
6619 Reported by Dan Jacobson.
6621 2003-08-20 Jim Meyering <jim@meyering.net>
6623 * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
6625 2003-08-19 Jim Meyering <jim@meyering.net>
6627 * src/system.h: Include stdlib.h unconditionally,
6628 as we're now assuming that part of hosted C89.
6630 2003-08-18 Jim Meyering <jim@meyering.net>
6632 * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
6633 to avoid warnings from gcc.
6635 2003-08-17 Jim Meyering <jim@meyering.net>
6637 Avoid unnecessary and sometimes time-consuming hostname lookups.
6638 * src/who.c (print_user): Use strchr, not strrchr.
6639 * src/pinky.c (print_entry): Likewise.
6640 Patch by Michael Stone.
6641 This fixes a typo I introduced in who-users.c on 1996-02-23.
6643 * Makefile.maint (makefile-check): Add 0-9 to the range of characters
6644 disallowed between `@...@'.
6646 2003-08-16 Paul Eggert <eggert@twinsun.com>
6648 * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
6649 done by gnulib .m4 files.
6650 (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
6651 * src/sys2.h (strtoull): Remove unused declaration.
6653 2003-08-16 Jim Meyering <jim@meyering.net>
6655 * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
6658 * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
6659 race condition bug. The bug would be triggered when tailing a file
6660 with file pointer not at beginning of file, and where the file was
6661 truncated to have a length of less than the initial offset at just
6662 the right moment (between the two lseek calls in this function).
6664 An invalid initial value for *read_pos would result in
6665 `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
6666 busy-wait rather than sleeping between iterations. The bug manifests
6667 itself only when tailing regular files that are initially nonempty.
6668 * src/tail.c (tail_bytes): Set *read_pos to new file offset after
6670 (tail_lines): Likewise, after lseek calls.
6671 Reported by Nick Estes. See http://bugs.debian.org/205251 for details.
6672 * tests/tail-2/tail-n0f: New file. Test for above fix.
6673 * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
6675 2003-08-15 Jim Meyering <jim@meyering.net>
6677 * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
6678 (sc_sun_os_names): Likewise.
6679 * .x-sc_space_tab, .x-sc_sun_os_names: New files.
6681 * man/help2man: Remove some SPACEs before TAB.
6683 2003-08-14 Paul Eggert <eggert@twinsun.com>
6685 * Makefile.maint (LC_ALL): Set to C.
6686 * man/Makefile.am (ASSORT): New var.
6687 (check-x-vs-1, programs): Use it.
6688 * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
6689 * tests/Makefile.am (ASSORT, all_programs): Likewise.
6691 2003-08-11 Jim Meyering <jim@meyering.net>
6693 fold -s -wN would infloop for N < 8 with TABs in the input.
6694 E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
6695 * src/fold.c (fold_file): Move contents of `else'-block
6696 out of conditional so it's used also for --spaces (-s).
6697 * tests/misc/fold: Test for the above fix.
6698 * tests/misc/Makefile.am (TESTS): Add fold.
6700 2003-08-10 Jim Meyering <jim@meyering.net>
6702 * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
6703 system.h so the types from time.h and sys/time.h are available.
6704 It appears that this is necessary for OpenBSD, NetBSD, and
6705 Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
6707 2003-08-06 Paul Eggert <eggert@twinsun.com>
6709 * NEWS: Add support for setting file timestamps to microsecond
6710 resolution, on hosts that support this.
6711 * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
6712 * src/copy.c (copy_internal):
6713 Set file timestamps with utimens, not utime.
6714 * src/cp.c (re_protect): Likewise.
6715 * src/install.c (change_timestamps): Likewise.
6716 * src/touch.c (newtime, touch, main): Likewise.
6718 2003-08-09 Jim Meyering <jim@meyering.net>
6720 * Makefile.maint (sc_sun_os_names): New rule based on a regexp
6722 (syntax-check-rules): Add it.
6724 * src/tail.c (main): Tweak Solaris OS version number in comment.
6725 * src/wc.c (wc): Likewise
6726 * tests/tail-2/fflush: Likewise.
6728 * src/tail.c: Add new undocumented option, --presume-input-pipe.
6729 (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
6731 2003-08-08 Paul Eggert <eggert@twinsun.com>
6733 Use new gnulib 'extensions' module.
6734 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
6737 2003-08-08 Paul Eggert <eggert@twinsun.com>
6739 * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
6741 2003-08-09 Jim Meyering <jim@meyering.net>
6743 * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
6744 For tests of obsolete behavior, don't presume that unsetting
6745 _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
6747 2003-08-07 Paul Eggert <eggert@twinsun.com>
6749 * doc/coreutils.texi (split invocation):
6750 Add -d or --numeric-suffixes option to 'split'.
6751 From a suggestion by Jesse Kornblum.
6752 * src/split.c (suffix_alphabet): New var.
6753 (longopts, usage, next_file_name, main): Support -d.
6754 (next_file_name, main): Allow -a0, as POSIX requires.
6755 (next_file_name): Don't assume ASCII-like encoding;
6756 'a' through 'z' are not contiguous in EBCDIC.
6758 2003-08-05 Paul Eggert <eggert@twinsun.com>
6760 Merge getline from gnulib.
6761 * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
6762 * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
6763 New files, from gnulib.
6764 * lib/getdelim2.c, lib/getdelim2.h: Remove.
6765 * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
6766 getdelim2.h to getndelim2.c and getndelim2.h.
6767 * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
6768 checking for getdelim.
6769 (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
6770 than rolling our own.
6771 * src/cut.c: Include getndelim2.h rather than getdelim2.h.
6772 (cut_fields): Invoke getndelim2 rather than getdelim2.
6774 2003-08-04 Jim Meyering <jim@meyering.net>
6776 * src/sort.c (main): Use unsigned int instead of int for `nsigs'
6777 and for the indices to iterate through nsigs.
6779 2003-08-02 Paul Eggert <eggert@twinsun.com>
6781 * src/sort.c: Minor code cleanups, mostly to use more accurate
6782 types and to remove unnecessary casts.
6783 (min, max): Remove. All uses changed to MIN and MAX.
6784 (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
6785 keyfield.skipsblanks, struct keyfield.skipeblanks, struct
6786 keyfield.numeric, struct keyfield.general_numeric, struct
6787 keyfield.month, struct keyfield.reverse, reverse, unique,
6788 have_read_stdin): Now bool, not int. All uses changed.
6789 (eolchar): Now char, not int.
6790 (struct keyfield.ignore): Now bool const *, not int *.
6791 (struct keyfield.translate): Now char const *, not char *.
6792 (struct month.name): Likewise.
6793 (blanks, nonprinting, nondictionary): Now bool[], not int[].
6794 (cleanup, inittables, keycompare, check, mergefps, first_same_file,
6795 check, sort, main): Use const * pointers when possible.
6796 (month_cmp): Rewrite to avoid casts.
6797 (inittables): Initialize tables unconditionally, to avoid branches.
6798 (fillbuf): Return bool, not int. All uses changed.
6799 (fillbuf, keycompare, new_key, main):
6800 Use SIZE_MAX rather than (size_t) -1.
6801 (trailing_blanks): Renamed from trim_trailing_blanks.
6802 Return the number of blanks to trim. All uses changed.
6803 (getmonth): Use trailing_blanks rather than open code.
6804 (keycompare): Do not cast char * to unsigned char *; not needed.
6805 CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
6807 (compare, main): Use | rather than || to avoid jumps.
6808 Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
6810 (check, first_same_file, sort, main):
6811 Use bool instead of int local vars when possible.
6812 (check): Merge the old 'checkfp' and 'check' into a single function,
6813 that returns a boolean (true if the file was ordered).
6815 (main): Use int instead of unsigned for iterating through nsigs.
6816 Rename local var "posix_pedantic" to "posixly_correct".
6818 2003-08-02 Jim Meyering <jim@meyering.net>
6820 * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
6821 to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
6823 * src/cut.c (cut_fields): Don't read again after encountering an
6824 initial EOF. E.g., `cut -f2' would do so.
6825 * tests/misc/tty-eof: Add a test for the above fix.
6827 * src/sort.c (sortlines): Add description and references.
6830 * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
6831 the tests in help-version will use the just-built binaries.
6832 Reported by Christian Krackowizer.
6834 2003-07-31 Paul Eggert <eggert@twinsun.com>
6836 * NEWS: Add --rfc-2822 option to GNU date.
6837 * doc/coreutils.texi (Time directives, Options for date, Examples
6839 * src/date.c (long_options, usage, main): Likewise.
6840 * doc/getdate.texi (General date syntax): Likewise.
6841 * doc/coreutils.texi (Options for date): Fix a typo in format:
6842 it's now %d not %_d. Add URLs.
6844 2003-08-01 Jim Meyering <jim@meyering.net>
6846 * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
6847 Otherwise, with at least the /bin/sh from HPUX 10.20,
6848 the trap code would end up converting that to exit 1 and thus an
6849 unexpected test failure. Reported by Christian Krackowizer.
6851 2003-07-31 Paul Eggert <eggert@twinsun.com>
6853 * src/ptx.c: Do not include bumpalloc.h.
6854 (WORD_TABLE): New member alloc.
6855 (ALLOC_NEW_WORD): Remove.
6856 (occurs_alloc): New var.
6857 (digest_word_file, find_occurs_in_text): Check for arithmetic
6858 overflow when computing table size. Use xrealloc rather than
6859 bumpalloc primitives.
6861 2003-07-29 Jim Meyering <jim@meyering.net>
6865 * README: When running tests as root, suggest using
6866 sudo with NON_ROOT_USERNAME=$USER.
6868 * tests/Makefile.am (all_programs): Makefile is in ../src, not
6871 2003-07-28 Jim Meyering <jim@meyering.net>
6873 * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
6875 2003-07-28 Paul Eggert <eggert@twinsun.com>
6877 * lib/stdbool.hin (_Bool): Make it signed char, instead of
6878 an enum type, so that it's guaranteed to promote to int.
6879 * src/sort.c (sortlines_temp): Undo previous change.
6881 2003-07-28 Jim Meyering <jim@meyering.net>
6883 * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
6884 `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
6885 would cause lines[-1 - swap] (with swap = false) to evaluate to
6888 2003-07-27 Jim Meyering <jim@meyering.net>
6890 * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
6891 since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
6893 * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
6894 directories, as required by POSIX. Reported by Karl Berry.
6895 * tests/rm/dir-no-w: New file. Test for the above fix.
6896 * tests/rm/Makefile.am (TESTS): Add dir-no-w.
6898 * tests/mk-script: Emit `$xx', not its expansion.
6900 2003-07-27 Paul Eggert <eggert@twinsun.com>
6902 This change was inspired by a similar proposal by Stepan Kasal.
6903 * src/sort.c (mergelines, sortlines_temp): New functions.
6904 (sortlines): Use them, to reduce the number of times that
6905 we need to copy 'struct line' values. This improved CPU
6906 performance by about 30% on one 18 MB test.
6907 (sort): Don't invoke sortlines unless we have 2 or more lines.
6909 2003-07-26 Stepan Kasal <kasal@ucw.cz>
6911 * src/sort.c (sort): Don't require two `struct line's per text line,
6912 the new sort algorithm requires just 1.5.
6914 2003-07-27 Jim Meyering <jim@meyering.net>
6916 * src/pathchk.c (validate_path): Use %lu, not %ld.
6918 * src/cut.c (is_printable_field): Simplify bit arithmetic.
6920 * src/ls.c (sort_files): Put `volatile' in the right place.
6923 2003-07-26 Jim Meyering <jim@meyering.net>
6925 Use only one bit per field/offset in array, not one `int'.
6926 * src/cut.c (printable_field): Change type to `unsigned char'.
6927 (mark_printable_field, is_printable_field): New functions.
6928 Use them in place of all direct accesses of `printable_field'.
6930 * src/expand.c (parse_tabstops): Detect overflow properly.
6931 * src/cut.c (set_fields): Likewise.
6933 * src/rm.c: Include "dirname.h".
6934 (usage): Use base_name (program_name) in body of --help output.
6936 * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
6937 Idea from Brendan O'Dea, who suggested using
6938 `program_name = basename (argv[0]);' everywhere --
6939 can't do that, but using base_name works just fine here.
6941 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
6943 2003-07-24 Paul Eggert <eggert@twinsun.com>
6945 Fix some POSIX-compliance problems with 'test'. This makes
6946 'test' more compatible with Bash.
6948 * NEWS, doc/coreutils.texi: Document the following.
6949 * src/test.c: Include exitfail.h.
6950 (TEST_FAILURE): New constant, used for exit status if 'test' fails.
6951 (test-syntax_error): Use it.
6952 (binary_operator): Now takes bool arg specifying whether left operand
6953 is -l ARG, so that caller determines this rather than us.
6955 (term): Use posixtest to evaluate parenthesized subexpressions.
6956 (unary_operator, one_argument): Remove support for -t without operand.
6957 (one_argument): Take argument from argv[pos].
6958 (one_argument, two_arguments, three_arguments): Advance pos.
6959 All callers changed.
6960 (three_arguments): Look for binary ops before "!". Then look
6961 for parenthesized one_argument expressions, instead of trusting
6962 expr () to do the right thing.
6963 (posixtest): Now takes number of args. All callers changed.
6964 Treat "( A B )" like "A B".
6965 (main): Set exit_failure to TEST_FAILURE. Don't depend on
6966 POSIXLY_CORRECT, as we now conform to POSIX by default.
6967 (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
6968 * tests/test/Test.pm (test_vector): Add several tests to check
6969 the above. Syntax errors now exit with status 2, not 1.
6970 * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
6972 2003-07-26 Jim Meyering <jim@meyering.net>
6974 * tests/help-version: Adjust for above change in test behavior:
6975 `[' exits with 2, not 1, and test doesn't accept --help or --version.
6977 * Makefile.maint (ME): Don't use trick suggested in Make manual.
6978 It doesn't work for make-3.79.1. Reported by Christian Krackowizer.
6980 * Makefile.maint (sc_system_h_headers): Another syntax check.
6981 (syntax-check-rules): Add it to the list.
6983 * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
6984 so it matches `%ld' format even on 32-bit systems.
6986 * src/fmt.c (flush_paragraph): Cast field width to `int' to
6987 avoid warning on 64-bit systems.
6989 * src/ls.c (sort_files): Make `func' volatile, so it can't be
6990 clobbered by a `longjmp' into this function.
6992 2003-07-25 Jim Meyering <jim@meyering.net>
6994 * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
6997 * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
6998 because it'd evoke spurious failure on 64-bit systems.
7000 2003-07-24 Jim Meyering <jim@meyering.net>
7002 * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
7003 output its current record counts. Reported by Jurriaan.
7005 * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
7006 `wc' with no options. This goes along with the change of 2003-07-20.
7008 2003-07-23 Jim Meyering <jim@meyering.net>
7010 Don't include headers already included by system.h:
7011 * src/tr.c: Don't include errno.h.
7012 * src/true.c: Don't include version-etc.h.
7013 * src/test.c: Don't include limits.h or error.h.
7014 * src/stat.c: Don't include unistd.h or time.h.
7015 * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
7016 * src/pr.c: Don't include time.h.
7017 * src/pathchk.c: Don't include errno.h.
7018 * src/nice.c: Don't include sys/time.h.
7019 * src/ls.c: Don't include stdlib.h.
7021 * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
7022 * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
7023 * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
7024 * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
7025 * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
7026 * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
7027 * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
7028 * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
7029 Don't include closeout.h.
7031 * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
7032 can access the required version of rm.
7033 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
7035 * tests/cut/Test.pm (out-delim3a): New test.
7037 * man/help2man: Update to version 1.33.
7039 * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
7041 * src/dircolors.c: Include xstrndup.h.
7042 (xstrndup): Remove function, now that it's been factored out into
7045 2003-07-22 Paul Eggert <eggert@twinsun.com>
7047 * src/wc.c (wc): Fix typo in computation of file from file_x,
7048 which caused the former to be used uninitialized if file_x was
7051 2003-07-22 Jim Meyering <jim@meyering.net>
7053 * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
7055 * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
7056 help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by
7057 Thomas Luzat. See http://bugs.debian.org/202413 for details.
7059 * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
7061 * src/hostid.c: Don't include <unistd.h>. system.h already does that.
7063 * src/cut.c (set_fields): Mark all selected indices before trying to
7064 determine range endpoints.
7065 * tests/cut/Test.pm: New test for the above fix.
7067 Begin to address this comment: What if someone wants to
7068 extract the 1,000,000-th field of some huge input file?
7069 The first step is to rearrange things so that the values
7070 in the printable_field array are all 0/1 rather than 0/1/2.
7071 * src/cut.c (RANGE_START_SENTINEL): Remove.
7072 Store range-start indices in a hash table, rather than
7073 overloading the `printable_field' array.
7074 (range_start_ht): New global.
7075 (hash_int, hash_compare_ints, is_range_start_index): New functions.
7076 (print_kth): Use is_range_start_index; don't test printable_field.
7077 (set_fields): Detect overflow.
7078 (set_fields): Insert each range-start index into range_start_ht.
7079 (main): Call set_fields only once, and only after
7080 output_delimiter_specified and (if required) range_start_ht have
7083 2003-07-20 Paul Eggert <eggert@twinsun.com>
7085 * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
7086 invoked with a null pointer when there were no file arguments.
7088 2003-07-20 Jim Meyering <jim@meyering.net>
7090 * Makefile.maint (sc_changelog): Add another nit-picky check.
7092 * src/wc.c (write_counts): Add a comment.
7093 (wc): Rename `file' parameter.
7094 Set new local, `file', to be the file name, or (when it's NULL)
7095 _("standard output") so that all uses of `file' use the proper value.
7096 Use STREQ, not strcmp.
7098 2003-07-20 Paul Eggert <eggert@twinsun.com>
7100 wc count field widths now are heuristically adjusted depending
7101 on the input size, if known. If only one count is printed, it
7102 is guaranteed to be printed without leading spaces.
7104 Previously, wc did not align the count fields if
7105 POSIXLY_CORRECT was set, but POSIX did not actually require
7106 this undesirable behavior, so it has been removed.
7108 * NEWS: Document this.
7109 * doc/coreutils.texi (wc invocation): Likewise.
7111 * src/wc.c (number_width): New var.
7112 (posixly_correct): Remove.
7113 (struct fstatus): New struct.
7114 (write_counts): Output fields of width number_width.
7115 Do not worry about POSIXLY_CORRECT.
7116 Use null file, not empty-string file, to denote stdin,
7117 since "" is a valid file name on some hosts.
7118 (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
7120 (wc): Avoid problems if end_pos - current_pos overflows.
7121 Do not print odd message if stdin has a read error.
7122 (get_input_fstatus, compute_number_width): New functions.
7123 (main): Use them to implement the new behavior.
7124 Ignore POSIXLY_CORRECT.
7126 * tests/wc/Test.pm: Adjust to the new output widths.
7128 2003-07-19 Jim Meyering <jim@meyering.net>
7130 * tests/rm/fail-eperm: Don't create temporary directory --
7133 * tests/shred/remove: Don't open-code test for UID != 0.
7134 Use priv-check's require-non-root instead.
7135 Update to use newer framework.
7137 * tests/help-version (expected_failure_status_expr): Record that
7138 expr exits with status of 3 for e.g., a write error.
7140 * tests/priv-check: Use `id -u' to see if we're running as root,
7141 rather than trying go write to an write-protected file.
7142 When running as root, ensure $NON_ROOT_USERNAME is valid.
7143 When running as root with `require-non-root', ensure that `.'
7144 is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
7145 to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test.
7147 * src/printenv.c: Include "exitfail.h".
7148 (main): Set exit_failure rather than calling close_stdout_set_status.
7149 * src/date.c: Likewise.
7150 * src/sort.c: Likewise.
7151 * src/tty.c: Likewise.
7153 2003-07-18 Jim Meyering <jim@meyering.net>
7155 * tests/touch/not-owner: Update to use newer framework.
7157 * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
7158 directory, and remove Perl-coded `you may not run as root' test.
7159 * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
7160 hard-coding something not quite equivalent.
7161 Paul Jarc reported the inconsistent diagnostics.
7163 * src/sort.c (main): Use close_stdout via atexit.
7164 Now `sort --version' and `sort --help' fail, as they should
7165 when their output is redirected to /dev/full.
7167 * src/su.c (usage): Don't call close_stdout here.
7168 (main): Use close_stdout via atexit.
7169 Now `su --version > /dev/full' fails, as it should.
7170 Somehow, the change of 2000-05-07 that purports to fix this
7173 * tests/help-version (--help/--version vs. /dev/full): Special-case
7174 `[' to protect it from expected_failure_status-`eval'.
7176 * src/uniq.c (writeline): Use a SPACE, not a TAB between the
7177 count and the corresponding line, as required by POSIX.
7178 Reported by Clement Wang.
7179 * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
7181 * tests/expr/basic: Add tests for when exit status is 2.
7183 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
7184 Use an anonymous `enum', rather than #define.
7186 2003-07-17 Paul Eggert <eggert@twinsun.com>
7188 * src/expr.c: Include "exitfail.h", "quotearg.h".
7189 (EXPR_INVALID, EXPR_ERROR): New constants.
7190 (nomoreargs, null, toarith, nextarg): Return bool, not int.
7191 (syntax_error): New function, exiting with status 2. Use it
7192 insteading of printing "syntax error" ourselves.
7193 (main): Initialize exit_failure to EXPR_ERROR.
7194 Exit with EXPR_INVALID on syntax error (too few arguments).
7195 (nextarg): Use strcmp, not strcoll; strcoll might return
7196 an undesirable 0, or might fail.
7197 (docolon, eval4, eval3): Exit with status 3 on invalid argument type
7198 or other such error.
7199 (eval2): Report an error if strcoll fails in a string comparison.
7200 * src/sort.c: Include "exitfail.h".
7201 (main): Set exit_failure, not xalloc_exit_failure and
7202 xmemcoll_exit_failure.
7203 * tests/expr/basic: Invalid value exits with status 3, not 2.
7205 2003-07-16 Jim Meyering <jim@meyering.net>
7207 * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
7208 per GNU maintainer guidelines. The next non-beta release will be 5.1.
7210 This script would have caught at least two recent bugs:
7211 those in [ and kill.
7212 * tests/help-version: Revive this script.
7213 It wasn't doing anything useful, since $all_programs wasn't being
7214 defined by the invoking Makefile.am.
7215 Reflect that nohup is no longer a script, so don't exclude it.
7216 Add framework to handle the programs added since it was last run:
7217 kill, stat, unlink, [, link, readlink.
7218 Fix path-related problems deriving from the move of this script
7219 from src/ to its present location.
7220 * tests/Makefile.am (all_programs): Define.
7221 (TESTS_ENVIRONMENT): Use it.
7223 * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
7224 whereby kill would always attempt to operate on argv[0] and fail.
7226 * src/test.c (integer_expected_error): Improve diagnostic -- now,
7227 it also matches the one from bash's builtin test.
7228 (binary_operator): Add \n at end of diagnostic.
7230 * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ...
7231 * tests/priv-check: Move setuidgid-related and
7232 NON_ROOT_USERNAME-checking code to this file.
7234 * README: Update section on testing as `root'.
7235 Suggestion from Paul Jarc.
7237 * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
7238 names of authors that I just found in bash's builtins/test.def.
7240 Running `[' with no arguments would evoke a segfault.
7241 * src/test.c (main) [LBRACKET]: Move initialization of argv to
7242 precede potential use via test_syntax_error.
7244 * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
7245 warning from automake -Wall.
7247 2003-07-15 Jim Meyering <jim@meyering.net>
7251 * Makefile.maint (%.asc): Remove target first, so gpg doesn't
7254 * announce-gen (print_changelog_deltas): Relax tests for matching
7255 version-number line in NEWS.
7256 Change the .sig suffix to .asc here, too.
7258 2003-07-14 Jim Meyering <jim@meyering.net>
7260 * Makefile.maint (%.asc): Renamed from %.sig.
7261 Generate and use ascii-armored signatures.
7262 Use gpg's -o option.
7264 2003-07-13 Jim Meyering <jim@meyering.net>
7266 * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
7269 * Makefile.maint (syntax-check): Move each individual check into
7271 (syntax-check-rules): This is the list of syntax-check targets.
7272 (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
7273 (sc_cast_of_x_alloc_return_value, sc_space_tab):
7274 (sc_error_exit_success, sc_xalloc_h_in_src): New targets.
7276 2003-07-12 Jim Meyering <jim@meyering.net>
7278 * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
7279 traces of the nohup script.
7281 * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
7282 $(OPTIONAL_BIN_ZCRIPTS).
7284 * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
7285 target, not before the `>'.
7287 * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
7288 now that that function no longer calls `error'.
7290 * src/df.c (find_mount_point): Emit a diagnostic for each
7291 failed syscall, rather than relying on caller to do that.
7292 The caller couldn't do a good job, anyhow -- too many different
7293 ways to fail (each with a different referent).
7294 Give a diagnostic upon failed save_cwd, now that that function
7295 no longer calls `error'.
7296 (show_point): Don't diagnose find_mount_point's errors, now that
7297 it handles them itself.
7299 * src/df.c (find_mount_point): Don't let free clobber errno upon
7302 * src/sys2.h: Remove alloca-related block.
7303 * src/system.h: Include <alloca.h> here, instead.
7305 It appears that the `#pragma alloca' included via "system.h" is
7306 adequate, since join.c uses alloca, yet lacked an in-file #pragma.
7307 * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
7308 * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
7310 * src/chown-core.c (change_file_owner): Do not restore any special
7311 permission bits (e.g., set-user-ID, set-group-ID) that are reset
7312 by chown(2) on some systems. Suggestion and insistence :-) from
7315 * tests/input-tty: Also check `test -t 1'.
7316 This is necessary on linux-2.4.21. Otherwise, the stty/basic-1
7317 test would block when run in the background.
7319 2003-07-11 Jim Meyering <jim@meyering.net>
7321 * tests/sample-test: Also fail if cat-to-create-expected-output
7322 fails. Otherwise, if both `exp' and `out' were to end up empty
7323 because of e.g., a full disk, they would mistakenly compare equal.
7325 * src/nohup.c: New file. Rewrite of nohup.sh in C.
7326 This solves a portability problem: on at least Solaris systems,
7327 when nohup.sh used the vendor /bin/sh, it would exit with status
7328 of `1' rather than the required 126 or 127 upon failure to exec
7329 the specified program.
7331 * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
7332 (bin_PROGRAMS): Add nohup.
7333 (EXTRA_DIST): Remove nohup.sh.
7334 (all_programs): Remove use of $(EXTRA_SCRIPTS).
7335 * src/nohup.sh: Remove file.
7336 * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
7338 * tests/misc/nohup: Tests for the above.
7339 * tests/misc/Makefile.am (TESTS): Add nohup.
7341 * src/head.c (diagnose_copy_fd_failure): New function, renamed from
7342 the macro, COPY_FD_DIAGNOSE.
7343 (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
7344 (head_file): Likewise.
7346 * src/date.c: Include "quote.h".
7347 (batch_convert): Use the quote function rather than using literal `...'
7350 * src/setuidgid.c (main): Enclose diagnostic in _(...).
7351 * src/fmt.c (main): Likewise.
7352 * src/mknod.c (main): Likewise.
7353 * src/tac.c (tac_seekable): Likewise.
7354 * src/yes.c (main): Likewise.
7355 * src/od.c (main): Likewise.
7356 * src/install.c (change_attributes): Likewise.
7358 2003-07-10 Jim Meyering <jim@meyering.net>
7360 * src/head.c (usage): Use 1024*1024 in place of 1048576.
7361 * src/tail.c (usage): Likewise.
7363 * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
7364 place of the kludge in this test. Suggestion from Paul Jarc.
7366 * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
7367 * src/setuidgid.c: New program, solely for testing (not installed).
7369 * src/chown-core.c (change_file_owner): Don't leak file descriptors
7370 when dereferencing symlinks.
7372 2003-07-09 Jim Meyering <jim@meyering.net>
7374 * tests/du/slash: New file/test for today's lib/ftw.c fix.
7375 * tests/du/Makefile.am (TESTS): Add slash
7377 * src/tail.c (xlseek): Avoid warning about ``return without value
7378 from function returning non-void''.
7380 2003-07-08 Jim Meyering <jim@meyering.net>
7382 * man/help2man: Update to version 1.29.
7384 * man/help2man: Add END handler to close STDOUT and check for errors.
7386 2003-06-30 Paul Eggert <eggert@twinsun.com>
7388 Add support for a "[" that conforms to the GNU coding standards,
7389 i.e., that does not depend on its name.
7390 * src/lbracket.c: New file.
7392 * man/Makefile.am (programs): Ignore "[", since it doesn't have
7393 a separate man page.
7394 * src/Makefile.am (bin_PROGRAMS): Add "[".
7395 (__SOURCES): New var.
7396 * src/test.c (LBRACKET): Define to 0 if not defined.
7397 (main): Use LBRACKET rather than argv[0].
7399 * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
7400 Reported by Paul Jarc and Dan Jacobson.
7402 * src/test.c (main): Do not recognize --help or --version if
7403 POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
7404 Do not bother testing that margv[margc] is non-null.
7406 2003-07-04 Jim Meyering <jim@meyering.net>
7408 * src/who.c (print_line): Rewrite to use asprintf, in order to be
7409 able to avoid emitting trailing spaces. Reported by Dan Jacobson.
7411 * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
7412 option, and perform the +1600 invocations of head IFF the envvar
7413 RUN_EXPENSIVE_TESTS is set.
7415 2003-07-03 Jim Meyering <jim@meyering.net>
7417 * src/cp.c (do_copy): Give a better diagnostic when failing due
7418 to nonexistent destination directory. Reported by Dmitry Rutsky.
7419 See http://bugs.debian.org/199730 for details.
7421 2003-06-27 Jim Meyering <jim@meyering.net>
7423 split's --verbose option did nothing [broken in 4.5.10 and 5.0]
7424 * src/split.c (longopts): Use `1', not `0' as the value for
7425 for &verbose. Reported by Keith Thompson.
7427 Test for the above fix.
7428 * tests/misc/split-a: Also use --verbose and compare stderr
7429 output with what we'd expect.
7431 2003-06-20 Jim Meyering <jim@meyering.net>
7433 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
7434 Use `error_t' (rather than int) as type for local `err'.
7435 From Alfred M. Szmidt.
7437 2003-06-19 Marcus Brinkmann <marcus@gnu.org>
7439 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
7440 Fix author preservation code.
7442 2003-06-19 Jim Meyering <jim@meyering.net>
7444 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
7445 (do_link): Don't warn about hard link to symlink.
7447 2003-06-18 Jim Meyering <jim@meyering.net>
7449 * src/cut.c: Include "getdelim2.h", not "getstr.h".
7450 Reflect renaming: getstr -> getdelim2.
7452 * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
7453 readline -> readlinebuffer.
7455 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
7457 * src/readlink.c: Include <sys/types.h> before system.h (because
7458 the latter includes <sys/stat.h>). Required on Ultrix 4.3.
7460 2003-06-17 Jim Meyering <jim@meyering.net>
7462 * src/system.h (initialize_main): Define.
7463 Use it in every `main'. Applied via this:
7464 p='initialize_main (&argc, &argv);'
7465 perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \
7466 $(grep -l program_name.=.argv.0 *.c)
7467 test.c uses margc/margv, so I made the change manually for that file.
7468 Based on a patch from Bernard Giroud.
7470 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
7472 Fix for build failure on Ultrix 4.3.
7473 * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
7474 Include sys/param.h and sys/mount.h on ultrix.
7476 2003-06-16 Jim Meyering <jim@meyering.net>
7478 * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
7480 * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
7481 them here instead, but with one change: define EISDIR to -1, not 0.
7483 * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
7484 guaranteed to be defined.
7485 * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
7487 * README: Mention the CVS repository.
7488 Encourage addition of test cases.
7490 2003-06-12 Jim Meyering <jim@meyering.net>
7492 * src/touch.c (touch): Call close only if necessary.
7495 * src/wc.c (usage): Correct wording: wc prints counts in the order
7496 `newline, word, byte'. Reported by Keith M. Briggs.
7497 * man/wc.x: Fix it here, too. And change `lines' to `newlines'.
7499 2003-06-10 Jim Meyering <jim@meyering.net>
7501 * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
7503 2003-06-07 Jim Meyering <jim@meyering.net>
7505 * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
7508 2003-06-06 Jim Meyering <jim@meyering.net>
7510 * src/extract-magic (main): Avoid newer 3-arg form of open,
7511 so this script works also with e.g., perl5.005_03.
7512 Patch by John David Anglin.
7514 2003-06-04 Paul Eggert <eggert@twinsun.com>
7516 * src/system.h: Include <stdbool.h> unconditionally.
7518 2003-06-04 Jim Meyering <jim@meyering.net>
7520 * man/Makefile.am (check-programs-vs-x): Rename target
7521 from check-programs-vs-1. Adjust rule to check for the
7522 primary (.x) file, not the generated one (.1).
7524 2003-06-03 Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
7526 * man/kill.x: New file.
7527 * man/Makefile.am (dist_man_MANS): Add kill.1.
7530 2003-06-04 Jim Meyering <jim@meyering.net>
7532 Ensure that the .x file for a new program is never forgotten again.
7533 * man/Makefile.am (programs): Define.
7534 (check-programs-vs-1): New phony target.
7535 (check-local): Depend on it.
7537 2003-06-03 Jim Meyering <jim@meyering.net>
7539 Avoid unnecessary copying of environment.
7540 * src/env.c (main): Rather than clearing the environment and --
7541 unless told to ignore environment -- copying all settings from
7542 the saved, original environment, clear the environment only when
7543 that is requested. Suggested by Jens Elkner.
7545 2003-06-02 Jim Meyering <jim@meyering.net>
7547 * src/system.h: Always include <string.h>, since we assume C89.
7548 Include <limits.h> without checking for HAVE_LIMITS_H.
7550 * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
7551 (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
7553 2003-06-01 Jim Meyering <jim@meyering.net>
7555 Avoid a race condition in `tail -f' described by Ken Raeburn in
7556 http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
7557 * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
7558 (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
7559 (tail_bytes, tail_lines, tail): Likewise.
7560 (tail_file): Use the new `read_pos' value as the size,
7561 rather than stats.st_size from the fstat call.
7563 2003-05-28 Jim Meyering <jim@meyering.net>
7565 * src/extract-magic: Allow expansion of `$file' in the here-
7566 document corresponding to the comment at the top of fs.h.
7568 2003-05-26 Jim Meyering <jim@meyering.net>
7570 * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
7571 <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
7572 Use #if/#elif/... cascade so we get only one set of include files.
7573 Reported by Nelson Beebe.
7575 2003-05-24 Jim Meyering <jim@meyering.net>
7577 * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
7578 * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
7579 accept the BSD format.
7581 2003-03-28 Joe Orton <jorton@redhat.com>
7583 * src/md5sum.c (bsd_split_3): New function.
7584 (split_3): Detect checksums from BSD 'md5' command and handle them
7587 * tests/md5sum/basic-1: New tests for --check exit status, and for
7588 BSD-style checksum files.
7590 2003-05-21 Jim Meyering <jim@meyering.net>
7592 * src/head.c (elide_tail_lines_pipe): Fix a thinko.
7593 This sort of thing is why it'd be *Really Good* to factor
7594 out the common code used here and in tail.c.
7596 2003-05-14 Jim Meyering <jim@meyering.net>
7598 * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
7600 * tests/du/slink: Skip this test if `.' is on an XFS file system.
7602 * tests/du/fd-leak: New file. Test for the bug in du that
7603 was fixed by the 2003-05-12 change to lib/ftw.c.
7604 * tests/du/Makefile.am (TESTS): Add fd-leak.
7606 * src/head.c (AUTHORS): Enclose string in N_(...), now that it
7607 includes a translatable word, `and'.
7609 * src/dd.c (usage): Don't use `,' as the thousands separator
7610 in e.g. 1,000,000 and 1,048,576. Instead, do this:
7611 `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
7612 * src/df.c (usage): Likewise.
7613 * src/du.c (usage): Likewise.
7614 * src/ls.c (usage): Likewise.
7616 * Makefile.maint (syntax-check): Add another check.
7618 2003-05-13 Paul Eggert <eggert@twinsun.com>
7620 Fix uniq to conform to POSIX, which requires that "uniq -d -u"
7621 must output nothing. Problem reported by Josh Hyman.
7623 * src/uniq.c (enum output_mode, mode): Remove, replacing with:
7624 (output_unique, output_first_repeated, output_later_repeated):
7625 New vars. All uses of "mode" changed to use these variables,
7626 which are not mutually exclusive as "mode" was.
7627 (writeline): New arg "match", used to control whether to
7628 obey output_first_repeated or output_later_repeated.
7629 All callers changed.
7630 (check_file, main): Adjust to above changes.
7632 * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
7634 2003-05-14 Jim Meyering <jim@meyering.net>
7636 * tests/rm/rm3: Use tr's \n notation rather than \012.
7637 This package can afford to do that, since its tests are guaranteed use
7638 GNU tr, which has accepted the more modern notation for 10 years.
7639 * tests/rm/rm5: Likewise.
7640 * tests/cp/same-file: Likewise.
7641 * tests/stty/row-col-1: Likewise.
7642 * tests/stty/basic-1: Likewise.
7643 * tests/rm/deep-1: Likewise.
7644 * tests/mv/part-symlink: Likewise.
7645 * tests/mkdir/perm: Likewise.
7646 * tests/misc/nice: Likewise.
7648 2003-05-13 Jim Meyering <jim@meyering.net>
7650 * src/copy.c (struct F_triple) [name]: Remove const attribute.
7651 (triple_free): Don't apply cast to argument of free.
7652 (seen_file): Add cast here instead.
7654 * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
7655 (src_to_dest_free): Don't apply cast to argument of free.
7657 * src/sort.c (zaptemp): Don't apply cast to argument of free.
7658 * src/pr.c (init_fps, init_store_cols): Likewise.
7659 * src/join.c (delseq, freeline): Likewise.
7660 * src/expr.c (OLD): Likewise.
7661 * src/sort.c (sort): Likewise.
7662 * src/head.c (elide_tail_lines_pipe): Likewise.
7664 * src/tail.c: Include "quote.h".
7665 Use quote in diagnostics. Change many error format strings
7666 from just `%s' to e.g., `error reading %s'.
7667 (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
7668 Rewrite newline-counting loop to use memchr.
7670 * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
7671 Now that assert is no longer used, don't include <assert.h>.
7673 2003-05-12 Jim Meyering <jim@meyering.net>
7675 * src/head.c: Include <assert.h>.
7676 (AUTHORS): Add my name.
7677 (elide_tail_lines_pipe): New function.
7679 2003-05-10 Jim Meyering <jim@meyering.net>
7681 * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
7683 * src/readlink.c (main): Set program_name before first use.
7684 Remove that (redundant) first use.
7685 Don't exit successfully just because --verbose was specified.
7686 Pass 0, not EXIT_SUCCESS, as first argument to error; when that
7687 parameter is 0, error does not exit.
7689 * src/uname.c (main): When failing due to too many arguments, also say
7690 that, rather than just "Try `uname --help' for more information.".
7691 * src/comm.c (main): Likewise, but for too few arguments.
7692 * src/logname.c: Include error.h.
7693 (main): Say why we're failing.
7695 * src/uniq.c (main): Don't segfault when argc < optind.
7696 * src/who.c (main): Handle argc < optind.
7697 * src/df.c (main): Likewise.
7698 * src/install.c (main): Likewise.
7699 * src/mv.c (main): Likewise.
7700 * src/pwd.c (main): Likewise.
7701 * src/tty.c (main): Likewise.
7702 * src/chroot.c (main): Likewise.
7703 * src/hostname.c: Likewise.
7704 * src/du.c (main): Likewise.
7705 * src/expand.c (main): Likewise.
7706 * src/env.c (main): Likewise.
7707 * src/unexpand.c (main): Likewise.
7708 * src/printenv.c (main): Likewise.
7709 * src/sync.c (main): Handle argc == 0.
7710 * src/expr.c (main): Likewise.
7711 * src/printf.c (main): Likewise.
7712 * src/basename.c (main): Likewise.
7713 * src/ln.c (main): Test for `missing argument' before computing n_files.
7714 * src/tail.c (main): Test for the case of no arguments before
7717 * src/kill.c (send_signals): Don't check command line arguments here.
7718 (main): Check them here instead. Handle argc < optind.
7720 * src/logname.c (main): Use error, rather than fprintf, for the sake
7723 * src/rm.c (main): Don't overrun array bound if argc is 0.
7725 2003-05-09 Jim Meyering <jim@meyering.net>
7727 * src/sort.c (main): Don't overrun array bound if argc is 0.
7728 That would happen when invoked via: execl ("/usr/bin/sort", NULL);
7729 Reported by Wartan Hachaturow.
7731 2003-05-07 Jim Meyering <jim@meyering.net>
7733 Implement support so that `head --lines=-N' works on seekable files.
7734 * src/head.c (enum Copy_fd_status): Define.
7735 (COPY_FD_DIAGNOSE): New macro.
7736 (elide_tail_lines_seekable): New funtion.
7737 (elide_tail_lines_file): Call it here.
7739 2003-05-06 Jim Meyering <jim@meyering.net>
7741 * src/sys2.h (CHAR_BIT): Remove duplicate definition.
7743 2003-05-04 Jim Meyering <jim@meyering.net>
7745 * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
7746 caused the addition of thousands of small files to the tar archive.
7747 * tests/misc/head-elide-tail: New file. Add them here instead.
7748 * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
7750 2003-05-04 Paul Eggert <eggert@twinsun.com>
7752 * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
7753 (IF_READDIR_NEEDS_REWINDDIR): Remove.
7754 (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
7755 which was a bit weird because it couldn't be emulated by a function.
7757 2003-05-03 Jim Meyering <jim@meyering.net>
7759 Extend head to accept --lines=-N (--bytes=-N) and to print all
7760 but the N lines (bytes) at the end of the file.
7761 * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
7762 Use quote() in diagnostics, rather than literal `' marks.
7763 (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
7765 (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
7766 (head_file): Reorganize so as to call head from only one place.
7767 (main): Likewise, for head_file.
7768 Handle new, undocumented option, --presume-input-pipe.
7769 Handle negative line and byte counts.
7770 * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
7772 * tests/du/8gb: Skip test if the file system of `.' doesn't support
7773 sparse files -- otherwise it'd create a file of size 8GB.
7775 2003-05-02 Jim Meyering <jim@meyering.net>
7777 * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
7778 Instead explain about `-' and standard input.
7779 (main): Give a proper diagnostic for e.g., `fmt -c -72'.
7780 Reported by Keith Thompson.
7781 * tests/fmt/basic: Add test for the above fix.
7783 * src/fmt.c: Include "quote.h".
7784 Use quote() in diagnostics, rather than literal `' marks.
7785 (main): Exit nonzero when unable to open an input file.
7786 * tests/fmt/basic: Add test for the above fix.
7788 * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
7789 specifications like `-72x'.
7790 * tests/fmt/basic: Add test for the above fix.
7792 Work around nasty readdir bug on Darwin6.5.
7793 * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
7794 [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
7795 returned NULL and there has been at least one successful unlink or
7796 rmdir call since the opendir or previous rewinddir, then call
7797 rewinddir and reiterate the loop.
7799 Factor out common code.
7800 * src/remove.c (readdir_ignoring_dotdirs): New function.
7801 (is_empty_dir): Use it here.
7802 (remove_cwd_entries): Use it here.
7804 2003-05-01 Jim Meyering <jim@meyering.net>
7806 * tests/rm/r-3: Create 500 rather than just 300 files.
7807 There's a bug in Darwin6.5's readdir that shows up only with
7809 Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
7813 Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
7814 (dump_remainder): Move two declarations `down' into the scope
7815 where they are used.
7816 (xlseek): Return the resulting offset.
7817 (file_lines): Rename parameter, file_length, to end_pos.
7818 (pipe_lines): Don't coerce safe_read return value to `int'.
7819 Adapt tests accordingly.
7820 (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
7822 Change type of `total_bytes' from `int' to `size_t',
7823 since the former wouldn't always be wide enough.
7824 Don't coerce safe_read return value to `int',
7825 and adapt tests accordingly.
7826 Now that testing for a read error no longer involves
7827 using `tmp', handle that case *after* freeing `tmp'.
7828 (start_bytes): Clean up.
7829 (tail_bytes): Now that `n_bytes' may be larger than
7830 OFF_T_MAX, test for that condition and, if it's true, don't
7831 use lseek optimizations.
7832 (parse_options): Don't fail just because N_UNITS is larger than
7833 the maximum size of a file -- tail may be applied to an input
7834 stream (e.g., a pipe) with more data than that.
7836 * Makefile.maint (syntax-check): Rename from alloc-check.
7837 Also check for SPACE-TAB sequences.
7838 Also check for malloc/calloc/realloc casts.
7840 2003-05-01 Jim Meyering <jim@meyering.net>
7842 * src/tail.c (start_lines): Rewrite to use memchr. Clean up.
7844 2003-04-28 Jim Meyering <jim@meyering.net>
7846 * tests/misc/tty-eof: Send two tokens, not just one, so we don't
7847 make the now-more-picky tsort fail.
7849 2003-04-24 Jim Meyering <jim@meyering.net>
7851 * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
7852 (main): Minor syntactic clean-up.
7854 * src/tsort.c (tsort): Fail if the input contains an odd number of
7855 tokens. Reported by junkio@cox.net.
7857 * tests/tsort/basic-1: Test for the above fix.
7859 2003-04-21 Jim Meyering <jim@meyering.net>
7861 * tests/misc/printf: Add tests for the printf fixes below.
7863 * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
7865 2003-04-20 Paul Eggert <eggert@twinsun.com>
7867 Fix printf POSIX compatibility bug reported by Ben Harris in
7868 <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
7869 * doc/coreutils.texi (printf invocation): It's \NNN in the format,
7870 \0NNN in the %b operand.
7871 * src/printf.c (usage): Likewise.
7872 (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
7873 is desired. All uses changed. Behave like Bash printf if %b
7874 operand uses \NNN where the initial N is not 0.
7876 2003-04-17 Jim Meyering <jim@meyering.net>
7878 * src/stty.c: Remove uses of PROTOTYPE macro.
7880 2003-04-15 Jim Meyering <jim@meyering.net>
7882 * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
7883 each sequence of spaces before a TAB character.
7885 2003-04-13 Jim Meyering <jim@meyering.net>
7887 * src/remove.c (is_empty_dir): Don't closedir (NULL).
7889 2003-04-12 Jim Meyering <jim@meyering.net>
7891 Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
7892 --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
7893 FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
7894 * src/nl.c (main): Fix those problems and remove literal quote marks
7895 (e.g., "`%s'") from format string; instead use "%s" in each format
7896 string and `quote (optarg)' as the corresponding argument.
7897 Also, diagnose all invalid command line options before failing.
7899 * src/nl.c (proc_text): Fix a bug that would make nl output extra
7900 newlines in some cases. Details here: http://bugs.debian.org/177256.
7901 This bug was introduced on 2001-11-10 for textutils-2.0.17.
7902 * tests/misc/nl: Add test for the above-fixed bug.
7904 * tests/misc/readlink: New file. Test the --canonicalize option.
7905 * tests/misc/Makefile.am (TESTS): Add readlink.
7907 2003-04-11 Jim Meyering <jim@meyering.net>
7910 * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
7911 * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
7912 * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
7913 retain alignment) each sequence of spaces before a TAB character.
7915 * src/ls.c: Include <stdlib.h> unconditionally.
7917 * Makefile.maint (xalloc-check): Rename from header-check.
7919 * src/yes.c: Include error.h after system.h, not before.
7922 * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
7923 * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
7924 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
7925 * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
7926 * src/tr.c: * src/unexpand.c, src/users.c:
7927 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
7928 return values and of xrealloc's first argument.
7929 Fix the former with this:
7930 perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
7932 2003-04-10 Jim Meyering <jim@meyering.net>
7934 * src/stty.c (wrapf): Declare with format attribute.
7936 The S_MAGIC_... names shouldn't be maintained in two places (prior
7937 to this change, one would have to keep stat.c and fs.h in sync).
7938 This change makes it so those names and the corresponding
7939 hexadecimal constants all reside in stat.c. fs.h is now generated.
7940 * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
7941 (BUILT_SOURCES): Add fs.h, now that it's generated.
7942 (EXTRA_DIST): Add extract-magic.
7943 * src/extract-magic: New script to extract fs.h definitions from stat.c.
7944 * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
7945 fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
7947 * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
7948 file with nominal length > 4GB fails. Reported by Michael Deutschmann.
7950 * man/unexpand.x: Add `SEE ALSO' reference to expand.
7951 * man/expand.x: Add `SEE ALSO' reference to unexpand.
7952 Suggestion from Dan Jacobson.
7954 2003-04-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
7956 * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
7957 * src/stat.c (human_fstype): Handle Linux's devpts.
7959 2003-04-09 Paul Eggert <eggert@twinsun.com>
7961 * src/split.c (line_bytes_split): Arg is of type size_t, since
7962 that's all that is supported for now.
7963 (main): Check for overflow in obsolescent line count option.
7965 2003-04-09 Jim Meyering <jim@meyering.net>
7967 * tests/misc/split-fail: Add a new test for the above fix.
7969 * src/split.c (bytes_split): Use size_t temporary (rather than
7970 uintmax_t original) in remaining computations. From Paul Eggert.
7972 Handle command line option arguments larger than 2^31.
7973 This allows e.g., splitting into files of size 2GB and larger,
7974 and running split --lines=N with N=2^31 or more.
7975 But for --line-bytes=N, the restriction that N <= SIZE_MAX
7976 remains (for now), due to the way it is implemented.
7978 * src/split.c: Include "inttostr.h".
7979 (bytes_split, lines_split, line_bytes_split, main):
7980 Use uintmax_t, not size_t, for file sizes.
7981 (main): Give a better diagnostic for option arguments == 0.
7982 Use umaxtostr to print file sizes.
7983 Reported by Luke Hassell.
7985 2003-04-08 Jim Meyering <jim@meyering.net>
7987 * src/rm.c (usage): Mention that --directory (-d) works only
7988 on some systems. Suggestion from Samuel Tardieu.
7990 * tests/basename/basic: Run $PERL to see if it is available,
7991 rather than testing its value.
7992 * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
7993 * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
7994 * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
7995 * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
7996 * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
7997 * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
7998 * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
7999 * tests/sum/basic-1, tests/seq/basic: Likewise.
8001 * tests/misc/Makefile.am (TESTS): Add split-fail.
8002 * tests/misc/split-fail: New file.
8004 * src/split.c: Rename local variables: nchars -> n_bytes.
8005 (lines_split): Rename local, nlines -> n_lines.
8006 (main): Rename local variable: s/accum/n_units/.
8007 (main): Use STDIN_FILENO, not literal `0'.
8009 2003-04-07 Jim Meyering <jim@meyering.net>
8011 * src/stat.c: Add #include directives for Ultrix 4.4.
8012 Based on a suggested change from Bert Deknuydt.
8014 2003-04-06 Jim Meyering <jim@meyering.net>
8016 * Makefile.maint (makefile-check): New rule.
8017 (local-check): Add it.
8019 2003-04-05 Jim Meyering <jim@meyering.net>
8021 * Makefile.am (nearly all of them):
8022 Use $(VAR) rather than @VAR@, now that we can rely on automake to
8023 emit a definition for each substituted variable.
8024 * tests/Makefile.am.in: Likewise.
8026 * tests/rm/rm5: Add a comment explaining why this test fails when
8027 using Tru64's broken sed.
8028 * tests/rm/rm3: Likewise.
8030 Make `kill -t' output signal descriptions (not `?') on Tru64.
8031 * src/kill.c (sys_siglist): Also check for __sys_siglist.
8032 Patch by Tony Leneis.
8033 * configure.ac: Also check for declaration of __sys_siglist.
8034 Required for Tru64 4.0D, 4.0F, and 5.1.
8035 Reported by Tony Leneis.
8037 2003-04-04 Jim Meyering <jim@meyering.net>
8039 * src/Makefile.am (PERL): Remove unnecessary definition.
8041 Because of inappropriate (but POSIX-mandated) behavior of rename,
8042 `mv a b' would not remove `a' in some unusual cases. Work around
8043 this by unlinking `a' when necessary.
8045 * src/copy.c (same_file_ok): Add an output parameter.
8046 Set it in the offending case.
8047 (copy_internal): When necessary, unlink SRC_PATH and inform caller.
8048 Reported by Ed Avis.
8049 * tests/mv/hard-4: New test for the above.
8050 * tests/mv/Makefile.am (TESTS): Add hard-4.
8052 Clean up rules for automatically generated sources:
8053 * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
8054 Make each generated file be read-only.
8055 Add each file name to BUILT_SOURCES separately.
8056 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
8058 Put LOCALEDIR macro definition in new file: localedir.h.
8059 * src/Makefile.am (DEFS): Remove definition.
8060 (localedir.h): New rule.
8061 (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
8062 * src/system.h: Include "localedir.h".
8064 2003-04-02 Jim Meyering <jim@meyering.net>
8068 * tests/misc/Makefile.am (TESTS): Add false.
8070 * Makefile.maint (TMPDIR): Make sure it's defined.
8071 (my-distcheck): Build in $(TMPDIR), not `.'.
8073 * src/Makefile.am (false.c): Change all occurrences of
8074 `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
8075 unsuccessfully also with --help. Reported by Paul Jarc,
8076 * tests/misc/false: New test for the above.
8078 2003-03-30 Jim Meyering <jim@meyering.net>
8080 * NEWS: Note the location of older NEWS files.
8082 * src/remove.c (is_empty_dir): Don't let a failing closedir
8083 clobber errno. Spotted by Arnold Robbins.
8085 * src/env.c: Fix typo in comment. From Arnold Robbins.
8087 2003-03-29 Jim Meyering <jim@meyering.net>
8091 * README: Note to expect build problems for stat.c on Ultrix 4.3.
8092 Note that there are some harmless test failures when running
8093 `make check' as root on some systems.
8095 2003-03-28 Jim Meyering <jim@meyering.net>
8097 * tests/stty/row-col-1: Skip this test if stty can't get window size.
8098 This happens when connecting to sparc-solaris5.7 via ssh from within
8099 emacs. Reported by Karl Berry.
8101 * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
8102 Otherwise, on systems (DJGPP) that emulate pipes using files,
8103 this test would never complete, waiting for `yes' to terminate.
8104 * tests/du/slink: As above, use seq, not `yes' to generate link target.
8105 * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
8106 Reported by Rich Dawe.
8108 2003-03-27 Jim Meyering <jim@meyering.net>
8110 * src/id.c: Remove Arnold Robbins' obsolete e-mail address
8111 from `written by...' comment, at his request.
8113 2003-03-24 Paul Eggert <eggert@twinsun.com>
8115 Fix buffer overrun problem reported by TAKAI Kousuke, along
8116 with some other POSIX incompatibilities.
8118 * src/printf.c (print_esc): Do not treat \x specially if
8119 POSIXLY_CORRECT. Avoid buffer overrun if the format ends
8120 in backslash. Treat incomplete escape sequences as strings
8121 of characters, as POSIX requires.
8122 (print_formatted): Allow multiple flags. Avoid buffer overrun
8123 if the format is incomplete.
8125 2003-03-24 Jim Meyering <jim@meyering.net>
8127 * tests/misc/printf: Add tests for the above fixes and changes.
8129 2003-03-26 Jim Meyering <jim@meyering.net>
8131 * src/copy.h (struct cp_options): Add a comment.
8133 2003-03-23 Jim Meyering <jim@meyering.net>
8135 * README: Describe problem with 64-bit mode on HPUX 11.x,
8136 with patch for /usr/include/inttypes.h.
8137 * TODO: Plan to add an autoconf test to work around the bug.
8139 2003-03-22 Jim Meyering <jim@meyering.net>
8141 * src/stat.c: Don't include <sys/sysmacros.h>.
8142 That is already done via system.h. Otherwise, the multiple
8143 inclusion would evoke redefinition warnings from Cray's /bin/cc,
8144 aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28.
8145 (human_fstype): Factor some directives `up', out of this function.
8146 Cast away `const' to avoid error from Cray's /bin/cc.
8148 2003-03-20 Jim Meyering <jim@meyering.net>
8150 * announce-gen (print_changelog_deltas): Ensure that a newline
8151 precedes each row of `*'s.
8153 2003-03-20 Jim Meyering <jim@meyering.net>
8157 * src/seq.c (valid_format): Also accept ` ' and `'' as valid
8158 format flag characters.
8159 Do not require that a field width be specified.
8160 Do not fail when given a field width of `0'.
8161 Reported by Dan Jacobson.
8162 * tests/seq/basic: Add new tests for the above-fixed bug.
8164 * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
8165 (install-root): Likewise.
8166 (install-exec-local): Likewise.
8167 Based on a patch from Richard Dawe.
8169 2003-03-19 Jim Meyering <jim@meyering.net>
8171 * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
8172 because the DJGPP 2.03 port of 'ln -s' doesn't work.
8173 Include $(EXEEXT) in program names.
8174 Since $(LN_S) may degenerate to `cp -p', be careful
8175 to invoke it from the destination directory.
8176 Mostly from Richard Dawe.
8177 * configure.ac: Use AC_PROG_LN_S.
8179 * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the
8180 CDPATH shell variable set could cause this test to fail.
8181 Reported by Karl Berry.
8183 2003-03-18 Jim Meyering <jim@meyering.net>
8185 * src/fmt.c [struct Word] (paren, period, punct, final): Change the
8186 type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
8187 AIX 5.1's xlc could not compile the former.
8188 Patch by Petter Reinholdtsen. Also reported by Mike Jetzer.
8190 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
8192 * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
8193 program names, since automake only adds $(EXEEXT) to programs
8196 2003-03-16 Jim Meyering <jim@meyering.net>
8198 * src/remove.c (rm): Put two local variables in static storage,
8199 so they can't be clobbered by the potential longjmp.
8201 2003-03-15 Jim Meyering <jim@meyering.net>
8203 * Makefile.cfg (gnu_rel_host): Fix code to match the comment
8204 so that a version number with a two-digit component can still count
8205 as an alpha release. Reported by Richard A Downing.
8206 (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
8208 2003-03-14 Jim Meyering <jim@meyering.net>
8210 * src/ansi2knr.c: Remove no-longer-used file.
8211 * src/ansi2knr.1: Likewise.
8213 * Makefile.maint (prev_version_file): Don't use ?= for this particular
8214 assignment, since it causes trouble with old versions of GNU make
8215 (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here.
8216 http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
8217 Patch from Alexandre Duret-Lutz.
8219 * Use patched automake-1.7.3. Regenerate Makefile.in files in
8220 subdirectories so that each includes a definition of ACLOCAL_M4.
8222 * announce-gen (main): Label the compressed source URLs.
8226 * tests/du/slink: Relax the test for the `local'ness of a file system,
8227 so that now it works also for tmpfs.
8229 * tests/du/hard-link: Transform output from first du, so that this
8230 test doesn't fail on file systems like tmpfs that order directory
8231 entries differently.
8233 2003-03-13 Jim Meyering <jim@meyering.net>
8235 * tests/du/8gb: Work around what appears to be an NFS failure that
8236 would make this test fail on some systems.
8238 2003-03-11 Jim Meyering <jim@meyering.net>
8240 * tests/du/basic: Make the test file exactly 4k bytes long.
8242 * src/split.c (longopts): Don't hard-code `2' here.
8243 Instead, just specify `&verbose', and ...
8244 (main): ... remove the `case 2:' block for --verbose.
8246 * tests/du/basic: Make the test file larger than 64 bytes, so that
8247 we don't immediately disqualify file systems (e.g., NetApp) on which
8248 smaller files take up zero disk blocks. Reported by Vin Shelton.
8250 2003-03-10 Jim Meyering <jim@meyering.net>
8252 Don't segfault for a negative field width or precision in format string.
8253 Note that this is just a stopgap fix. The longer term solution may
8254 involve adapting bash's builtins/printf.def.
8256 * src/printf.c: (UNSPECIFIED): Define.
8257 (print_direc): Use the special value, UNSPECIFIED, to indicate
8258 that field_width or precision has not been specified.
8259 (print_formatted): Fail if field_width or precision is the
8260 special value, UNSPECIFIED.
8261 Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
8263 * src/sys2.h (INT_MIN): Define, if necessary.
8264 * tests/misc/printf: Add a test for the above-fixed bug.
8266 2003-03-09 Jim Meyering <jim@meyering.net>
8268 * src/remove.c (AD_stack_pop): Cast sizeof... to int before
8269 changing its sign. This avoids a warning from gcc on 64-bit systems.
8270 Reported by Bob Proulx.
8271 (pop_dir): Reverse order of sign change and cast, to be consistent
8274 2003-03-08 Jim Meyering <jim@meyering.net>
8276 * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
8277 shell variable, but only in the environment. With /bin/sh->bash, the
8278 shell variable is set to `y', and that would cause a spurious warning.
8279 Reported by Bob Proulx.
8281 * tests/Makefile.am (check-root): Remove touch/fifo.
8282 It doesn't appear to have to be run as root.
8284 * tests/rm/fail-2eperm: Rather than simply using the first non-root
8285 user name, make sure that the selected user name has a usable shell.
8286 Reported by Paul Jarc.
8288 Before, when using shred on a device, one had to specify --exact,
8289 or be careful to choose a size that would not be rounded up and
8290 exceed the maximum value; that could result in a failure of
8292 * src/shred.c (do_wipefd): --exact is now the default for non-regular
8293 files. Suggestion from Ben Elliston.
8296 * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
8297 Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
8298 Patch by Bob Proulx.
8300 * src/Makefile.am (check-misc): Check for use of `defined' in
8302 Change to $(srcdir) before running grep.
8304 * src/sleep.c: Remove now-unused #include and #define directives.
8306 * src/du.c (process_file): If a file's size is not being counted
8307 e.g., because it's a hard link to a file we've already counted,
8308 then don't print a line for it.
8310 * tests/du/hard-link: New test for the above-fixed bug.
8311 * tests/du/Makefile.am (TESTS): Add hard-link.
8314 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
8315 and make the two-array approach work.
8317 * tests/du/basic: Correct/add tests for the above fix.
8318 Set LC_ALL, etc., now that we use sort.
8319 Check the block/size of a small file, too.
8320 Correct expected results for simple dir1/dir2/file case.
8321 Add another test of du -S.
8323 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
8325 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
8326 middle-end/9986). As one of GCC's optimizations, it transforms a
8327 fputs_unlocked call to a fputc_unlocked call when the string is
8328 one character long. However, hpux doesn't have fputc_unlocked.
8330 * expr.c (usage): Use putchar, not fputs, to output a single character.
8331 * ls.c (dired_dump_obstack): Likewise.
8332 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
8333 * stat.c (print_it): Likewise.
8335 2003-03-07 Jim Meyering <jim@meyering.net>
8337 * src/cp.c: Remove everything associated with mmap-stack.c.
8338 This reverts the two changes of 2003-02-21.
8339 * src/du.c: Remove everything associated with mmap-stack.c.
8340 This reverts the change of 2003-02-19.
8342 2003-03-06 Jim Meyering <jim@meyering.net>
8344 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
8345 CDPATH shell variable set could cause this test to fail.
8346 Reported by Karl Berry.
8348 2003-03-05 Jim Meyering <jim@meyering.net>
8352 * src/printf.c (print_esc): Remove pointless comparison of unsigned
8353 integer with zero, to avoid a warning from Intel's ecc.
8354 Reported by Nelson Beebe.
8356 * src/du.c (process_file): Sizes must all be of type uintmax_t.
8357 Otherwise, for files or totals that are too big, numbers would
8358 be truncated. Patch mostly by Michael Stone.
8359 Reported by Ingo Saitz as Debian bug #183210.
8361 * tests/du/8gb: New test for the above-fixed bug.
8362 * tests/du/Makefile.am (TESTS): Add 8gb.
8364 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
8365 rather than UTILS_OPEN_MAX - 10.
8367 2003-03-04 Jim Meyering <jim@meyering.net>
8369 * README: Refer new feature discussion to bug-coreutils@gnu.org,
8370 rather than bug-gnu-utils, now that the former is better known.
8371 Suggestion from Göran Uddeborg.
8373 * src/stat.c (usage): Capitalize consistently.
8374 Reported by Göran Uddeborg.
8376 * Makefile.maint (rel-files): Include $(signatures), so that
8377 those files are also copied into $(release_archive_dir).
8379 * src/df.c (find_mount_point): Call error here, now that restore_cwd
8381 * src/remove.c (AD_pop_and_chdir): Likewise.
8383 * tests/Makefile.am (check-root): Add fail-2eperm.
8385 2003-03-03 Jim Meyering <jim@meyering.net>
8387 * src/remove.c (remove_cwd_entries): Include the full filename of
8388 the offending file, not just the basename.
8390 * tests/misc/tty-eof: Set $ME properly.
8392 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
8393 Remove now-unused variables.
8394 (tag-prev-version, prev-cvs-tag): Likewise.
8396 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
8397 accurate diagnostic when failing to remove a file owned by some other
8398 user. Reported by Ivo Timmermans via Michael Stone.
8399 This fixes Debian bug# 178471.
8401 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
8402 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
8403 Based on a report from Ivo Timmermans.
8405 2003-03-02 Jim Meyering <jim@meyering.net>
8407 * src/copy.c (copy_internal) [un_backup]: When recovering from a
8408 failure to create a hard link, do not remove the entry associating
8409 the source dev/ino with the destination file name.
8410 * tests/mv/Makefile.am (TESTS): Add hard-3.
8411 * tests/mv/hard-3: New test, for the above-fixed bug.
8412 Inspired by a report from Iida Yosiaki.
8414 2003-03-01 Jim Meyering <jim@meyering.net>
8416 * src/df.c (print_header): Don't embed spaces in a separate `Type'
8417 header string. Instead, put `Filesystem' and `Type' headers in the
8418 same string, so translators can use horizontal space as needed.
8419 Reported by Jean Charles Delepine.
8421 2003-02-28 Jim Meyering <jim@meyering.net>
8423 * src/copy.c (copy_internal): When link fails because of an
8424 existing destination file, unlink that file and try again.
8425 Reported by Iida Yosiaki.
8427 * tests/mv/Makefile.am (TESTS): Add hard-2.
8428 * tests/mv/hard-2: New test for the above-fixed bug.
8429 Based on a test case from Iida Yosiaki.
8431 2003-02-26 Jim Meyering <jim@meyering.net>
8433 * tests/du/basic: Don't test du's -b option here. Directory byte
8434 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
8435 and IBM AIX 4.2. Reported by Nelson Beebe.
8437 2003-02-25 Jim Meyering <jim@meyering.net>
8439 * Makefile.maint (announcement): Now that ChangeLog entries
8440 are output by announce-gen, don't do it here.
8441 * announce-gen (print_changelog_deltas): New function.
8444 2003-02-22 Jim Meyering <jim@meyering.net>
8446 * announce-gen: New option: --release-type=TYPE
8447 * Makefile.maint (beta, major): New targets. Remove `release'.
8448 Put them all together on a line.
8449 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
8450 invocation of `announcement'.
8451 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
8453 * announce-gen: New option: --news=NEWS_FILE.
8454 Extract NEWS entries here, not via rules in Makefile.maint.
8455 * Makefile.maint (announcement): Now that NEWS entries are
8456 extracted by announce-gen, don't do it here.
8457 (news-r1, news-r2): Remove now-unused definitions.
8459 2003-02-21 Jim Meyering <jim@meyering.net>
8463 Merge in changes from autoconf's version of this file.
8464 * Makefile.maint (www-gnu): Define.
8465 (standards.texi-url_prefix): Use $(www-gnu).
8466 (make-stds.texi-url_prefix): Likewise.
8468 * src/cp.c: Include "mmap-stack.h".
8469 (main): Invoke `run' through a macro that (when possible) runs it
8470 with a large, mmap'd stack.
8472 * src/cp.c (run): New function, preparing for the above.
8473 Exit from this function, not from main
8476 * src/du.c: New option: --apparent-size.
8477 (enum) [APPARENT_SIZE_OPTION]: New member.
8478 (long_options): Add it.
8479 (usage): Describe it.
8481 ['b']: Set apparent_size.
8482 David Eisner reported that the behavior of --bytes had changed.
8483 Paul Eggert proposed the use of a new option, --apparent-size.
8485 * src/du.c (apparent_size): New global.
8486 (print_only_size): Reflect the fact that we're printing byte counts,
8487 not ST_NBLOCKSIZE-byte-block counts.
8488 (print_size): Call print_only_size rather than duplicating its code.
8489 (process_file): Accumulate byte counts, rather than block counts.
8491 * src/du.c (process_file): Always reset size_to_propagate_to_parent
8492 for --separate-dirs (-S).
8494 2003-02-20 Jim Meyering <jim@meyering.net>
8496 * Use automake-1.7.3. Regenerate dependent files.
8498 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
8499 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
8500 (usage) [%B]: Describe it.
8503 * src/du.c (process_file): Reorganize the code to use only
8504 one `sum' array, and change how -S works back to the way it was
8505 before 2003-01-31. Patch by Bruno Haible.
8507 * tests/du/basic: New test.
8508 * tests/du/Makefile.am (TESTS): Add basic.
8510 * tests/envvar-check: Add checks for the following:
8511 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
8513 * tests/Makefile.am: Rename phony target envvar-check to evar-check
8514 so as not to conflict with the distributed file by the same name.
8516 * src/du.c (process_file): Set info->skip before any possible return.
8518 Report correct usage for directories, not 0.
8519 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
8520 _before_ recording the dev/ino of a directory.
8521 Reported by Bruno Haible.
8523 Now, df always displays the device file name corresponding to the
8524 listed mount point under `Filesystem'. Before, for an unmounted
8525 block- or character-special file argument, it would display the
8526 command-line argument instead.
8527 * src/df.c (show_disk): Return a value indicating whether
8528 there was a match. Don't try to find a mount point here.
8529 (show_entry): If show_disk doesn't find a match, call show_point.
8531 2003-02-19 Jim Meyering <jim@meyering.net>
8533 * src/du.c: Include "mmap-stack.h".
8534 (du_files): Add prototype with ATTRIBUTE_NORETURN.
8535 Exit from this function, not from...
8537 Instead, if possible, invoke du_files through a macro that
8538 runs it with a large, mmap'd stack.
8540 * src/join.c (usage): Change wording in --help output:
8541 use FILENUM instead of `SIDE' and say what FILENUM means.
8542 Reported by Bernhard Gabler.
8544 * src/df.c (print_header): Rather than using a hard-coded literal
8545 string of spaces matching the length of the English `...Type' header,
8546 output the right number of spaces to match the selected translation.
8547 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
8549 * src/split.c (bytes_split): Remove unnecessary `else' after break.
8550 (lines_split): Likewise. and correct misleading indentation.
8552 * src/split.c: Include "full-read.h".
8553 (bytes_split, lines_split, line_bytes_split): Use full_read,
8554 not safe_read. The way split was using the latter, a short read
8555 could cause split to terminate before EOF.
8557 * tests/misc/tty-eof: Test all programs that can read stdin,
8558 requiring no arguments and that write to standard output.
8560 * tests/misc/tty-eof: New file. Renamed from ...
8561 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
8562 * tests/misc/Makefile.am (TESTS): Reflect renaming.
8564 2003-02-18 Jim Meyering <jim@meyering.net>
8566 cksum would perform an extra read after encountering EOF
8567 * src/cksum.c (cksum): Exit the loop upon EOF, too.
8568 Patch by Michael Bacarella.
8570 Test for the bug fixed today in cksum, md5sum, and sha1sum.
8571 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
8572 cat, cksum, md5sum, and sha1sum all in the same loop.
8574 2003-02-14 Jim Meyering <jim@meyering.net>
8576 * src/remove.c: Include "euidaccess.h".
8577 Remove declaration of euidaccess.
8579 2003-02-12 Jim Meyering <jim@meyering.net>
8581 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
8582 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
8584 2003-02-10 Jim Meyering <jim@meyering.net>
8586 * src/test.c: Don't include group-member.h.
8587 Include euidaccess.h.
8588 (eaccess): Rewrite function to set the real uid and gid temporarily
8589 to the effective uid and gid, then invoke 'access', and then set the
8590 real uid and gid back. On systems that lack setreuid or setregid,
8591 fall back on the kludges in euidaccess. Before, it would not work
8592 for e.g., files with ACLs, files that were marked immutable,
8593 or on file systems mounted read-only. Nelson Beebe raised the issue.
8594 Paul Eggert suggested the new implementation.
8596 2003-02-09 Jim Meyering <jim@meyering.net>
8598 * src/test.c (test_stat): Remove function. It's job is done (only
8599 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
8601 2003-02-08 Jim Meyering <jim@meyering.net>
8605 * tests/mv/part-symlink: Don't assume that the file owner username
8606 length is less than 9 in ls output: instead, omit that field
8607 altogether. Reported by, and suggested fix from, Ferdinand.
8609 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
8610 * tests/du/Makefile.am (TESTS): Add restore-wd.
8612 * src/rm.c: Correct now-invalid comment about cycle-detection.
8614 2003-02-06 Jim Meyering <jim@meyering.net>
8616 * NEWS: Add entries from old/*/NEWS
8617 from fileutils-4.1 through 4.1.11 and
8618 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
8622 * src/du.c (process_file): Don't return early for excluded files
8623 or for files whose dev/inode we've already seen.
8625 2003-02-05 Jim Meyering <jim@meyering.net>
8627 * tests/du/exclude: New file.
8628 * tests/du/Makefile.am (TESTS): Add exclude.
8630 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
8632 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
8633 Fix memory allocation arithmetic.
8635 2003-02-04 Jim Meyering <jim@meyering.net>
8637 `df /dev/block-or-char-device-file--not-mounted' now reports
8638 the name of the file system on which the file resides, usually `/'.
8639 Before, it would leave the `Mounted on' field blank.
8640 * src/df.c (show_disk): Move function to precede find_mount_point.
8641 (show_disk): Add parameter: STATP.
8642 If we don't find a matching device name, then resort to calling
8643 find_mount_point. Reported by Bob Proulx.
8645 2003-02-03 Andreas Schwab <schwab@suse.de>
8647 * tests/rm/cycle: Require non-root.
8648 * tests/rm/isatty: Likewise.
8650 2003-02-02 Jim Meyering <jim@meyering.net>
8654 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
8656 Ensure that there are no offending uses of `:'.
8657 * Makefile.maint (makefile_path_separator_check): New rule.
8658 (local-check): Add it to the list.
8660 2003-02-01 Jim Meyering <jim@meyering.net>
8662 * src/du.c (MAX_N_DESCRIPTORS): Define.
8664 * src/stat.c (G_fail): New global.
8665 (human_time): Diagnose failed localtime, not failed nstrftime.
8666 (main): Fail if G_fail is set.
8668 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
8670 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
8671 hard-coding the path-separator. Also double-quote the new PATH,
8672 to avoid problems when the path-separator is a semi-colon or when
8673 `pwd` contains e.g. a space.
8674 * tests/chgrp/Makefile.am: Likewise.
8675 * tests/chmod/Makefile.am: Likewise.
8676 * tests/chown/Makefile.am: Likewise.
8677 * tests/cp/Makefile.am: Likewise.
8678 * tests/dd/Makefile.am: Likewise.
8679 * tests/dircolors/Makefile.am: Likewise.
8680 * tests/du/Makefile.am: Likewise.
8681 * tests/expr/Makefile.am: Likewise.
8682 * tests/factor/Makefile.am: Likewise.
8683 * tests/fmt/Makefile.am: Likewise.
8684 * tests/install/Makefile.am: Likewise.
8685 * tests/ln/Makefile.am: Likewise.
8686 * tests/ls/Makefile.am: Likewise.
8687 * tests/ls-2/Makefile.am: Likewise.
8688 * tests/md5sum/Makefile.am: Likewise.
8689 * tests/misc/Makefile.am: Likewise.
8690 * tests/mkdir/Makefile.am: Likewise.
8691 * tests/mv/Makefile.am: Likewise.
8692 * tests/od/Makefile.am: Likewise.
8693 * tests/rm/Makefile.am: Likewise.
8694 * tests/rmdir/Makefile.am: Likewise.
8695 * tests/seq/Makefile.am: Likewise.
8696 * tests/sha1sum/Makefile.am: Likewise.
8697 * tests/shred/Makefile.am: Likewise.
8698 * tests/stty/Makefile.am: Likewise.
8699 * tests/sum/Makefile.am: Likewise.
8700 * tests/tail-2/Makefile.am: Likewise.
8701 * tests/touch/Makefile.am: Likewise.
8702 * tests/tsort/Makefile.am: Likewise.
8703 * tests/unexpand/Makefile.am: Likewise.
8705 2003-01-31 Jim Meyering <jim@meyering.net>
8707 * src/stat.c: Include "file-type.h"
8708 (print_human_type): Remove function.
8709 (human_access): Rename from print_human_access. Return a string.
8710 (human_time): Rename from print_human_time. Return a string.
8711 (print_stat): Arrange so that field width and an alignment specifier
8712 are honored for the %A, %F, %x, %y, and %z formats.
8713 [%F]: Use file_type; this gives slightly different file type strings,
8714 e.g., `directory' instead of `Directory' and `regular file' or
8715 `regular empty file' instead of `Regular file'.
8716 Prompted by a report from Richard Dawe that the uses of
8717 S_IFSOCK and S_IFIFO in print_human_time were not portable
8718 to systems using e.g., DJGPP.
8720 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
8722 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
8723 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
8725 2003-01-31 Jim Meyering <jim@meyering.net>
8727 * src/du.c (main): Upon processing an invalid option or an invalid
8728 --exclude-from or --max-depth option argument, don't exit right away,
8729 in case there are others. Rather record the failure and exit after
8730 processing other options.
8732 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
8733 tar archive easier to reproduce.
8735 Rewrite to perform directory traversal using nftw.
8737 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
8738 (AUTHORS): Add self.
8739 (opt_one_file_system): Move global into `main'.
8740 (path, xstat, exit_status): Remove declarations.
8741 (arg_length, suffix_length): New globals.
8742 (G_fail): New global, sort of like the old `exit_status'.
8743 (IS_FTW_DIR_TYPE): Define.
8744 (print_only_size): New function.
8745 (process_file): New function.
8746 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
8747 (str_trunc, pop_dir, count_entry): Likewise.
8748 (du_files): Rewrite to use nftw.
8750 2003-01-30 Jim Meyering <jim@meyering.net>
8752 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
8753 symlink-to-directory with -L, even without the trailing slash.
8755 2003-01-27 Jim Meyering <jim@meyering.net>
8757 * src/Makefile.am (check-misc): Check for st_blocks, too.
8759 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
8760 Reported by Richard Dawe.
8762 2003-01-27 Andreas Schwab <schwab@suse.de>
8764 * src/ls.c (quote_name): Add fourth parameter, width, into which to
8765 store the screen columns, and return the number of bytes instead.
8766 (print_dir): Pass NULL as fourth parameter of quote_name.
8767 (print_name_with_quoting): Likewise.
8768 (length_of_file_name_and_frills): Get the width from the fourth
8769 parameter of quote_name instead of return value.
8771 2003-01-27 Jim Meyering <jim@meyering.net>
8773 * src/ls.c (decode_switches): If `dired' is set without
8774 `format == long_format', then silently reset dired. This doesn't
8775 change the behavior of ls (all prior uses of dired were protected
8776 by `&& format == long_format'), and lets us...
8777 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
8778 (PUSH_CURRENT_DIRED_POS): Likewise.
8781 2003-01-22 Jim Meyering <jim@meyering.net>
8783 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
8784 * tests/du/Makefile.am (TESTS): Add no-x.
8786 2003-01-21 Jim Meyering <jim@meyering.net>
8788 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
8789 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
8790 it may still be a directory -- or not (e.g., with FreeBSD on an
8791 NFS-mounted file system), so resort to calling lstat to find out.
8792 Based on a patch by Michael van Elst.
8794 * tests/cp/same-file: Don't assume that the file owner username
8795 length is less than 9 in ls output: instead, omit that field
8796 altogether. Reported by, and suggested fix from, Ferdinand.
8798 2003-01-20 Jim Meyering <jim@meyering.net>
8800 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
8801 large format widths no longer cause strftime to infloop.
8803 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
8805 2003-01-19 Jim Meyering <jim@meyering.net>
8807 * src/readlink.c: Include "canonicalize.h".
8809 2003-01-18 Jim Meyering <jim@meyering.net>
8811 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
8813 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
8814 (long_options): Add option --dereference-command-line-symlink-to-dir.
8815 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
8816 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
8817 -d, -F, -l options is specified.
8818 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
8819 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
8820 Change --dereference-command-line (-H) to dereference *all*
8821 command line arguments, including broken symlinks.
8823 2003-01-15 Paul Eggert <eggert@twinsun.com>
8825 Change ls -H back to the way it was yesterday, since this is
8826 compatible with FreeBSD and the POSIX spec is confusing
8827 and somewhat contradictory.
8829 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
8830 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
8831 (long_options): Change the long option name back.
8832 (usage): Change the usage back.
8833 (gobble_file): When -H is specified, dereference a top-level
8834 arg even if it points to a non-directory.
8836 2003-01-15 Jim Meyering <jim@meyering.net>
8838 * src/ls.c (gobble_file): Fall back on using lstat when required:
8839 when --dereference (-L) is not specified, and
8840 - when operating on a dangling symlink
8841 - when operating on command-line-symlink-to-directories
8842 This fixes numerous problems. Here are examples:
8843 - `ls dangling-symlink' would fail with `no such file...'
8844 Now it prints `dangling-symlink'.
8845 - `ls -i symlink' would mistakenly print the inode of the referent.
8846 Now it prints the inode of the symlink. Likewise for --size (-s).
8847 Based on a patch from Michael Stone.
8848 Reported by Deepak Goel as Debian bug #173793.
8850 Rename ls's --dereference-command-line (-H)
8851 option to --dereference-command-line-symlink-to-dir.
8852 * src/ls.c [enum Dereference_symlink]
8853 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
8854 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
8855 (long_options): Rename the long option.
8856 (usage): Say that --dereference-... changes how ls treats
8857 only symlinks to directories specified on the command line.
8859 2003-01-14 Jim Meyering <jim@meyering.net>
8861 * tests/ls/dangle: New file/test, for the above fix.
8862 * tests/ls/inode: Another new file/test, for the above fix.
8863 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
8865 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
8866 so that ls --color would no longer highlight the names of files with
8867 the execute bit set when not specified on the command line.
8868 Patch by Michael Stone. Reported by Stephen Depooter as
8871 * tests/ls-2/tests (color-exe): New test, for the above fix.
8873 2003-01-13 Jim Meyering <jim@meyering.net>
8875 * tests/shred/exact: Also test for just fixed bug with --zero.
8877 * src/shred.c (long_opts): --zero does not require an argument.
8878 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
8880 2003-01-12 Jim Meyering <jim@meyering.net>
8882 * Makefile.maint (cvs-update): Skip any file with local modifications.
8884 * src/unexpand.c (usage): Document --first-only and mention that
8885 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
8887 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
8889 * src/df.c: Include "canonicalize.h".
8890 Use canonicalize_file_name unconditionally.
8892 2003-01-09 Jim Meyering <jim@meyering.net>
8894 * README: Add readlink.
8896 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
8898 * src/df.c: Include "xgetcwd.h".
8899 * src/pwd.c: Likewise.
8901 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
8903 * src/shred.c: Remove declaration of xstrdup.
8904 We already get it via xalloc.h which is included via system.h.
8906 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
8908 New program: readlink.
8910 * src/Makefile.am (bin_PROGRAMS): Add readlink.
8911 * src/readlink.c: New file.
8913 * man/readlink.x: New file.
8914 * man/Makefile.am (dist_man_MANS): Add readlink.1.
8915 (readlink.1): New rule.
8917 2003-01-09 Jim Meyering <jim@meyering.net>
8919 When selecting ranges of byte offsets (as opposed to ranges of fields)
8920 and when --output-delimiter=STRING is specified, output STRING between
8921 ranges of selected bytes.
8922 * src/cut.c (RANGE_START_SENTINEL): Define.
8923 (output_delimiter_specified): New global.
8924 (print_kth): Add parameter. Adjust all callers.
8925 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
8926 (cut_bytes): When requested, output STRING between ranges of
8928 (main): Make a diagnostic a little clearer.
8929 Based on a patch from Jan Nieuwenhuizen.
8931 * tests/cut/Test.pm: New tests for the above.
8933 * src/cut.c (set_fields): Make code agree with comment:
8934 Don't merge abutting ranges like 4- and 2-3. This makes no
8935 difference currently, but is required to support an upcoming change.
8937 2003-01-07 Jim Meyering <jim@meyering.net>
8939 * src/cut.c (set_fields): Fix typo in comment.
8941 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
8942 * tests/touch/Makefile.am (TESTS): Add not-owner.
8943 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
8944 Now, this tests only the nonexistent-directory diagnostic.
8945 Suggestion from Michael Stone.
8947 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
8949 2003-01-04 Jim Meyering <jim@meyering.net>
8951 * src/copy.h: Remove use of PARAMS.
8952 * src/remove.h: Likewise.
8953 * src/chown-core.h: Likewise.
8955 rm could be tricked into mistakenly reporting a cycle.
8956 * src/remove.c: [cycle_check_state]: New global.
8957 (remove_cwd_entries): Adapt to new semantics of cycle_check.
8958 (rm): Call cycle_check_init and cycle_check_free for each file.
8959 * tests/rm/cycle (rm): New test, for the above fix.
8960 * tests/rm/Makefile.am (TESTS): Add cycle.
8962 When rm detects a cycle, don't abort the entire command,
8963 but rather just the affected command line argument.
8964 * src/remove.c: Include <setjmp.h>
8965 (struct dirstack_state) [current_arg_jumpbuf]: New member.
8966 (remove_cwd_entries): Call longjmp if we detect a cycle.
8967 (rm): Call setjmp here.
8969 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
8970 Instead, include cycle-check.h and use it.
8972 * src/remove.h (struct dev_ino): Remove declaration.
8974 * src/remove.c (remove_cwd_entries): Fix typos in comment.
8976 Don't include trailing /. in diagnostics about directories.
8977 * src/remove.c (full_filename_): When FILENAME is just `.'
8978 and there is a nonempty directory-name part, don't append `/.'.
8979 * tests/rm/unread2: Remove trailing /. from diagnostic.
8980 * tests/rm/rm2: Likewise.
8982 * src/remove.c (struct dirstack_state): Define.
8983 To be used in place of these file-scoped globals ...
8984 (dir_stack, len_stack, Active_dir): Remove globals.
8985 (ds_init, ds_free): New functions.
8986 (full_filename): Define.
8987 (full_filename_): Rename from full_filename.
8989 Begin to make AD_* functions more generic.
8990 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
8991 (AD_push): Likewise.
8992 (AD_INIT_OTHER_MEMBERS): Define.
8993 (remove_dir): Define the `status' member manually after each
8994 call to AD_push or AD_push_initial.
8996 * src/Makefile.am (check-misc): New rule, to ensure that no more
8997 S_IS* macro definitions sneak into the code.
8998 (check): Depend on check-misc.
9000 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
9001 * src/du.c (count_entry) [S_ISLNK]: Don't define.
9002 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
9004 2003-01-03 Jim Meyering <jim@meyering.net>
9006 * src/true.c: Add copyright.
9007 (AUTHORS): I suppose I've written it.
9009 * src/Makefile.am (false.c): Make the generated file be read-only.
9011 2003-01-04 Jim Meyering <jim@meyering.net>
9013 * src/ls.c: Include "dev-ino.h".
9014 [struct dev_ino]: Remove declaration.
9016 2003-01-02 Jim Meyering <jim@meyering.net>
9018 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
9019 from mv: s/missing file arguments/missing file argument/.
9020 With --target-directory=DIR, cp and mv work with a single file argument.
9021 Reported by Karl Berry.
9023 * tests/rm/isatty: Enable this test.
9025 2002-12-31 Jim Meyering <jim@meyering.net>
9027 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
9028 (AD_push): Likewise.
9029 (AD_INIT_OTHER_MEMBERS): Define.
9030 (remove_dir): Define the `status' member manually after each
9031 call to AD_push or AD_push_initial.
9033 * src/ls.c [struct dev_ino]: Remove definition.
9034 Include "dev-ino.h" instead.
9036 2002-12-28 Jim Meyering <jim@meyering.net>
9038 * tests/du/Makefile.am (TESTS): Add no-deref.
9039 * tests/du/no-deref: New script.
9041 2002-12-23 Jim Meyering <jim@meyering.net>
9043 * src/remove.c (remove_cwd_entries): Fix typo in comment.
9045 2002-12-21 Jim Meyering <jim@meyering.net>
9047 * announce-gen: Generate MML-formatted announcement.
9048 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
9050 2002-12-20 Jim Meyering <jim@meyering.net>
9052 * src/touch.c (touch): Change the wording of a diagnostic so
9053 that it makes sense both when the file exists and when it doesn't.
9054 Suggestion from Michael Stone.
9056 2002-12-18 Jim Meyering <jim@meyering.net>
9058 * src/stty.c (valid_options): Declare to be static.
9060 2002-12-15 Jim Meyering <jim@meyering.net>
9062 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
9064 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
9065 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
9066 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
9067 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
9068 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
9070 * src/remove.c (PARAMS): Remove definition.
9071 * src/sys2.h: Likewise.
9073 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
9074 Include strftime.h instead.
9076 2002-12-14 Jim Meyering <jim@meyering.net>
9078 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
9080 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
9081 This is necessary at least for Irix6.5 when using c89.
9082 Reported by Nelson Beebe.
9084 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
9086 * tests/misc/cat-tty-eof: New test.
9088 * src/mknod.c (usage): Specify how major and minor mode numbers
9089 are interpreted. Report forwarded by Kristin E Thomas.
9090 * src/mknod.c: Remove now-redundant usage-specifying comment.
9092 2002-12-13 Jim Meyering <jim@meyering.net>
9096 * tests/du/trailing-slash: Allow for a directory of size `0'.
9097 That happens at least on file systems of type tmpfs on linux-2.4.18.
9099 * announce-gen: New script to begin replacing the commands
9100 associated with the rule here...
9101 * Makefile.maint (announcement): Invoke announce-gen.
9102 * Makefile.am (EXTRA_DIST): Add announce-gen.
9104 * tests/cp/preserve-2: New file/test, for latest fix.
9105 * tests/cp/Makefile.am (TESTS): Add preserve-2.
9107 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
9109 Fix a bug whereby cp would fail to parse an option like
9110 --preserve=mode,ownership.
9111 * src/cp.c (decode_preserve_arg): Advance `comma' to
9112 point the character following the comma.
9114 2002-12-11 Jim Meyering <jim@meyering.net>
9116 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
9117 in case it's already defined.
9119 2002-12-09 Jim Meyering <jim@meyering.net>
9121 * tests/touch/fail-diag: Don't get a test failure if /no exists.
9122 Instead, evoke a framework failure if /no-$$ exists.
9123 Reported by Michael Stone.
9125 2002-12-08 Jim Meyering <jim@meyering.net>
9127 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
9128 Define to rpl_lstat, so that even on systems like Solaris 5.8,
9129 du honors (per POSIX) the trailing slash on an argument referring
9130 to a symlink-to-directory.
9132 2002-12-06 Jim Meyering <jim@meyering.net>
9134 * Use autoconf-2.57. Regenerate dependent files.
9135 * Use automake-1.7.2. Regenerate dependent files.
9137 * src/ls.c (gobble_file): Also stat the file if it's a
9138 regular file and --indicator-style=classify (aka -F).
9139 Thanks to Ed Santiago for opening my eyes.
9141 * tests/ls/file-type: New file. Test for the above.
9142 A test to contrast ls -F and ls --indicator-style=file-type.
9143 * tests/ls/Makefile.am (TESTS): Add file-type.
9145 2002-12-04 Jim Meyering <jim@meyering.net>
9147 * tests/ls/follow-slink: Make sure the symlink was created.
9148 Richard Dawe reported that `ln -s link link' succeeds, but creates
9149 no file on systems running some version of the DJGPP libc.
9151 2002-12-03 Jim Meyering <jim@meyering.net>
9153 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
9154 since this package no longer panders to K&R compilers.
9156 2002-12-02 Jim Meyering <jim@meyering.net>
9158 * tests/du/slink: Skip this test if `.' is on a non-local file system.
9160 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
9161 something to replace.
9163 2002-12-01 Jim Meyering <jim@meyering.net>
9165 * src/stat.c: Don't include <string.h> or <ctype.h>.
9166 That's already done via system.h.
9167 * src/dircolors.c: Don't include <ctype.h>.
9169 2002-11-30 Jim Meyering <jim@meyering.net>
9171 * ls.c (gobble_file): Remove the block of code that caused
9172 `ls --color -F symlink-to-dir' to list the files in
9173 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
9174 like `ls -F symlink-to-dir') but with the addition of highlighting.
9175 Similarly, `ls --color -dF symlink-to-dir' would print
9176 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
9177 Reported by Jeff Sheinberg as Debian bug #168203.
9178 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
9180 ls is now more efficient: with certain options, it no longer needs
9181 to stat each directory entry on systems with valid dirent.d_type.
9182 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
9183 (main): Make --recursive set format_needs_type, not format_needs_stat.
9184 (gobble_file): Remove a FIXME comment, now that it's fixed.
9186 2002-11-24 Jim Meyering <jim@meyering.net>
9188 * src/du.c (du_files): Don't strip any trailing slash.
9189 Rewrite so that `/' is no longer represented internally as
9191 (count_entry): When appending a file name component,
9192 account for the fact that the current path may end in `/'.
9193 François Pinard reported that `du symlink-to-dir/' was not
9194 equivalent to `du symlink-to-dir/.'. Now it is.
9195 * tests/du/trailing-slash: New file/test, for the above fix.
9196 * tests/du/Makefile.am (TESTS): Add trailing-slash.
9198 2002-11-23 Jim Meyering <jim@meyering.net>
9200 * src/tac.c (output): Declare some local variables to be of type size_t,
9201 rather than `int' to avoid warnings from gcc.
9203 2002-11-21 Paul Eggert <eggert@twinsun.com>
9205 * src/ls.c (decode_switches): Use case-sensitive matching to
9206 decode the QUOTING_STYLE environment variable. This is more
9207 consistent with the documentation, and with --quoting-style.
9209 2002-11-21 Martin Buck <martin.buck@ascom.ch
9211 * src/stty.c (struct speeds): Add support for all baud rates defined
9214 2002-11-19 Jim Meyering <jim@meyering.net>
9216 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
9217 run in a UTF locale. Report and suggested fix by Bruno Haible.
9218 * tests/fmt/basic: Likewise.
9220 2002-11-17 Jim Meyering <jim@meyering.net>
9222 * configure.ac: Update via autoupdate.
9223 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
9225 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
9226 Reported by Hans Ginzel.
9228 2002-11-15 Jim Meyering <jim@meyering.net>
9230 * Makefile.cfg (gnu_rel_host): Define.
9231 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
9232 on whether $(VERSION) looks like a major release number.
9234 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
9235 (release): Rename from `alpha'.
9236 (alpha): Depend on release.
9238 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
9240 2002-11-14 Jim Meyering <jim@meyering.net>
9242 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
9243 (announcement): Use the new variable.
9245 * Makefile.maint: Sync with Bison, i.e.:
9246 (po-check): Scan .l and .y files instead of the
9247 .c and the .h files that they generate. This fixes the bug
9248 reported by Tim Van Holder in:
9249 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
9250 Look for N_ as well as for _. Try to avoid matching #define for
9254 2002-11-12 Jim Meyering <jim@meyering.net>
9256 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
9257 Replace sole use with equivalent `#ifdef S_ISLNK'.
9258 Inconsistency reported by Dmitry V. Levin.
9260 2002-11-11 Jim Meyering <jim@meyering.net>
9262 * src/stat.c (usage): Transform --help items output via s/ - / /,
9263 so that help2man produces properly formatted man pages.
9264 Reported by Herbert Xu as Debian bug #168400.
9266 2002-11-10 Jim Meyering <jim@meyering.net>
9268 * src/ls.c (sighandler): Handle SIGTSTP specially.
9269 Based on suggestions from Solar Designer and Dmitry V. Levin.
9272 * Makefile.cfg (cvs_files): Define. From autoconf.
9273 (local_updates): Likewise.
9275 * src/ls.c (restore_default_color_handler, sigtstp_handler):
9277 (sighandler): New function, based on the one in sort.c.
9278 (main): Use sigaction, if possible; otherwise signal.
9279 Handle these signals:
9280 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
9281 Don't register our handler if the signal is already being ignored.
9283 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
9284 * src/csplit.c (interrupt_handler): Likewise.
9285 * src/sort.c (sighandler): Likewise.
9286 (main): Declare `i' and `nsigs' to be unsigned, not int.
9288 2002-11-09 Jim Meyering <jim@meyering.net>
9290 ls --color: restore terminal text color upon signal.
9291 * src/ls.c: Include "full-write.h" and <signal.h>.
9292 (restore_default_color, restore_default_color_handler): New functions.
9293 (sigtstp_handler, put_indicator_direct): New functions.
9294 (main) [print_with_color]: Register signal handlers.
9295 Patch mostly by Solar Designer and Stanislav Ievlev.
9297 Update from autoconf.
9298 * Makefile.maint (AMTAR): Remove definition.
9299 (update, cvs-update, po-update, do-po-update): New rules.
9300 (wget-update): Update (thus renaming to cvs-update).
9301 (automake_repo): Use anoncvs@sources.redhat.com.
9303 2002-11-06 Jim Meyering <jim@meyering.net>
9305 * tests/misc/Makefile.am (TESTS): Add printf-hex.
9307 * tests/misc/printf: Be careful to test the code in this package,
9308 not the shell built-in function.
9310 * src/printf.c (print_esc): A hexadecimal escape sequence has
9311 at most two hex. digits, not three. Reported by Padraig Brady.
9312 (usage): Update description.
9313 * tests/misc/printf-hex: New file/test, for the above fix.
9315 2002-10-07 Paul Eggert <eggert@twinsun.com>
9317 Add support for locale-specific size indications (e.g.,
9318 thousands-separators) and for explicit size suffixes on output.
9320 * doc/coreutils.texi (Block size): Say that:
9321 This affects display format as well as block size.
9322 Fractional block counts are rounded up.
9323 ls file size blocksize defaults to 1.
9324 A block size spec preceded by ' generates thousands separators.
9325 A suffix without a preceding integer generates suffixes.
9326 (tail invocation): 32k -> 32 KiB.
9327 (What information is listed): ls -h is now equivalent to
9328 ls --block-size=human, and ls -H is now equivalent to
9329 ls --block-size=si. Displayed file size is now always affected by
9332 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
9333 lib/umaxtostr.c: New files, taken from GNU tar.
9335 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
9337 (EXTRA_DIST): Add inttostr.c.
9339 * lib/human.c, lib/human.h: Rewrite to support locale-specific
9340 notations like thousands separators.
9341 Specify what includer of include.h must include beforehand.
9342 (human_group_digits, human_suppress_point_zero, human_autoscale,
9343 human_base_1024, human_SI, human_B): New enum values.
9344 (human_readable): Rename from human_readable_inexact; put the
9345 options before the sizes. All uses changed. The old human_readable
9346 function has been removed; use inttostr.h instead.
9347 (human_options): Renamed from human_block_size, with new signature
9348 that allows block sizes up to UINTMAX_MAX. All callers changed.
9350 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
9351 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
9352 freestanding C89. No need to check for stdlib.h or string.h since
9353 autoconf does this now.
9355 * src/cksum.c (cksum): Use primitives from inttostr.h, not
9356 human.h, to print large numbers simply.
9357 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
9358 * src/dd.c (print_stats, main): Likewise.
9359 * src/df.c (print_header): Likewise.
9360 * src/factor.c (print_factors): Likewise.
9361 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
9362 * src/shred.c (dopass): Likewise.
9363 * src/sort.c (checkfp): Likewise.
9364 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
9365 * src/tail.c (xlseek): Likewise.
9366 * src/wc.c (write_counts, wc): Likewise.
9368 * src/df.c (human_output_opts): New var.
9369 (output_block_size): Now uintmax_t, not int, to handle larger
9370 block sizes. All uses changed.
9371 * src/du.c: Likewise.
9372 * src/ls.c: Likewise.
9374 * src/df.c (print_header): In the header line, prefer SI to human
9375 representation if it's shorter; if neither is shorter, try to
9376 intuit what the user would prefer.
9378 * src/expr.c (inttostr): Remove; use new imaxtostr library
9381 * src/ls.c (file_output_block_size): New var, to distinguish
9382 file sizes from other sizes.
9383 (decode_switches): Set it.
9385 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
9386 (dopass): When printing progress, use floor for what has been done
9387 so far (since we should be conservative there), and ceiling for
9388 what needs to be done (since that's what other programs use).
9390 2002-10-19 Jim Meyering <jim@meyering.net>
9392 * src/pinky.c (print_heading): Align TTY and Name headings.
9393 Reported by Karl Eichwalder.
9395 2002-10-18 Jim Meyering <jim@meyering.net>
9397 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
9398 Remove now-useless cast.
9399 (stdread): Remove function.
9400 (bytes_split): Use size_t instead of int.
9401 Use safe_read, not stdread.
9402 (lines_split): Likewise.
9403 Use memchr rather than a `while' loop.
9404 (line_bytes_split): Use size_t instead of int.
9405 Use safe_read, not stdread.
9406 (main): Add some FIXME comments to remind me to remove casts.
9408 * src/system.h (ST_BLKSIZE): Correct comment describing how to
9409 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
9411 2002-10-17 Jim Meyering <jim@meyering.net>
9413 Fix a problem that could make e.g., `cat' misbehave on systems which
9414 give invalid (unreasonably large) values for stat.st_blksize.
9415 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
9416 Reported by Petter Reinholdtsen.
9418 2002-10-14 Jim Meyering <jim@meyering.net>
9420 Specifying a printf conversion specifer as nl's separator string
9421 could cause nl to segfault.
9422 * src/nl.c (build_print_fmt): Don't include separator string
9423 in the printf format; it might contain `%'.
9424 Use a better bound on the length of the print_fmt buffer.
9425 (print_lineno): Print the separator here instead.
9426 Reported by Doug Coleman.
9428 * tests/misc/nl: New file/tests, including a test for the above.
9429 * tests/misc/Makefile.am (TESTS): Add nl.
9431 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
9432 * tests/misc/Makefile.am (TESTS): Add split-l.
9434 2002-10-13 Jim Meyering <jim@meyering.net>
9438 * src/du.c (usage): Tweak description of --dereference-args/-D.
9440 * src/du.c (count_entry): Also save cwd when dereferencing (via
9441 --dereference-args, -D) a command-line argument.
9442 Reported by Michal Svec. Based on a patch by Andreas Schwab.
9444 * src/Makefile.am (../AUTHORS): New target/rule.
9446 2002-10-12 Jim Meyering <jim@meyering.net>
9448 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
9449 of type size_t, since that's the way it's used and avoids a warning.
9451 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
9452 since that's how it's always used and avoids a new warning from gcc.
9453 (read_input): Adapt to new safe_read ABI.
9455 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
9458 * src/pinky.c (print_long_entry): fread returns size_t.
9459 Declare local `bytes' accordingly, to avoid warning.
9461 tail -c +N would perform an extra read after encountering EOF
9462 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
9463 * src/tail.c (start_bytes): Detect EOF, inform caller.
9464 (tail_bytes): Upon EOF in start_bytes, return immediately.
9465 (file_lines): Reorganize to use memrchr rather than an explicit loop.
9466 Adapt to new safe_read ABI.
9468 2002-10-11 Jim Meyering <jim@meyering.net>
9470 * tests/du/deref: New file/test, for the above fix.
9471 * tests/du/Makefile.am (TESTS): Add deref.
9473 2002-10-10 Jim Meyering <jim@meyering.net>
9475 * tests/ln/Makefile.am (TESTS): Add target-1.
9476 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
9478 2002-10-09 Jim Meyering <jim@meyering.net>
9480 * tests/cp/backup-is-src: Ensure that certain environment variables
9481 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
9483 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
9484 consume 4GB of disk space on systems without support for sparse files.
9485 Fix a logic error that'd make it `cat err' even though dd didn't fail.
9487 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
9488 Patch by steven@magelico.net, forwarded by Michael Stone.
9490 * tests/ls/dired: Ensure that ls produces English messages.
9491 Patch by Alexey Vyskubov, forwarded by Michael Stone.
9493 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
9495 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
9497 2002-10-08 Jim Meyering <jim@meyering.net>
9499 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
9500 Fix syntax in test: use =, not ==.
9501 Reported by Bob Proulx.
9502 Change all the rest like this: grep -lR "testing framework'" .\
9503 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
9505 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
9506 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
9507 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
9508 * src/wc.c (wc): Likewise.
9510 2002-10-07 Paul Eggert <eggert@twinsun.com>
9513 Don't advance the write pointer past the end of the write buffer.
9514 * src/sort.c (begfield, limfield): Likewise.
9516 2002-10-07 Jim Meyering <jim@meyering.net>
9518 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
9519 * src/head.c (head_bytes, head_lines): Likewise.
9521 2002-10-06 Jim Meyering <jim@meyering.net>
9523 * src/dd.c (scanargs): Ensure that specified block sizes (specified
9524 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
9525 (skip, dd_copy): Adapt to new safe_read ABI.
9527 * Makefile.maint (signatures): Define.
9529 (announcement): Depend on $(signatures).
9531 * Makefile.maint (announcement): Output all URLs for detached
9532 signatures, not just the last one from the previous loop.
9534 2002-10-05 Jim Meyering <jim@meyering.net>
9538 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
9539 don't recurse into directory, DIR. Prompted by a report from
9542 * tests/rm/i-no-r: New file/test, for the above fix.
9543 * tests/rm/Makefile.am (TESTS): Add i-no-r.
9545 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
9546 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
9548 2002-10-03 Jim Meyering <jim@meyering.net>
9550 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
9551 * src/df.c (AUTHORS): Likewise.
9552 * src/du.c (AUTHORS): Likewise.
9553 * src/tail.c (AUTHORS): Likewise.
9554 * src/touch.c (AUTHORS): Likewise.
9556 2002-10-02 Jim Meyering <jim@meyering.net>
9558 * Makefile.am (SUBDIRS): Remove `old'.
9559 (EXTRA_DIST): List the files in old/.
9560 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
9561 Suggestion from Akim Demaille.
9563 2002-10-01 Jim Meyering <jim@meyering.net>
9565 * src/sys2.h (SSIZE_MAX): Define.
9567 2002-09-30 Jim Meyering <jim@meyering.net>
9569 * src/csplit.c: Don't include stdlib.h here. It's already included
9572 2002-09-29 Jim Meyering <jim@meyering.net>
9574 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
9575 expression to avoid bogus warning from gcc.
9577 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
9578 (cat): Declare insize and outsize to be of type size_t, not int.
9579 Rearrange pointer/integer expressions to avoid bogus warnings.
9580 (main): Declare insize and outsize to be of type size_t, not int.
9582 * src/tail.c (parse_options): Give a sensible diagnostic for
9583 an invalid byte or line count. Reported by Mikko Tuumanen.
9585 * src/touch.c (main): Split a long line.
9587 * tests/du/Makefile.am (TESTS): Add slink.
9588 * tests/du/slink: New test for system.h change of 2002-08-31.
9590 In move mode, always first try to rename. Before, upon failure to
9591 rename a directory, this code would never attempt to rename any
9592 other file in that directory, but would thenceforth always copy.
9593 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
9594 may fail with EXDEV, yet renaming files within that directory to
9595 a newly-created destination directory succeeds.
9596 * src/copy.c (copy_internal): Remove local, move_mode;
9597 use x->move_mode instead. Based on a patch from Tom Haynes.
9599 2002-09-28 Jim Meyering <jim@meyering.net>
9601 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
9602 Factor out some duplication.
9604 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
9606 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
9608 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
9609 to avoid compiler warnings.
9611 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
9614 Fix things so `mkdir -p' can create very deep directories, e.g.,
9615 mkdir -p $(perl -e 'print "a/" x 40000') now works.
9616 * src/mkdir.c (main): For --parents (-p), call make_path with the
9617 entire directory name, so we don't ever require that file operations
9618 like stat or chmod be performed on the entire command line argument.
9619 * makepath.c (make_path): Restore umask *before* creating the final
9622 2002-09-27 Andreas Schwab <schwab@suse.de>
9624 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
9625 to avoid overflow. Reported by Hans Lermen.
9627 2002-09-26 Jim Meyering <jim@meyering.net>
9629 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
9631 2002-09-25 Jim Meyering <jim@meyering.net>
9633 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
9634 and add a cast, to avoid a warning about `signed and unsigned type in
9635 conditional expression'.
9637 2002-09-22 Jim Meyering <jim@meyering.net>
9639 * src/rmdir.c: Include "dirname.h", for declaration of
9640 strip_trailing_slashes.
9642 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
9643 Now they're defined through system.h.
9645 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
9646 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
9647 since it's already included from sys2.h via system.h.
9649 * Use automake-1.6f. Regenerate dependent files.
9651 * src/Makefile.am (PERL): Remove duplicate definition.
9653 fmt's -s, -t, -c options didn't work properly for long lines.
9654 Since get_line may end up calling put_paragraph (for long lines),
9655 be sure to set global, `other_indent', before it is used there.
9657 * src/fmt.c (set_other_indent): New function, factored out of...
9658 (get_paragraph): ... here. Call it.
9659 (get_line): Call set_other_indent before calling flush_paragraph,
9660 which calls fmt_paragraph, which in turn calls put_paragraph,
9661 which uses other_indent.
9663 * tests/fmt/Makefile.am (TESTS): Add long-line.
9664 * tests/fmt/long-line: New file/test, for the above fix.
9666 2002-09-21 Jim Meyering <jim@meyering.net>
9668 * src/od.c: No longer include deprecated <values.h>.
9669 It was required solely for now-removed reference to BITSPERBYTE.
9670 * src/install.c: Likewise.
9671 Suggestion from Bruno Haible.
9673 2002-09-06 Andreas Schwab <schwab@suse.de>
9675 `rmdir -p dir-specified-with-trailing-slash/' would fail.
9676 * src/rmdir.c (remove_parents): Strip trailing slashes.
9678 2002-09-20 Jim Meyering <jim@meyering.net>
9680 * tests/rmdir/t-slash: New file/test, for the above fix.
9681 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
9683 * Makefile.maint (announcement): Arrange to gpg-sign the message.
9684 Add a URL for each detached signature file.
9686 2002-09-07 Bruno Haible <bruno@clisp.org>
9688 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
9690 2002-09-18 Jim Meyering <jim@meyering.net>
9692 `od -t x8' used the wrong (`l'-prefixed) printf format.
9693 Likewise for the o8 and u8 formats.
9694 * src/od.c (ISPEC_TO_FORMAT): Define macro.
9695 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
9696 Reported by Arun Sharma.
9698 2002-09-17 Jim Meyering <jim@meyering.net>
9700 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
9701 From gettext's intl/loadmsgcat.c.
9703 * tests/od/x8: New file/test, for the above fix.
9704 * tests/od/Makefile.am (TESTS): Add x8.
9706 2002-09-15 Jim Meyering <jim@meyering.net>
9708 * Use autoconf-2.54. Regenerate dependent files.
9710 * src/csplit.c (get_format_width): Add cast to avoid
9711 warning about `signed and unsigned type in conditional expression'.
9713 2002-09-14 Jim Meyering <jim@meyering.net>
9715 * src/who.c (print_user): Change type of local to size_t
9716 to avoid warnings about `comparison between signed and unsigned'.
9717 * src/ptx.c (generate_all_output): Likewise.
9719 * src/dd.c (main, skip): Add casts to avoid warnings about
9720 `comparison between signed and unsigned'.
9722 * src/id.c (print_full_info, print_group_list): Add casts to avoid
9723 warnings about `signed and unsigned type in conditional expression'.
9725 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
9726 to avoid warnings about `comparison between signed and unsigned'.
9727 (split_3): Change parameter names to be readable and add comment.
9728 Clean up the test for whether a line may be ignored.
9730 2002-09-13 Jim Meyering <jim@meyering.net>
9732 * src/printf.c (main): Handle leading command line argument of `--'.
9733 Reported by Raul: DervishD <raul@pleyades.net>
9734 * tests/misc/printf: New file: test for the above.
9735 * tests/misc/Makefile.am (TESTS): Add printf.
9737 * src/date.c (usage): Explain that %S's range of [0..60] is required --
9738 rather than 0..59 -- to accommodate the occasional positive leap second.
9739 Reported by Richard Neill.
9741 2002-09-12 Jim Meyering <jim@meyering.net>
9743 * src/Makefile.am (nanosec_libs): Define.
9744 (sleep_LDADD, tail_LDADD): Use it here.
9746 Factor nanosleep-related code into ../lib/xnanosleep.c.
9747 * src/sleep.c: Include xnanosleep.h.
9748 Factor out fenv.h-related code.
9749 (timespec_subtract): Remove function.
9750 (main): Remove code that deals with computing start and stop times
9751 as well as the loop around nanosleep. Now that's in xnanosleep.c.
9753 Allow S (in --sleep-interval=S) to be a floating point value.
9754 * src/tail.c: Include xnanosleep.h and xstrtod.h.
9755 Move declaration of global variable, sleep_interval, to ...
9757 (usage): Update description of --sleep-interval option.
9758 (tail_forever): New parameter, sleep_interval. Update caller.
9759 Use xnanosleep, rather than sleep.
9760 (parse_options): New parameter, sleep_interval. Update caller.
9761 Use xstrtod, now that we accept floating point values.
9762 Prompted by a patch from Augey Mikus.
9764 2002-09-06 Jim Meyering <jim@meyering.net>
9766 * src/remove.c (prompt): Change comment to give a better note to
9767 translators. From Michael Piefel.
9769 2002-09-02 Jim Meyering <jim@meyering.net>
9771 * README: A good problem report/patch includes diffs against
9772 the most recent test release.
9774 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
9775 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
9777 * src/kill.c (print_table_row): Use an unsigned type for widths
9778 to avoid warning about comparison between signed and unsigned.
9779 (list_signals): Likewise.
9781 * src/od.c (skip): Add a cast to avoid warning about comparison
9782 between signed and unsigned.
9783 * src/install.c (get_ids): Likewise. Also rearrange range-checking
9784 comparisons to make them more readable.
9786 2002-09-01 Jim Meyering <jim@meyering.net>
9790 2002-08-31 Jim Meyering <jim@meyering.net>
9792 Symlinks were always reported as using 0 blocks.
9793 * src/system.h (ST_NBLOCKS): Don't depend on file type.
9794 This reverts the change of 2000-01-30.
9795 Based on a report and patch from Neil Brown via Michael Stone.
9796 This fixes Debian Bug#156358.
9798 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
9799 `exit (1)' to `exit (EXIT_FAILURE)', and
9800 `usage (1)' to `usage (EXIT_FAILURE)'.
9802 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
9803 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
9804 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
9805 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
9806 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
9807 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
9808 error never exits successfully.
9810 2002-08-29 Jim Meyering <jim@meyering.net>
9812 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
9813 when ignoring any return value.
9815 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
9816 failures. On some systems (at least EMC Celerra and Solaris5.8),
9817 this appears to be necessary.
9818 (is_empty_dir): Likewise. Also, always close directory handle.
9819 * src/ls.c (print_dir): Likewise.
9820 (print_dir): Rename local variable: reading -> dirp.
9821 Reported by Mike Coleman.
9823 2002-08-28 Jim Meyering <jim@meyering.net>
9825 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
9826 Give a diagnostic and fail if closedir fails.
9828 2002-08-26 Jim Meyering <jim@meyering.net>
9830 * Makefile.am (THANKS-to-translators): New rule.
9831 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
9832 * THANKStt.in: New file.
9834 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
9836 (main): Register it with atexit.
9837 Close STDOUT_FILENO, to avoid a problem when writing to
9838 /dev/audio on at least Solaris 5.7 and 5.8 systems.
9839 Reported by Shing-Shong Shei.
9841 2002-08-25 Jim Meyering <jim@meyering.net>
9843 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
9844 * src/tac.c (main): Likewise.
9845 * src/tail.c (main): Likewise.
9846 * src/tee.c (main): Likewise.
9847 * src/tr.c (main): Likewise.
9848 * src/wc.c (main): Likewise.
9850 2002-08-20 Jim Meyering <jim@meyering.net>
9852 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
9854 2002-08-10 Paul Eggert <eggert@twinsun.com>
9856 * src/nohup.sh: Don't use "exec --"; it's not portable and
9857 shouldn't be needed.
9859 2002-08-09 Jim Meyering <jim@meyering.net>
9861 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
9862 (usage): Clarify help text for the -COLUMN option.
9863 Patch by Padraig Brady.
9864 * tests/pr/Test.pm [col-last]: New test for the above.
9866 * configure.ac: Start with version 4.5.1, chosen so that it's larger
9867 than the latest version numbers of the component packages.
9869 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
9872 2002-08-08 Jim Meyering <jim@meyering.net>
9874 * src/date.c: Guard inclusion of <langinfo.h> with
9875 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
9876 * src/sort.c: Likewise.
9877 Patch by GOTO Masanori.
9879 2002-08-05 Paul Eggert <eggert@twinsun.com>
9881 Fix some minor time-related bugs with POSIX time arguments.
9882 Some valid time stamps were being rejected (notably -1, and
9883 time stamps before 1900 on 64-bit hosts). And some invalid
9884 time stamps were being accepted, e.g. September 31.
9886 * src/date.c (main): Adjust to posixtime signature change.
9887 * src/touch.c (main): Likewise. Remove unnecessary initialization.
9888 Use localtime, not posixtm, to warn about obsolete "touch".
9890 2002-08-05 Jim Meyering <jim@meyering.net>
9892 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
9894 2002-08-04 Jim Meyering <jim@meyering.net>
9896 * src/Makefile.am (check-README): New target/rule.
9897 (check): Depend on it.
9899 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
9901 2002-08-03 Jim Meyering <jim@meyering.net>
9903 * Makefile.am (SUBDIRS): Add old.
9904 * old/: New directory, containing legacy ChangeLog* and NEWS files
9905 from the fileutils, sh-utils, and textutils packages.
9907 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
9909 2002-08-02 Paul Eggert <eggert@twinsun.com>
9911 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
9913 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
9914 (hard_LC_COLLATE): New var.
9915 (different): Args are now char *, not const char *.
9916 Use xmemcoll instead of memcmp to compare lines, so that
9917 LC_COLLATE has effect. However, use memcmp if it is an
9919 (check_file): Do not include newline in comparison, so that
9920 xmemcoll has a byte to stomp on temporarily.
9921 (main): Set hard_LC_COLLATE.
9923 2002-07-29 Jim Meyering <jim@meyering.net>
9925 * Makefile.am (SUBDIRS): Remove djgpp, for now.
9927 2002-07-20 Jim Meyering <jim@meyering.net>
9929 * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
9930 into EXIT_FAILURE. Otherwise, false --help and false --version
9933 2002-07-08 Jim Meyering <jim@meyering.net>
9935 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
9936 rather than the hard-coded `sh-utils'.
9938 2002-07-01 Jim Meyering <jim@meyering.net>
9940 * configure.ac: Merge the three files from fileutils,
9941 textutils, and sh-utils.
9942 * Makefile.am: Likewise.
9943 * src/Makefile.am: Likewise.