1 2005-06-14 Paul Eggert <eggert@cs.ucla.edu>
5 Improve diagnostics for restore_cwd failure.
6 * src/install.c (main): Standardize on a diagnostic for
7 restore_cwd failure, and report errno.
8 (install_file_in_file_parents): Fail if restore_cwd fails and
9 one of the files is relative. This fixes a bug (albeit unlikely).
10 * src/mkdir.c (create_parents): Remove static var (now local to 'main').
11 (main): Standardize on a diagnostic for restore_cwd failure,
13 Don't bother to check cwd_errno unless create_parents.
14 Use mkdir rather than make_dir; it's simpler.
16 * src/install.c (main): Adjust to new make_dir_parents convention.
17 * src/mkdir.c (main): Likewise.
19 2005-06-14 Jim Meyering <jim@meyering.net>
21 * tests/mkdir/p-3: Ensure mkdir succeeds if the following argument
22 is an absolute directory name.
24 * Makefile.maint (my-distcheck): Add -Wall to the list of options that
25 are used with -Werror. This target is not intended for general use.
27 2005-06-13 Jim Meyering <jim@meyering.net>
29 * src/mkdir.c (main): Give a diagnostic for -- and skip -- each
30 relative directory name after make_dir_parents fails to restore
31 the working directory. Before, `mkdir -p' could create directories
32 in the wrong place in unusual circumstances.
33 * src/install.c (main): Likewise.
34 (install_file_in_file_parents): Update make_dir_parents caller.
35 * tests/mkdir/p-3: New test for today's mkdir.c/mkdir-p.c bug fixes.
36 * tests/mkdir/Makefile.am (TESTS): Add p-3.
38 2005-06-10 Paul Eggert <eggert@cs.ucla.edu>
40 Act on the Austin Group's response yesterday to XCU ERN 63; see
41 <http://www.opengroup.org/austin/docs/austin_260.txt>.
42 * NEWS: ls no longer outputs an extra space between mode and link count.
43 * doc/coreutils.texi: Remove the extra spaces in "ls -l" output.
44 * src/ls.c (any_has_acl): New var.
45 (clear_files): Clear it.
46 (gobble_file): Set it if a file has an ACL.
47 (print_long_format): Omit needless space unless some file has an ACL.
49 2005-06-10 Jim Meyering <jim@meyering.net>
51 * src/system.h (VERIFY_W_TYPEOF): Add parentheses.
53 2005-06-02 Jim Meyering <jim@meyering.net>
55 * src/sort.c (usage): Put `Ordering options:' line where it belongs.
57 2005-06-01 Paul Eggert <eggert@cs.ucla.edu>
59 Use "file name" when talking about file names, instead of "filename"
60 or "path", as per the GNU coding standards.
61 * src/basename.c: Don't use "path" or "filename".
62 * src/copy.c: Likewise.
63 * src/copy.h: Likewise.
64 * src/cp-hash.c: Likewise.
67 * src/install.c: Likewise.
69 * src/pinky.c: Likewise.
71 * src/pwd.c: Likewise.
72 * src/remove.c: Likewise.
73 * src/rmdir.c: Likewise.
74 * src/sort.c: Likewise.
75 * src/system.h: Likewise.
76 * src/tty.c: Likewise.
77 * src/who.c: Likewise.
78 * src/cp.c (parents_option): Renamed from flag_path. All uses changed.
79 (make_dir_parents_private): Renamed from make_path_private.
81 * src/cp.c (usage): Don't use "path" to describe a file name.
82 * src/readlink.c (usage): Likewise.
83 * src/rmdir.c (usage): Likewise.
84 * src/df.c: Don't include "path-concat.h"; not needed.
85 * src/install.c (install_file_in_file_parents): Renamed from
86 install_file_to_path. All uses changed.
87 * src/ln.c (FILE_BASENAME_CONCAT): Renamed from PATH_BASENAME_CONCAT.
89 * src/ls.c (make_link_name): Renamed from make_link_path.
91 * src/pwd.c (struct file_name): Renamed from struct Path.
93 (file_name_free): Renamed from path_free. All uses changed.
94 (file_name_init): Renamed from path_init. All uses changed.
95 (file_name_prepend): Renamed from path_prepend. All uses changed.
96 * src/rmdir.c (remove_empty_parents): Renamed from empty_paths.
98 (longopts): Add comment that --path is deprecated.
100 2005-05-31 Jim Meyering <jim@meyering.net>
102 * src/copy.c (chown_privileges, chown_failure_ok): Mark as `extern'.
103 This is a crutch so that `make distcheck's sc_tight_scope rule
104 knows that they really are deliberately declared that way.
106 2005-05-30 Paul Eggert <eggert@cs.ucla.edu>
108 Port to Solaris 10's rules for whether programs can chown files.
109 * src/copy.c [HAVE_PRIV_H]: Include <priv.h>.
110 (DO_CHOWN): Remove. Replaced by chown_failure_ok. All callers
112 (copy_internal): If chown failed, don't worry about what happened
113 to the mode bits; they can't have changed.
114 (chown_privileges, chown_failure_ok): New functions.
115 * src/copy.h: Add copyright notice.
116 (struct cp_options): Remove myeuid member. Add chown_privileges
118 (chown_privileges, chown_failure_ok): New function decls.
119 * src/cp.c (re_protect): Remove unnecessary call to geteuid.
120 Use chown_failure_ok rather than our own code.
121 * src/cp.c (cp_options_init): Use chown_privileges rather than geteuid.
122 * src/install.c (cp_option_init): Likewise.
123 * src/mv.c (cp_option_init): Likewise.
125 2005-05-29 Paul Eggert <eggert@cs.ucla.edu>
127 * src/chgrp.c (getgrnam) [!defined _POSIX_VERSION]: Remove decl.
128 * src/chown-core.c (getgrnam, getgrgid) [!defined _POSIX_VERSION]:
130 * src/cp.c (geteuid) [!defined _POSIX_VERSION]: Remove decl.
131 * src/id.c (getpwuid, getgrgid, getuid, getgid, geteuid, getegid)
132 [!defined _POSIX_VERSION]: Remove decls.
133 * src/install.c (getpwnam, getgrnam): Remove decl.
134 (getuid, getgid) [!defined _POSIX_VERSION]: Remove decls.
135 * src/md5sum.c (OPENOPTS, TEXT1T01, TEXTCNVT): Remove.
136 (digest_file): Use O_BINARY-using expr instead of OPENOPTS.
137 * src/system.h: Don't bother mentioning _POSIX_VERSION in comment.
138 * src/test.c: Include sys/param.h if it exists, not if _POSIX_VERSION
140 Don't include <sys/file.h>; no longer needed.
141 (getegid, geteuid): Remove no-longer-necessary decls.
143 * src/pathchk.c (_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
144 Define to 256, not 255, as per modern POSIX.
146 2005-05-27 Paul Eggert <eggert@cs.ucla.edu>
148 * NEWS: dd seek=N now conforms to POSIX if the output isn't seekable.
149 * src/dd.c (skip): Return the number of records that were not
150 skipped due to encountering EOF.
151 (dd_copy): If the file wasn't seekable and EOF was encountered,
152 write zeros past EOF until the desired offset is reached.
154 * NEWS: expr and test now correctly compare integers of unlimited size.
155 (Also, correct a comment that claimed that expr detects integer
156 overflow; it does so only when converting from strings.)
157 * src/expr.c: Include strnumcmp.h, xstrtol.h.
158 (looks_like_integer): New function.
159 (toarith): Use it. Also, use xstrtoimax rather than rolling our
161 (eval2): Don't look for trouble if !evaluate; this simplifies things.
162 Compare numbers using string comparison, so that overflow is
164 * src/sort.c: Refactor so that others can use large-integer
165 comparison functions.
166 Include "strnumcmp.h".
167 (NEGATION_SIGN, NUMERIC_ZERO, fraccompare):
168 Remove; moved to strnumcmp.
169 (decimal_point): Now int, to simplify converison overhead with
170 new API. All uses changed.
171 (thousands_sep): Now -1 if there isn't one, as per new API.
173 (numcompare): Move contents to strnumcmp module, except for
175 * src/test.c: Include inttostr.h, strnumcmp.h.
176 (whitespace, digit, digit_value, integer_expected_error): Remove.
177 (is_int): Remove; replaced by...
178 (find_int): New function.
179 (binary_operator): Don't let integers overflow in comparisons;
180 return the correct answer instead. Simplify the code.
181 (unary_operator): Convert the integer ourself, since find_int
183 * tests/expr/basic (bigcmp): New test.
184 * tests/test/Test.pm (eq-6, gt-5, lt-5): New tests.
186 2005-05-26 Paul Eggert <eggert@cs.ucla.edu>
188 * NEWS: nohup now redirects a tty stdin to an unreadable fd
189 instead of closing it.
190 * doc/coreutils.texi (nohup invocation): Document this.
191 * src/nohup.c (main): Implement this.
193 2005-05-26 Jim Meyering <jim@meyering.net>
195 * src/expr.c (toarith): Fix a sign error introduced on 2005-01-14.
196 Reported by David Alan Gilbert.
197 * tests/expr/basic: Add tests using arithmetic on negative integers.
199 2005-05-19 Jim Meyering <jim@meyering.net>
201 * src/remove.c (AD_mark_helper, AD_mark_current_as_unremovable):
202 Remove inaccurate-but-harmless `const' attributes.
204 * src/join.c (decode_field_spec): Add an abort after
205 `error (EXIT_FAILURE, ...' to avoid a gcc warning in caller,
206 about variables being used uninitialized.
208 2005-05-18 Paul Eggert <eggert@cs.ucla.edu>
210 * configure.ac: Add copyright notice. gl_LIB_CHECK -> cu_LIB_CHECK.
211 * src/Makefile.am: Add copyright notice.
212 (factor_LDADD): Remove, as factor no longer needs sqrt.
213 * src/hostname.c: Remove test for HAVE_LIMITS_H; we can assume
214 it's always true now.
216 2005-05-16 Paul Eggert <eggert@cs.ucla.edu>
218 Fix Cygwin porting problem reported by Eric Blake.
219 * src/remove.c (DT_IS_DIR): Remove.
220 (DT_IS_KNOWN, DT_MUST_BE): New macros.
221 (remove_entry): Use them.
223 2005-05-14 Paul Eggert <eggert@cs.ucla.edu>
225 * src/remove.c: Include unlinkdir.h.
226 (UNLINK_CAN_UNLINK_DIRS): Remove.
227 (remove_entry): Use cannot_unlink_dirs () rather than
228 UNLINK_CAN_UNLINK_DIRS.
230 2005-05-14 Jim Meyering <jim@meyering.net>
232 Update FSF postal mail address.
233 * Makefile.maint, Makefile.cfg, gnupload
234 * src/basename.c, src/cat.c, src/checksum.h, src/chgrp.c
235 * src/chmod.c, src/chown-core.c, src/chown-core.h, src/chown.c
236 * src/chroot.c, src/cksum.c, src/comm.c, src/copy.c, src/copy.h
237 * src/cp-hash.c, src/cp-hash.h, src/cp.c, src/csplit.c, src/cut.c
238 * src/date.c, src/dcgen, src/dd.c, src/df.c, src/dircolors.c
239 * src/dirname.c, src/du.c, src/echo.c, src/env.c, src/expand.c
240 * src/expr.c, src/factor.c, src/fmt.c, src/fold.c, src/fs.h
241 * src/groups.sh, src/head.c, src/hostid.c, src/hostname.c, src/id.c
242 * src/install.c, src/join.c, src/kill.c, src/lbracket.c, src/link.c
243 * src/ln.c, src/logname.c, src/ls-dir.c, src/ls-ls.c, src/ls-vdir.c
244 * src/ls.c, src/ls.h, src/md5.c, src/md5sum.c, src/mkdir.c
245 * src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c, src/nl.c
246 * src/nohup.c, src/od.c, src/paste.c, src/pathchk.c, src/pinky.c
247 * src/pr.c, src/printenv.c, src/printf.c, src/ptx.c, src/pwd.c
248 * src/readlink.c, src/remove.c, src/remove.h, src/rm.c, src/rmdir.c
249 * src/seq.c, src/setuidgid.c, src/sha1sum.c, src/shred.c
250 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c
251 * src/su.c, src/sum.c, src/sync.c, src/system.h, src/tac-pipe.c
252 * src/tac.c, src/tail.c, src/tee.c, src/test.c, src/touch.c
253 * src/tr.c, src/true.c, src/tsort.c, src/tty.c, src/uname.c
254 * src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c
255 * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c
257 2005-05-13 Jim Meyering <jim@meyering.net>
259 * NEWS: `rm -r' now removes all of the files it should, even on
260 systems with a buggy readdir affecting file systems inaccessible
263 In some unusual circumstances `rm -r' would fail to remove --
264 or even consider -- all entries in a directory with more than 254
265 (SunOS) or 338 (Darwin) entries. This could cause trouble even on
266 other types of systems when using an affected file system via e.g.,
267 NFS. The underlying cause was a bug in readdir on those systems.
268 Coreutils-5.2.1 and earlier used a configure-time test designed
269 to detect precisely those problem systems, but it would detect
270 the problem and enable remove.c's work-around code only when its
271 configure-time test was run on a losing file system. Obviously,
272 it couldn't detect a problem if the offending file system wasn't
273 tested or even mounted at coreutils configure time. Now, rm itself
274 performs a minimal-cost run-time test to detect the problem.
276 * src/remove.c (CONSECUTIVE_READDIR_UNLINK_THRESHOLD): Define.
277 (remove_cwd_entries): When readdir returns NULL for a directory from
278 which we've removed more than CONSECUTIVE_READDIR_UNLINK_THRESHOLD
279 entries, call rewinddir and then resume the readdir/unlink loop.
280 (UNLINK_CAN_UNLINK_DIRS): Rename from ROOT_CAN_UNLINK_DIRS.
282 2005-05-12 Paul Eggert <eggert@cs.ucla.edu>
284 * NEWS: nohup now closes stdin if it is a terminal, unless
285 POSIXLY_CORRECT is set. This fixes a glitch noted by Wayne Pollock in
286 <https://www.opengroup.org/sophocles/show_mail.tpl?
287 source=L&listname=austin-group-l&id=8341>.
288 * doc/coreutils.texi (nohup invocation): Document this.
289 * src/nohup.c (main): Implement this.
291 2005-05-12 Jim Meyering <jim@meyering.net>
293 * src/date.c: Assume `free (NULL)' works.
294 * src/dd.c: Likewise.
296 * src/dircolors.c:Likewise.
297 * src/head.c: Likewise.
298 * src/ls.c: Likewise.
299 * src/md5sum.c: Likewise.
300 * src/pr.c: Likewise.
301 * src/sort.c: Likewise.
303 2005-05-10 Jim Meyering <jim@meyering.net>
305 * tests/touch/not-owner: Skip this test if the user running it
306 owns `/' or has write access to it.
308 * src/copy.c (abandon_move): Remove erroneous UNWRITABLE check.
309 This makes `mv -i --reply=no f1 f2' work as expected (in not
310 performing the move operation). But note that specifying `-i'
311 after `--reply=no' does *not* work.
312 Tiny patch from Vlada Macek.
314 * tests/mv/reply-no: New file. Test for the above fix.
315 * tests/mv/Makefile.am (TESTS): Add reply-no.
317 * tests/ls-2/tests: Don't print PATH to stderr.
319 2005-05-08 Paul Eggert <eggert@cs.ucla.edu>
321 * NEWS: cp, ln, mv, rm no longer discard white space when intepreting
324 2005-05-06 Paul Eggert <eggert@cs.ucla.edu>
326 * NEWS: dd has new iflag= and oflag= flags "binary" and "text".
327 * src/dd.c (flags, usage): Add support for "binary" and "text".
329 2005-05-04 Paul Eggert <eggert@cs.ucla.edu>
331 * NEWS: chmod -w now complains if it differs from chmod a-w.
332 * src/chmod.c: Include quotearg.h.
333 (diagnose_surprises): New var.
334 (process_file): Diagnose surprises. Simplify the logic a bit,
336 (main): Prepare to diagnose surprises. Remove useless code for
338 * tests/chmod/Makefile.am (TESTS): Add umask-x.
339 * tests/chmod/umask-x: New file.
341 2005-05-02 Paul Eggert <eggert@cs.ucla.edu>
343 * NEWS: ls --indicator-style=directory renamed to ls
344 --indicator-style=slash, to avoid confusion with ls --directory.
345 * src/ls.c (usage): Likewise.
346 (slash): Renamed from directory_only. All uses changed.
348 2005-05-01 Paul Eggert <eggert@cs.ucla.edu>
350 * NEWS: "chmod +1 foo" is now diagnosed.
352 2005-04-29 Paul Eggert <eggert@cs.ucla.edu>
354 * NEWS: ls -p now marks only directories. New option
355 --indicator-style=directory equivalent to -p.
356 * doc/coreutils.texi (ls invocation): Document this.
357 Also, mention ">" is for doors.
358 * src/ls.c (enum indicator_style): New constant directory_only,
360 (indicator_style_args, indicator_style_types): Set it appropriately.
361 (decode_switches, gobble_file, print_type_indicator):
362 (length_of_file_name_and_frills):
363 Implement the change described in NEWS.
364 (decode_switches): Quote ">", too.
365 (usage): Update to match the new behavior. Describe ">".
366 * tests/ls/file-type: Test for new behavior. Omit -1 option.
367 The "ls --color" test wasn't being checked; add a check for
368 "ls --color=auto" instead.
370 * tests/head/Test.pm: Don't set _POSIX2_VERSION; no longer needed.
371 * tests/misc/split-fail: Likewise.
372 * tests/pr/Test.pm: Likewise.
373 * tests/sort/Test.pm: Fix comment to match new behavior of "sort".
374 * tests/tail/Test.pm (tv): Rename tests from obs to obs-plus
375 if they use file names starting with +.
376 (test_vector): Don't set _POSIX2_VERSION if obs but not obs-plus.
377 * tests/uniq/Test.pm (tv, test_vector): Likewise.
379 The following was partly derived from a tiny change by Eric Blake:
380 * tests/misc/nice: Don't use 'set -'. It's not portable to strict
381 POSIX 1003.1-2001 hosts. Also, don't set _POSIX2_VERSION.
382 * tests/mkdir/perm: Don't use 'set -'. Simplify test construction.
383 Work even if the underyling system attaches ACLs to new dirs.
384 * tests/mv/part-hardlink: Don't use 'set -'.
385 * tests/stty/row-col-1: Don't use 'set -'.
387 2005-04-28 Paul Eggert <eggert@cs.ucla.edu>
389 * NEWS: Document fixes described below.
390 * src/chmod.c (change, umask_value): New static vars.
391 (reference_file): Move this static var to inside "main".
392 (process_file, process_files): Remove CHANGES arg; now taken from
393 static var. All uses changed.
394 (usage): Fix incorrect description of MODE operand.
395 (main): For invalid mode usages, output a brief usage message.
396 Adjust to new modechange API.
397 * install.c (main): Adjust to new modechange API.
398 Also, free the mode_change object when done.
399 * mkdir.c (main): Likewise.
400 * mkfifo.c (main): Likewise.
401 * mknod.c (main): Likewise.
402 * tests/chmod/equal-X: Check for =xX bug.
403 * tests/chmod/equals: Check for =u bug.
404 * tests/chmod/usage: Check for u+gr and ug,+x bugs.
406 2005-04-26 Paul Eggert <eggert@cs.ucla.edu>
408 Restore support for usages like "head -1" and "tail -1",
409 even when conforming to POSIX 1003.1-2001.
410 Fix bug with "POSIXLY_CORRECT=1 fold file -3".
411 join now supports a NUL field separator, e.g., "join -t '\0'".
412 join now detects and reports incompatible options, e.g.,
414 * NEWS: Document this.
415 * src/date.c: Remove posixver.h and its uses.
416 (COMMON_SHORT_OPTIONS): Remove.
417 (short_options): New constant.
418 (short_options, usage): -I now always takes an optional arg.
419 * src/expand.c: Remove posixver.h and its uses.
420 (shortopts): New constant. -DIGIT now always takes an optional arg.
421 (main): Revamp parsing of -DIGIT to let parse_tab_stops handle it.
422 Don't complain about -DIGIT.
423 * src/fold.c: Remove posixver.h and its uses.
424 (shortopts): New constant. -DIGIT now always takes an optional arg.
425 (main): Don't preprocess arg list; that was buggy. Use method
427 * src/head.c: Remove posixver.h and its uses.
428 (header_mode_option): Remove.
429 (main): Don't complain about obsolete -NUM args.
430 * src/join.c: Remove posixver.h and its uses.
431 (obsolete_usage): Remove.
432 (join_field_1, join_field_2): Initialize to SIZE_MAX to indicate
433 they haven't been set yet.
434 (tab): Now int, not char. Initialize to -1 to indicate white space
435 separates columns, so that we can use NUL as a separator.
437 (OBSOLETE_LONG_OPTIONS, get_option): Remove.
438 (string_to_join_field): Remove ERR_MSG_FMT arg; a single format
439 suffices. Use xstrtoul for sizes; it suffices.
440 (decode_field_spec): Report an error and exit on failure. Return void,
442 (add_field_list): Likewise.
443 (set_join_field): New function.
444 (enum operand_status): New enum.
445 (add_file_name): New args OPERAND_STATUS, JOPTION_COUNT,
446 PREV_OPTC_STATUS, OPTC_STATUS to handle the bewildering array of
447 possibilities with obsolete option parsing.
448 (main): Use it. Do not depend on POSIX version.
449 Check for conflicting options. Parse obsolete options -j1 and -j2
450 so that it is a pure extension to POSIX 1003.1-2001.
451 Allow '-t\0' to specify a NUL tab, stealing the code from 'sort'.
452 * src/nice.c: Remove posixver.h and its uses.
453 (main): Always support -NUM option.
454 * src/od.c: Remove posixver.h and its uses.
455 (short_options): New constant, which always supports -w[num].
456 (COMMON_SHORT_OPTIONS): Remove.
457 * src/pr.c: Remove posixver.h and its uses.
458 (short_options): New constant, which always supports -S[string].
459 (COMMON_SHORT_OPTIONS): Remove.
460 * src/sort.c: Remove posixver.h and its uses.
461 (short_options): New constant, which always supports -y arg.
462 (COMMON_SHORT_OPTIONS): Remove.
463 (main): Redo workaround for Solaris compatibility with -y.
464 This change isn't visible to the user; it just cleans up the
465 code so that we don't need posixver.h.
466 * src/split.c: Remove posixver.h and its uses.
467 (main): Don't complain about -NUM option.
468 * src/tail.c (parse_obsolete_option): Don't complain about -NUM.
469 * src/unexpand.c: Remove posixver.h and its uses.
470 (main): Don't complain about -TAB.
471 * src/uniq.c (main): Don't complain about -NUM.
473 2005-04-22 Paul Eggert <eggert@cs.ucla.edu>
475 * src/nohup.c (main): If getopt fails, exit with status 127,
476 not status 1. POSIX requires this.
477 * NEWS: Document this.
479 * src/nice.c (main): Report proper program name when getopt finds
480 trouble. Problem reported by Behdad Esfahbod.
482 * NEWS: Fix bug with "mkdir -m =+x dir"; the umask was being ignored
483 when the "+x" was being evaluated.
484 * mkdir.c (main): Compile mode with MODE_MASK_ALL and initial umask.
485 * mkfifo.c (main): Likewise.
486 * mknod.c (main): Likewise.
487 * tests/mkdir/perm: Test for the above bug.
489 2005-04-20 Paul Eggert <eggert@cs.ucla.edu>
491 Port test cases to Microsoft-Windows-related environments,
492 following suggestions from Eric Blake.
493 * tests/install/Makefile.am (TESTS_ENVIRONMENT): Add EXEEXT.
494 * tests/install/basic-1: Undo previous change.
495 (dd, dd2): New vars, which use $EXEEXT. All uses of dd and dd2 changed.
496 * tests/install/trap: Undo previous change.
497 (sig): New var. Use it insted of "trap '' CHLD".
498 Append $EXEEXT to executable name.
500 "fetish" -> "coreutils" in more places.
501 * tests/Coreutils.pm: Renamed from tests/Fetish.pm.
502 (package Coreutils): Renamed from package Fetish. All uses changed.
503 * tests/Makefile.am (EXTRA_DIST): Add Coreutils.pm and
506 2005-04-19 Paul Eggert <eggert@cs.ucla.edu>
508 * tests/mv/setup (dot_mount_point): Use stat -L, in case the
509 directory is actually a symbolic link. Problem reported by
512 * tests/mv/mv-special-1: Use test -p to test for fifos, rather
513 than the (incorrect) test -f and the (inadequate) ls. ls is
514 inadequate because on some hosts a buggy mv will create a file of
515 the wrong type (problem reported by Eric Blake). Skip this test
516 if test -p doesn't work.
518 * tests/chmod/setgid: Use numeric group ids, not symbolic group names,
519 since the latter can have shell metacharacters in them (e.g., spaces).
520 This follows up to the 2005-01-17 patch, which missed this occurrence.
522 2005-04-18 Paul Eggert <eggert@cs.ucla.edu>
524 "fetish" -> "coreutils" in several places.
525 * Makefile.cfg (ftp): Remove fetish.sf.net.
526 * Makefile.maint (emit_upload_commands): Likewise.
527 * src/Makefile.am (LDADD, $(PROGRAMS)): fetish -> coreutils.
528 * tests/group-names (COREUTILS_GROUPS): Renamed from FETISH_GROUPS.
529 * tests/chmod/setgid (FETISH_GROUP): Renamed from COREUTILS_GROUP.
531 * tests/install/basic-1: Use "cat", not "test", to test for
532 ../../src/dd. Problem reported by Eric Blake.
534 2005-04-18 Jim Meyering <jim@meyering.net>
536 * src/dd.c: Don't include stat-macros.h directly. system.h does that.
538 2005-04-17 Paul Eggert <eggert@cs.ucla.edu>
540 Work around a couple of "make check" failures reported for Cygwin
541 and ash by Eric Blake.
542 * tests/install/basic-1: Skip this test if ../../src/dd isn't readable.
543 * tests/install/trap: Skip this test if "trap '' CHLD" doesn't work.
545 2005-04-16 Jim Meyering <jim@meyering.net>
547 * src/dd.c (S_TYPEISSHM): Remove definition.
548 Get the definition by including "stat-macros.h", instead.
550 2005-04-14 Paul Eggert <eggert@cs.ucla.edu>
552 Fix test suite problems reported by Eric Blake on Cygwin.
553 * tests/mv/mv-special-1: Ignore chatter about when files are removed,
554 since POSIX doesn't require rename to fail across file systems.
555 * tests/mv/setup (dot_mount_point): Use stat rather than df, as
557 (other_partition_tmpdir): Remove df from name as that would be
560 2005-04-14 Jim Meyering <jim@meyering.net>
562 * src/chown-core.c: Correct typo, fchmod -> fchown, in a comment.
564 2005-04-12 Paul Eggert <eggert@cs.ucla.edu>
566 * src/ls.c (usage): "uid" -> "user ID".
568 2005-04-12 Jim Meyering <jim@meyering.net>
570 * src/tsort.c (tsort): Use "%s" as the format string,
571 rather than a diagnostic or a file name.
573 * src/comm.c (compare_files): Remove declaration of unused local.
575 * src/chown-core.c (chopt_free): Mark parameter as unused.
577 2005-04-11 Paul Eggert <eggert@cs.ucla.edu>
579 * man/chown.x: Reword to match user manual.
580 * man/id.x: Likewise.
581 * src/setuidgid.c (usage): Use "user ID", not "UID", and similarly
583 * src/whoami.c (usage, main): Likewise.
585 Add bulletproofing for cases where stdin, stdout, or stderr are closed.
586 * src/comm.c: Include stdio-safer.h.
587 (compare_files): Exit right away on I/O error rather than continuing
588 and producing confusing output and error messages.
589 Return void, not int; all callers changed.
590 Use fopen_safer to avoid confusion with file descriptors.
591 * src/copy.c: Include unistd-safer.h.
592 (copy_reg): Use fd_safer.
593 * src/csplit.c: Include stdio-safer.h.
594 (input_desc): Remove unnecessary static initialization.
595 (set_input_file): Use STDIN_FILENO, not 0.
596 (create_output_file): Use fopen_safer.
597 * src/dircolors.c (dc_parse_file): Don't assume fopen does not
599 * src/head.c (head_file): Don't assume open does not return 0.
600 * src/join.c: Include stdio-safer.h.
601 (main): Use fopen_safer. Simplify the resulting code.
602 * src/md5sum.c (digest_file, digest_check):
603 Don't assume that fopen does not return stdin.
604 * src/nohup.c: Include unistd-safer.h.
605 (main): Don't dup stderr to stdin or stdout by mistake.
606 * src/od.c (check_and_close): Don't assume fopen does not return stdin.
607 * src/paste.c (paste_serial): Likewise.
608 * src/pr.c: Include stdio-safer.h.
609 (open_file): Use fopen_safer.
610 (close_file): Don't assume fopen does not return stdin.
611 * src/ptx.c (main): Don't assume fopen returns stdout after closing
612 stdout. Use freopen instead.
613 * src/shred.c: Include unistd-safer.h.
614 (wipename): Use fd_safer on directory file descriptor.
615 (wipefile): Remove special case for /dev/fd/* on older hosts.
616 It didn't work in general, and wasn't documented.
618 * src/sort.c: Include unistd-safer.h.
619 (create_temp_file): Use fd_safer.
620 (xfclose): Don't assume fileno (stdin) == STDIN_FILENO, etc.
621 * src/split.c: Include unistd-safer.h.
622 (cwrite): Use fd_safer. Replace mystery constant 0666 with symbolic
623 version, as POSIX requires.
624 * src/sum.c (bsd_sum_file, sysv_sym_file):
625 Use same pattern as elsewhere for checking for stdin.
626 * src/tac.c: Include unistd-safer.h.
627 (copy_to_temp): Use fd_safer.
628 (tac_file): Don't assume fopen cannot return stdin.
629 * src/tail.c: Include unistd-safer.h rather than fcntl-safer.h.
630 (recheck, tail_file): Use fd_safer rather than open_safer.
631 * src/tee.c: Include stdio-safer.h.
632 (tee): Use fopen_safer.
633 * src/touch.c: Include unistd-safer.h.
634 (touch): Use fd_safer.
635 * src/tsort.c (have_read_stdin): Remove; no longer needed. All uses
637 (tsort): Do not assume fopen can't return stdin.
638 Close stdin before returning. All uses changed.
639 * src/unexpand.c (next_file): Don't assume fopen cannot return stdin.
640 * src/uniq.c: Include stdio_safer.h.
641 (check_file): Don't assume fopen cannot return stdin or stdout.
643 2005-04-09 Jim Meyering <jim@meyering.net>
645 * src/dd.c (quit): Define with ATTRIBUTE_NORETURN.
647 Now that close_stdout closes standard output unconditionally,
648 these workarounds for dd and cat are no longer necessary.
649 * src/dd.c (close_stdout_wrapper): Remove function.
650 (main): Call atexit with close_stdout, instead.
651 * src/cat.c (close_stdout_wrapper): Likewise.
652 Don't close STDOUT_FILENO explicitly; close_stdout does it.
654 * src/system.h (__attribute__): Readability nit:
656 # define __attribute__(x)
658 # define __attribute__(x) /* empty */
660 2005-04-09 Jim Meyering <jim@meyering.net>
662 * src/rm.c (usage): Mention that --recursive removes listed
663 directories too, not just their contents.
664 Say that by default, rm does not remove directories.
666 * src/pr.c: Don't include "timespec.h". system.h does that.
667 * Makefile.maint (sc_system_h_headers): Propagate exit status
670 2005-04-08 Paul Eggert <eggert@cs.ucla.edu>
672 * NEWS: Document that dd no longer treats QUIT or PIPE specially,
673 and when conforming to POSIX no longer treats USR1 specially.
674 Document that dd no longer dumps core when handling signals.
675 * src/system.h (RETSIGTYPE): Remove; no longer needed. All uses
677 * src/csplit.c (SA_NOCLDSTOP): Define to 0 if not defined.
679 (siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
680 (delete_all_files): New arg IN_SIGNAL_HANDLER, to avoid undefined
681 behavior when called from a signal handler. All uses changed.
682 (main) [!defined SA_NOCLDSTOP]:
683 Use siginterrupt to specify that system calls should be interrupted.
684 * src/dd.c: Do not include safe-read.h or full-write.h; no longer needed.
685 (process_signals): Add forward decl.
686 (SA_NOCLDSTOP, sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]:
688 (siginterrupt) [! HAVE_SIGINTERRUPT]: New macro.
689 (SA_NODEFER) [!defined SA_NODEFER]: New macro.
690 (SA_RESETHAND) [!defined SA_RESETHAND]: New macro.
691 (caught_signals, interrupt_signal, info_signal_count, catch_siginfo):
693 (usage): Mention -USR1 versus -INFO.
694 (cleanup): Don't invoke print_stats; the caller must do it now.
696 (quit): Process signals just before exiting.
697 (interrupt_handler): Simply record the signal and return.
698 (siginfo_handler): Simply increment the signal counter and return.
699 (install_handler): Remove, replacing with:
700 (install_signal_handlers, process_signals, iread, iwrite):
701 New functions. All callers to safe_read and full_write replaced
702 by iread and iwrite. All callers to install_handler replaced by
704 * src/ls.c (SA_NOCLDSTOP): Define to 0 if not defined.
706 (siginterrupt) [! HAVE_SIGINTERRUPT]: New macro.
707 (main) [! SA_NOCLDSTOP]: Use it.
708 * src/shred.c: Remove all uses of signals; modern hosts have
709 /dev/random and don't need this gorp.
710 Do not include signal.h.
711 (env, sigill_handler, isaac_seed_machdep): Remove. All uses removed.
712 * src/sort.c (SA_NOCLDSTOP): Define to 0 if not defined.
714 (siginterrupt) [! HAVE_SIGINTERRUPT]: New macro.
715 (main) [! SA_NOCLDSTOP]: Use it.
717 * src/dd.c: Do not include inttostr.h, no longer needed.
718 (print_stats, main): Rewrite and simplify formats to use PRIuMAX
719 instead of umaxtostr.
720 (print_stats): Work even in languages that have special
721 forms for two of things, for r_truncate and w_bytes. We can't
722 fix delta_s in this way, since ngettext doesn't support floating-point.
723 (main): Rewrite to avoid casts.
725 2005-04-07 Jim Meyering <jim@meyering.net>
727 Placate gcc-4's -Wuninitialized.
728 * src/md5sum.c (digest_check) [lint]: Initialize hex_digest to NULL.
729 * src/test.c (binary_operator) [lint]: Initialize lt and rt to 0.
731 * src/test.c (is_int, age_of, binop): Declare `char *' parameters to
733 (binop): Move function definition to precede first use so we can...
734 (binop): ...remove prototype.
736 2005-04-05 Paul Eggert <eggert@cs.ucla.edu>
738 * man/Makefile.am (.x.1): Remove "COMMAND.td/" from examples.
739 * src/basename.c (usage): Add examples.
740 * src/cat.c (usage): Likewise.
741 * src/chgrp.c (usage): Likewise.
742 * src/chown.c (usage): Likewise.
743 * src/dirname.c (usage): Likewise.
745 2005-04-05 Jim Meyering <jim@meyering.net>
747 * src/nice.c (usage): Mention that some shells provide a
748 built-in function by the same name.
749 * src/nohup.c (usage): Likewise.
750 * src/printenv.c (usage):Likewise.
752 2005-04-04 Dmitry V. Levin <ldv@altlinux.org>
754 * src/tee.c (tee): When closing files, do not close stdout,
755 leave this job to close_stdout() instead.
756 * configure.ac (AC_CONFIG_FILES): Add tests/tee/Makefile.
757 * tests/Makefile.am (SUBDIRS): Add tee.
758 * tests/tee/Makefile.am: New file.
759 * tests/tee/.cvsignore: Likewise.
760 * tests/tee/{basic,dash}: New tee tests.
762 2005-04-04 Jim Meyering <jim@meyering.net>
764 * src/echo.c (usage): Mention that some shells provide a
765 built-in function by the same name.
766 * src/kill.c (usage): Likewise
767 * src/printf.c (usage): Likewise.
768 * src/pwd.c (usage): Likewise.
769 * src/stat.c (usage): Likewise.
770 * src/test.c (usage): Likewise.
771 * src/true.c (usage):
772 * src/system.h (USAGE_BUILTIN_WARNING): New macro.
774 * man/echo.x: Remove `DESCRIPTION' section, now that --help includes it.
775 * man/printf.x: Likewise.
776 * man/pwd.x: Likewise.
778 2005-04-03 Jim Meyering <jim@meyering.net>
780 * src/pr.c (main): Fix off-by-one error.
781 pr -$(perl -e 'print "0"x63 . 1') would write one byte beyond the
782 end of a malloc'd buffer.
784 2005-04-01 Jim Meyering <jim@meyering.net>
786 * src/pr.c (main): Free column_count_string when done with it.
788 Don't let pr treat +1:-1 like +1:18446744073709551615.
789 * src/pr.c (strtoumax): Remove declaration.
790 (first_last_page): Use xstrtoumax in place of strtoumax,
791 so we don't interpret a negative page number (e.g., in an option
792 like --pages=1:-1) as valid.
793 * tests/pr/Test.pm (neg-page): Add a test for this.
795 2005-03-30 Paul Eggert <eggert@cs.ucla.edu>
797 * src/pinky.c (short_pinky): Adjust to read_utmp signature change.
798 * src/uptime.c (uptime): New arg OPTIONS. All uses changed.
799 * src/users.c (users): Likewise.
800 * src/who.c (who): Likewise.
801 * src/uptime.c (main): Check PIDs when invoked with zero arguments.
802 * src/users.c (main): Likewise.
803 * src/who.c (main): Likewise. Also with two arguments.
804 Omit duplicate code in 2-arg case.
805 (UT_PID): Moved to ../lib/readutmp.h.
807 2005-03-29 Jim Meyering <jim@meyering.net>
809 * src/system.h (ptr_align): Declare `ptr' parameter to be a
810 `const' pointer, since this function never writes through it.
812 * src/uname.c: Indent cpp directives to reflect nesting.
814 2005-03-28 Jim Meyering <jim@meyering.net>
816 * src/seq.c (get_width_format) [HAVE_RINT && HAVE_MODF && HAVE_FLOOR]:
817 Add `void' to make this an ANSI-style function declaration.
818 * src/remove.c (ds_init): Likewise.
819 * src/pr.c (print_sep_string): Likewise.
821 * src/stty.c (speeds): Declare this array to be static.
822 * src/Makefile.am (sc_tight_scope): Adjust to catch any
823 new declarations like that of stty.c's `speeds'.
825 * src/system.h (GETOPT_HELP_OPTION_DECL): Use NULL, not `0'.
826 (GETOPT_VERSION_OPTION_DECL): Likewise.
827 * src/chown.c (long_options): Likewise.
828 * src/chgrp.c (long_options): Likewise.
829 * src/chmod.c (long_options): Likewise.
830 * src/cp.c (sparse_type_string, reply_args, decode_preserve_arg):
832 * src/chown-core.c (chopt_init): Likewise.
833 * src/comm.c (long_options): Likewise.
834 * src/copy.c (copy_reg): Likewise.
835 * src/csplit.c (extract_regexp): Likewise.
836 * src/cut.c (longopts): Likewise.
837 * src/date.c (time_spec_string): Likewise.
838 * src/df.c (find_mount_point, show_point): Likewise.
839 * src/expr.c (docolon): Likewise.
840 * src/fmt.c (long_options): Likewise.
841 * src/ls.c (time_style_args, indicator_style_args, long_options)
842 (format_args, sort_args, time_args, decode_switches)
843 (gobble_file): Likewise.
844 * src/md5sum.c (long_options): Likewise.
845 * src/mv.c (reply_args): Likewise.
846 * src/paste.c (longopts): Likewise.
847 * src/pinky.c (print_entry): Likewise.
848 * src/pr.c (long_options): Likewise.
849 * src/ptx.c (long_options, format_args): Likewise.
850 * src/readlink.c (longopts): Likewise.
851 * src/sort.c (long_options, mergefps): Likewise.
852 * src/stat.c (long_options): Likewise.
853 * src/tac.c (main): Likewise.
854 * src/tail.c (follow_mode_string): Likewise.
855 * src/touch.c (longopts, time_args): Likewise.
856 * src/uniq.c (delimit_method_string): Likewise.
857 * src/uptime.c (print_uptime): Likewise.
858 * src/who.c (print_user): Likewise.
860 2005-03-27 Jim Meyering <jim@meyering.net>
862 * src/dcgen: Simplify further, clean up.
863 Add a standard-output-closing global destructor.
865 * src/wheel-gen.pl: Use the same global destructor as dcgen.
867 2005-03-26 Paul Eggert <eggert@cs.ucla.edu>
869 * src/dcgen: Squeeze multiple blanks into one. Output a simple
870 array of adjacent strings rather than a more complicated data
871 structure; this saves space in the dircolors executable.
872 * src/dircolors.c (parse_line): Use char *, not unsigned char *.
874 (dc_parse_stream, main): Avoid casts.
875 Adjust to simpler data structure generated by new dcgen.
877 2005-03-25 Eric Blake <ebb9@byu.net> (tiny change)
879 * src/ls.c (usage): Document usage of LS_COLORS.
881 2005-03-25 Paul Eggert <eggert@cs.ucla.edu>
883 * src/dircolors.hin: Add "TERM cygwin".
885 2005-03-25 Jim Meyering <jim@meyering.net>
887 * src/system.h (DECIMAL_DIGIT_ACCUMULATE): Reverse the sense of
888 the return value, and update callers:
889 * src/cut.c (set_fields): Update use of DECIMAL_DIGIT_ACCUMULATE.
890 * src/expand.c (parse_tab_stops, main): Likewise.
891 * src/split.c (main): Likewise.
892 * src/unexpand.c (parse_tab_stops, main): Likewise.
893 * src/uniq.c (main): Likewise.
895 2005-03-22 Jim Meyering <jim@meyering.net>
897 * build-aux: New directory. Renamed from config.
898 * configure.ac: Reflect renaming: config -> build-aux.
899 * Makefile.am (dist-hook): Likewise.
900 * Makefile.maint: Likewise.
901 * Makefile.cfg (cvs_files): Likewise.
902 * .x-sc_sun_os_names: Likewise.
903 * .x-sc_trailing_blank: Likewise.
905 * src/ls.c (get_funky_string): Use '\a', rather than 7, for
906 portability to EBCDIC hosts.
908 2005-03-20 Jim Meyering <jim@meyering.net>
910 * src/pr.c (init_header): Add missing `%' in new format string.
911 (init_header): Use zero-filled `.%09d' format, not space-filled `.%9d'.
913 2005-03-19 Jim Meyering <jim@meyering.net>
915 * src/Makefile.am (pr_LDADD): Now that pr uses gettime, add
916 $(LIB_CLOCK_GETTIME) to get the required -lrt on newer Linux systems.
918 2005-03-18 Paul Eggert <eggert@cs.ucla.edu>
920 * NEWS: pr -D "FORMAT" now accepts the same formats that
922 * src/pr.c: Include strftime.h, timespec.h.
923 (init_header): Obtain and format nanosecond part of time stamp.
925 * NEWS: nohup now ignores the umask when creating nohup.out.
926 nohup now closes stderr if it is a terminal and stdout is closed.
927 * src/nohup.c (main): Likewise. Be a little more paranoid about
928 return values; e.g., check for any negative return from open.
929 Assume free (NULL) works.
930 Close file descriptor leak when redirecting standard output to a file.
932 2005-03-17 Jim Meyering <jim@meyering.net>
934 * src/cut.c (set_fields): Use DECIMAL_DIGIT_ACCUMULATE macro,
935 in place of functionally-equivalent code.
936 * src/expand.c (parse_tab_stops, main): Likewise.
937 * src/split.c (main): Likewise.
938 * src/unexpand.c (parse_tab_stops, main): Likewise.
939 * src/uniq.c (main): Likewise.
940 * src/od.c: Use VERIFY macro in place of an equivalent open-coded
942 * src/system.h (VERIFY, VERIFY_EXPR, DECIMAL_DIGIT_ACCUMULATE):
945 Before, this command would make uniq skip 11 fields and print
947 $ _POSIX2_VERSION=1 ./uniq -f1 -1 <(seq --format='1 %g' 2)
950 * src/uniq.c (main): Interpret `uniq -f1 -1' like `uniq -f1',
951 not like `uniq -f11'.
953 2005-03-15 Jim Meyering <jim@meyering.net>
955 Both `pr -0' and e.g., `pr -03' would evoke `column count too large'.
956 `pr -0' should give a better diagnostic and `pr -03' should be
957 equivalent to `pr -3'.
958 * src/pr.c (parse_column_count): Change return type to void.
959 Call error (EXIT_FAILURE, ... for an invalid string.
960 (main): Allocate space for column_count_string using malloc.
961 Accumulate all old-style column-count digits before converting.
962 When the number of columns is specified via both old-style,
963 (e.g., -3), and a long option (--columns=5), ensure that only
964 the last one specified takes effect.
965 * tests/pr/Test.pm: Add tests for the above.
967 2005-03-15 Corinna Vinschen <corinna@vinschen.de> (tiny change)
969 * src/copy.c (copy_reg): Copy regular files in binary mode.
971 2005-03-14 Paul Eggert <eggert@cs.ucla.edu>
973 * NEWS: Restate why ls limits time stamp lengths.
975 2005-03-12 Jim Meyering <jim@meyering.net>
977 Add a little infrastructure to help prevent future bugs like the
979 * src/stat.c (xstrcat): New function.
980 (print_statfs, print_stat): Add buf_len parameter and convert all
981 uses of strcat to xstrcat. Update callers.
982 (print_it): Call print_func with buf_len parameter.
984 Invoking stat -c FMT with a lone format directive of %s, %f, %h, %s,
985 could cause a buffer overrun error.
986 * src/stat.c (print_it): Allocate 2 more bytes, to accommodate our
987 conversion of the stat %s format string to the longer printf %llu one.
988 Patch from Guochun Shi.
990 2005-03-11 Paul Eggert <eggert@cs.ucla.edu>
992 * src/ls.c (TIME_STAMP_LEN_MAXIMUM): New constant.
993 (long_time_expected_width, print_long_format): Use it, to avoid
994 some possible denial-of-service attacks.
995 * NEWS: Document this.
997 2005-03-11 Jim Meyering <jim@meyering.net>
999 Prompt once again for `mv -i A B' when A and B are hard links
1000 to the same file. This fixes a bug introduced by my 2003-04-04
1001 (coreutils-5.0.1) change. Reported by Thomas Wolff via Eric Blake.
1002 * src/copy.c (abandon_move): New function, factored out of
1003 copy_internal, now that this code is being used from two places.
1004 (copy_internal): Perform the same interactive-related test for
1005 whether it's alright to proceed and (usually) overwrite the
1007 * tests/mv/i-4: Add tests for the above.
1009 Don't segfault for a very long date format string, e.g.,
1010 ls -ld --time-style=+%99999999H .
1011 * src/ls.c (long_time_expected_width): Use x2nrealloc, not alloca,
1012 so format string abuse cannot provoke stack overflow.
1013 (print_long_format): Likewise.
1015 Don't segfault for a long header date string, e.g.,
1016 echo a|pr -D +%9999999A
1017 * src/pr.c (init_header): Use x2nrealloc, rather than alloca.
1018 Don't bother with fixed-sized initial buffer; always use x*alloc.
1020 * src/pr.c (init_header): Use slightly clearer INT_BUFSIZE_BOUND
1021 in place of equivalent INT_STRLEN_BOUND + 1.
1022 * src/expr.c (tostring, printv): Likewise.
1024 2005-03-09 Paul Eggert <eggert@cs.ucla.edu>
1026 * src/system.h: Include intprops.h.
1027 (TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_STRLEN_BOUND): Remove;
1028 they are now defined in intprops.h.
1030 2005-03-09 Jim Meyering <jim@meyering.net>
1032 * TODO: Remove entry about named pipes. It was fixed in 5.3.0.
1034 2005-03-08 Paul Eggert <eggert@cs.ucla.edu>
1036 * src/date.c (usage): Redo to match recent documentation changes.
1037 Don't bother documenting which usages are GNU extensions; the list
1038 wasn't correct, and is better left to the printed manual anyway.
1040 2005-03-06 Jim Meyering <jim@meyering.net>
1042 Factor out column-count processing.
1043 * src/pr.c: Include "inttostr.h".
1044 (parse_column_count): New function.
1045 (main): Use the new function for both old-style, -9, and long,
1046 --columns=-9, options.
1048 * src/cksum.c: Remove `register' keyword.
1049 * src/cut.c: Likewise.
1050 * src/dd.c: Likewise.
1051 * src/env.c: Likewise.
1052 * src/factor.c: Likewise.
1053 * src/fmt.c: Likewise.
1054 * src/fold.c: Likewise.
1055 * src/id.c: Likewise.
1056 * src/logname.c: Likewise.
1057 * src/ls.c: Likewise.
1058 * src/pr.c: Likewise.
1059 * src/printf.c: Likewise.
1060 * src/shred.c: Likewise.
1061 * src/sort.c: Likewise.
1062 * src/sum.c: Likewise.
1063 * src/test.c: Likewise.
1064 * src/tsort.c: Likewise.
1065 * src/uniq.c: Likewise.
1066 * src/wc.c: Likewise.
1067 * src/whoami.c: Likewise.
1069 2005-03-01 Paul Eggert <eggert@cs.ucla.edu>
1071 * src/Makefile.am (nanosec_libs): Remove $(LIB_XANOSLEEP); no
1074 2005-03-01 Jim Meyering <jim@meyering.net>
1076 * src/copy.c (copy_internal): Change test of source type from
1077 !S_ISREG to S_ISLNK. Reported by Paul Eggert in
1078 http://lists.gnu.org/archive/html/bug-coreutils/2004-10/msg00050.html.
1080 2005-02-28 Jim Meyering <jim@meyering.net>
1082 * NEWS: Mention that xnanosleep fixes sleep failure on linux-2.6.8.1.
1084 2005-02-21 Paul Eggert <eggert@cs.ucla.edu>
1086 * src/Makefile.am (dd_LDADD, shred_LDADD): Add $(LIB_GETHRXTIME).
1087 (nanosec_libs): Add $(LIB_XNANOSLEEP). Needed for newer GNU/Linux
1088 hosts with clock_gettime.
1090 2005-02-20 Paul Eggert <eggert@cs.ucla.edu>
1092 * NEWS: Describe user-visible change to dd.
1093 * src/Makefile.am (dd_LDADD, shred_LDADD, nanosec_libs):
1094 Remove $(LIB_CLOCK_GETTIME). These functions now use
1096 * src/dd.c: Include gethrxtime.h, xtime.h.
1097 (start_time): Now of type xtime_t, not struct timespec.
1098 (print_stats, main): Use gethrxtime rather than gettime.
1099 * src/ls.c (time): Remove obsolete decl.
1100 (get_current_time): gettimeofday always returns 0, so don't
1102 * src/shred.c: Include gethrxtime.h.
1103 (isaac_seed): Use gethrxtime rather than a mishmash.
1104 * src/touch.c (time): Remove obsolete decl.
1106 * tests/misc/split-fail: Don't assume that the current host
1107 supports integers wider than 32 bits. Fix comment typo.
1108 * tests/od/x8: Likewise.
1110 * src/chown-core.c (enum RCH_status): Remove trailing comma,
1111 as it's not valid in standard C89.
1113 2005-02-15 Jim Meyering <jim@meyering.net>
1115 * src/stat.c (human_fstype): Add case/definition for S_MAGIC_XFS
1116 so that file systems of type `xfs' are recognized as such.
1117 * src/fs.h: Regenerate.
1118 Reported by Bernd Eckenfels.
1119 * src/stat.c (human_fstype): Likewise for S_MAGIC_JFS/jfs.
1120 * src/fs.h: Regenerate.
1121 Reported by Andreas Schwab.
1123 * src/nice.c (NZERO) [NZERO == 0]: Undefine and define to 20,
1124 to work around the invalid definition from Darwin 7.7.0.
1125 Test failure reported by Sébastien Maret.
1127 2005-02-14 Paul Eggert <eggert@cs.ucla.edu>
1129 * src/sort.c (mergefps): Use binary search rather than linear one
1130 when comparing new line to lines already in main memory.
1131 Idea suggested by James Lemley.
1133 2005-02-09 Jim Meyering <jim@meyering.net>
1135 * src/copy.c (valid_options): Add an assertion that
1136 not both hard_link and symbolic_link are set.
1138 2005-02-08 Paul Eggert <eggert@cs.ucla.edu>
1140 * NEWS: Document stat -f -c %S, plus changes to default formats.
1141 * doc/coreutils.texi (stat invocation): Normalize terminology,
1142 capitalization, and sort order to match --help output. Mention %c
1143 for file systems. Add new -f -c format %S, and document %s versus %S;
1144 problem reported by Jeroen van Wolffelaar.
1145 * src/stat.c (usage): Likewise.
1146 (STATFS_FRSIZE): New macro.
1147 (print_statfs): Use it, for stat -f -c %S.
1148 (do_statfs): Change default formats to output %S.
1150 2005-02-03 Paul Eggert <eggert@cs.ucla.edu>
1152 * src/system.h: Include "memrchr.h".
1153 (memrchr) [!HAVE_DECL_MEMRCHR]: Remove decl.
1155 2005-02-02 Jim Meyering <jim@meyering.net>
1157 * tests/du/8gb: Also adjust the test (s/64/128/) to detect
1158 systems that don't support sparse files.
1159 Check for $2 -ge 128, rather than $2 = 128, in case
1160 there is a file system type that doesn't support sparse files,
1161 yet for which metadata takes up additional space.
1162 Both reported by Andreas Schwab.
1164 2005-02-01 Eric Blake <ebb9@byu.net> (tiny change)
1166 * tests/du/8gb: Create a larger test file, so we properly
1167 detect that sparse files can be created on NTFS under cygwin.
1169 2005-01-30 Jim Meyering <jim@meyering.net>
1171 * src/head.c (elide_tail_bytes_pipe): Correct wording in diagnostic.
1173 * src/stty.c: Remove unnecessary parentheses in all #if directives.
1175 2005-01-29 Eric Blake <ebb9@byu.net> (tiny change)
1177 * .cvsignore: Ignore config.cache and config.status.lineno.
1178 * src/stty.c [VSWTCH]: Some systems, like Cygwin, use VSWTC
1179 instead of VSWTCH, for use with CSWTCH.
1181 2005-01-29 Eric Blake <ebb9@byu.net> (tiny change)
1183 * tests/Makefile.am (.PHONY): Add check-root and root-hint.
1184 * tests/rwx-to-mode: Ignore ACL designation.
1185 * tests/setgid-check: Likewise.
1186 * tests/chown/separator: Quote user and group names.
1188 2005-01-24 Jim Meyering <jim@meyering.net>
1190 * src/cp.c (usage): Merge the descriptions of --no-dereference and -P.
1191 Suggestion from Johan Boule.
1193 2005-01-17 Eric Blake <ebb9@byu.net> (tiny change)
1195 * src/Makefile.am (all_programs.list): Strip $(EXEEXT) and remove
1197 * man/Makefile.am (all_programs): Revert previous patch; updated
1198 all_programs.list fixes this.
1199 (.x.1): No need to add $(EXEEXT).
1201 2005-01-03 Corinna Vinschen <corinna@vinschen.de> (tiny change)
1203 * src/system.h: Use S_BLKSIZE value for ST_NBLOCKSIZE where
1206 2005-01-22 Jim Meyering <jim@meyering.net>
1208 * Makefile.maint (v_etc_file): The version string has moved to
1209 version-etc-fsf.c, search that new file, not version-etc.c.
1211 2005-01-17 Paul Eggert <eggert@cs.ucla.edu>
1213 * tests/group-names: Use numeric group ids, not symbolic group names,
1214 since the latter can have shell metacharacters in them (e.g., spaces).
1215 Problem reported by Eric Blake.
1216 * tests/chgrp/basic: Assume groups are numeric, not symbolic.
1217 * tests/chgrp/deref: Likewise.
1218 * tests/chgrp/posix-H: Likewise.
1219 * tests/chgrp/recurse: Likewise.
1221 2005-01-15 Jim Meyering <jim@meyering.net>
1223 * src/shred.c (isaac_seed) [HAVE_GETHRTIME]: #if-0 this block,
1224 because just calling gethrtime evokes an `illegal instruction'
1225 failure when compiled with Sun's c89 on Solaris 8 and 9.
1226 Reported by Nelson Beebe.
1228 * src/shred.c (isaac_seed) [HAVE_GETHRTIME]: Don't call ISAAC_SEED
1229 twice with the same value of `t'.
1230 Replace nested #if-#else blocks with #if-#elif-#elif chain.
1232 2005-01-14 Jim Meyering <jim@meyering.net>
1234 The test, tests/tail/f-1, failed on powerpc-apple-darwin7.7.0.
1235 * src/tail.c (IS_TAILABLE_FILE_TYPE): Adjust definition also to include
1236 sockets, since that's what you get when reading from a command-line-
1237 supplied pipe on Darwin 7.7.
1238 (IS_PIPE_LIKE_FILE_TYPE): Define.
1239 (main): Use new IS_PIPE_LIKE_FILE_TYPE rather than simply S_ISFIFO.
1240 Reported by Nelson Beebe.
1241 This same change is also required on NetBSD/sparc-1.5.
1242 Reported by Adrian Bunk.
1244 * src/expr.c (toarith): Rewrite to detect/diagnose integer overflow,
1245 rather than suffering silently.
1246 Before, expr would silently overflow and wrap around:
1247 $ expr 9223372036854775808 = 0 # $(echo 2^63|bc)
1249 Now it detects the problem and exits nonzero:
1250 $ ./expr $(echo 2^63|bc) = 0
1251 ./expr: 9223372036854775808: integer is too large
1253 * tests/chown/separator (id_gn): Exit 77, not 1, for a test-framework
1254 failure, so that doesn't cause `make check' to stop. Nelson Beebe
1255 reported that this test would fail with the diagnostic,
1256 `cannot find name for group ID 10', on one of his systems.
1258 2005-01-13 Jim Meyering <jim@meyering.net>
1260 * src/test.c (is_int): Don't overflow when evaluating integer
1261 constants. Before, ./test $(echo 2^64|bc) -eq 0 && echo FAIL
1264 * tests/Fetish.pm (run_tests): Add code (if-0'd out) to detect
1265 names of temporary files that would clash on 8.3 file systems.
1266 * tests/mk-script (validate): Likewise.
1268 2005-01-12 Jim Meyering <jim@meyering.net>
1270 * tests/dd/skip-seek: Shorten test names to accommodate 8.3 systems.
1272 * tests/tr/Test.pm (repeat-xC): Change test name from
1273 `repeat-Compl', to avoid 8.3 conflict with `repeat-compl'.
1274 Reported by Eric Blake.
1275 (repeat-000): Rename to `repeat-zeros' for the same reason.
1277 2005-01-11 Jim Meyering <jim@meyering.net>
1279 * configure.ac: Update version to 5.3.1.
1281 2005-01-11 Eric Blake <ebb9@byu.net>
1283 * src/Makefile.am (check-README, check-AUTHORS): Account for $(EXEEXT).
1284 * man/Makefile.am (all_programs): Account for $(EXEEXT).
1286 2005-01-11 Jim Meyering <jim@meyering.net>
1288 * src/unexpand.c (add_tab_stop): Properly diagnose a tabstop list
1289 with decreasing values.
1291 * src/expand.c (main): Likewise.
1292 * src/unexpand.c (main): Check for overflow in tabstop values
1293 specified via the obsolete form. E.g., now this command fails:
1294 _POSIX2_VERSION=1 ./unexpand -$(echo '2^64+1'|bc)
1295 Before it would act like `_POSIX2_VERSION=1 ./unexpand -1'.
1296 * tests/unexpand/basic-1 (obs-ovflo): New test for this.
1298 2005-01-10 Paul Eggert <eggert@cs.ucla.edu>
1300 Respond to POSIX interpretations about pathchk -p dated 2005-01-06.
1301 * NEWS: Document the changes.
1302 * doc/coreutils.texi (pathchk invocation): Likewise.
1303 * src/pathchk.c (PORTABILITY_OPTION): New constant.
1304 (longopts, usage, main, validate_file_name):
1305 Add support for new -P option.
1306 Reject empty file names (unless -p is not specified and the
1307 current system allows empty file names).
1308 Change --portability so that is now equivalent to -p -P.
1309 Don't test whether file name is too long, if it is known to exist.
1310 (no_leading_hyphen): New function.
1311 * tests/misc/pathchk1: Add tests for empty file names and
1314 2005-01-08 Jim Meyering <jim@meyering.net>
1318 `pr --columns=N' was not equivalent to `pr -N' when also using
1321 * src/pr.c (main): Set `explicit_columns' for --columns=N,
1322 not just for -N. This bug has existed since the introduction
1323 of the --columns=N option on 1998-08-15.
1324 * NEWS: Document this.
1325 * tests/pr/Test.pm (test_vector): For each -N test, automatically
1326 create a new test vector using --columns=N.
1328 2005-01-07 Paul Eggert <eggert@twinsun.com>
1330 * src/pr.c (main): Check for column count overflow with
1331 usages like "pr -2147483648".
1333 2005-01-07 Jim Meyering <jim@meyering.net>
1335 * src/pr.c (init_fps): Use xnmalloc, rather than xmalloc.
1337 2005-01-06 Jim Meyering <jim@meyering.net>
1339 * README: List the precise HP-UX version numbers that are affected.
1340 Suggestion from Bob Proulx.
1342 * Makefile.maint (sc_changelog): Specify find's `-maxdepth 2'
1343 predicate before `-name ChangeLog' to avoid a harmless warning
1346 2005-01-05 Jim Meyering <jim@meyering.net>
1348 * tests/help-version: Punt on the uptime test, since it fails when
1349 it can't get boot time, and I don't want that to stop `make check'.
1351 * src/du.c (process_file): Evaluate exclusion rules against
1352 the entire file name, not just the last component.
1353 Reported by Robert Lindgren.
1354 * tests/du/exclude: Test for this.
1355 * NEWS: Document this.
1357 Ensure that tests/Makefile.am's check-root actions stay up to date.
1358 * Makefile.maint (sc_root_tests): New rule.
1359 (syntax-check-rules): Add it to the list.
1361 2005-01-04 Jim Meyering <jim@meyering.net>
1363 * man/shred.x: Change one-line summary to reflect that shred does
1364 not remove files by default. Suggestion from Helen Faulkner in
1365 http://bugs.debian.org/288552
1367 * README: Request VERBOSE=yes output when reporting test failures.
1368 Other minor changes.
1370 * tests/Makefile.am (check-root): Update.
1372 2005-01-03 Paul Eggert <eggert@cs.ucla.edu>
1374 * src/system.h: Undo previous change; we now use Autoconf.
1376 2005-01-03 Jim Meyering <jim@meyering.net>
1378 * tests/stty/row-col-1: Don't set rows or columns to zero, to avoid
1379 a bug in the TIOCGWINSZ ioctl on at least Solaris5.9 systems. Setting
1380 either (or both) to zero would succeed, but subsequent `stty size'
1381 would say `no size information for this device' due to the ioctl
1382 failing with EINVAL.
1384 * src/system.h: If PRIdMAX, PRIoMAX, PRIuMAX, and PRIxMAX are
1385 not all defined and either ULONG_MAX or ULLONG_MAX is not defined,
1386 then fail at compile-time rather than let tools like od produce
1387 invalid results at run time.
1389 2004-12-21 Jim Meyering <jim@meyering.net>
1391 * src/csplit.c (usage): Say the default names are `xx00, xx01, ...',
1392 not `xx01, xx02, ...'.
1393 Reported by Matt Kraai in http://bugs.debian.org/286605
1395 * tests/misc/split-fail: Avoid spurious failure on x86 Solaris5.9
1398 2004-12-20 Paul Eggert <eggert@cs.ucla.edu>
1400 * src/split.c (usage): Mention default size. Suggested by Dan Jacobson.
1402 2004-12-19 Paul Eggert <eggert@cs.ucla.edu>
1404 * NEWS: Mention that one should eval "`dircolors`" rather than
1407 2004-12-17 Jim Meyering <jim@meyering.net>
1409 * tests/mv/hard-link-1: Rearrange to use newer trap-handling code,
1410 so temporary directories aren't left behind upon e.g., interrupt.
1412 2004-12-16 Paul Eggert <eggert@cs.ucla.edu>
1414 * src/ls.c (print_dir): Use "%s: not listing already-listed
1415 directory", not "not listing already-listed directory: %s", to
1416 format already-listed directories, to be consistent with other
1417 diagnostics involving file names and colons.
1419 2004-12-15 Jim Meyering <jim@meyering.net>
1421 * src/Makefile.am (__LDADD): Define, so that building `[' on
1422 Solaris still uses the -lgen library that it requires in order
1423 to get a definition of eaccess.
1425 2004-12-14 Jim Meyering <jim@meyering.net>
1427 tac would exit immediately upon I/O or temp-file creation failure.
1428 Now it continues on, processing any remaining command line arguments.
1430 * src/tac.c: Include quotearg.h.
1431 Use quotearg_colon in most diagnostics.
1432 (copy_to_temp): Rewrite not to exit upon I/O or temp-file-creation
1433 failure. Before, this command (with /full/tmp being a full partition)
1434 TMPDIR=/full/tmp ./tac /proc/modules tac.c
1435 would exit immediately upon the write error while trying to copy
1436 non-seekable /proc/modules to the full partition. Now it still
1437 reports the failure but continues on with the remaining file.
1438 (tac_nonseekable): Return false also if copy_to_temp fails.
1439 [DONT_UNLINK_WHILE_OPEN]: Add a FIXME comment explaining that
1440 using atexit like this is wrong.
1441 * NEWS: Document this.
1442 * tests/misc/tac-continue: New test for this.
1443 * tests/misc/Makefile.am (TESTS): Add tac-continue.
1445 * tests/chown/basic: Add a few more tests.
1447 2004-12-13 Paul Eggert <eggert@cs.ucla.edu>
1449 * src/ls.c (gobble_file): Change arg name to be command_line_arg
1450 rather than explicit_arg, for consistency with copy.c.
1451 (extract_dirs_from_files): Remove ignore_dot_and_dot_dot arg, since
1452 it is deducible from dirname arg. All callers changed.
1453 (extract_dirs_from_files, print_dir, queue_directory):
1454 Add command_line_arg arg. All callers changed.
1455 (struct pending): Add command_line_arg member.
1456 (main): Use NULL rather than 0 when appropriate.
1457 (set_exit_status, file_failure): New functions.
1458 (queue_directory): Store command_line_arg into new structure.
1459 (print_dir, gobble_file, get_link_name):
1460 Use file_failure to report problems in accessing files,
1461 so that the exit status is set consistently.
1462 (print_dir): Simplify readdir failure code yet again.
1463 If closedir fails, report "closing directory" rather than "reading
1465 (xstrcoll): Use set_exit_status to set status on failure.
1466 * tests/ls-2/tests (no-a-isdir-b): This now exits with status 2,
1469 2004-12-11 Jim Meyering <jim@meyering.net>
1471 Avoid a race condition vulnerability in chown, when used with
1472 --from=O:G and without the (-h) --no-dereference option.
1473 * src/chown-core.c (restricted_chown): New function.
1474 (change_file_owner): Call it.
1475 Reported by Ulrich Drepper.
1476 * NEWS: Mention this.
1478 2004-12-09 Paul Eggert <eggert@cs.ucla.edu>
1480 * ls now exits with status 1 on minor problems, 2 if serious trouble.
1481 * NEWS: Document this.
1482 * src/ls.c (LS_MINOR_PROBLEM, LS_FAILURE): New constants.
1483 All uses of EXIT_FAILURE replaced with LS_FAILURE, unless
1485 (main): Initialize exit failure to LS_FAILURE.
1486 (print_dir, gobble_file, get_link_name, xstrcoll):
1487 Set exit status to LS_MINOR_PROBLEM if the failure is minor.
1488 (print_dir): Do not give up on entire directory merely because readdir
1490 (usage): Explain exit status.
1491 * tests/help-version: ls and variants now exit with status 2
1494 2004-12-08 Paul Eggert <eggert@cs.ucla.edu>
1496 * NEWS: Document new UTC+HH:MM date syntax, and put date changes
1499 2004-12-07 Paul Eggert <eggert@cs.ucla.edu>
1501 * src/factor.c (factor): Don't list 1 as a factor of 1.
1502 Problem reported by Thomas Folz-Donahue.
1504 2004-12-06 Jim Meyering <jim@meyering.net>
1506 * tests/du/files0-from: Sanitize environment.
1507 Otherwise, e.g., BLOCKSIZE=k would cause a failure, and that
1508 setting is the default (exported from /etc/profile) on at least one
1510 * tests/du/no-deref: Likewise.
1511 * tests/cp/symlink-slash: Likewise.
1512 * tests/ls/symlink-slash: Likewise
1514 2004-12-05 Jim Meyering <jim@meyering.net>
1516 * tests/tail/Test.pm (err-6) ["tail -c"]: Avoid test failure when
1517 _POSIX2_VERSION=199209 is in the environment, or when building on
1520 2004-12-04 Jim Meyering <jim@meyering.net>
1522 * NEWS: Mention cut's new --complement option.
1524 2004-10-01 Paolo Bonzini <bonzini@gnu.org>
1526 * cut.c (complement, COMPLEMENT_OPTION): New.
1527 (longopts): Add --complement.
1528 (usage): Say not that -b, -c, and -f `print' fields,
1529 but rather that they `select' fields for printing.
1530 Describe the new --complement option.
1531 (mark_range_start): Extracted from set_fields.
1532 (print_kth): Support --complement.
1533 (compare_ranges): New function.
1534 (set_fields): Rewrite the part that populates range_start_ht,
1535 merging it with the part that populates printable_field.
1536 (main): Handle --complement.
1538 2004-12-03 Paul Eggert <eggert@cs.ucla.edu>
1540 * src/tail.c (tail_file): Set errnum to -1 if the initial "tail"
1541 failed. This works around an assertion failure reported by
1543 http://lists.gnu.org/archive/html/bug-coreutils/2004-12/msg00012.html
1545 2004-12-02 Jim Meyering <jim@meyering.net>
1547 With using --color and with LS_COLORS saying not to color
1548 executables, don't stat every file.
1549 * src/ls.c (is_colored): New function.
1550 (gobble_file): Use it.
1551 (main): Use it here, in place of too-strict tests against NULL:
1552 if either ORPHAN or MISSING was set to 0 from LS_COLORS, the
1553 old test would fail.
1555 2004-12-01 Paul Eggert <eggert@cs.ucla.edu>
1557 * src/comm.c (compare_files): Assume setlocale exists.
1558 * src/join.c (keycmp): Likewise.
1559 * src/seq.c (decimal_point): Treat like sort. Now char.
1561 (main): Assume localeconv exists. Use same code as sort.
1562 * src/sort.c (C_DECIMAL_POINT): Remove. Use changed to '.'.
1563 Assume setlocale exists.
1564 (thousands_sep): Renamed from th_sep.
1565 (IS_THOUSANDS_SEP): Remove. All uses replaced by comparisons.
1566 (NONZERO): Parenthesize use of arg.
1567 (numcompare): Avoid duplicate loads. Use ISDIGIT as boolean, for
1568 consistency. Avoid unnecessary negation by reversing
1570 (main): Rewrite localeconv call to match seq.c.
1571 * src/system.h: Assume locale.h exists.
1572 (HAVE_SETLOCALE): Remove.
1573 * src/uniq.c (different): Assume setlocale exists.
1575 * src/ls.c (sort_files): Minor cleanup. Remove an unnecessary
1576 'volatile' on a local variable. Rewrite to avoid unnecessary
1577 double-assignment to 'func' in the usual case where strcoll does
1580 2004-11-30 Paul Eggert <eggert@cs.ucla.edu>
1582 * src/pinky.c (gethostname): Remove decl.
1583 (scan_entries): Use IS_USER_PROCESS instead of by-hand code.
1584 * src/uptime.c (print_uptime): Use IS_USER_PROCESS and
1585 UT_TYPE_BOOT_TIME instead of by-hand code.
1586 * src/users.c (list_entries_users): Use IS_USER_PROCESS
1587 instead of by-hand code.
1588 * src/who.c (USER_PROCESS, RUN_LVL, INIT_PROCESS, LOGIN_PROCESS,
1589 DEAD_PROCESS, BOOT_TIME, NEW_TIME, UT_TYPE_UNDEF, UT_TYPE): Remove.
1590 (IS_USER_PROCESS): Move to ../lib/readutmp.h.
1591 (UT_TYPE_RUN_LVL, UT_TYPE_INIT_PROCESS, UT_TYPE_LOGIN_PROCESS,
1592 UT_TYPE_DEAD_PROCESS, UT_TYPE_NEW_TIME): New macros.
1593 (gethostname): Remove decl.
1594 (list_entries_who, scan_entries): Use the new macros defined above,
1595 for consistency with pinky, uptime, and users.
1597 2004-11-25 Paul Eggert <eggert@cs.ucla.edu>
1599 Fix problem reported by Scott S. Tinsley for HP-UX 11.11 using
1600 HP's ANSI C compiler. Declaring int functions causes warnings on
1601 some modern systems and shouldn't be needed to compile on ancient
1603 * src/copy.h (stat, lstat, rename): Remove decls.
1604 * src/install.c (stat): Remove decl.
1605 * src/ln.c (link, symlink): Remove decls.
1607 2004-11-25 Jim Meyering <jim@meyering.net>
1609 * man/help2man: Import help2man-1.35.1.
1610 * man/Makefile.am (.x.1): Remove now-unnecessary use of
1611 locally-added --program-name=NAME option. Now, help2man gets
1612 the name from the [NAME] section (i.e. from our .x file).
1613 * man/install.x: Use `install', not `ginstall' in the one-line
1614 description. Reported by Brendan O'Dea.
1615 * man/sha1sum.x: Use `sha1sum', not `shasum'.
1617 2004-11-24 Jim Meyering <jim@meyering.net>
1619 Since the changes of 2004-05-22, the u.saved_cwd member at
1620 the bottom of the active-directory stack was no longer
1621 strictly necessary. This change removes that member and uses
1622 the newer cwd_state parameter for the final restore_cwd.
1624 * src/remove.c (struct AD_ent) [u]: Remove now-unnecessary union.
1625 [dev_ino]: Rename from `a'.
1626 (AD_pop_and_chdir): Add a parameter to play the role of just-removed
1627 bottom-of-stack cwd-state member.
1628 (AD_pop_and_chdir): No longer return boolean. Adjust caller.
1629 (AD_push_initial): Remove CWD parameter. Adjust caller.
1631 2004-11-23 Paul Eggert <eggert@cs.ucla.edu>
1633 Minor performance improvements and cleanups for "touch".
1634 * src/touch.c (posix_date): Remove; not needed as a static var.
1636 (touch): Use new futimens function to operate more efficiently
1637 in some cases. Don't stat/fstat existing file when
1638 (!amtime_now && change_times == (CH_ATIME | CH_MTIME)); the
1639 old time stamps aren't needed in that case.
1640 (main): change_times is int, not bool. Simplify test for
1643 2004-11-20 Paul Eggert <eggert@cs.ucla.edu>
1645 * src/install.c (usage): Avoid usage that runs afoul of Docbook
1646 translation. Problem reported by Eric S. Raymond.
1648 Restore dd's noctty flag, reverting the change of 2004-04-08.
1649 POSIX does not allow "dd" to use O_NOCTTY by default.
1650 * NEWS: Add noctty flag to dd.
1651 * doc/coreutils.texi (dd invocation): Likewise.
1652 * src/dd.c (flags, usage, main): Likewise.
1654 2004-11-19 Alfred M. Szmidt <ams@gnu.org>
1656 * src/ls.c (usage): Clarified description of --no-group (-G),
1657 --human-readable (-h), --inode (-i), --size (-s), --time,
1660 2004-11-19 Jim Meyering <jim@meyering.net>
1662 * src/ls.c (usage): Clarify description of --author.
1663 Tweak indentation so that help2man creates better nroff.
1664 Reported by Dan Jacobson.
1666 * src/uniq.c (check_file): Don't check stdout for errors here.
1668 * src/pwd.c (find_dir_entry): Update comment to match reality.
1670 2004-11-18 Jim Meyering <jim@meyering.net>
1672 * src/pwd.c (robust_getcwd): Correct the comment: this function
1673 constructs the directory name. The caller prints it.
1675 2004-11-16 Paul Eggert <eggert@cs.ucla.edu>
1677 * src/stat.c (STATFS): New macro, for portability to Solaris 9.
1678 (do_statfs): Use it.
1680 * src/basename.c, src/chroot.c, src/cksum.c, src/dd.c, src/dirname.c,
1681 src/factor.c, src/hostid.c, src/hostname.c, src/link.c, src/logname.c,
1682 src/nohup.c, src/printenv.c, src/pwd.c, src/setuidgid.c, src/sleep.c,
1683 src/sync.c, src/tsort.c, src/unlink.c, src/uptime.c, src/users.c,
1684 src/whoami.c, src/yes.c (main): Use getopt_long rather than getopt.
1685 * src/readlink.c (main): argv is not const.
1687 * src/cut.c (usage): Improve documentation along the lines suggested
1689 * src/echo.c (usage): Likewise.
1690 * src/expr.c (usage): Likewise.
1692 * src/dircolors.hin: Add putty, screen-bce.
1694 * src/pinky.c (print_entry): Fix memory leak.
1695 * src/who.c (print_user): Likewise.
1697 2004-11-15 Paul Eggert <eggert@cs.ucla.edu>
1699 * NEWS: New dd operand "status=noxfer".
1700 * src/dd.c (C_ASCII, C_EBCDIC, C_IBM, C_BLOCK, C_UNBLOCK,
1701 C_LCASE, C_UCASE, C_SWAB, C_NOERROR, C_NOTRUNC, C_SYNC, C_TWOBUFS,
1702 C_NOCREAT, C_EXCL, C_FDATASYNC, C_FSYNC): Now constants, not
1704 (STATUS_NOXFER, statuses): New constants.
1705 (usage, print_stats, scanargs): Add support for status=noxfer.
1706 (usage): Update status output to match new behavior.
1707 (print_stats): Always output complete byte count.
1708 Put space between numbers and units, as SI requires.
1709 Use ngettext so that i18n can use plurals for "byte" and "second".
1710 Don't multiply by 1e-9 (inexact); divide by 1e9 (which is exact).
1711 (iflag_error_msgid, oflag_error_msgid): Remove; replace uses by
1713 * tests/dd/skip-seek (@Tests): Use status=noxfer to avoid
1714 problems with regression testing.
1716 2004-11-14 Paul Eggert <eggert@cs.ucla.edu>
1718 * NEWS: dd now outputs total bytes, seconds, and bytes per second.
1719 * src/Makefile.am (dd_LDADD): Add $(LIB_CLOCK_GETTIME).
1720 * src/dd.c: Include "human.h".
1721 (w_bytes, start_time): New vars.
1722 (usage): Document new I/O statistics output
1723 (print_stats): Output new I/O statistics.
1724 (cleanup): Do statistics after closing stdin and stdout, so that
1725 the times are more accurate.
1726 (write_output, dd_copy): Count output bytes.
1727 (main): Get initial value of clock.
1729 2004-11-14 Jim Meyering <jim@meyering.net>
1731 Backslash-escape `-'s in email addresses, so that they are
1732 rendered properly in UTF-locales.
1733 * man/help2man (escape_hyphens): New function.
1734 (main): Call it on email addresses.
1736 * src/sort.c (zaptemp): Mark new diagnostic for translation.
1738 * tests/misc/close-stdout: New file. Test today's closeout.c change.
1739 * tests/misc/Makefile.am (TESTS): Add close-stdout.
1741 2004-11-13 Jim Meyering <jim@meyering.net>
1743 * src/test.c (usage): Put the description of `[-n] STRING'
1744 on two lines, one for `-n STRING' and one for `STRING' so that
1745 help2man properly escapes the `-'. Otherwise, the hyphen is
1746 rendered inappropriately in UTF-8 locales.
1747 Reported by Uwe Zeisberger in http://bugs.debian.org/281069.
1749 2004-11-12 Paul Eggert <eggert@cs.ucla.edu>
1751 * NEWS: Document the following changes.
1753 * src/sort.c: Avoid O(N**2) behavior when there are many temporary
1755 (temptail): New variable, so that we can easily append to list.
1756 (create_temp_file): Create new files at end of list, so that
1757 searching the list has O(N*NMERGE) behavior instead of O(N**2).
1758 (zaptemp): Update temptail if needed.
1759 (mergefps, merge): Accept new arg that counts temp files, and keep it
1760 up to date as we create and remove temporaries. This is for
1761 efficiency, so that we don't call zaptemp so often.
1762 All callers changed.
1763 (sort): Don't create array in reverse order, since the list of
1764 temporaries is now in the correct order.
1766 (zaptemp): Protect against race condition: if 'sort' is
1767 interrupted in the middle of zaptemp, it might unlink the
1768 temporary file twice, and the second time this happens the file
1769 might already have been created by some other process.
1771 (zaptemp): Warn if a temporary file is not removed.
1773 (create_temp_file): Use offsetof for clarity.
1774 (die): Move it up earlier, to clean up the code a bit.
1776 * src/pr.c (strtoumax): Declare if not declared.
1777 (skip_to_page, first_page_number, last_page_number, page_number,
1778 first_last_page, print_header):
1779 Use uintmax_t for page numbers.
1780 (first_last_page): Remove unnecessary forward declaration.
1781 Do not modify arg (it is now a const pointer).
1782 Return a true if successful, false (without print a diagnostic)
1784 (main): If +XXX does not specify a valid page range, treat it
1785 as a file name. This follows the response to Open Group XCU ERN 41
1786 <http://www.opengroup.org/sophocles/show_mail.tpl?source=L&listname=austin-group-l&id=7717>,
1787 which says the behavior is allowed.
1788 (skip_to_page): When starting page number exceeds page count,
1789 print both numbers in the diagnostic.
1790 (print_header): Detect page number overflow.
1792 2004-11-07 Jim Meyering <jim@meyering.net>
1794 * src/uname.c [__APPLE__]: Include <mach/machine.h> and <mach-o/arch.h>.
1795 (main) [__APPLE__]: Get the processor type via syscall rather than
1796 hard-coding "powerpc". From Toby Peterson.
1798 * src/sort.c (merge): Remove declarations of now-unused variables.
1800 2004-11-06 Paul Eggert <eggert@cs.ucla.edu>
1802 * src/sort.c (first_same_file): Remove. Move most of the code to....
1803 (avoid_trashing_input): New function.
1804 (merge): Avoid some silly merges, e.g., copying a single file to
1805 a temporary file when there are exactly 17 input files to merge.
1806 Take a count of temporary files rather than a max_merge arg.
1809 2004-11-06 Jim Meyering <jim@meyering.net>
1811 * src/sort.c (xfclose): Don't close stdout here (just flush it),
1812 since close_stdout now closes stdout unconditionally.
1814 2004-11-05 Paul Eggert <eggert@cs.ucla.edu>
1816 * src/sort.c (inittables, sort_buffer_size, getmonth, mergefps,
1817 first_same_file, merge, sort, main): Use size_t for indexes to arrays.
1818 This fixes some unlikely havoc-wreaking bugs (e.g., more than INT_MAX
1820 (getmonth, keycompare, compare): Rewrite to avoid need for alloca,
1821 thus avoiding unchecked stack overflow in some cases. As a side
1822 effect this improve the performance of "sort -M" by a factor of 4
1825 2004-11-03 Paul Eggert <eggert@cs.ucla.edu>
1827 * src/stty.c: Include "vasprintf.h" since we use vasprintf now.
1829 * src/Makefile.am (check-AUTHORS): Don't assume \? works in a sed
1830 expression; it's not portable. Problem reported by Albert Chin.
1831 Don't invoke a program more than once.
1832 * src/groups.sh (version): New variable, containing author info,
1833 for benefit of AUTHORS check. Use it when acting on --version option.
1834 * AUTHORS: Remove duplicate lines. Remove bogus "chroot:"
1837 * src/system.h: Don't #define and #undef getopt around <stdlib.h>,
1838 as this breaks the new regime that does "#define getopt rpl_getopt".
1839 Problem reported by Albert Chin for Solaris 9 with Sun cc in:
1840 http://lists.gnu.org/archive/html/bug-gnulib/2004-11/msg00019.html
1841 I suppose this may cause problems on ancient hosts with
1842 incompatible getopt declarations, but we'll cross that bridge if
1843 the problem gets reported to us by someone who can test the fix.
1845 2004-11-03 Jim Meyering <jim@meyering.net>
1847 * src/tac.c: quote(...) file names in diagnostics.
1849 2004-10-29 Paul Eggert <eggert@cs.ucla.edu>
1851 * NEWS: Document getdate changes.
1853 2004-10-29 Jim Meyering <jim@meyering.net>
1855 * src/tac.c (tac_file): Remove temporary prototype and move this
1856 function `down' so that it precedes definition of tac_nonseekable.
1858 `tac /proc/modules' would print nothing
1859 Reported by Harald Dunkel in http://bugs.debian.org/278604.
1861 * src/tac.c (copy_to_temp): Renamed from save_stdin, since
1862 now it copies a general file descriptor, not just stdin.
1863 (tac_nonseekable): Renamed/adapted from tac_stdin.
1864 (tac_file): Get fd via `open' directly rather than via fopen/fileno,
1865 since we never used the stream. Perform "-" to stdin mapping here
1866 rather than in main. Determine whether a file is seekable,
1867 by trying to `lseek' to its end, and dispatch to tac_seekable or
1868 tac_nonseekable accordingly.
1869 (main): Rewrite argument handling now that it uses only tac_file.
1870 * NEWS: Mention it here.
1872 2004-10-21 Jim Meyering <jim@meyering.net>
1874 * tests/mv/leak-fd: New file.
1875 * tests/mv/Makefile.am (TESTS): Add it.
1876 * tests/rm/dot-rel: New file.
1877 * tests/rm/Makefile.am (TESTS): Add it.
1879 Correct my patch of 2004-10-18.
1880 * src/remove.c (rm): Destroy the saved_cwd here (via cwd_state),
1881 if necessary, not in remove_dir. Otherwise, removing multiple
1882 `.'-relative nonempty directories no longer worked.
1884 2004-10-20 Paul Eggert <eggert@cs.ucla.edu>
1886 * src/fmt.c (usage): Improve description of --prefix.
1887 Problem reported by Edward Welbourne.
1889 * man/uniq.x: Change summary so that it doesn't imply that
1890 uniq writes to its input file. Problem reported by
1893 2004-10-18 Jim Meyering <jim@meyering.net>
1895 Plug a leak that would cause a cross-device mv to fail when
1896 operating on too many command-line-specified nonempty directories.
1897 * src/remove.c (remove_dir): Destroy the `struct saved_cwd' on the
1898 top of the stack before returning. This usually closes the file
1899 descriptor that was used to return to the original working directory.
1900 Reported by Cyril Bouthors in
1901 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/3048
1902 * NEWS: Mention it here.
1904 * src/pathchk.c (validate_file_name): Give a more descriptive
1905 diagnostic when pathconf fails. This also avoids an unwarranted
1906 warning from gcc-3.3.5 about a format not being a string literal.
1908 * src/sleep.c (main): Remove declaration of unused local, c.
1909 * src/printenv.c (main): Likewise.
1910 * src/logname.c (main): Likewise.
1911 * src/uptime.c (main): Likewise, for optc.
1912 * src/tsort.c (main): Likewise, for opt.
1914 2004-10-17 Paul Eggert <eggert@cs.ucla.edu>
1916 * AUTHORS: Add self to pathchk.
1917 * src/pathchk.c (AUTHORS): Add self.
1918 Change "path" to "file name" whenever possible.
1919 Remove usage comment, as it was a duplication of the code or doc.
1920 Include <wchar.h> if available.
1921 (mbrlen, mbstate_t) [! (HAVE_MBRLEN && HAVE_MBSTATE_T)]: Define.
1922 (NEED_PATHCONF_WRAPPER, PATH_MAX, PATH_MAX_FOR, NAME_MAX,
1923 pathconf_wrapper, portable_chars, dir_ok): Remove.
1924 (NAME_MAX_MINIMUM, PATH_MAX_MINIMUM): New macros.
1925 (pathconf, _PC_NAME_MAX, _PC_PATH_MAX): Define if nonexistent.
1926 (portable_chars_only): New arg FILELEN.
1927 Don't assume ASCII; we might be on an EBCDIC host.
1928 Don't assume unibyte locale in diagnostic.
1929 (component_start, component_len): New functions.
1930 (validate_file_name): Renamed from validate_path. All uses changed.
1931 Pretty much a complete rewrite.
1932 Don't make copy of file arg. Always append trailing slash to
1933 pathconf arg, just in case it's a symlink (this is pure paranoia;
1934 we don't know of any hosts where the trailing slash is required).
1935 Use size_t instead of long int when possible.
1936 Avoid need to call pathconf in most practical cases.
1937 Don't use euidaccess several times to test searchability;
1938 just use lstat once. Reword diagnostic to put the (often very long)
1941 2004-10-15 Paul Eggert <eggert@cs.ucla.edu>
1943 * src/printf.c (usage): Mention Unicode, and use H for hex digits.
1945 2004-10-13 Jim Meyering <jim@meyering.net>
1947 * NEWS: Mention today's fts.c fix.
1949 2004-10-13 Paul Eggert <eggert@cs.ucla.edu>
1951 * tests/stty/row-col-1: Set LC_ALL=C.
1953 2004-10-12 Jim Meyering <jim@meyering.net>
1955 * src/dircolors.hin: Add .flac and .mpc as audio suffixes.
1956 From Jesus Climent in http://bugs.debian.org/276149.
1958 2004-10-05 Paul Eggert <eggert@cs.ucla.edu>
1960 * src/ls.c (ignore_mode): Renamed from ignore, to avoid shadowing
1961 problems. All uses changed.
1963 2004-10-05 Jim Meyering <jim@meyering.net>
1965 * .x-sc_trailing_blank: Add an exclusion for config/texinfo.tex,
1966 since Karl says its trailing blanks are there to stay :-)
1968 2004-10-04 Paul Eggert <eggert@cs.ucla.edu>
1970 * src/expr.c (NEW, OLD): Remove, partly to avoid
1971 reference to obsolescent macro XMALLOC.
1972 All uses replaced by xmalloc and free.
1974 2004-09-28 Jim Meyering <jim@meyering.net>
1976 * src/tail.c (usage): Clarify: --retry works only with --follow=name.
1977 Reported by Nik A. Melchior in http://bugs.debian.org/273781.
1979 2004-09-27 Paul Eggert <eggert@cs.ucla.edu>
1981 * src/od.c (format_address_paren): c is optional, so don't output
1984 2004-09-26 Paul Eggert <eggert@cs.ucla.edu>
1986 Add support for ls --hide. Idea suggested by Bardur Arantsson.
1987 * NEWS: Document this.
1988 * src/ls.c (file_ignored): Renamed from file_interesting, with
1989 inverted return value. Accept the file name, not a struct dirent *.
1990 All uses changed. Avoid the expense of calling fnmatch if the
1991 file is ignorable due to leading '.'.
1992 (all_files, really_all_files): Removed; replaced by:
1993 (ignore): New variable. All uses changed.
1994 (IGNORE_DEFAULT, IGNORE_DOT_AND_DOTDOT, IGNORE_MINIMAL, HIDE_OPTION):
1996 (hide_patterns): New variable.
1997 (long_options, decode_switches, file_ignored, usage):
1998 Add support for --hide.
1999 (patterns_match): New function.
2000 (usage): Replace "hide" with "ignore" in explanation, to avoid
2003 2004-09-25 Paul Eggert <eggert@cs.ucla.edu>
2005 * src/ls.c (gobble_file, print_long_format): Don't assume that
2006 human-readable output has a byte count equal to its column width;
2007 this isn't always true in locales where the radix character is not
2009 (format_user_or_group): Revamp code to match the above fix;
2010 this avoids the (very faint) possibility of integer overflow.
2012 2004-09-24 Paul Eggert <eggert@cs.ucla.edu>
2014 * NEWS: Mention that "chmod -r -w x" now works as expected.
2015 * src/chmod.c (main): Revamp option processing to support this.
2016 * tests/chmod/Makefile.am (TESTS): Add 'usage'.
2017 * tests/chmod/usage: New set of tests for usage like that.
2019 2004-09-24 Jim Meyering <jim@meyering.net>
2021 * Makefile.maint (CVS_LIST): Use --types=AFGM option so that
2022 it lists only cvs-controlled regular files.
2024 * src/csplit.c (xalloc_die): Declare to be `extern', not `static'
2025 to avoid a warning from gcc-3.4.1. Reported by Paul Eggert.
2027 2004-09-23 Paul Eggert <eggert@cs.ucla.edu>
2029 * Makefile.maint (CVS_LIST): New macro.
2030 (sc_space_tab, sc_prohibit_atoi_atof, sc_file_system,
2031 sc_prohibit_jm_in_m4, sc_system_h_headers, sc_sun_os_names,
2032 sc_trailing_blank, po-check): Use it instead of the
2033 nonstandard "cvsu --list".
2035 * src/tail.c (parse_obsolete_option): Bring back support
2036 for obsolete option followed by non-obsolete, or by more
2037 than one file. When obsolete, conform to SUSv2 rather than
2038 original POSIX 1003.2-1992, as SUSv2 corrected the case of
2039 "tail -c". Add support for the SUSv2 "b" modifier.
2040 * NEWS: Mention the above.
2041 * tests/tail/Test.pm: New test case obs-b to check the above.
2042 err-[134] no longer need _POSIX2_VERSION=199209.
2043 Fix comments to match revised behavior.
2045 2004-09-22 Jim Meyering <jim@meyering.net>
2047 * Use automake-1.9.2. Regenerate dependent files.
2049 * src/remove.c (struct dirstack_state) [current_arg_jumpbuf]:
2050 Improve the comment.
2052 Clean up scoping etc. so that some make `distcheck' tests pass.
2053 * src/csplit.c (xalloc_die): Declare to be static.
2054 * src/chown-core.c (chown_files): Declare as `extern'.
2055 * src/cp-hash.c (remember_created): Likewise.
2056 * src/copy.c (copy): Likewise.
2057 * src/checksum.h (enum) [ALG_MD5]: Define to be 1, not 0.
2059 * src/id.c, src/nl.c, src/expand.c: Remove trailing blanks.
2060 * src/unexpand.c: Likewise.
2062 * src/Makefile.am (check-AUTHORS): New rule.
2063 (check): Depend on it.
2066 * Makefile.maint (syntax-check-rules): Remove duplicate sc_tight_scope.
2067 (sc_system_h_headers): Also exclude copy.h; it includes <stdbool.h>.
2069 2004-09-22 Paul Eggert <eggert@cs.ucla.edu>
2071 * src/ls.c (decode_switches): Don't compare a short value
2072 to SIZE_MAX: GCC sometimes complains.
2074 2004-09-21 Paul Eggert <eggert@cs.ucla.edu>
2076 * NEWS: The following commands now reject unknown options:
2077 basename dirname factor hostname link nohup sync unlink yes
2078 Also, pathchk no longer accepts trailing options.
2080 * src/basename.c: Include <getopt.h>.
2081 * src/chroot.c: Likewise.
2082 * src/dirname.c: Likewise.
2083 * src/factor.c: Likewise.
2084 * src/hostid.c: Likewise.
2085 * src/hostname.c: Likewise.
2086 * src/nohup.c: Likewise.
2087 * src/pwd.c: Likewise.
2088 * src/setuidgid.c: Likewise.
2089 * src/sync.c: Likewise.
2091 * src/basename.c (main): Reject unknown options.
2092 * src/dirname.c (main): Likewise.
2093 * src/factor.c (main): Likewise.
2094 * src/hostid.c (main): Likewise.
2095 * src/hostname.c (main): Likewise.
2096 * src/link.c (main): Likewise.
2097 * src/nohup.c (main): Likewise.
2098 * src/pwd.c (main): Likewise.
2099 * src/setuidgid.c (main): Likewise.
2100 * src/sync.c (main): Likewise.
2101 * src/unlink.c (main): Likewise.
2102 * src/yes.c (main): Likewise.
2104 * src/cat.c (main): Remove unused "case 0".
2105 * src/chgrp.c (main): Likewise.
2106 * src/chmod.c (main): Likewise.
2107 * src/chown.c (main): Likewise.
2108 * src/comm.c (main): Likewise.
2109 * src/cp.c (main): Likewise.
2110 * src/csplit.c (main): Likewise.
2111 * src/cut.c (main): Likewise.
2112 * src/date.c (main): Likewise.
2113 * src/df.c (main): Likewise.
2114 * src/du.c (main): Likewise.
2115 * src/env.c (main): Likewise.
2116 * src/expand.c (main): Likewise.
2117 * src/fold.c (main): Likewise.
2118 * src/head.c (main): Likewise.
2119 * src/id.c (main): Likewise.
2120 * src/install.c (main): Likewise.
2121 * src/join.c (main): Likewise.
2122 * src/ln.c (main): Likewise.
2123 * src/ls.c (decode_switches): Likewise.
2124 * src/mkdir.c (main): Likewise.
2125 * src/mkfifo.c (main): Likewise.
2126 * src/mknode.c (main): Likewise.
2127 * src/mv.c (main): Likewise.
2128 * src/nl.c (main): Likewise.
2129 * src/paste.c (main): Likewise.
2130 * src/pinky.c (main): Likewise.
2131 * src/pr.c (main): Likewise.
2132 * src/ptx.c (main): Likewise.
2133 * src/readlink.c (main): Likewise.
2134 * src/rm.c (main): Likewise.
2135 * src/rmdir.c (main): Likewise.
2136 * src/seq.c (main): Likewise.
2137 * src/shred.c (main): Likewise.
2138 * src/split.c (main): Likewise.
2139 * src/sum.c (main): Likewise.
2140 * src/tac.c (main): Likewise.
2141 * src/tail.c (main): Likewise.
2142 * src/tee.c (main): Likewise.
2143 * src/touch.c (main): Likewise.
2144 * src/tr.c (main): Likewise.
2145 * src/tty.c (main): Likewise.
2146 * src/uname.c (main): Likewise.
2147 * src/unexpand.c (main): Likewise.
2148 * src/wc.c (main): Likewise.
2149 * src/who.c (main): Likewise.
2151 * src/chroot.c (main): Use getopt where it suffices, not getopt_long.
2152 * src/cksum.c (main): Likewise.
2153 * src/dd.c (main): Likewise.
2154 * src/logname.c (main): Likewise.
2155 * src/printenv.c (main): Likewise.
2156 * src/sleep.c (main): Likewise.
2157 * src/tsort.c (main): Likewise.
2158 * src/uptime.c (main): Likewise.
2159 * src/users.c (main): Likewise.
2160 * src/whoami.c (main): Likewise.
2162 * src/du.c (long_options): Standardize on NULL vs 0.
2163 * src/rm.c (long_opts): Likewise.
2165 * src/logname.c (long_options): Remove.
2166 * src/printenv.c (long_options): Likewise.
2167 * src/sleep.c (long_options): Likewise.
2168 * src/tsort.c (long_options): Likewise.
2169 * src/uptime.c (longopts): Likewise.
2170 * src/users.c (longopts): Likewise.
2171 * src/whoami.c (long_options): Likewise.
2173 * src/pathchk.c (longopts): Add --help, --version.
2174 (main): Use longopts rather than parse_long_options.
2175 * src/stty.c (longpts, main): Likewise.
2177 * src/pathchk.c (main): Don't reorder arguments, so that
2178 we can check weird file names.
2180 * src/readlink.c: Don't include "long-options.h".
2181 * src/sort.c: Likewise.
2182 * src/stty.c: Likewise.
2184 * src/split.c (verbose): Now bool, not int.
2185 (VERBOSE_OPTION): New enum.
2186 (longopts, main): Use it.
2188 * tests/factor/basic: Adjust to new wording in diagnostic
2189 that results from the above changes.
2191 2004-09-21 Jim Meyering <jim@meyering.net>
2193 * man/rm.x: Say "the response is affirmative" rather than "the
2194 response begins with y or Y", so that the documentation is
2195 accurate in non-English locales. Problem reported by Munzir Taha.
2197 2004-09-19 Paul Eggert <eggert@cs.ucla.edu>
2199 * src/echo.c (main): Don't pass NULL to strcmp when
2200 POSIXLY_CORRECT and given no arguments.
2202 * src/md5sum.c (STRING_OPTION): Remove.
2203 (long_options, main): Remove support for undocumented and
2204 obsolete --string option, as suggested in the 1996-09-26 patch.
2205 * NEWS: Document this.
2207 * tests/rm/fail-eperm: Don't try to remove writeable files in a
2208 sticky /tmp directory, as SVR4-like systems (e.g., Solaris 9) let
2209 you remove such files. Problem reported by Bert Fischer in:
2210 http://lists.gnu.org/archive/html/bug-coreutils/2004-09/msg00074.html
2212 2004-09-18 Paul Eggert <eggert@cs.ucla.edu>
2214 * src/md5sum.c (STATUS_OPTION, STRING_OPTION): New enums.
2215 (long_options, main): Use them instead of magic numbers 2 and 1.
2216 For --string, optarg can't possibly be NULL.
2218 * src/dd.c (usage): Distinguish between options and operands.
2219 (scanargs): Don't mess with argc, argv; getopt_long handles this now.
2220 Say "operands" for operands, not "options".
2221 (main): Use getopt_long, so that "dd --" works as POSIX requires.
2222 * tests/dd/misc: Check for "dd --".
2224 * src/chroot.c (main): Reject unknown options instead of
2225 interpreting them as a directory to chroot to.
2227 * src/cksum.c: Remove obsolete comment about POSIX 1003.2/D11.2.
2228 The current standard (POSIX 1003.1-2004) is correct.
2229 (crc_remainder) [defined CRCTAB]: Renamed from "remainder" to avoid
2230 collision with builtin function.
2231 (main) [defined CRCTAB]: Output in lowercase hexadecimal, and
2232 output the first 0 as 8 digits, to make it easier to compare to
2233 the text of the standard. Output crctab to be a const array.
2234 (crctab): Use result of above changes.
2235 (long_options): Remove; not needed if empty.
2236 (main): getopt_long can't return 0 here, so simplify the code.
2238 2004-09-13 Jim Meyering <jim@meyering.net>
2240 * src/Makefile.am (localedir.h): Don't redirect directly to target.
2242 2004-09-13 Paul Eggert <eggert@cs.ucla.edu>
2244 * src/id.c (print_full_info): Don't exit with failure status simply
2245 because a user or group number can't be turned into a name.
2246 Problem reported by Felipe Kellermann in:
2247 http://lists.gnu.org/archive/html/bug-coreutils/2004-09/msg00081.html
2249 2004-09-12 Jim Meyering <jim@meyering.net>
2251 * Makefile.maint (my-distcheck): When building with -Werror, also
2254 2004-09-10 Paul Eggert <eggert@cs.ucla.edu>
2256 * NEWS: "tail" now handles obscure POSIX 1003.2-1992 cases better.
2257 * src/tail.c (parse_obsolete_option): Renamed from
2258 parse_obsolescent_option, since the options are obsolete now.
2259 Remove bool *arg; just exit if there's an error. Revamp to follow
2260 POSIX 1003.2-1992 more precisely, to handle cases like "tail -
2261 file" and "tail -10 -- file" correctly when we are conforming to
2263 (main): Adjust to this change.
2264 * tests/tail/Test.pm (test_vector): minus-* requires
2265 _POSIX2_VERSION=199209 now, to work correctly if there is
2266 an input file. err-1 and err-3 no longer errors if there
2269 2004-09-09 Paul Eggert <eggert@cs.ucla.edu>
2271 * src/test.c (usage): Document -r, -w, -x more carefully.
2273 2004-09-08 Paul Eggert <eggert@cs.ucla.edu>
2275 * src/test.c (usage): Document "test" (with no args) and "[ ]".
2276 Document that -h and -L don't dereference.
2278 * NEWS: Document that "tr xy -z" now works as per POSIX.
2279 Sort the descriptions.
2280 * src/tr.c (main): Don't reorder options.
2281 * tests/tr/Test.pm (fowler-1): New test case.
2283 2004-09-06 Paul Eggert <eggert@cs.ucla.edu>
2285 * src/touch.c (main): Fix POSIX-conformance bug: "touch --
2286 MMDDhhmm file" must be treated like "touch MMDDhhmm file" when
2287 conforming to pre-2001 POSIX.
2288 * NEWS: Document this.
2289 * tests/touch/obsolescent: Test for this bug. Also, set
2290 _POSIX2_VERSION=199209 and POSIXLY_CORRECT=1 so that it's
2291 a better test for obsolescent features.
2293 * src/sort.c (main): Emulate Solaris 8 and 9 "sort -y", so that
2294 "sort -y abc" is like "sort abc" whereas "sort -y 100" is like
2297 * src/od.c: Several changes for POSIX and FreeBSD compatibility.
2298 (COMMON_SHORT_OPTIONS): Add -B, -D, -e, -F, -H, -I, -L, -O, -s, -X.
2299 (long_options, main): --strings is now -S, not -s.
2300 (usage): Reflect the usage changes.
2301 (parse_old_offset): Do not issue a diagnostic on failure;
2302 callers now do this as necessary.
2303 (main): Support POSIX syntax. Remove unused case 0 from getopt_long.
2304 Add support for new short options (many undocumented) for
2305 compatibility with FreeBSD. Remove FIXME for -s; it's now
2306 POSIX-compatible. Default format is now oS, not o2.
2307 * NEWS: Describe the above.
2309 2004-09-05 Paul Eggert <eggert@cs.ucla.edu>
2311 * src/stty.c (valid_options): Remove.
2312 (main): Fix some bugs in handling invalid option-combinations
2314 (recover_mode): Arg is now char const *, not char *.
2315 (main): Use STDIN_FILENO, not 0.
2316 Simplify option-parsing code a tad.
2317 * tests/stty/basic-1: Check for the fixed bugs.
2319 2004-09-03 Paul Eggert <eggert@cs.ucla.edu>
2321 * src/stat.c (HAVE_STRUCT_STATXFS_F_TYPE): Fix typo that prevented
2322 it from ever being nonzero. Reported by Pozsar Balazs in:
2323 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00189.html
2324 (human_fstype): Add ramfs, squashfs, sysfs.
2325 Reported by Pozsar Balazs in:
2326 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00188.html
2327 (human_fstype): Return char const *, not char *.
2328 Simplify internals a bit, and avoid casts.
2330 * src/dd.c (usage): "alternated EBCDIC" -> "alternate EBCDIC".
2331 (bit_count): Remove. All uses changed to....
2332 (multiple_bits_set): New function.
2333 (scanargs): Use it, and check separately for each set of
2334 incompatible options, to improve diagnostics.
2336 (apply_translations): Move checks for incompatible options
2337 to scanargs, so that they're done consistently.
2339 2004-09-02 Paul Eggert <eggert@cs.ucla.edu>
2341 Output correct errno-related diagnostic on "paste" I/O errors.
2342 * src/paste.c (write_error, xputchar): New functions.
2343 (paste_parallel): Use correct errno value after input error.
2344 (paste_parallel, paste_serial): Report errno value after output error.
2346 Port to diet libc. Problem reported by Felix von Leitner in:
2347 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00171.html
2348 * src/paste.c (dummy_closed, CLOSED, dummy_endlist, ENDLIST): Remove;
2349 it's not portable C to assume FILE is a complete type.
2350 (paste_parallel): Use index test instead of ENDLIST, and NULL
2353 2004-08-24 Paul Eggert <eggert@cs.ucla.edu>
2355 POSIX-conformance fixes for "expand" and "unexpand".
2356 Also, consistently use "tab stop" rather than "tabstop".
2357 * NEWS: Document fixes.
2358 * src/expand.c: Revamp to resemble the new unexpand.c better.
2359 (usage): -i does not convert tabs after non-tabs.
2360 (add_tab_stop): Renamed from add_tabstop. All uses changed.
2361 (parse_tab_stop): Renamed from parse_tabstop. All uses changed.
2362 (validate_tab_stop): Renamed from validate_tabstop. All uses changed.
2363 (next_file, main): Check fclose against 0, not EOF.
2364 (expand): Remove unnecessary casts.
2365 Add another loop nesting level, for lines, so that per-line variables
2366 are initialized cleanly.
2367 Revamp tab checking. Check for write error immediately, rather
2368 than just once at the end of the program.
2369 * src/unexpand.c: Lkewise (for the expand.c changes).
2370 (TAB_STOP_SENTINEL): Remove.
2371 (tab_size): Now size_t, not uintmax_t, since we need to store
2372 the sequences of blanks.
2373 (max_column_width): New var.
2374 (usage): Say "blank" where POSIX requires this.
2375 (add_tab_stop): Calculate maximum column width.
2376 (unexpand): Store the pending blanks, instead of merely counting them.
2377 Follow POSIX's rules about -a requiring two blanks before a tab stop.
2378 Get rid of internal label and goto.
2379 * tests/unexpand/basic-1: Fix infloop-3 to match POSIX.
2380 Add blanks-1 through blanks-13.
2382 2004-08-19 Paul Eggert <eggert@cs.ucla.edu>
2384 * NEWS: "chown : file", "chown '' file", and "chgrp '' file" now
2385 succeed without changing the uid and gid, like FreeBSD.
2386 * src/chgrp.c (parse_group): Return gid_t rather than storing it
2387 through a pointer. Treat "chgrp '' file" as a no-op change,
2389 (main): Set chopt.group_name to NULL if the group is the empty
2391 * src/chown-core.c (describe_change): Describe changes to -1:-1
2392 without using "to OWNERSHIP" phrase.
2393 * src/chown.c (usage): "chown '' file" is now allowed.
2394 (main): Do not set user name to the empty string if the group
2396 * tests/chgrp/basic: Test "chgrp '' file".
2397 * tests/chown/Makefile.am (TESTS): Add separator.
2398 * tests/chown/separator: New file, partly taken from
2399 Dmitry V. Levin's suggestion in
2400 <http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00102.html>
2402 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
2404 * tests/install/basic-1: Test for the -d regression.
2406 2004-08-11 Dmitry V. Levin <ldv@altlinux.org>
2408 * src/install.c (main): Fix -d regression introduced with
2409 --target-directory support at 2004-06-25.
2411 2004-08-11 Paul Eggert <eggert@cs.ucla.edu>
2413 * src/copy.c (copy_internal): When preserving links, unlink
2414 a destination with link count greater than one. This is so
2415 that commands like "cp -a" don't get confused when copying into
2416 a destination that already contains many hard links. Problem
2417 reported by Tim Waugh in:
2418 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00053.html
2420 2004-08-10 Paul Eggert <eggert@cs.ucla.edu>
2422 Convert all files to UTF-8.
2423 * tests/fmt/basic (8-bit-pfx): Use UTF-8, not Latin-1.
2424 * tests/sort/Test.pm (16a): Likewise.
2425 * tests/uniq/Test.pm (8): Likewise.
2426 * tests/misc/printf-hex: Use ASCII, not Latin-1.
2428 * NEWS: Document "sort -o -" and "tee -" POSIX-conformance fixes.
2429 * src/shred.c (usage): "-" is an operand, not an option.
2430 * src/sort.c (die, xfopen, mergefps, first_same_file, merge):
2431 A null file arg means standard output.
2432 (main): "-o -" means to write to a file named "-",
2433 not to standard output.
2434 * src/tee.c (usage, tee): "tee -" writes to standard output, not
2435 to a file named "-".
2437 2004-08-10 Dmitry V. Levin <ldv@altlinux.org>
2439 * src/install.c (change_timestamps): Fix int->bool conversion
2440 bugs introduced on 2004-07-29.
2442 2004-08-09 Paul Eggert <eggert@cs.ucla.edu>
2444 * src/shred.c (wipename): Work even if the directory is writeable
2445 and not readable. Prefer write access, since this should work
2446 better with fdatasync.
2448 * src/csplit.c (xalloc_die): New function.
2449 (main): Remove now-obsolete initialization of xalloc_fail_func.
2451 * src/md5sum.c: Adjust to sha->sha1 renaming.
2453 2004-08-08 Dmitry V. Levin <ldv@altlinux.org>
2456 * src/readlink.c (canonicalize_fname): Remove unneeded proxy function.
2457 (can_mode): Make variable local.
2459 2004-08-07 Paul Eggert <eggert@cs.ucla.edu>
2461 * src/system.h (O_BINARY) [!O_BINARY && defined O_BINARY]:
2462 Do not define, to avoid annoying compiler messages on QNX 6.3.
2463 Problem reported by Johan in:
2464 http://lists.gnu.org/archive/html/bug-coreutils/2004-08/msg00050.html
2466 2004-08-04 Paul Eggert <eggert@cs.ucla.edu>
2468 * src/system.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX):
2469 Define to a concatenation of string literals, not to an expression;
2470 needed for concatenation contexts.
2471 (INTMAX_MAX, INTMAX_MIN): New macros.
2473 * src/stat.c (print_stat): Don't assume st_ino / st_dev fits in
2474 unsigned long; this isn't true for st_ino on Solaris 9.
2476 2004-08-03 Paul Eggert <eggert@cs.ucla.edu>
2478 * src/uname.c: Do not depend on HAVE_SYSCTL when deciding
2479 whether to include files. Include <sys/param.h> if
2480 HAVE_SYS_PARAM_H (not HAVE_SYSCTL).
2481 (main) [defined __POWERPC__]: Add a kludge to work around a
2482 Mac OS X bug, so that uname -p defaults to "powerpc" if
2483 sysctl ((int[]) {CTL_HW, HW_MACHINE_ARCH}, 2, buffer, &bufsize, 0, 0)
2484 fails. Problem reported by Petter Reinholdtsen in:
2485 http://lists.gnu.org/archive/html/bug-gnu-utils/2003-02/msg00201.html
2487 * src/uniq.c (hard_LC_COLLATE, ignore_case, different, check_file,
2488 main): Use bool for booleans.
2489 (writeline, check_file): Use uintmax_t for line counts.
2490 (check_file): Check for and report line number overflow,
2492 * src/wc.c (iswspace, wc): Use to_uchar rather than a cast.
2493 (print_lines, print_words, print_chars, print_bytes, print_linelength,
2494 have_read_stdin, wc, wc_file, main):
2495 Use bool for booleans.
2496 (exit_status): Remove.
2497 (wc, wc_file): Return bool status. All callers changed.
2498 * src/who.c (scan_entries): 0 -> STDIN_FILENO.
2499 * src/whoami.c (main): Print uids using unsigned long int, not
2502 * src/unexpand.c: Int cleanup and minor reorganization to be more
2504 Include quote.h, xstrndup.h.
2505 (TAB_STOP_SENTINEL): Increase from INT_MAX to INTMAX_MAX.
2506 (convert_entire_line, have_read_stdin, parse_tabstops, next_file,
2508 Use bool for booleans.
2509 (tab_size, tab_list, add_tabstop, validate_tabstops, unexpand):
2510 Use uintmax_t for column counts.
2511 (first_free_tab, validate_tabstops, unexpand): Use size_t for sizes.
2512 (add_tabstop, parse_tabstops, main): Don't reserve UINTMAX_MAX
2514 (parse_tabstops): Don't use ISBLANK on possibly-signed char.
2515 Detect overflow in tab stop string.
2516 (next_file, main): Use EXIT_FAILURE/EXIT_SUCCESS instead of 1/0.
2517 (unexpand): Concatenate input files the same way expand does.
2519 * src/touch.c (no_create, use_ref, posix_date, amtime_now,
2520 touch, main): Use bool for booleans.
2521 (main): Avoid integer overflow when given more than INT_MAX
2523 * src/tsort.c (struct item, n_strings): Use size_t for sizes.
2524 (have_read_stdin, count_items, scan_zeros, detect_loop,
2525 recurse_tree, walk_tree, tsort, main):
2526 Use bool for booleans.
2527 (exit_status): Remove.
2528 (tsort): Return a success flag instead of storing into a global.
2530 * src/tty.c (silent, main): Use bool for booleans.
2531 (main): 0 -> STDIN_FILENO.
2532 * src/uname.c (print_element): Use bool for booleans.
2534 * src/test.c (TRUE, FALSE, SHELL_BOOLEAN, TRUTH_OR, TRUTH_AND):
2535 Remove. All uses replaced by C99 boolean primitives.
2536 (TEST_TRUE, TEST_FALSE): New constants, for readability.
2537 (test_unop, binop, unary_operator, binary_operator, two_arguments,
2538 three_arguments, posixtest, expr, term, and, or, is_int, age_of,
2539 one_argument, main): Use bool for booleans.
2540 (advance, unary_advance): Now inline procedures rather than a macros.
2541 (is_int): Renamed from isint, to avoid namespace clash with ctype.h.
2542 (term, and, or): When it's easy, loop instead of recursing.
2543 (term): Avoid integer overflow if there are INT_MAX-3 args (!).
2544 (binary_operator, unary_operator): Simplify by systematically rewriting
2545 true==FOO to FOO (where FOO is a boolean).
2546 (unary_operator): Don't consider a file to be a regular file
2547 merely because its mode&S_IFMT is zero. Just use S_ISREG.
2548 Remove unnecessary casts. Remove ifdefs for things like
2549 S_ISSOCK that are no longer needed, since stat-macros.h always
2552 * src/tac-pipe.c (buf_init_from_stdin, find_bol, tac_mem):
2553 Use bool for booleans.
2554 (buf_init_from_stdin, buf_free, find_bol, print_line):
2555 Use size_t for sizes.
2556 * src/tac.c (separator_ends_record, tac_seekable, tac_file,
2557 tac_stdin, tac_stdin_to_mem, main): Use bool for booleans.
2558 (match_length, G_buffer_size, tac_seekable, main): Use size_t for sizes.
2559 (tac_seekable): Use ptrdiff_t for pointer subtraction.
2560 Report an error if the result is out of range.
2561 (tac_seekable, main): Check for integer overflow in buffer size
2563 (main): Remove unnecessary casts.
2565 * src/su.c (run_shell): Pass a new n_additional_args arg, so that
2566 the callee doesn't have to count 'em. All callers changed.
2567 Don't allocate more space for the arg vector than we'll need.
2568 Use memcpy to copy the args rather than rolling our own loop.
2569 Use size_t for sizes.
2570 (fast_startup, simulate_login, change_environment, log_su,
2571 correct_password, restricted_shell, main): Use bool for booleans.
2572 (longopts): Don't assume change_environment is an int.
2573 Use NULL, not 0, for pointers.
2574 (xsetenv): New function, replacing xputenv and concat.
2575 All callers changed.
2576 (elements): Remove; no longer needed.
2577 (log_su, correct_passwd, main): Prefer !x to x==NULL.
2578 (log_su): 2 -> STDERR_FILENO.
2579 (modify_environment, main): Don't assume that getenv's returned value
2580 has an indefinite lifetime.
2581 (modify_environment): Allocate a larger environ.
2582 (main): Remove an impossible 'case 0'; if it happens now, it'll
2583 get diagnosed. Don't assume getpwnam results outlive endpwent.
2584 Check for null or empty pw_name, pw_dir and for null pw_passwd.
2586 * src/stty.c (VA_START): Remove. All callers now use va_start.
2587 (_POSIX_VDISABLE): Remove unnecessary cast.
2588 (struct control_info, visible): Use cc_t for control chars.
2589 (struct control_info): Use size_t for sizes.
2590 (recover_mode, set_mode, display_speed, display_window_size,
2591 valid_options, main, display_changed):
2592 Use bool for booleans.
2593 (integer_arg): Return unsigned long int, not long int.
2594 Accept new max arg; all callers changed, to specify a maximum
2595 value for integer parameters instead of silently overflowing.
2596 (wrap): Do not overrun the stack buffer if the output contains
2597 more than 1024 bytes. Instead, malloc a buffer.
2598 (main): Remove a "what is this?!?" FIXME. Nobody knows what it is.
2599 Remove unnecessary casts.
2600 (set_control_char): Allow int values only up to cc_t range.
2601 (screen_columns): Don't reject INT_MAX.
2602 (display_changed, display_all, display_speed, recover_mode):
2603 Don't assume cc_t fits in int.
2605 * src/remove.h: Add copyright notice.
2606 (struct rm_options): Use bool for booleans.
2607 * src/rmdir.c (empty_paths, ignore_fail_on_non_empty, verbose,
2608 errno_rmdir_non_empty, remove_parents, main): Likewise.
2609 * src/sum.c (have_read_stdin, bsd_sum_file, sysv_sum_file,
2611 (main): Don't dump core if invoked with argv[0]==NULL.
2612 * src/tee.c (tee, append, ignore_interrupts, main, tee):
2613 Use bool for booleans.
2614 (tee): Use ssize_t for read returns.
2616 * src/ptx.c: Add a FIXME mentioning that there are many
2617 unchecked integer overflows in this file.
2618 (gnu_extensions, auto_reference, input_reference, right_reference,
2619 ignore_case, initialize_regex, fix_output_parameters,
2620 output_one_roff_line, output_one_text_line, output_one_dumb_line, main):
2621 Use bool for booleans.
2622 (SKIP_SOMETHING, compare_words, digest_break_file,
2623 find_occurs_in_text, fix_output_parameters):
2624 Use to_uchar instead of a caset.
2625 (print_field): Rewrite to avoid cast.
2627 * src/printf.c (posixly_correct): Use bool for booleans.
2628 (verify, main): Use EXIT_FAILURE/EXIT_SUCCESS instead of 1/0.
2629 (STRTOX): Rewrite to avoid casts.
2630 (print_esc_char): Arg is char, not int.
2631 * src/readlink.c (canonicalize): Remove. All uses now merely inspect
2633 (no_newline, verbose): Use bool for booleans.
2634 (can_mode): Now of type int; use -1 to denote otherwise-uninitialized.
2635 * src/shred.c (struct Options, main): Use bool for booleans.
2636 (isaac_seed_data, fillpattern, wipefile): Rewrite to avoid casts.
2637 * src/split.c (cwrite, bytes_split, lines_split, line_bytes_split):
2638 Use bool for booleans.
2639 * src/stat.c (G_fail): Remove.
2640 (print_statfs): Print various gotta-be-nonnegative values using
2641 unsigned long int, not long int or int.
2642 (do_statfs, do_stat): Return a boolean success flag.
2643 (do_stat, main): Use bool for booleans.
2645 * src/pr.c: Add a FIXME mentioning that there are many
2646 unchecked integer overflows in this file.
2647 (TRUE, FALSE): Remove. All uses replaced by true and false.
2648 (struct COLUMN, read_line, print_page, print_stored, open_file,
2649 skip_to_page, init_fps, parallel_files, align_empty_cols,
2650 empty_line, FF_only, explicit_columns, extremities, keep_FF,
2651 print_a_FF, print_a_header, use_form_feed, have_read_stdin,
2652 print_across_flag, storing_columns, balance_columns,
2653 truncate_lines, join_lines, untabify_input, failed_opens,
2654 numbered_lines, skip_count, use_esc_sequence, use_cntrl_prefix,
2655 double_space, ignore_failed_opens, use_col_separator,
2656 pad_vertically, last_line, main, init_parameters, skip_read,
2657 read_line, print_stored):
2658 Use bool for booleans.
2659 (struct COLUMN, char_to_clump, store_char, print_char):
2661 (clump_buff, print_clump): Use char[], not int[], for an array whose
2662 elements are always chars.
2663 (first_last_page, main, getoptarg, balance, add_line_number,
2664 char_to_uclump): Remove unnecessary casts.
2665 (init_parameters): Allocate chars, not ints, for clump_buff.
2666 (print_char): Use to_uchar before invoking ISPRINT.
2667 (char_to_clump): Convert to unsigned char before invoking ISPRINT.
2669 * src/nohup.c (main): Use bool for booleans.
2670 * src/paste.c (paste_parallel, paste_serial, main): Likewise.
2671 * src/pathchk.c (validate-path, main, portable_chars_only): Likewise.
2672 (portable_chars_only): Use to_uchar rather than a cast.
2673 * src/printenv.c (main): Use bool for booleans.
2674 Do not assume that the environ has at most one matching entry
2675 for each option (integer overflow was possible otherwise).
2677 * src/od.c (FMT_BYTES_ALLOCATED): Now an enum, not a decimal
2678 constant. Do not assume PRIdMAX etc. are strings of length 3 or
2680 (struct tspec): Use it. fmt_string is now an array, not
2681 a pointer, as there's little point to the indirection here.
2682 (struct tspec, flag_dump_strings,
2683 traditional, flag_pseudo_start, limit_bytes_to_format,
2684 abbreviate_duplicate_blocks, have_read_stdin, simple_strtoul,
2685 decode_one_format, open_next_file, check_and_close,
2686 decode_format_string, skip, write_block, read_char, read_block,
2687 parse_old_offset, dump, dump_strings, main):
2688 Use bool for booleans.
2689 (struct tspec): Use void *, not char *, for generic pointers.
2690 (bytes_to_oct_digits, bytes_to_signed_dec_digits,
2691 bytes_to_unsigned_dec_digits, bytes_to_hex_digits):
2692 Use char, not unsigned int, since char suffices.
2693 (print_s_char, print_char, print_s_short, print_short,
2694 print_int, print_long, print_long_long, print_float,
2695 print_double, print_long_double): Rewrite to avoid casts.
2696 These now take void * arguments, instead of char *.
2697 Use the same body for all functions, except for the choice
2698 of type. Assume C89 to simplify handling of signed char.
2699 (dump_hexl_mode_trailer, print_named_ascii, print_ascii):
2700 Rewrite to avoid casts.
2701 (print_named_ascii, print_ascii): Now takes void *, not char *.
2702 (decode_one_format): Use int for printf field widths, not
2703 unsigned int. Pass void * to subsidiary printers,
2704 not char *. Simplify handling of floating-point formats
2705 by factoring out common code dealing with precision and field width.
2706 (decode_format_string): Avoid need for temporary copy of
2707 each decoded struct tspec.
2708 (get_lcm): Remove unnecessary cast.
2709 (main): Fix bug where more than INT_MAX failed decodes were ignored.
2711 2004-08-02 Paul Eggert <eggert@cs.ucla.edu>
2713 * src/nl.c (TRUE, FALSE): Remove; all uses changed to true, false.
2714 (enum number_format): Remove.
2715 (FORMAT_RIGHT_NOLZ, FORMAT_RIGHT_LZ, FORMAT_LEFT): Now strings,
2717 (DEFAULT_SECTION_DELIMITERS): Now an array constant, not a macro.
2718 (section_del): Now const.
2719 (print_fmt): Remove.
2720 (starting_line_number, page_incr, blank_join, line_no,
2721 print_lineno, proc_text, main):
2722 Use intmax_t for line numbers.
2723 (reset_numbers, have_read_stdin, build_type_arg, nl_file, main):
2724 Use bool for booleans.
2725 (lineno_format): Now a string, not an enum value.
2726 (build_print_fmt): Remove. All calls removed. This work is
2727 now done within print_lineno.
2728 (build_type_arg): Use size_t for sizes.
2729 (print_lineno): Check for line number overflow.
2730 (proc_text, main): Remove unnecessary cast.
2732 * src/ln.c (symbolic_link, interactive, remove_existing_files,
2733 verbose, hard_dir_link, dereference_dest_dir_symlinks,
2734 do_link, main): Use bool for booleans.
2736 * src/ls.c (struct fileinfo, file_interesting,
2737 extract_dirs_from_files, color_symlink_as_referent,
2738 FILE_OR_LINK_MODE, sort_reverse, print_owner, print_group,
2739 numeric_ids, print_block_size, dired, print_with_color,
2740 check_symlink_color, print_inode, recursive, immediate_dirs,
2741 all_files, really_all_files, qmark_funny_chars,
2742 print_dir_name, format_needs_stat, format_needs_type, visit_dir,
2743 main, decode_switches, parse_ls_color, print_dir, file_interesting,
2744 gobble_file, make_link_path, basename_is_dot_or_dotdot,
2745 extract_dirs_from_files, print_long_format):
2746 Use bool for booleans.
2747 (dir_defaulted): Remove; no longer needed.
2748 (main): Use int to count files, since it suffices for argv.
2749 Rewrite to avoid need for dir_defaulted.
2750 (main, print_dir, gobble_file, get_link_name,
2752 Set exit status to EXIT_SUCCES/EXIT_FAILURE rather than 0/1.
2753 (decode_switches): Put back check for ws.ws_col <= SIZE_MAX.
2754 Remove unnecessary cast to int. Use int instead of unsigned
2755 int to count from 0 to 1.
2756 (get_funky_string, print_type_indicator): Use char for bytes, not int.
2757 (make_link_path): Use NULL for null pointers.
2758 (quote_name): Use to_uchar instead of cast.
2760 * src/id.c (use_name, main, print_user, xgetgroups, print_group_list,
2761 print_full_info): Use bool for booleans.
2762 (problems): Remove, replacing with....
2763 (ok): New var (inverted from old sense).
2764 (print_user, print_group, print_full_info):
2765 Print uids/gids with %lu, not %u.
2766 (xgetgroups): Don't run out of memory if getgroups or getugroups
2768 * src/setuidgid.c (main): Print uids/gids with %lu, not %ld.
2770 * src/factor.c (wheel_tab): Use unsigned char instead of unsigned
2771 int, since it suffices.
2772 (factor, print_factors): Use size_t for sizes.
2773 (print_factors, do_stdin, main): Use bool for booleans.
2774 * src/fold.c (TAB_WIDTH): New macro; use it instead of "8".
2775 (fold_file, main): Use bool for booleans.
2776 (fold_file, main): Use size_t for sizes.
2777 (main): Allow -w options up to SIZE_MAX - TAB_WIDTH - 1, instead
2778 of prohibiting widths greater than INT_MAX.
2779 * src/head.c (presume_input_pipe, print_headers, have_read_stdin,
2780 write_header, elide_tail_bytes_pipe, elide_tail_bytes_file,
2781 elide_tail_lines_pipe, elide_tail_lines_seekable,
2782 elide_tail_lines_file, head_bytes, head_lines, head, head_file,
2783 string_to_integer, main):
2784 Use bool for booleans.
2785 (main): Rewrite to avoid cast.
2787 * src/csplit.c (struct line): Use size_t for sizes.
2788 (main): Remove unnecessary cast.
2789 * src/cut.c (cut_fields): Use to_uchar rather than a cast.
2790 * src/cut.c (cut_file, main): Use bool for booleans.
2791 * src/date.c (show_date, rfc_format, batch_convert, main): Likewise.
2792 * src/env.c (main): Likewise.
2793 * src/expr.c (nextarg): Likewise.
2794 * src/env.c (main): Remove unused and nonstandard envp arg.
2796 * src/fmt.c (COST, MAXWORDS): Add a comment describing some of
2797 fmt's arbitrary limits.
2798 (TRUE, FALSE): Remove; all uses changed to (true, false).
2799 (main): Use bool for booleans.
2800 Limit maximum width to MAXCHARS / 2. Use xstrtoul, not xstrtol,
2802 (copy_rest): Remove unnecessary cast.
2803 (get_prefix): Rewrite to avoid cast.
2804 (check_punctuation): Use char *, not unsigned char *; C89 requires
2805 this. Avoid off-by-one buffer read overrun when line is empty.
2806 (flush_paragraph): Don't assume wptr-parabuf is <= INT_MAX.
2807 Remove unnecessary casts.
2808 * tests/fmt/basic (wide-1, wide-2, bad-suffix): Adjust to above
2811 * src/expand.c (convert_entire_line, have_read_stdin, parse_tabstops,
2812 next_file, expand, main):
2813 Use bool for booleans.
2814 (tab_size, tab_list, add_tabstop, parse_tabstops, validate_tabstops,
2816 Use uintmax_t for column counts.
2817 (add_tabstop): Don't reserve -1 (now UINTMAX_MAX) as a special value.
2818 All callers changed.
2819 (parse_tabstops): Don't pass a negative char to isblank.
2820 Avoid memory leak with large tab stops.
2821 (validate_tabstops, expand): Don't assume number of tab stops is
2823 (next_file, main): Use EXIT_SUCCESS/EXIT_FAILURE rather than 0/1 when
2824 storing values into exit_status.
2825 (expand): Use same pattern as unexpand for reading chars.
2826 Report an error when input line is too long, instead of silently
2827 screwing up. Do not mishandle tab stops when backspacing left
2830 * src/dircolors.c (have_read_stdin, append_quoted,
2831 dc_parse_stream, dc_parse_file, main): Use bool for booleans.
2832 (dc_parse_stream): Use enum for state, rather than int.
2833 Use ssize_t to store getline result.
2835 * src/dd.c (translation_needed, parse_integer, scanargs,
2836 apply_translations, char_is_saved, swab_buffer, skip_via_lseek):
2837 Use bool for booleans.
2838 (translate_buffer): Use to_uchar rather than a cast.
2839 (swab_buffer, copy_simple, copy_with_unblock):
2840 Use size_t for sizes.
2842 * src/seq.c (equal_width, valid_format, main): Use bool for booleans.
2843 * src/sleep.c (apply_suffix): Likewise.
2844 * src/tail.c (struct File_spec, reopen_inaccessible_files, count_lines,
2845 forever, from_start, print_headers, have_read_stdin, valid_file_spec,
2846 write_header, file_lines, pipe_lines, pipe_bytes, recheck,
2847 tail_forever, tail_bytes, tail_lines, tail, tail_file,
2848 parse_obsolescent_option, parse_options, main): Likewise.
2849 * src/sleep.c (apply_suffix): Invert sense of result.
2850 Use int (not unsigned int) for multiplier, as this generates better
2851 code with some compilers. Simplify code a bit.
2852 * src/tail.c (struct File_spec, max_n_unchanged_stats_between_opens,
2853 parse_options): Use uintmax_t, not unsigned int or unsigned long int,
2855 (tail_bytes, tail_lines): Redo test of return value (-1, 0, 1) to
2856 make it a bit clearer.
2858 * src/hostname.c: Include "xgethostname.h".
2859 (xgethostname): Remove decl; xgethostname.h has it.
2860 (sethostname) [!defined(HAVE_SETHOSTNAME) && defined(HAVE_SYSINFO)
2861 && defined (HAVE_SYS_SYSTEMINFO_H) && defined(HAVE_LIMITS_H)]: Use
2862 prototypes rather than K&R form. Assume any negative value from
2863 sysinfo denotes failure, not just -1.
2864 (main): Simplify use of sethostname.
2866 * src/pinky.c (include_idle, include_heading, include_fullname,
2867 include_project, include_plan, include_home_and_shell, do_short_format,
2868 include_where, main): Use bool for booleans.
2869 (count_ampersands, create_fullname, scan_entries, short_pinky):
2870 Use size_t for sizes.
2871 (create_fullname): Check for overflow in size calculations.
2872 (idle_string): Don't assume that the number of idle days
2873 is less than 10**8 and/or INT_MAX/(24*60*60).
2874 (main): No need to pass a non-NULL last arg to getopt_long.
2875 * src/uptime.c (print_uptime, uptime): Use size_t for sizes.
2876 (print_uptime): Remove unused local variable.
2877 (main): No need to pass a non-NULL last arg to getopt_long.
2878 * src/users.c (list_entries_users, users): Use size_t for sizes.
2879 (list_entries_users): Use char for bytes.
2880 (main): No need to pass a non-NULL last arg to getopt_long.
2881 * src/who.c (do_lookup, short_list, short_output, include_idle,
2882 include_heading, include_mesg, include_exit, need_boottime,
2883 need_deadprocs, need_login, need_initspawn, need_clockchange,
2884 need_runlevel, need_users, my_line_only, main): Use bool for booleans.
2885 (print_runlevel): Use unsigned char for bytes.
2886 (list_entries_who, scan_entries, who): Use size_t for sizes.
2887 (main): No need to pass a non-NULL last arg to getopt_long.
2889 * src/install.c (isdir): Remove decl.
2890 (install_file_to_path): Rely on make_path to fail if the destination
2891 is not a directory, by passing preserve_existing==true to it.
2892 Hence we no longer need to call isdir.
2893 Free dest_dir immediately when it's no longer needed, rather than
2894 waiting until the end of the function.
2895 (copy_file): Don't bother calling isdir, as copy will do the
2896 right thing if the destination is a directory.
2898 * src/du.c (fts_debug, opt_all, apparent_size, opt_count_all,
2899 print_grand_total, opt_separate_dirs, hash_ins, process_file, main):
2900 Use bool for booleans.
2901 (max_depth): Now size_t, not int, to avoid an arbitrary limit
2902 of INT_MAX on depth.
2903 (G_fail): Remove: no longer needed, now that the relevant
2904 functions return bool.
2905 (process_file): Use return value to signal success rather than
2906 setting a global. Remove first_call static var; not needed, since
2907 we can look at n_alloc. Use size_t for depths. Remove FIXME
2908 about size_t casts, as it's now fixed. Use xnrealloc rather
2909 than the obsolescent XREALLOC. Don't bother to check whether
2910 reallocation is needed unless level > prev_level.
2911 (du_files): Invert sense of result, for consistency with
2912 other coreutils code. All callers changed.
2913 (main): Allow --max-depth values up to SIZE_MAX.
2915 * src/df.c (inode_format, show_all_fs, show_local_fs,
2916 show_listed_fs, posix_format, require_sync, print_type,
2917 selected_fstype, excluded_fstype, show_dev, show_point, main):
2918 Use bool for booleans.
2919 (df_readable, show_dev): Use UINTMAX_MAX instead of -1.
2920 (show_dev, show_point, main):
2921 Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
2922 Don't assume disk name lengths are <= INT_MAX.
2923 Rewrite pct calculation to avoid cast.
2924 (show_point): Don't assume resolved length is <= SSIZE_MAX.
2926 * src/cut.c (hash_int) [!defined UINTPTR_MAX]: Use size_t
2927 instead of uintptr_t.
2928 * src/shred.c (UINT_MAX_32_BITS): Remove.
2929 (word32): Remove. All uses changed to uint32_t.
2930 (isaac_seed_data): Remove unnecessary cast.
2931 * src/system.h (ptr_align): Use size_t; in practice, this is just as
2932 good as uintptr_t in checking for alignments, and has fewer
2933 configuration hassles.
2935 * src/Makefile.am (localedir.h): Make it readonly; this
2936 undoes part of the 2004-07-27 patch.
2938 2004-07-30 Paul Eggert <eggert@cs.ucla.edu>
2940 * src/sort.c (UCHAR): Remove; all uses changed to to_uchar.
2941 (IS_THOUSANDS_SEP): Use bool when appropriate.
2942 (numcompare, main): Use char, not int, when the value is always a char.
2943 (numcompare): Remove "register"; compilers are smart enough these days.
2944 * src/system.h (errno, CHAR_BIT): Remove decls;
2945 no longer needed now we assume C89 or better.
2946 Include <inttypes.h> before <stdint.h>, as it's the
2947 Autoconf-recommended pattern.
2948 (to_uchar): New inline function, moved here from tr.c.
2949 Use full names for int types, e.g. "long int" rather than "long".
2950 * src/tr.c (to_uchar): Remove; now in system.h.
2951 (is_char_class_member): Use bool when appropriate.
2953 * src/mkdir.c (create_parents, main): Use bool when appropriate.
2954 (main): Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
2956 2004-07-29 Paul Eggert <eggert@cs.ucla.edu>
2958 * src/mkfifo.c (main): Use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1.
2960 * src/chmod.c (recurse, force_silent, process_file, process_files,
2961 main): Use bool when appropriate.
2962 * src/cksum.c (cksum, main): Likewise.
2963 * src/comm.c (hard_LC_COLLATE, only_file_1, only_file_2, both,
2964 compare_files, main): Likewise.
2966 * src/copy.h (struct cp_options): Likewise.
2967 * src/copy.c (copy_internal, is_ancestor, copy_dir, copy_reg,
2968 same_file_ok, seen_file, copy_internal, valid_options, copy): Likewise.
2969 * src/cp-hash.h (remember_created): Likewise.
2970 * src/cp-hash.c (remember_created): Likewise.
2971 * src/cp.c (struct dir_attr, flag_path, remove_trailing_slashes,
2972 re_protect, make_path_private, target_directory_operand, do_copy,
2973 cp_option_init, decode_preserve_arg, main): Likewise.
2974 * src/install.c (isdir, change_timestamps, change_attributes,
2975 copy_file, install_file_to_path, install_file_in_dir,
2976 install_file_in_file, strip_files, dir_arg, cp_option_init, main,
2977 change_attributes, change_timestamps): Likewise.
2978 * src/mv.c (remove_trailing_slashes, rm_option_init,
2979 cp_option_init, do_move, movefile, main): Likewise.
2980 * src/remove.c (right_justify), full_filename_, AD_pop_and_chdir,
2981 AD_push, prompt, remove_dir): Likewise.
2982 * src/rm.c (rm_option_init, main): Likewise.
2984 * src/remove.c (top_dir, pop_dir, full_filename_):
2985 Use size_t for sizes.
2986 * src/cp.c (target_directory_operand): Do not clear *NEW_DST if stat
2987 succeeds. It's not necessary in that case, as *NEW_DST is always
2989 (do_copy): Rewrite slightly to avoid need for "unreachable" comment.
2990 (main): Use EXIT_SUCCESS, EXIT_FAILURE instead of 0, 1.
2991 * src/rm.c (main): Likewise.
2993 md5sum, sha1sum integer cleanups.
2995 * src/checksum.h: Don't include config.h, sys/types.h, stdio.h:
2997 (ALG_UNSPECIFIED): Remove.
2998 (ALG_MDT): Don't make it equal to CHAR_MAX + 1; this isn't necessary.
2999 * src/md5.c: Don't include any files other than checksum.h.
3000 * src/sha1sum.c: Likewise.
3001 * src/md5sum.c (OPENOPTS, have_read_stdin, status_only, warn,
3002 bsd_split_3, split_3, hex_digits, digest_file, digest_check, main):
3003 Use bool when appropriate.
3004 (digest_check): Increase limit of number of input lines to
3005 UINTMAX_MAX from INT_MAX. Diagnose any overflows of this counter.
3006 Use ngettext instead of hard-to-i18nize hardcoded stuff for plurals.
3008 2004-07-28 Paul Eggert <eggert@cs.ucla.edu>
3010 * src/cat.c (exit_status): Remove. Now done by passing a boolean
3012 (simple_cat, cat): Return true if successful. All callers changed.
3013 (simple_cat, cat, main): Use bool for booleans.
3014 (simple_cat): Use size_t for sizes.
3015 (cat, main): Use the same names for parameters that we use for
3016 long options, to avoid confusion. This inverts the sense of the
3017 show_tabs (formerly output_tabs) and number_nonblank
3018 (formerly numbers_at_empty_lines) variables.
3019 (main): Don't mess up (due to integer overflow) if we are given
3020 INT_MAX - INT_MIN + 1 options.
3021 [O_BINARY]: Don't invoke isatty unless the other options require it.
3022 (main): When deciding whether to use simple_cat, don't worry
3023 about binary option; it's irrelevant.
3025 * src/dcgen: Remove comments, trailing white space, and empty
3026 lines from the output strings, to save space.
3027 Use a narrower type like 'unsigned char' for line lengths, if
3029 Make the output variables static, not extern.
3031 * src/chgrp.c (parse_group): Require base 10 when parsing
3033 (main): int -> bool when appropriate.
3034 * src/chown.c (main): Likewise.
3035 * src/chown-core.c: Include inttostr.h.
3036 (UINT_MAX_DECIMAL_DIGITS, uint_to_string): Remove.
3037 (gid_to_name, uid_to_name): Use imaxtostr/umaxtostr
3038 instead of uint_to_string).
3039 (describe_change): Instead of an int flag, use a char *
3040 auxiliary; this avoids the need for casts.
3041 Assume free (NULL) works.
3042 (change_file_owner): Return true/false, not 0/-1, since
3043 we don't set errno. All callers changed.
3044 Use bool when appropriate.
3045 (chown_files): Likewise.
3046 * src/chown-core.h (chown_files): Likewise.
3048 * tests/chown/basic: Test for proper handling of uids like
3049 "010", which must be parsed as decimal.
3051 * tests/misc/pwd: Don't assume that Perl's getpwd agrees with our
3052 pwd when there are multiple names for the working directory
3053 (which can happen with an automounter, sigh).
3055 * src/Makefile.am ($(SCRIPTS)): Don't depend on Makefile;
3056 this causes Solaris 8 'make' to refuse to build "groups".
3057 (localedir.h): Don't depend on Makefile: this causes Solaris
3058 8 'make' to build localedir.h unnecessarily. The dependence
3059 on Makefile is ineffective anyway, since $(localedir) might
3060 change even if Makefile hasn't.
3062 * src/remove.c (remove_dir): If we can't save the state of the
3063 working directory, pretend we started from "/", not ".".
3064 This avoids a bug on hosts like Solaris that don't let you
3065 remove the working directory.
3067 2004-07-27 Paul Eggert <eggert@cs.ucla.edu>
3069 * src/printf.c (strtiomax, strtoumax): Declare if not already
3070 declared: this fixes a portability bug with Solaris 8 + GCC.
3071 (STRTOX): Parenthesize use of macro arg as expression.
3072 (vstrtoimax, vstrtoumax, vstrtold): Remove now-unnecessary
3074 * configure.ac: Check for declaration of strtoumax, for
3077 * src/Makefile.am (cp_LDADD, ginstall_LDADD, mv_LDADD,
3078 pathchk_LDADD, rm_LDADD, test_LDADD): New vars, for eaccess.
3080 * tests/readlink/can-e: Don't assume that we can remove the
3081 working directory: this isn't possible under Solaris 8, say.
3082 * tests/readlink/can-f: Likewise.
3083 * tests/readlink/can-m: Likewise.
3085 * src/copy.c (copy_internal): find_backup_file_name no longer
3086 returns NULL, so don't bother to check for this.
3087 * src/cp.c (do_copy): Likewise.
3088 * src/ln.c (do_link): Likewise.
3090 2004-07-25 Paul Eggert <eggert@cs.ucla.edu>
3092 * src/nice.c (GET_NICE_VALUE): Renamed from GET_PRIORITY.
3094 (NZERO): New macro, if system doesn't define it already.
3095 (usage): Distinguish priorities from nice values.
3096 Don't assume NZERO is 20.
3097 (main): Use bool instead of int where appropriate.
3098 If user specifies an adjustment out of range, always truncate it
3099 to an inrange value instead of sometimes giving an error message
3101 Do not assume that -1 is an error return from "nice" or
3102 "getpriority", as it might be the current nice value minus NZERO.
3103 If nice/setpriority fails with errno == EPERM, go ahead and run
3104 the command anyway; POSIX requires this.
3106 * src/pathchk.c: Include euidaccess.h.
3107 (dir_ok): Use euidaccess, not access.
3108 * src/test.c (R_OK, W_OK, X_OK, FOK): Remove; system.h defines them.
3109 (eaccess): Remove. All users changed to use euidaccess instead.
3111 2004-07-24 Paul Eggert <eggert@cs.ucla.edu>
3113 * src/uptime.c (print_uptime) [defined BOOT_MSG]:
3114 Don't assume ut_line is null-terminated.
3115 * src/who.c (print_line): New arguments USERLEN and LINELEN,
3116 since USER and LINE might not be null terminated. All callers
3119 2004-07-23 Paul Eggert <eggert@cs.ucla.edu>
3121 Fix bug with "tail -f" reported by Rob Holland in
3122 <http://lists.gnu.org/archive/html/bug-coreutils/2004-07/msg00054.html>.
3123 Also, remove the undocumented and unsupported-since-2000
3124 --max-consecutive-size-changes options. Fix another related bug:
3125 "tail" got confused if stdin, stdout, or stderr were closed.
3126 Also, use output buffering even with "tail -f".
3128 * NEWS: Document this, plus yesterday's patch.
3129 * doc/coreutils.texi (tail invocation): "size has remained the same"
3130 -> "file has not changed", which is more accurate for fifos.
3131 * src/tail.c: Include fcntl-safer.h.
3132 (COPY_TO_EOF): Set to UINTMAX_MAX, not OFF_T_MAX (which was wrong).
3133 (COPY_A_BUFFER): New macro.
3134 (struct File_spec): New members mtime, mode, blocking.
3135 Remove member n_consecutive_size_changes.
3136 (DEFAULT_MAX_N_CONSECUTIVE_SIZE_CHANGES,
3137 max_n_consecutive_size_changes_between_opens,
3138 MAX_CONSECUTIVE_SIZE_CHANGES_OPTION): Remove.
3139 (long_options, tail_forever, parse_options):
3140 Remove (non-)support for --max-consecutive-size-changes.
3141 (record_open_fd): New function.
3142 (recheck, tail_file): Use it. Don't assume that stdin is open.
3143 (dump_remainder): Add support for new COPY_A_BUFFER special value.
3144 Treat errno==EAGAIN like EOF, since it might be a nonblocking read.
3145 (recheck): New arg BLOCKING, specifying whether to use blocking reads.
3147 (n_live_files): Remove, replacing with...
3148 (any_live_files): New function. All uses changed.
3149 (tail_forever): Use nonblocking I/O unless we know that blocking I/O
3150 is safe; this avoids some hangs when reading from a fifo.
3151 Avoid invoking fstat or sleep when using blocking I/O.
3152 Do not check for changes to size if the file is not a regular file,
3153 as the size is undefined in that case.
3154 Check for changes to mtime or mode, too; this works for non-regular
3156 (tail_forever, main): Redo fflush strategy to work even when input
3157 is nonblocking. Don't use unbuffered output; just flush when needed.
3159 2004-07-22 Paul Eggert <eggert@cs.ucla.edu>
3161 * src/tail.c (main): Ignore -f if no file operand is specified
3162 and standard input is a pipe.
3163 * doc/coreutils.texi (tail invocation): Do not ignore -f for
3164 all pipes, just for when standard input is a pipe and no
3165 file operand is specified.
3166 * tests/tail/Test.pm: Reinstate f-1 test, since we now pass.
3167 Add a new commented-out f-2 test, which we still fail.
3168 (test_vector): All f-* tests are special cases, not just f-1.
3170 2004-07-12 Paul Eggert <eggert@cs.ucla.edu>
3172 * src/uptime.c: Include c-strtod.h.
3173 (print_uptime): Use c_strtod instead of setlocale and sscanf.
3174 Use long int rather than int to count days (for 64-bit hosts),
3175 and check for arithmetic overflow when converting double to time_t.
3177 2004-07-11 Paul Eggert <eggert@cs.ucla.edu>
3179 * src/printf.c (vstrtold): Renamed from vstrtod.
3180 Now returns long double. All uses changed.
3181 (print_direc): Use "L" length modifier when printing floating point
3182 numbers, since we're now printing long double.
3184 2004-07-06 Paul Eggert <eggert@cs.ucla.edu>
3186 printf cleanup, to avoid undefined behavior, to add support for
3187 formats that Bash supports, and to support wide integers like
3190 * NEWS: Document this.
3191 * src/printf.c (UNSPECIFIED): Remove. All uses now replaced by
3192 booleans, so that we don't reserve any values for precision or
3194 (STRTOX): Use prototype, not K&R-style definition.
3195 (vstrtoimax): Renamed from xstrtol (to avoid confusion with xstrtol
3196 in ../lib), with type change to intmax_t.
3198 (vstrtoumax): Renamed from xstrtoul, with type change to uintmax_t.
3200 (vstrtod): Renamed from xstrtod. All uses changed.
3201 (print_direc): Use boolean arg instead of special value to indicate
3202 a missing precision or width. LENGTH no longer includes
3203 length modifiers or conversion character. New arg CONVERSION
3204 now specifies conversion character.
3205 Use intmax_t-width formatting for integers (like Bash).
3206 Add support for C99 %a, %A, %F (like Bash).
3207 Add support for field width with %c (POSIX requires this).
3208 Add a FIXME for lack of support for field width and precision
3210 Add support for '\'', '0' flags.
3211 Check for invalid combinations of flags, field width, precision,
3212 and conversion, to prevent use of undefined behavior.
3213 Allow multiple length modifiers, for formats like "%lld" (like Bash).
3214 Add support for C99 'j', 't', 'z' length modifiers (like Bash).
3215 In error message, output entire invalid conversion specification,
3216 instead of merely outputting % followed by the conversion char.
3217 * tests/misc/printf: Add tests for the above.
3219 2004-04-03 Dmitry V. Levin <ldv@altlinux.org>
3221 Change "readlink -f" to be more compatible with prior implementations.
3222 Add more canonicalize options, -e and -m.
3223 Add comprehensive tests for all readlink modes.
3225 * m4/canonicalize.m4 (AC_FUNC_CANONICALIZE_FILE_NAME):
3226 Do not add canonicalize.c here.
3228 * src/readlink.c (longopts): Add new options.
3229 (usage): Document them.
3230 (canonicalize_fname): New proxy function.
3231 (main): Handle new options.
3232 * doc/coreutils.texi (readlink invocation): Document new
3233 "readlink -f" behaviour and new canonicalize options, -e and -m.
3235 * configure.ac (AC_CONFIG_FILES): Add tests/readlink/Makefile.
3236 * tests/Makefile.am (SUBDIRS): Add readlink.
3237 * tests/readlink/Makefile.am: New file.
3238 * tests/readlink/{rl-1,can-e,can-f,can-m}: New readlink tests.
3239 * tests/misc/Makefile.am (TESTS): Remove basic readlink test.
3240 * tests/misc/readlink: Remove file.
3242 2004-07-04 Jim Meyering <jim@meyering.net>
3244 * src/copy.c (copy_internal): Add a FIXME comment.
3246 2004-07-02 Paul Eggert <eggert@cs.ucla.edu>
3248 * src/copy.c (copy_dir): Assume path_concat returns non-NULL.
3249 * src/cp.c (do_copy): Likewise.
3250 * src/mv.c (movefile): Likewise.
3252 * src/cp.c (make_path_private): 2nd arg is now size_t, not int,
3253 to avoid problem when path_concat dir name is longer than 2 GiB (!).
3255 * src/nohup.c (main): Don't pass NULL first argument to path_concat.
3256 This cleans up the semantics a bit, as we no longer try to open the
3259 2004-07-01 Paul Eggert <eggert@cs.ucla.edu>
3261 * NEWS: Add short names -t and -T for --target-directory
3262 and --no-target-directory options, respectively.
3264 * src/cp.c (NO_TARGET_DIRECTORY_OPTION, TARGET_DIRECTORY_OPTION):
3265 Remove. All uses changed to 'T' and 't', respectively.
3266 * src/install.c, src/ln.c, src/mv.c: Likewise.
3268 * src/cp.c (long_opts, usage, do_copy, main): Add -t and -T as
3269 aliases for --target-directory and --no-target-directory,
3271 * src/install.c (long_options, main, usage): Likewise.
3272 * src/ln.c, src/mv.c: Likewise.
3274 2004-07-01 Jim Meyering <jim@meyering.net>
3276 * Makefile.maint (sc_file_system): New target.
3277 (syntax-check-rules): Add it.
3278 .x-sc_file_system: New file.
3279 * Makefile.am (EXTRA_DIST): Add it.
3281 * man/sync.x: Use "file system" rather than "filesystem".
3282 * man/stat.x, man/df.x: Likewise.
3284 2004-06-30 Paul Eggert <eggert@cs.ucla.edu>
3286 * src/df.c (usage, main): Output "file system" rather than
3288 * src/du.c (usage): Likewise.
3289 * src/shred.c (usage): Likewise.
3290 * src/stat.c (usage): Likewise.
3291 * src/stat.c (long_options, usage): Rename "--filesystem" to
3292 "--file-system". But keep the old name around, for compatibility
3295 2004-06-29 Paul Eggert <eggert@cs.ucla.edu>
3297 Add support for --no-target-directory option.
3299 * NEWS: Document it.
3300 * doc/coreutils.texi (Common options, Target directory, cp
3301 invocation, install invocation, mv invocation, ln invocation):
3303 (link invocation): Explain how to rewrite link using ln now
3304 that we have --no-target-directory.
3305 (ln invocation): Explain that --no-target-directory subsumes
3307 (unlink invocation): Modify wording to match new wording in
3310 * src/cp.c (NO_TARGET_DIRECTORY_OPTION): New constant.
3311 (long_opts, usage, do_copy, main): Add support for
3312 --no-target-directory,
3313 * src/install.c (NO_TARGET_DIRECTORY_OPTION, long_options, main,
3315 * src/ln.c (NO_TARGET_DIRECTORY_OPTION, long_options, usage,
3317 * src/mv.c (NO_TARGET_DIRECTORY_OPTION, long_options, usage,
3319 * src/mv.c (enum): Sort values.
3321 2004-06-29 Jim Meyering <jim@meyering.net>
3323 Don't let verbose-mode output from a subshell obscure actual differences.
3324 * tests/rm/inaccessible: Turn off command-echoing just before
3325 invoking subshell, then turn it back on if VERBOSE=yes afterward.
3327 2004-06-25 Paul Eggert <eggert@cs.ucla.edu>
3329 Add support for 'install --target-directory', an option
3330 that has been documented for years but not implemented (!).
3331 * doc/coreutils.texi (install invocation): Document
3332 --target-directory in synopsis, too.
3333 * src/install.c (TARGET_DIRECTORY_OPTION): New var.
3334 (long_options, main, usage): Add --target-directory.
3335 (target_directory_operand): New function, stolen from mv.c.
3336 (main): Use it. Check for -d and --target-directory.
3337 Alter wording of diagnostics to match other programs.
3339 2004-06-28 Jim Meyering <jim@meyering.net>
3341 * src/cp.c (usage): Fix copy+paste error in description of
3342 --target-directory: s/move/copy/. From Paul Jarc.
3344 2004-06-27 Paul Eggert <eggert@cs.ucla.edu>
3346 Use more-consistent rules among cp, ln, and mv when dealing with
3347 last operands that are (or look like) directories.
3349 * src/cp.c (target_directory_operand): New, nearly-common function,
3350 It reports an error if the destination appears to be a directory
3351 (e.g., because it has a trailing slash) but is not.
3352 * src/ln.c, src/mv.c: Likewise.
3353 * src/cp.c (do_copy): Use it.
3354 * src/ln.c (main): Likewise.
3355 * src/mv.c (main): Likewise.
3357 * src/cp.c (do_copy): Don't assume argc is positive.
3358 Don't bother to lstat dest, since copy() will do that for us.
3359 Use "const" to avoid the need for cast.
3361 * src/cp.c (do_copy): Don't output a usage message because of file
3362 problems (e.g., an operand is not a directory). Use it only for
3363 syntax. Standardize on "target %s is not a directory" for the
3365 * src/ln.c (main): Likewise.
3366 * src/mv.c (main): Likewise.
3368 * src/cp.c (do_copy): Remove test for trailing slash, since
3369 target_directory_operand now does this.
3370 * src/ln.c (main): Likewise.
3371 * src/mv.c (movefile): Likewise.
3373 * src/cp.c (main): Reject multiple target directories.
3374 Check whether a specified target is a directory when parsing the
3375 options, using stat. This gives more-accurate diagnostics.
3376 * src/ln.c (main): Likewise.
3378 * src/ln.c (isdir): Remove decl; no longer needed.
3379 * src/mv.c (isdir, lstat): Likewise.
3381 * src/ln.c (do_link): New arg dest_is_dir. All uses changed.
3382 Don't check the destination ourself; rely on dest_is_dir.
3383 This way we can avoid lstatting the destination in the
3384 usual case, and in the worst case we lstat 1, not 3 times.
3385 Don't bother to unlink unless link failed; this saves a syscall.
3386 Remove unnecessary backup_succeeded flag;
3387 it was identical to "dest_backup != NULL".
3389 * src/ln.c (main): Use int to count to argc, not unsigned int.
3390 This handles negative operand counts.
3391 * src/mv.c (main): Likewise.
3393 * src/mv.c (do_move): Don't call hash_init; expect the caller to
3394 do it, for consistency with cp.c and ln.c. All callers changed.
3395 (movefile): dest_is_dir parameter is now bool, not int.
3396 (main): Standardize on "missing destination file operand after %s"
3397 for the diagnostic, for consistency with cp.c.
3399 * tests/mv/diag: Don't assume "mv --target=nonexistentdir"
3400 will complain about the arg count.
3401 Adjust to new (briefer) diagnostics.
3402 * tests/cp/fail-perm: Add a test to verify that we get the new
3403 diagnostic when failing to copy through a symlink-to-inaccessible-dir.
3405 2004-06-27 Paul Eggert <eggert@cs.ucla.edu>
3407 Fix a bug: formerly, if d/x was a directory and x a file, "ln x
3408 d/" incorrectly created a link d/x/x. It also saves some system
3411 * NEWS: Document the fix.
3413 * src/ln.c (main): Don't append basename to dest if this
3414 results in an existing directory name.
3415 * tests/ln/misc: See whether a trailing slash is followed too far.
3417 2004-06-26 Jim Meyering <jim@meyering.net>
3419 * src/printf.c (main): When given no arguments, print the standard
3420 "missing operand\nTry printf --help..." message -- to be consistent.
3422 2004-06-26 Jim Meyering <jim@meyering.net>
3424 * src/mknod.c (main): Add \n at the end of message output via fprintf.
3426 2004-06-25 Jim Meyering <jim@meyering.net>
3428 * tests/ln/misc: Add test for ln subscript error.
3430 2004-06-23 Paul Eggert <eggert@cs.ucla.edu>
3432 * src/ln.c (do_link): Remove unnecessary call to lstat.
3433 (main): Avoid subscript error when the destination is "".
3435 2004-06-23 Jim Meyering <jim@meyering.net>
3437 * tests/*: Replace all occurrences of `(exit N); exit' with
3438 `(exit N); exit N'. Otherwise, those many tests could exit with
3439 improper exit status when exiting via e.g., a trapped interrupt.
3440 Thanks to a report from Bob Proulx.
3442 2004-06-22 Paul Eggert <eggert@cs.ucla.edu>
3444 * src/who.c (idle_string, print_user): New arg boottime,
3445 specifying the most recent boot time. All uses changed.
3446 (idle_string) Consider a line to be "old" if it hasn't been used
3447 since the last boot time. Watch out for overflow when computing
3448 times, and for times in the future.
3449 (idle_string): Record latest boot time.
3451 2004-06-22 Jim Meyering <jim@meyering.net>
3453 * src/test.c (usage): Correct description of `-t FD'. The file
3454 descriptor, FD, is no longer optional. Reported by Ton Nijkes.
3456 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
3458 The 2004-06-19 fix for who and pinky was incomplete, as ctime
3459 has undefined behavior if the year precedes -999 or follows 9999.
3460 Since we have to stop using ctime anyway, we might as well use
3461 strftime and fix the FIXME, and support internationalized dates.
3463 * NEWS: Document the new behavior.
3464 * src/who.c: Include "hard-locale.h".
3465 (time_format, time_format_width): New vars.
3466 (time_string, print_line): Use them.
3468 (time_string): Use localtime + strftime instead of
3469 ctime, to avoid problems with years before -999 or after 9999.
3470 * src/pinky.c: Likewise.
3472 2004-06-21 Paul Eggert <eggert@cs.ucla.edu>
3474 Fix bug: GNU 'ls' didn't count columns correctly if user or group
3475 names contained multibyte characters where the column count
3476 differed from the byte count. This patch also corrects
3479 * src/ls.c (format_user_or_group): New function, which counts
3481 (format_user, format_group): Use it.
3482 (format_user_or_group_width): New function, which counts columns
3484 (format_user_width, format_group_width): Use it.
3486 2004-06-21 Jim Meyering <jim@meyering.net>
3488 * tests/priv-check: Quote "$PATH" in PATH=$PATH.
3489 Suggestion from Andreas Schwab.
3491 * tests/priv-check: When running as root, be sure to propagate
3492 PATH through to the process we exec as non-root.
3493 Reported by michael@aplatform.com.
3495 * src/mknod.c (main): Don't segfault when calculating the
3496 expected number of operands for `mknod NAME'.
3498 2004-06-20 Jim Meyering <jim@meyering.net>
3500 * src/dd.c (input_seek_errno): Declare file-scoped variable as static.
3502 2004-06-20 Paul Eggert <eggert@cs.ucla.edu>
3504 * src/basename.c (main):
3505 Standardize on the diagnostics given when someone gives
3506 too few operands ("missing operand after `xxx'") or
3507 too many operands ("extra operand `xxx'").
3508 Include "quote.h" and/or "error.h" if it wasn't already being included.
3509 * src/chgrp.c (main): Likewise.
3510 * src/chmod.c (main): Likewise.
3511 * src/chown.c (main): Likewise.
3512 * src/chroot.c (main): Likewise.
3513 * src/comm.c (main): Likewise.
3514 * src/cp.c (do_copy): Likewise.
3515 * src/csplit.c (main): Likewise.
3516 * src/date.c (main): Likewise.
3517 * src/dircolors.c (main): Likewise.
3518 * src/dirname.c (main): Likewise.
3519 * src/du.c (main): Likewise.
3520 * src/expr.c (main): Likewise.
3521 * src/hostid.c (main): Likewise.
3522 * src/hostname.c (main): Likewise.
3523 * src/id.c (main): Likewise.
3524 * src/install.c (main): Likewise.
3525 * src/join.c (add_file_name, main): Likewise.
3526 * src/link.c (main): Likewise.
3527 * src/ln.c (main): Likewise.
3528 * src/logname.c (main): Likewise.
3529 * src/md5sum.c (main): Likewise.
3530 * src/mkdir.c (main): Likewise.
3531 * src/mkfifo.c (main): Likewise.
3532 * src/mknod.c (main): Likewise.
3533 * src/mv.c (main): Likewise.
3534 * src/nohup.c (main): Likewise.
3535 * src/od.c (main): Likewise.
3536 * src/pathchk.c (main): Likewise.
3537 * src/ptx.c (main): Likewise.
3538 * src/readlink.c (main): Likewise.
3539 * src/rm.c (main): Likewise.
3540 * src/rmdir.c (main): Likewise.
3541 * src/seq.c (main): Likewise.
3542 * src/setuidgid.c (main): Likewise.
3543 * src/shred.c (main): Likewise.
3544 * src/sleep.c (main): Likewise.
3545 * src/sort.c (main): Likewise.
3546 * src/split.c (main): Likewise.
3547 * src/stat.c (main): Likewise.
3548 * src/test.c (beyond, main): Likewise.
3549 * src/touch.c (main): Likewise.
3550 * src/tr.c (main): Likewise.
3551 * src/tsort.c (main): Likewise.
3552 * src/tty.c (main): Likewise.
3553 * src/uname.c (main): Likewise.
3554 * src/uniq.c (main): Likewise.
3555 * src/unlink.c (main): Likewise.
3556 * src/uptime.c (main): Likewise.
3557 * src/users.c (main): Likewise.
3558 * src/who.c (main): Likewise.
3559 * src/whoami.c (main): Likewise.
3561 * tests/basename/basic: Adjust to new diagnostics.
3562 * tests/du/files0-from: Likewise.
3563 * tests/expr/basic: Likewise.
3564 * tests/mv/diag: Likewise.
3565 * tests/tsort/basic-1: Likewise.
3567 2004-06-20 Jim Meyering <jim@meyering.net>
3569 * src/ln.c: Remove declaration of yesno.
3570 Instead, include yesno.h.
3571 * src/copy.c: Likewise.
3573 * src/remove.c: Remove declaration of yesno.
3574 Instead, include yesno.h.
3575 (top_dir): Remove now-unnecessary cast of obstack_base.
3576 (pop_dir): Likewise.
3577 (full_filename_): Likewise.
3579 2004-06-19 Paul Eggert <eggert@cs.ucla.edu>
3581 Don't dump core if ctime returns NULL; this is possible on
3582 hosts with 64-bit time_t and 32-bit int.
3583 * src/who.c: Include "inttostr.h".
3584 (time_string): If ctime fails, print the raw time as an integer
3585 instead of dumping core.
3586 * src/pinky.c: Likewise, as follows:
3587 Include "inttostr.h".
3588 (time_string): New function, copied from who.c.
3589 (print_entry): Use it.
3591 2004-06-19 Paul Eggert <eggert@cs.ucla.edu>
3593 * src/who.c (print_line): Don't truncate user names at 8 bytes.
3594 Problem reported by Guido Leenders in:
3595 http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00056.html
3596 * NEWS: document this.
3598 2004-06-19 Jim Meyering <jim@meyering.net>
3600 * src/system.h (case_GETOPT_VERSION_CHAR): Switch back to
3601 using GNU_PACKAGE (from PACKAGE) once again. This restores
3602 `GNU' to the parenthesized package name in --version output.
3603 Before, the first argument from AC_INIT, `GNU coreutils', would
3604 be propagated to the PACKAGE variable. Now, `GNU ' is trimmed.
3605 Reported by Richard Stallman.
3607 2004-06-17 Jim Meyering <jim@meyering.net>
3609 * src/tr.c (to_uchar): Rename function from `uchar'. The latter
3610 would clash with a typedef in Tru64's <sys/types.h>. From Albert Chin.
3612 2004-06-15 Paul Eggert <eggert@cs.ucla.edu>
3614 * NEWS: Remove more special cases for POSIXLY_CORRECT when POSIX
3615 allows the GNU behavior. "--" is now supported by chroot, hostid,
3616 hosname, pwd, sync, yes.
3617 * doc/coreutils.texi (yes invocation, false invocation,
3618 true invocation): Document this.
3619 * src/chroot.c (main): Handle "--".
3620 * src/hostid.c (main): Likewise.
3621 * src/hostname.c (main): Likewise.
3622 * src/pwd.c (main): Likewise.
3623 * src/sync.c (main): Likewise.
3624 * src/yes.c (main): Likewise.
3625 * src/true.c (main): Recognize --help and --version even if
3626 POSIXLY_CORRECT is set.
3627 * src/yes.c (main): Likewise.
3629 2004-06-09 Paul Eggert <eggert@cs.ucla.edu>
3631 * NEWS: Remove special cases for POSIXLY_CORRECT when POSIX allows
3633 * doc/coreutils.texi (pr invocation, unlink invocation): Document this.
3634 * src/ls.c (decode_switches): Pay attention to TABSIZE even if
3635 POSIXLY_CORRECT is set. POSIX reserves upper-case environment
3636 variables to the implementation, so it's OK for ls to depend on
3638 * src/pr.c: Include "hard-locale.h".
3639 (main): When in a non-POSIX locale, ignore POSIXLY_CORRECT, since
3640 POSIX specifies the behavior only in the POSIX locale.
3641 * src/printf.c (print_esc): Support \x, \u, \U even if POSIXLY_CORRECT,
3642 since POSIX says the behavior is unspecified here.
3643 * src/tail.c (parse_obsolescent_option): Support multiple file operands
3644 even if POSIXLY_CORRECT, since POSIX does not require a diagnostic.
3645 * src/printf.c (main): Recognize --help, --version even if
3646 POSIXLY_CORRECT. POSIX does not specify any options, but it
3647 does not prohibit options either, so "printf" is like "expr" here.
3648 * src/unlink.c (main): Likewise.
3649 * tests/misc/printf: Adjust to the new semantics for \x if
3652 2004-06-14 Jim Meyering <jim@meyering.net>
3654 * tests/misc/pwd: New test, for fix of 2004-04-19.
3655 * tests/misc/Makefile.am (TESTS): Add pwd.
3656 (BUILD_SRC_DIR): Define BUILD_SRC_DIR.
3658 * src/copy.c: Remove declaration of euidaccess.
3659 Instead, include "euidaccess.h".
3661 2004-06-13 Paul Eggert <eggert@cs.ucla.edu>
3663 * src/who.c (PIDSTR_DECL_AND_INIT): Don't assume pid_t fits in int.
3664 (UT_ID) [!HAVE_STRUCT_XTMP_UT_ID]: Remove bogus comment,
3665 as (sizeof "??") reliably returns 3.
3666 (print_line): Guard against idle and pid being too long
3667 (which is possible when printing headers).
3668 (print_user): Allocate enough bytes for idlestr. Use IDLESTR_LEN.
3669 Avoid unnecessary cast of sizeof to int.
3670 (make_id_equals_comment): Do not assume that UT_ID returns
3671 a string; it might return a non-null-terminated array.
3672 Use strncat instead. It's not very often where strncat is
3673 exactly what you want, but this is one of those rare cases.
3675 2004-06-11 Paul Eggert <eggert@cs.ucla.edu>
3677 * src/who.c (list_entries_who): Don't output a trailing space.
3679 2004-06-09 Jim Meyering <jim@meyering.net>
3681 * src/touch.c (usage): Improve wording in description of the
3682 --time=WORD option. Reported by Dan Jacobson.
3684 * src/chown-core.c (change_file_owner): Change names of parameters
3685 old_uid and old_gid to required_uid and required_gid respectively.
3687 * src/chmod.c (mode_changed): Return false, not 0, now that the
3688 function returns `bool'.
3690 2004-06-08 Paul Eggert <eggert@cs.ucla.edu>
3692 Adjust chmod and chown to be similar if -c or -v are given. In
3693 particular, a no-op chown is no longer reported as a change; this
3694 reverts to previous behavior. Also, fix both commands so that -v
3695 report failures even if the failure is not due to the chmod or
3698 * src/chmod.c (CH_NOT_APPLIED): New constant.
3699 (describe_change): Handle it.
3700 (process_file): Use it, if a symlink wasn't changed.
3701 (mode_changed): Return bool, not int. Accept new argument
3702 NEW_MODE; all callers changed. This lets us avoid statting the
3703 file unless the new mode has unusual bits.
3704 (process_file): Return -1 on error. With -v, report all errors
3705 verbosely, not just some.
3707 * src/chown-core.c (change_file_owner): Return -1 on error, not
3708 1 sometimes and -1 on others. Our caller ORs together our results,
3709 and (-1 | 1) == 0 on ones-complement hosts.
3710 With -v report all errors verbosely, not just some.
3711 Fix bug when chopt->root_dev_ino && !chopt->affect_symlink_referent:
3712 file_stats wasn't set properly in that case.
3714 * tests/chgrp/basic: Adjust to above changes.
3716 2004-05-20 Paul Eggert <eggert@cs.ucla.edu>
3718 * tests/chgrp/basic: Test that chgrp -h does not fail on
3719 symlinks, even on hosts where that's not supported.
3720 Test that if -R is specified without -H or L, -h is assumed.
3721 Test that chown() is not optimized away.
3723 2004-05-18 Paul Eggert <eggert@cs.ucla.edu>
3725 Several fixes to chgrp and chown for compatibility with POSIX and BSD:
3727 Check for incompatible options. When -R and --dereference are
3728 both used, then either -H or -L must also be used. When -R and -h
3729 are both used, then -P must be in effect.
3731 -H, -L, and -P have no effect unless -R is also specified.
3732 If -P and -R are both specified, -h is assumed.
3734 Do not optimize away the chown() system call when the file's owner
3735 and group already have the desired value. This optimization was
3736 incorrect, as it failed to updated the last-changed time and reset
3737 special permission bits, as POSIX requires.
3739 Do not report an error if the owner or group of a
3740 recursively-encountered symbolic link cannot be updated because
3741 the file system does not support it.
3743 * NEWS: Document the above.
3745 * src/chgrp.c (main): Check for incompatible options. -R --dereference
3746 requires either -H or -L, and -R -h requires -P. If -H, specify
3747 FTS_PHYSICAL as well as FTS_COMFOLLOW; this is faster. Make this
3748 file as much like chown.c as possible.
3749 * src/chown.c (main): Likewise.
3751 * src/chown-core.c (change_file_owner): Use ent->fts_statp only if
3752 needed. Chown a directory only after chowning its children; this
3753 avoids problems if the new directory ownership doesn't permit
3754 access to the children. Dereference symlinks before doing
3755 ROOT_DEV_INO_CHECK, not after, so that we catch symlinks to /.
3756 Do not optimize away the chown() system call when the file's owner
3757 and group already have the desired value. POSIX does not permit
3758 this optimization. Rely on chown and lchown to do the right
3759 thing with symlinks and/or -1 arguments, now that we have wrappers
3760 to do this. Use ENOTSUPP not ENOSYS, and ignore all ENOTSUPP
3761 errors, not just command-line errors.
3762 (chown_files): Pass FTS_NOSTAT to xfts_open if we don't need file status.
3764 * src/system.h (ENOTSUP): Remove.
3766 * tests/chgrp/basic: Use chown --from to discover whether the
3767 group changed, since chgrp now changes unconditionally. This
3768 complicates the sed script a bit. Do not specify --dereference,
3769 since it's the default (and we want to test this). Adjust output
3770 to match the fact that chgrp no longer optimizes the case of
3771 changing a file's group to the same value as before.
3772 * tests/chgrp/posix-H: Do not attempt to combine -h and -H; these
3773 options are incompatible, and their behavior is undefined with POSIX.
3774 (changed, not_changed): Adjust to match the fact that -h is no longer
3775 specified. Sort names.
3776 * tests/chown/deref: Adjust error-diagnostic spelling to match new
3779 2004-06-07 Paul Eggert <eggert@cs.ucla.edu>
3781 * src/uname.c (main): Fix typo introduced on 2003-05-10 that
3782 prevented a diagnostic of any operands.
3784 2004-06-08 Jim Meyering <jim@meyering.net>
3786 * src/shred.c (direct_mode): Turn it on/off with directio, too.
3788 2004-06-07 Jim Meyering <jim@meyering.net>
3790 Enable direct-mode I/O (bypassing the buffer cache), if possible.
3791 Prompted by a suggestion from Kalle Olavi Niemitalo
3792 in http://bugs.debian.org/207035.
3793 * src/shred.c (direct_mode): New function.
3794 (do_wipefd): Turn on direct-mode I/O.
3795 (dopass): If a file's first write fails with EINVAL,
3796 turn off direct-mode I/O and retry the write.
3798 2004-06-05 Paul Eggert <eggert@cs.ucla.edu>
3800 * src/tr.c (main): "tr -d a b" is now a fatal error even if
3801 POSIXLY_CORRECT is set. The POSIX SYNOPSIS does not allow this
3804 2004-06-04 Paul Eggert <eggert@cs.ucla.edu>
3806 * src/shred.c (dopass): Don't subtract 1 from the offset after
3807 a write error. Problem reported by Jon Peatfield in:
3808 http://lists.gnu.org/archive/html/bug-coreutils/2004-06/msg00020.html
3810 2004-06-02 Paul Eggert <eggert@cs.ucla.edu>
3812 Fix bug reported by Buciuman Adrian in
3813 <http://mail.gnu.org/archive/html/bug-coreutils/2003-08/msg00105.html>
3814 where 'dd' created a file that was too large. The bug was that dd
3815 assumed that the input file offset does not advance after a failed
3816 read; but POSIX says that the input file offset is undefined after
3819 * src/dd.c (MAX_BLOCKSIZE): New macro.
3820 (input_seekable, input_seek_errno, input_offset,
3821 input_offset_overflow): New vars.
3822 (scanargs): Reject block sizes greater than MAX_BLOCKSIZE.
3823 (advance_input_offset): New function.
3824 (skip_via_lseek): Set errno to zero when reporting our failure,
3825 so that we don't report based on garbage errno.
3826 (skip): If fdesc is standard input, advance the input offset.
3827 Do not quit if reading, and if noerror was specified;
3828 POSIX seems to require this.
3829 If read fails on output file, report the earlier lseek failure
3830 instead; this fixes a FIXME in dd_copy.
3831 (advance_input_after_read_error): New function.
3832 (dd_copy): Use it, instead of assuming that failed reads
3833 do not advance the file pointer. Advance input offset
3834 after nonfailed reads. Advance only a partial block if
3835 the previous read (before the failed read) succeeded, and
3836 do not generate an output block of zeros in this case.
3837 (main): Determine initial input offset, seekability of input,
3838 and error if it wasn't seekable.
3840 2004-06-02 Jim Meyering <jim@meyering.net>
3842 rm (without -f) could hang unnecessarily when attempting to
3843 remove a symlink to a file on an off-line NFS-mounted partition.
3844 Reported by David Howells in https://bugzilla.redhat.com/124699.
3845 * src/remove.c (write_protected_non_symlink): New function.
3846 Don't invoke euidaccess on symlinks.
3847 (prompt): Use write_protected_non_symlink rather than using
3848 euidaccess directly, being careful not to call lstat twice for a file.
3850 Fix a bug in how the --output-delimiter=D option works with
3851 abutting byte or character ranges. Reported by David Krider in
3852 http://lists.gnu.org/archive/html/bug-coreutils/2004-05/msg00132.html
3853 * src/cut.c (print_kth): Remove special case for open-ended range.
3854 (set_fields): Record the range start index for an interval even
3855 when it abuts another interval on its low side.
3856 Also record the range start index of the longest right-open-interval.
3857 * tests/cut/Test.pm: Add tests of --output-delimiter=S with
3858 abutting and overlapping byte ranges.
3860 2004-06-01 Paul Eggert <eggert@cs.ucla.edu>
3862 Some POSIX-conformance cleanups for tr.
3864 * src/tr.c (posix_pedantic): Remove; no longer needed since
3865 we need to test this in just one place now.
3866 (usage): Mention -C.
3867 (unquote): Note that \055, \n, etc are escaped.
3868 Do not worry about POSIXLY_CORRECT when warning about ambiguous
3870 \ at end of string stands for itself.
3871 Do not diagnose invalid backslash escapes: POSIX says the behavior
3872 is unspecified in this case, so we don't need to diagnose it.
3873 (main): Add support for -C (currently an alias for -c).
3874 Do not diagnose 'tr [:upper:] [:upper:], as POSIX does not require
3876 * tests/tr/Test.pm: New tests bs-055, bs-at-end, repeat-Compl.
3877 Fix comment for range-a-a.
3879 2004-05-25 Paul Eggert <eggert@cs.ucla.edu>
3881 Improve the efficiency (and in one case, correctness) of code
3882 that reads symlinks.
3884 * src/copy.c (copy_internal): Don't use alloca, as it can mess up
3885 royally if the link length is long (e.g., GNU/Hurd). Use
3886 xreadlink instead, it's safer. Don't bother to read the link if
3887 it's the wrong size. Add a FIXME because this area is a bit murky
3889 * src/ls.c (get_link_name): Update use of xreadlink.
3890 * src/readlink.c (main): Likewise.
3891 * src/stat.c (print_stat): Likewise.
3893 2004-06-01 Jim Meyering <jim@meyering.net>
3895 * src/env.c (main): Prefer the notation `STREQ (a, b)'
3896 over `!strcmp (a, b)'.
3897 * src/sort.c (main, sort_buffer_size): Prefer the notation
3898 `STREQ (a, b)' over `strcmp (a, b) == 0'.
3899 * src/date.c (batch_convert): Likewise.
3900 * src/expr.c (nextarg): Likewise.
3901 * src/su.c (correct_password, restricted_shell, main): Likewise.
3902 * src/ptx.c (swallow_file_in_memory, main): Likewise.
3903 * src/test.c (binary_operator, and, or, main): Likewise.
3905 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
3907 * NEWS: echo compatibility cleanup.
3908 * doc/coreutils.texi (echo invocation): Document the changes.
3909 * src/echo.c (V9_ECHO): Remove; always enabled.
3910 (DEFAULT_ECHO_TO_XPG): Renamed from V9_DEFAULT, so that
3911 we use the same naming convention as bash. Now an enum,
3913 (usage): Reword to mention -e/-E more accurately.
3914 Mention \0NNN (the POSIX syntax) rather than \NNN (nonstandard).
3915 (hextobin): New function.
3916 (main): Use bool rather than int for local vars when appropriate.
3917 Do not allow options if POSIXLY_CORRECT, unless we are using
3918 BSD semantics and the first argument is "-n".
3919 Don't pass unnecessary extra arg to parse_long_options.
3920 do_v9 now defaults to DEFAULT_ECHO_TO_XPG, not to allow_options.
3921 Do not look for options if !allow_options.
3922 Use size_t rather than int when appropriate.
3923 Open-code option test rather than using strrchr.
3924 Use faster test for "-".
3925 Avoid redundant argc test.
3926 Add support for \x, for Bash compatibility.
3927 Use e.g. '\a' rather than '\007', for portability to EBCDIC hosts.
3928 When '\c' is encountered, stop printing immediately, as POSIX
3930 Add support for \xhh syntax.
3931 Add support for \0ooo syntax; POSIX requires this.
3933 2004-06-01 Jim Meyering <jim@meyering.net>
3935 * Use automake-1.8b. Regenerate dependent files.
3937 2004-05-31 Jim Meyering <jim@meyering.net>
3939 * tests/Makefile.am.in (TESTS_ENVIRONMENT): Define PATH to include
3940 the build src/ directory -- at the front.
3941 ($(srcdir)/$x-tests): Depend on Makefile.am.
3942 Use $x as the program name, except when it would be `test' (test is
3943 the sole program tested via mk-script that is also a shell built-in).
3944 In that case, use the old ../../src/$x.
3946 2004-05-30 Jim Meyering <jim@meyering.net>
3948 Work around HPUX /bin/cc compiler bug that is exposed, now that
3949 sets are arrays of type `bool'. More details here:
3950 http://lists.gnu.org/archive/html/bug-gnulib/2004-05/msg00094.html
3951 FIXME: verify that the above URL points to the right message
3953 * src/tr.c (card_of_complement): Use cleaner `sizeof in_set'
3954 rather than `N_CHARS * sizeof(in_set[0])'. Using HPUX's /bin/cc
3955 (aC++/ANSI C B3910B A.05.55 [Dec 04 2003]) on an ia64-hp-hpux11.22
3956 system, those two expressions are not the same (256 vs. 1024).
3957 The effect of this problem was that `tr -c x y' would fail:
3958 tr: when not truncating set1, string2 must be non-empty
3959 (set_initialize): Remove unnecessary initialization of the `in_set'
3960 buffer; that initialization triggered the same compiler bug as above.
3962 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
3964 tr cleanup, mostly having to do with integer type ranges.
3967 * tests/tr/Test.pm: Add a few tests for the below. Alas, most of
3968 the test cases wouldn't be portable, or would take too much CPU
3971 * src/tr.c (N_CHARS, N_CHAR_CLASSES): Now an enum, not a macro.
3972 This is safe since the code already assumes N_CHARS fits in int.
3973 (Filter): Remove: we want to prototype everything.
3974 (ORD, CHR): Remove. All uses removed. Some replaced with:
3975 (uchar): New function. All places where a char must be converted
3976 to an unsigned char are now done this way, not by ad-hoc methods.
3977 (count): New type. Use it whenever counts or states are needed.
3978 (BEGIN_STATE): Increase from INT_MAX - 1 (which was bogus, anyway,
3979 since we used it in an unsigned int context) to UINTMAX_MAX - 1.
3980 (REPEAT_COUNT_MAXIMUM): New macro. Use it in place of BEGIN_STATE
3981 whenever appropriate.
3982 (NOT_A_CHAR): Remove global macro; now a local enum.
3983 (UL_LOWER, UL_UPPER, UL_NONE): No longer specify values, since
3984 the rest of the code no longer depends on them.
3985 (class_ok): Remove; all uses changed to use inline comparisons.
3986 (RE_NO_TYPE): Remove; wasn't used or needed.
3987 (struct List_element): normal_char and equiv_code are now unsigned
3989 first_char, last_char, and the_repeated_char are now unsigned char,
3990 not unsigned int. repeat_count is now count, not size_t.
3992 (struct Spec_list): state is now count, not unsigned int.
3993 lengthis now count, not size_t.
3994 n_indefinite_repeats is now size_t, not int.
3995 has_equiv_class, has_char_class, and has_restricted_char_class
3996 are now bool, not int. All uses changed.
3997 (struct E_string): s is now char *, not unsigned char *.
3998 escaped is now bool *, not int *. All uses changed.
3999 (ES_MATCH): Remove macro, replacing with:
4000 (es_match): New inline function. All uses changed.
4001 (squeeze_repeats, complement, posix_pedantic, truncate_set1,
4002 translating): Now bool, not int.
4003 (io_buf): Now char array, not unsigned char.
4004 (SET_TYPE): Remove. All uses replaced with bool.
4005 (is_equiv_class_member, unquote, append_range, append_char_class,
4006 append_equiv_class, find_closing_delim, star_digits_closebracket,
4007 build_spec_list, parse_str, homogeneous_spec_list):
4008 Now returns bool, not int. All uses changed.
4009 (is_equiv_class_member): Now inline.
4010 (is_equiv_class_member, is_char_class_member, make_printable_str,
4011 append_normal_char, append_range, append_repeated_char,
4013 Args are now of proper integer type.
4014 (unquote, look_up_char_class, make_printable_str,
4015 append_equiv_class, build_spec_list, squeeze_filter):
4016 Avoid unsigned char *p; gently convert *p to unsigned char instead.
4017 (unquote, get_spec_stats): Do not jump past declarations and then
4018 use them; C doesn't allow this in portable programs.
4019 (make_printable_str): Check for overflow in size calculations.
4020 (xmemdup): Remove. All uses rewritten.
4021 (find_bracketed_repeat): Args are now of proper pointer-to-integer
4022 type. Do not reject [c*0]. Use xstrtoumax, not xstrtoul.
4023 (find_bracketed_repeat, star_digits_closebracket): Check that the
4024 digits are not escaped.
4025 (build_spec_list): Don't bother to copy opnd_str; not needed.
4026 (build_spec_list, get_next): Simplify internal logic a bit.
4027 (card_of_complement): Fix bug due to char overflow.
4028 (get_spec_stats): Don't assume len fits into int.
4029 Check for integer overflow. Use abort() rather than assert(0).
4030 (string2_extend): Fix subscript error: is_char_class_member (..., 255)
4032 (squeeze_filter): READER is never null now; simplify code.
4033 READER arg now has a simpler type. Remove unnecessary casts.
4034 (squeeze_filter, main): Calls to fwrite improperly checked result
4035 against zero, rather than against requested size.
4036 (plain_read): New function.
4037 (read_and_delete, read_and_xlate):
4038 Remove unused filter arg, and don't worry about hit_eof.
4039 Simplify by using plain_read.
4040 (set_initialize): Args are bool and bool *, not int and SET_TYPE *.
4041 (main): Always pass a non-null procedure to squeeze_filter.
4042 Rewrite so that class_ok isn't needed.
4044 2004-05-29 Paul Eggert <eggert@cs.ucla.edu>
4046 * src/shred.c (dosync): Ignore EBADF errors, as IRIX 6.5
4047 fdatasync reports EBADF when syncing (unwritable) directories.
4048 Problem reported by Albert Chin-A-Young in:
4049 http://lists.gnu.org/archive/html/bug-coreutils/2004-05/msg00165.html
4051 2004-05-29 Jim Meyering <jim@meyering.net>
4053 * tests/chown/deref: Fix typo: use ls -ldo, not ls -ldg.
4054 Patch from Albert Chin.
4056 * src/ptx.c (text_buffer_maxend): Remove declaration of unused variable.
4058 * src/remove.c (push_dir): Merge declaration and adjacent assignment
4059 into a single statement.
4061 2004-05-28 Jim Meyering <jim@meyering.net>
4063 * src/remove.c (AD_mark_helper): Eliminate an unnecessary comparison.
4065 2004-05-22 Jim Meyering <jim@meyering.net>
4067 rm -r would get a failed assertion when run from an inaccessible
4068 directory and with two or more command line arguments including an
4069 absolute-named directory followed by a relative-named directory.
4071 * src/remove.h (struct rm_options) [require_restore_cwd]: New member.
4072 * src/remove.c (struct cwd_state): Define.
4073 (AD_pop_and_chdir): Redesign interface so that a restore_cwd failure
4074 can be detected by the caller. Instead of returning a malloc'd
4075 directory name, communicate it to caller via a new parameter, and
4076 return an indication of whether restore_cwd failed. Update caller.
4077 Eliminate an unnecessary call to AC_stack_top.
4078 (remove_dir): Change type of cwd_state parameter to `struct cwd_state'
4079 so we can now communicate to caller whether/how functions like
4080 restore_cwd have failed. Update caller.
4081 (rm_1): Fail if we've failed to restore the working directory
4082 and the name of the next file to remove is `.'-relative.
4083 (rm): Fail if the require_restore_cwd flag is true and we've
4084 failed to restore the working directory.
4085 * src/mv.c (rm_option_init): Initialize new member,
4086 x->require_restore_cwd.
4087 * src/rm.c (rm_option_init): Likewise.
4089 2004-05-21 Jim Meyering <jim@meyering.net>
4091 * tests/rm/inaccessible: New test for the above fix.
4092 * tests/rm/Makefile.am (TESTS): Add inaccessible.
4094 * src/remove.c (rm): Use free rather than XFREE.
4095 (remove_dir): Use xmalloc, not XMALLOC.
4096 (ds_init): Likewise.
4098 2004-05-20 Jim Meyering <jim@meyering.net>
4100 * Makefile.maint (sc_unmarked_diagnostics): Now that the unmarked
4101 diagnostics in shred.c have been fixed, don't exempt shred.c from
4104 * src/shred.c: Use translatable diagnostics, e.g.
4105 change "%s: remove" to _("%s: failed to remove") and
4106 change "%s: close" to _("%s: failed to close").
4108 2004-05-17 Paul Eggert <eggert@cs.ucla.edu>
4110 * src/shred.c (names): Bring back lower-case letters, "_", and
4111 ".". But continue to omit +, =, %, @, #, as they're either
4112 shell metacharacters (for some shells) or are not in some
4113 character sets, or (in the case of '%') must be a
4114 metacharacter somewhere.
4116 2004-05-16 Paul Eggert <eggert@cs.ucla.edu>
4118 * src/cut.c (cut_fields): Adjust to new signature of getndelim2.
4120 2004-05-17 Jim Meyering <jim@meyering.net>
4122 * src/shred.c (incname): Decrement `len' only once per loop iteration.
4124 chgrp and chown now dereference symlinks by default, per POSIX.
4125 Reported by Michal Politowski as http://bugs.debian.org/249177.
4127 * src/chown-core.c (chopt_init): Affect each symlink referent by default.
4128 * src/chown.c (usage): Update to reflect this.
4129 * src/chgrp.c (usage): Likewise.
4130 * NEWS: Describe the change.
4131 Adapt tests accordingly.
4132 * tests/chgrp/basic: Use -h where necessary to retain semantics.
4133 * tests/chgrp/deref: Likewise.
4134 * tests/chgrp/posix-H: Likewise.
4136 2004-05-15 Paul Eggert <eggert@cs.ucla.edu>
4138 In shred, check for errors from fdatasync more carefully. If
4139 fdatasync fails with errno==EINVAL, it means this implementation
4140 does not support synchronized I/O for this file. Do not report
4141 this as an error, as (for example) AIX 5.2 fdatasync reports it
4142 for raw disk devices. Problem reported by Albert Chin in
4143 <http://mail.gnu.org/archive/html/bug-gnu-utils/2004-05/msg00028.html>.
4145 Check for write errors, though: the old code ignored them.
4146 Improve error checking in a few other cases, too (e.g., close of a
4149 Also, change several 'int' values to 'bool', so that the error
4150 checking is a bit clearer. Similarly, change unsigned values
4151 to size_t where appropriate.
4153 * src/shred.c: Include "dirname.h".
4154 (datasync) [!HAVE_FDATASYNC]: Remove.
4155 (dosync): New function.
4156 (dopass): Use it. Return 1 on write error, -1 on other error.
4157 All callers changed. Report write error if dosync does.
4158 (do_wipefd, wipefd, wipename, wipefile): Return bool (true/false),
4159 not int (0/-1). All callers changed. Return false if there's a
4161 (incname): Return bool (true/false), not int (0/1). Accept
4162 size_t length, not unsigned. All callers changed. Do not
4163 bother checking for non-digits; it can't happen. Replace
4164 recursion with iteration.
4165 (wipename): Use dir_name, base_name, etc. instead of assuming
4166 Unix file names. Use size_t for length, not unsigned.
4167 Report error if unlink or close fails.
4168 (wipename, main): Use bool for booleans.
4170 (names): Use only digits and uppercase letters, for greater
4173 2004-05-16 Jim Meyering <jim@meyering.net>
4175 * tests/chown/deref: New test for the yesterday's change.
4176 * tests/chown/Makefile.am (TESTS): Add deref.
4178 2004-05-15 Jim Meyering <jim@meyering.net>
4180 chown --dereference did nothing when the owner/group of a
4181 symlink matched the desired owner/group. Reported by David Malone.
4182 Also reported in 1999 as http://bugs.debian.org/39642.
4184 * src/chown-core.c (change_file_owner): When --dereference has
4185 been specified, and when processing a symlink, stat it to get the
4186 owner and group of the referent.
4188 2004-05-14 Jim Meyering <jim@meyering.net>
4190 * man/pwd.x, man/echo.x, man/printf.x: Fix typo:
4191 s/supercede/supersede/ reported by Andrew Fabbro.
4193 2004-05-13 Paul Eggert <eggert@cs.ucla.edu>
4195 Improve performance of `sort -m' on large files, at the cost of
4196 making some contrived examples unsafe. POSIX allows this
4197 optimization. Performance problem reported by Jonathan Baker in
4198 <http://mail.gnu.org/archive/html/bug-coreutils/2004-05/msg00071.html>.
4200 * src/sort.c (first_same_file): Do not treat input pipes
4201 differently from other files.
4202 * doc/coreutils.texi (sort invocation): Document that "sort -m -o F"
4203 might write F before reading all the input.
4206 2004-05-12 Paul Eggert <eggert@cs.ucla.edu>
4208 * src/od.c (print_ascii, dump_strings): Use e.g. '\a' rather than
4209 '\007', for portability to EBCDIC hosts.
4210 * src/printf.c (print_esc_char): Likewise.
4211 * src/tr.c (unquote, make_printable_str): Likewise.
4213 2004-05-12 Jim Meyering <jim@meyering.net>
4215 * src/remove.c (AD_pop_and_chdir): Move lstat-`.' into if-block
4216 where the result is used. This avoids one unnecessary lstat call
4217 per command line argument.
4219 2004-05-12 Paul Eggert <eggert@cs.ucla.edu>
4221 Don't assume that "make -C" works; Solaris "make" doesn't have -C.
4223 * src/Makefile.am (all_programs.list): New rule, copied from
4224 man/Makefile.am and tests/Makefile.am, except that we use the
4225 system tr rather than ./tr and we don't use tr -s.
4226 * tests/Makefile.am (all_programs): Use it.
4227 * man/Makefile.am (all_programs): Likewise. Renamed from programs,
4228 for consistency. All uses changed.
4230 2004-05-11 Jim Meyering <jim@meyering.net>
4232 * tests/rm/unread3: New test, for the above fix and today's
4233 lib/save-cwd.c improvement.
4234 * tests/rm/Makefile.am (TESTS): Add unread3.
4236 * src/rm.c: Don't include "save-cwd.h". It's no longer used.
4238 2004-05-10 Jim Meyering <jim@meyering.net>
4240 * tests/install/trap: New file. Test for bug fix of 2004-04-18.
4241 * tests/install/Makefile.am (TESTS): Add trap.
4243 * src/remove.c (AD_push): Don't use errno in diagnostic about
4246 Remove these generated files from CVS.
4247 * tests/cut/cut-tests, tests/date/date-tests, tests/join/join-tests:
4248 * tests/ls/ls-tests, tests/pr/pr-tests, tests/tac/tac-tests:
4249 * tests/tail/tail-tests, tests/test/test-tests, tests/tr/range-tests:
4250 * tests/tr/tr-tests, tests/wc/wc-tests:
4252 2004-05-09 Jim Meyering <jim@meyering.net>
4254 * src/tr.c (unquote): Use xcalloc rather than xmalloc and
4255 a loop initializing the just-allocated memory to zero.
4257 2004-05-08 Jim Meyering <jim@meyering.net>
4259 * tests/rm/no-give-up: New file; check for today's fix.
4260 * tests/rm/Makefile.am (TESTS): Add no-give-up.
4262 2004-05-08 Paul Eggert <eggert@cs.ucla.edu>
4264 Fix bug where "rm" gave up too easily, reported by Dan Jacobsen in
4265 <http://mail.gnu.org/archive/html/bug-coreutils/2004-05/msg00013.html>.
4267 * src/remove.c (remove_entry): Check for errno values like ENOENT
4268 that show the file cannot be directory, instead of for errno
4269 values like EPERM that show the file might be a directory. This
4270 is necessary because, when a single unlink() call has multiple
4271 reasons to fail, it can set errno to any of those reasons; it's
4272 only the rare errno value like ENOENT that excludes all the other
4273 possible reasons to fail even when the file is a directory.
4274 (remove_cwd_entries): Don't attempt chdir if the file is known
4275 to not be a directory.
4276 (remove_dir): Use the same method that remove_cwd_entries uses
4277 (for some reason they differed). Don't assert that saved_errno
4278 must be EPERM; it might be just about anything.
4280 2004-05-06 Jim Meyering <jim@meyering.net>
4282 * src/id.c (xgetgroups): Use xnmalloc, rather than xmalloc.
4283 Don't add `1' to the buffer size (it was to protect against malloc
4284 implementations that fail to allocate a buffer of size zero).
4285 That is no longer necessary, since we use a malloc wrapper
4288 * src/wc.c (get_input_fstatus): Use xnmalloc, rather than xmalloc.
4289 * src/head.c (elide_tail_bytes_pipe): Likewise.
4290 * src/df.c (main): Likewise.
4291 * src/shred.c (do_wipefd): Likewise.
4292 * src/users.c (list_entries_users): Likewise.
4293 * src/tail.c (main): Likewise.
4294 * src/md5sum.c (main): Likewise.
4296 2004-04-29 Paul Eggert <eggert@cs.ucla.edu>
4298 * src/df.c (show_disk, show_point): If several filesystems are
4299 mounted on the same mount point, prefer the last one, not the first.
4300 Problem reported by Christian Jones in
4301 <http://mail.gnu.org/archive/html/bug-coreutils/2004-04/msg00200.html>.
4302 (show_disk): Remove unused statp arg. Return bool, not int.
4303 (show_point): Rewrite to avoid gotos. Use the same algorithm
4304 for lofs and dummies for each pass through the mount table,
4305 rather than subtly different algorithms (which are probably
4308 2004-05-03 Jim Meyering <jim@meyering.net>
4310 * Makefile.am (EXTRA_DIST): Add m4/ChangeLog, now that we no longer
4313 2004-05-01 Jim Meyering <jim@meyering.net>
4315 When chown or chgrp is modifying the referent of a symlink,
4316 use the chown(2) function, if possible.
4317 * src/chown-core.c (change_file_owner): Don't hard-code the
4318 open/fchown/close kludge here. Use `chown' instead.
4319 The chown function works just fine on conforming systems.
4320 Other systems now go through the new chown wrapper that
4321 resorts to the old kludge.
4323 * src/chown-core.c (change_file_owner): Add a comment.
4325 2004-04-27 Jim Meyering <jim@meyering.net>
4327 * src/ptx.c: Make over 40 global extern variables `static'.
4328 (syntax_table, re_syntax_table): Remove declarations of two unused
4329 variables (they were exposed by the above change).
4331 * src/du.c (G_fail, opt_nul_terminate_output): Declare `static'.
4332 * src/ln.c (backup_type): Likewise.
4334 * src/remove.c (rm): Add `extern' keyword.
4335 * src/cp-hash.c (forget_created, remember_created)
4336 (src_to_dest_lookup, remember_copied, hash_init, forget_all): Likewise.
4337 * src/copy.c (dest_info_init, src_info_init, copy): Likewise.
4338 * src/chown-core.c (chopt_init, chopt_free, gid_to_name)
4339 (uid_to_name, chown_files): Likewise.
4341 * src/Makefile.am (sc_tight_scope): New rule.
4342 * Makefile.maint (sc_tight_scope): New rule.
4343 (syntax-check-rules): Add it.
4345 2004-04-26 Jim Meyering <jim@meyering.net>
4347 * Use automake-1.8.4. Regenerate dependent files.
4349 * src/sort.c (limfield): Make a comment clearer.
4351 2004-04-25 Paul Eggert <eggert@twinsun.com>
4353 Fix POSIX-conformance bug: "sort -k 3,3.5b" is supposed to skip
4354 leading blanks when computing the location of the field end;
4355 it is not supposed to skip trailing blanks. Solaris 8 "sort"
4356 does conform to POSIX. Also fix the documentation to clarify
4357 this and related issues.
4359 * doc/coreutils.texi (sort invocation): Mention -k earlier, so
4360 that the options are in alphabetical order. Describe how -b works
4361 more-accurately; this involves fixing some examples, too. Mention
4362 what happens if the start field falls after an end field or after
4363 a line end. Warn about using -k without -b, -g, -M, -n, or -t.
4364 Add an example of how to sort IPv4 addresses and Apache Common
4365 Log Format dates. Remove a duplicate example.
4366 (Putting the tools together): Use separate options rather
4367 than agglomerating them.
4368 * src/sort.c (limfield): Use skipeblanks, not skipsblanks, to
4369 decode whether to skip leading blanks.
4370 (trailing_blanks): Remove.
4371 (fillbuf, getmonth, keycompare): Don't trim trailing blanks.
4373 * tests/pr/Test.pm: Fix typo in env_default comment.
4374 * tests/sort/Test.pm: Likewise.
4375 (18c, 18d): Reverse the order of output lines, so that the
4376 test cases conform to POSIX.
4378 2004-04-22 Paul Eggert <eggert@twinsun.com>
4380 More signal-handling cleanup for ls.c. Do not allow signals to
4381 happen between arbitrary output bytes, as the
4382 restore-default-color sequence can bollix up multibyte chars or
4383 color-change sequences in the ordinary output. Instead, process
4384 signals only between printing a file name and changing the color
4385 back to non_filename_text color. That way, if the signal handler
4386 changes the color (to the default), 'ls' will change it back when
4387 'ls' continues (after being suspended).
4389 Also, do not bother with signal-handling unless stdout is a
4390 controlling terminal; this lets stdio buffer better when "ls
4391 --color" is piped or sent to a file.
4393 * src/ls.c (sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]: New macros.
4394 Do not include "full-write.h"; no longer needed.
4395 (tcgetpgrp) [! HAVE_TCGETPGRP]: New macro.
4396 (put_indicator_direct): Remove. All callers changed to use
4398 (caught_signals, interrupt_signal, stop_signal_count): New vars.
4399 (restore_default_color): Don't bother checking for put_indicator
4401 (sighandler): Don't handle SIGTSTP; that's another handler now.
4402 Simply set interrupt_signal to the signal, then exit.
4403 (stophandler, process_signals): New functions.
4404 (main): Don't output any color changes until _after_ the signal
4405 handlers are set up. This fixes a race condition where 'ls'
4406 could be interrupted while initializing colors, and leaving the
4407 terminal in an undesirable state.
4408 Don't mess with signal-handling if standard output is not a
4409 controlling terminal.
4410 When exiting, restore the default color, then restore the
4411 default signal handling, then act on any signals that weren't
4413 Do not print //DIRED// etc. in colors; this avoids the need
4414 to catch signals when printing them.
4415 (print_name_with_quoting): Process signals just before switching
4416 color back to non_filename_text.
4418 2004-04-23 Jim Meyering <jim@meyering.net>
4420 Avoid segfault on systems for which SIZE_MAX != (size_t) -1.
4421 * src/ls.c (quote_name): Use SIZE_MAX, not -1, in calls
4422 of quotearg_buffer. Patch by Mikulas Patocka.
4424 2004-04-18 Paul Eggert <eggert@twinsun.com>
4426 tee ignored SIGPIPE, but POSIX doesn't allow this.
4428 * src/tee.c (main): Do not ignore SIGPIPE, as POSIX 1003.1-2001
4429 does not allow this. This undoes the 1996-10-24 patch.
4431 2004-04-18 Paul Eggert <eggert@twinsun.com>
4433 Signal-handling cleanup for coreutils. Here are the highlights:
4435 - csplit sometimes failed to remove files when interrupted.
4436 - csplit didn't clean up if two signals arrived nearly simultaneously.
4437 - install -s would infloop on System V if SIGCHLD was ignored.
4438 - ls could incorrectly restore color if multiple signals
4439 arrived nearly simultaneously.
4441 * src/csplit.c (sigprocmask, sigset_t) [!defined SA_NOCLDSTOP]:
4443 (filename_space, prefix, suffix, digits, files_created, remove_files):
4445 (caught_signals): New var.
4446 (cleanup): Block signals while deleting all files.
4447 (cleanup_fatal, handle_line_error, regexp_error):
4448 Mark with ATTRIBUTE_NORETURN.
4449 (create_output_file, close_output_file, interrupt_handler):
4450 Block signals while changing the number of output files,
4451 to fix some race conditions.
4452 (delete_all_files): Do nothing if remove_files is zero.
4453 Clear files_created.
4454 (main): Don't mess with signals until after argument processing
4457 * src/csplit.c (main): Rewrite signal-catching code to make it
4458 similar to other coreutils programs. When processing signals,
4459 block all signals that we catch, but do not block signals that we
4460 don't catch. Avoid problems with unsigned int warnings.
4461 * src/ls.c (main): Likewise.
4462 * src/sort.c (main): Likewise.
4464 * src/csplit.c (interrupt_handler):
4465 Use void, not (obsolete) RETSIGTYPE.
4466 * src/shred.c (sigill_handler, isaac_seed_machdep): Likewise.
4468 * src/csplit.c (interrupt_handler) [defined SA_NOCLDSTOP]:
4469 Use simpler "signal (sig, SIG_DFL)" rather than sigaction equivalent.
4470 * src/ls.c (sighandler) [defined SA_NOCLDSTOP]: Likewise.
4471 * src/sort.c (sighandler) [defined SA_NOCLDSTOP]: Likewise.
4472 * src/nohup.c (main) [!defined _POSIX_SOURCE]: Likewise, except
4474 * src/tee.c (main) [!defined _POSIX_SOURCE]: Likewise.
4476 * src/install.c: Include <signal.h>.
4477 (main) [defined SIGCHLD]: Set SIGCHLD handler to the default, if -s is
4478 given, since System V fork+wait does not work if SIGCHLD is ignored.
4480 * src/ls.c (sighandler) [!defined SA_NOCLDSTOP]: Reset signal
4481 handler to self, not to SIG_IGN, since SIGTSTP can be received
4483 (main): Use SA_RESTART, as that is simpler than checking for EINTR
4484 failures all over the place.
4486 2004-04-20 Jim Meyering <jim@meyering.net>
4488 * src/remove.c (is_empty_dir): Clarify comment.
4490 * man/help2man: Accept new option: --program-name=NAME, so that we
4491 can override the one in --version output. This is needed solely
4492 so that test.1 doesn't refer to `[' as the program name.
4493 Reported by Benjamin Cutler as http://bugs.debian.org/205251.
4494 * man/Makefile.am (.x.1): Use help2man's new --program-name option.
4496 * src/pwd.c: Don't include pathmax.h; system.h already does it.
4498 * src/cut.c (cut_fields): Free buffer upon getndelim2 failure.
4500 2004-04-19 Jim Meyering <jim@meyering.net>
4502 * src/shred.c (isaac_seed_start) [AVOID_USED_UNINITIALIZED_WARNINGS]:
4503 Initialize a buffer to avoid warnings from tools like valgrind.
4505 * Makefile.maint (sc_trailing_blank): New rule.
4506 (syntax-check-rules): Add it.
4507 * .x-sc_trailing_blank: New file.
4509 Make pwd work even if the resulting name is so long that getcwd fails.
4510 * src/pwd.c: (path_free, path_init, path_prepend): New functions.
4511 (nth_parent, find_dir_entry, robust_getcwd): New functions.
4512 (main): First try getcwd, then, upon failure, robust_getcwd.
4514 2004-04-18 Jim Meyering <jim@meyering.net>
4516 * src/who.c (print_user): Use xrealloc here, rather than
4517 unchecked realloc. Remove anachronistic casts.
4519 * src/remove.c (full_filename_): Don't leak upon failed realloc.
4521 * src/system.h (readdir_ignoring_dot_and_dotdot): New inline function,
4523 * src/remove.c (readdir_ignoring_dotdirs): Move function to system.h,
4524 renaming it. Update uses.
4526 2004-04-17 Jim Meyering <jim@meyering.net>
4528 * configure.ac: Depend on automake-1.8.3.
4530 * src/join.c (add_file_name): Declare function to be `static'.
4531 (string_to_join_field): Likewise.
4532 * src/remove.c (ds_init, ds_free): Likewise.
4534 * Makefile.maint (sc_prohibit_jm_in_m4): New rule.
4535 (syntax-check-rules): Add to the list.
4537 2004-04-13 Paul Eggert <eggert@twinsun.com>
4539 Use page-aligned buffers whenever we bother to do I/O using buffer
4540 sizes that are tailored for the files.
4542 * src/cat.c: Include getpagesize.h.
4543 * src/copy.c: Likewise.
4544 * src/shred.c: Likewise.
4545 * src/split.c: Likewise.
4546 * src/cat.c (main): Align I/O buffers to page boundaries.
4547 * src/copy.c (copy_reg): Likewise.
4548 * src/shred.c (dopass): Likewise.
4549 * src/split.c (main): Likewise.
4550 * src/dd.c (ROUND_UP_OFFSET, PTR_ALIGN): Remove.
4551 All uses replaced by ptr_align.
4552 * src/od.c (gcd, lcm): Remove; now in system.h.
4553 * src/system.h (gcd, lcm, ptr_align): New functions, moved from od.c.
4555 2004-04-14 Jim Meyering <jim@meyering.net>
4557 Remove m4/Makefile.am: it's no longer needed, with newer automake
4558 * configure.ac (AC_CONFIG_FILES): Remove m4/Makefile.in from the list.
4559 * Makefile.am (SUBDIRS): Remove `m4' from the list.
4561 2004-04-13 Jim Meyering <jim@meyering.net>
4563 * configure.ac: Change `jm_' in AC_DEFINE'd names to `gl_'.
4565 2004-03-27 Paul Eggert <eggert@twinsun.com>
4567 * NEWS: cp -pu and mv -u (when copying) now take the destination
4568 file system time stamp resolution into account.
4569 * doc/coreutils.texi (mv invocation): Document this.
4570 (cp invocation): Document -u (it was missing!) with new behavior.
4572 * src/copy.c: Include "utimecmp.h".
4573 (copy_internal): Compare time stamps using utimecmp rather than
4576 2004-04-09 Jim Meyering <jim@meyering.net>
4578 * Makefile.maint (.re-list): New rule/file, to replace
4579 hard-coded list of header file names.
4580 (sc_system_h_headers): Use the new file.
4581 Don't look for sys2.h anymore.
4583 * src/system.h: Include new "stat-macros.h" rather than hard-coding
4584 all of its macro definitions -- the list was slightly out of date.
4585 Suggestion from Dmitry V. Levin.
4587 2004-04-08 Paul Eggert <eggert@cs.ucla.edu>
4589 * NEWS: Remove noctty flag from dd. Suggested by Philippe Troin.
4590 * doc/coreutils.texi (dd invocation): Likewise.
4591 * src/shred.c (O_NOCTTY): Remove redundant decl.
4592 * src/dd.c (flags, usage): Remove noctty flag.
4593 (main): Always use O_NOCTTY when opening files.
4595 2004-04-08 Jim Meyering <jim@meyering.net>
4597 * src/dd.c (dd_copy): Mark two diagnostics for translations.
4598 (set_fd_flags): Undo part of today's change: it's a little
4599 cleaner -- and more efficient in the common case -- to go
4600 ahead and OR in the -1 when fcntl fails.
4602 * Makefile.maint (sc_dd_max_sym_length): New target.
4603 (syntax-check-rules): Add it.
4605 * src/md5sum.c (PROGRAM_NAME) [algorithm == ALG_SHA1]:
4606 Correct spelling: s/shasum/sha1sum. Reported by Jesse Kornblum.
4608 * src/dd.c (set_fd_flags): Don't OR in -1 when fcntl fails.
4609 Rename parameter, flags, to avoid shadowing global.
4610 (LONGEST_SYMBOL): Tweak comment.
4612 2004-04-07 Paul Eggert <eggert@twinsun.com>
4614 * NEWS: New dd conv= symbols nocreat, excl, fdatasync, fsync,
4615 and new dd options iflag= and oflag=.
4616 * src/dd.c (usage): Likewise.
4617 * src/Makefile.am (dd_LDADD, shred_LDADD): Add fdatasync's lib.
4618 * src/dd.c (fdatasync) [!HAVE_FDATASYNC]: New macro.
4619 (C_NOCREAT, C_EXCL, C_FDATASYNC, C_FSYNC): New macros.
4620 (input_flags, output_flags): New vars.
4621 (LONGEST_SYMBOL): New macro.
4622 (struct symbol_value): Renamed from struct conversion. Members
4623 symbol and value renamed from convname and conversion. The
4624 symbol value is now an array instead of a pointer; this saves
4625 a bit of space and time in practice. All uses changed.
4626 (conversions): Add nocreat, excl, fdatasync, fsync. Now const.
4627 (flags): New constant array.
4628 (iflag_error_msgid, oflag_error_msgid): New constants.
4629 (parse_symbols): Renamed from parse_conversion and generalized
4630 to handle either conversion or flag symbols.
4631 (scanargs): Adjust uses of parse_symbols accodingly. Add
4632 support for iflag= and oflag=. Reject attempts to use
4633 both excl and nocreat.
4634 (set_fd_flags): New function.
4635 (dd_copy): Just return X rather than calling quit (X), since our
4636 caller invokes quit with the returned value. Add support for
4637 fdatasync and fsync.
4638 (main): Add support for iflag=, oflag=, and new conv= symbols.
4639 * src/system.h (O_DIRECT, O_DSYNC, O_NDELAY, O_NOFOLLOW,
4640 O_RSYNC, O_SYNC): Define to 0 if not already defined.
4642 * NEWS: Remove duplicate mention of BLOCKSIZE.
4644 2004-04-02 Andreas Schwab <schwab@suse.de>
4646 * src/stty.c: Add support for IUTF8 input flag.
4648 2004-04-06 Jim Meyering <jim@meyering.net>
4650 * src/system.h (makedev) [mkdev && !makedev]: Define in terms of mkdev.
4651 Interix spells it `mkdev'. Reported by Mark Funkenhauser.
4653 2004-04-04 Jim Meyering <jim@meyering.net>
4655 A specified format is no longer automatically newline terminated.
4656 If you want a newline at the end of your format, use `\n'.
4657 * src/stat.c (print_it): Don't print a newline at the end of
4659 (do_statfs): Add a newline at end of each default format string.
4661 2004-03-30 Paul Eggert <eggert@twinsun.com>
4663 * src/nohup.c (main): Adjust to new calling convention
4664 for set_cloexec_flag.
4666 2004-03-31 Jim Meyering <jim@meyering.net>
4668 * tests/Fetish.pm (run_tests): Remove `.orig' file.
4669 Remove debugging diagnostic.
4671 Specifying an invalid --width=N (-w) or --gap-size=N (-g)
4672 would not elicit an error.
4673 * src/ptx.c: Include "xstrtol.h" and "quotearg.h".
4674 (main): Don't use atoi. Use xstrtoul instead.
4676 2004-03-30 Jim Meyering <jim@meyering.net>
4678 * Makefile.maint (sc_prohibit_atoi_atof): New rule.
4679 (syntax-check-rules): Add it.
4680 * .x-sc_prohibit_atoi_atof: New file.
4682 2004-03-29 Jim Meyering <jim@meyering.net>
4684 * tests/du/files0-from: Use new OUT_SUBST directive, so that this
4685 test is not sensitive to system-dependent block size differences.
4686 Prompted by a report of Solaris 8 differences from Paul Eggert.
4688 * tests/Fetish.pm: Accept new directives: OUT_SUBST, ERR_SUBST.
4689 Rename `%tmp' to `%actual'. Reverse order of last two args to
4690 _compare_files (to $actual, $expected) so as to match declaration.
4692 2004-03-28 Paul Eggert <eggert@twinsun.com>
4694 Fix some gotchas encountered when porting to Solaris 8, using
4695 the Forte 6u2 compiler.
4697 * src/hostname.c [HAVE_SETHOSTNAME && !defined sethostname]:
4698 Declare sethostname, since no Solaris header does it.
4699 * src/who.c: Include "vasprintf.h", for asprintf.
4701 2004-03-28 Jim Meyering <jim@meyering.net>
4704 * src/du.c (process_file): Don't record dev/inode for directories.
4706 Under some circumstances, without -c, du would mistakenly count the
4707 space of hard-linked files, not just the first one it encountered.
4708 Reported by Anthony Thyssen.
4709 * src/du.c (du_files): Don't ever clear the set of `seen' dev/inodes.
4711 * src/du.c: Rename global `print_totals' to `print_grand_total'.
4713 * src/du.c (main): Rearrange filtering loop to be a tiny bit
4716 * src/chown-core.c: Don't include savedir.h -- no longer needed.
4717 * src/chmod.c: Likewise.
4719 2004-03-25 Jim Meyering <jim@meyering.net>
4721 * src/du.c (main): Remove now-unused declaration of `i'.
4723 2004-03-24 Paul Eggert <eggert@twinsun.com>
4725 * src/du.c (main): Filter out file names of length zero before
4726 invoking fts, so that they don't cause fatal errors.
4728 2004-03-25 Jim Meyering <jim@meyering.net>
4730 * tests/du/files0-from (zero-len): Add a test for the above.
4732 2004-02-25 Paul Eggert <eggert@twinsun.com>
4734 * NEWS: New environment var BLOCKSIZE.
4735 * lib/human.c (humblock): Support BLOCKSIZE as well as BLOCK_SIZE.
4736 * tests/envvar-check: Test for it. Factor the code to simplify it.
4738 2004-03-23 Paul Eggert <eggert@twinsun.com>
4740 * NEWS: Shorten the du --files0-from announcement, and say
4741 "NUL-terminated" rather than "NUL-separated".
4742 * src/du.c (EXPECTED_BYTES_PER_FILE_NAME, DEFAULT_PROJECTED_N_FILES):
4744 (usage): Say "NUL-terminated", not "NUL-separated".
4745 (main): Check for I/O error when istream is closed.
4746 Allow --files0-from=F even if F is empty; this specifies no files.
4747 (du_files): Now that we allow the list of files to be empty,
4749 * tests/du/files0-from: Adjust to above changes to src/du.c.
4751 2004-03-24 Jim Meyering <jim@meyering.net>
4753 * tests/tail-2/assert: Avoid race condition that could cause
4754 spurious failure. Based on a patch from Andreas Schwab.
4756 2004-03-23 Jim Meyering <jim@meyering.net>
4758 * src/du.c (main): Free the hash table, too.
4760 2004-03-22 Jim Meyering <jim@meyering.net>
4762 * man/Makefile.am (.x.1): Remove --info-page= option, reverting
4763 the change of 2004-01-22. I can no longer reproduce the problem
4764 that prompted that change, and `info coreutils pr' would display the
4765 `printing text' section of the manual, not the one on `pr invocation'.
4767 * tests/du/files0-from (nul-1, nul-2): Adjust expected diagnostics
4768 to match corrected output.
4770 * src/du.c: Include "readtokens0.h" rather than "readtokens.h".
4771 (main): Use readtoken0 functions rather than readtokens.
4772 Don't use errno when diagnosing readtokens0 failure.
4773 Fix off-by-one error in the token number reported in a diagnostic.
4774 (du_files): Return bool, rather than int.
4775 (main): Call readtokens0_free.
4777 2004-03-21 Jim Meyering <jim@meyering.net>
4779 * src/remove.c (ds_free): Plug a small leak.
4781 * tests/Fetish.pm: Fix typo in comment.
4783 2004-03-07 Jim Meyering <jim@meyering.net>
4785 * NEWS: du accepts a new option --files0-from=FILE, where FILE
4786 contains a list of NUL-separated file names.
4788 * src/du.c: Include "readtokens.h".
4789 (usage): Describe the new option, and adjust the `Usage':
4790 with this option, no FILE may be specified on the command line.
4791 (main): Handle the new option.
4793 * tests/du/files0-from: New tests, for the above.
4794 * tests/du/Makefile.am (TESTS): Add files0-from.
4796 * src/factor.c (do_stdin): Reflect changes in use of readtoken.
4797 * src/tsort.c (tsort): Likewise.
4799 2004-02-29 Paul Eggert <eggert@twinsun.com>
4801 * NEWS: Add support for a new notation @N to get_date to represent
4802 the time stamp with numeric value N. Improve support for
4803 fractional time stamps. date's -d and -f options now accept them.
4804 Likewise for touch -t. date has a new option --iso-8601=ns.
4806 * doc/coreutils.texi (touch invocation):
4807 Describe use of fractional seconds.
4808 (date invocation, Options for date): Likewise.
4809 * doc/getdate.texi (General date syntax, Time of day items): Likewise.
4810 * doc/coreutils.texi (date invocation): Mention effect of LC_TIME.
4811 (Options for date): Describe new --iso-8601=ns option.
4813 * doc/getdate.texi: Add copyright notice. Change getdate to
4814 get_date when talking about the function name.
4815 (Seconds since the Epoch): New section, containing the time_t
4816 info moved from Date input formats section, along with new
4817 info about the @ syntax. Mention negative time stamps,
4818 fractional time stamps, and leap seconds.
4819 (General date syntax): Modernize examples a bit to reflect new
4821 (General date syntax, Relative items in date strings):
4822 Use ' rather than " to quote formats.
4823 (Time of day items): Add an example with fractional seconds.
4824 Describe fractional-second syntax.
4826 * src/Makefile.am (touch_LDADD): New macro, since `touch' now
4827 needs clock_gettime.
4829 * src/date.c (enum Time_spec): New enum TIME_SPEC_NS.
4830 (time_spec_string, time_spec, show_date): Support it.
4831 (usage): Remove description of -ITIMESPEC, as it's obsolete and
4832 confusing. Mention --iso-8601=ns.
4833 (batch_convert): getline returns ssize_t, not int.
4835 * src/touch.c (newtime): Now an array of two timespecs, one
4836 for access and one for modification.
4837 (ref_stats): Remove.
4838 (get_reldate): Use get_date's parameter profile.
4839 (touch, main): Adjust to above changes.
4840 (main): Work even if tm_year == INT_MAX (so long as long int is wider).
4841 Use gettime instead of gettimeofday, for new get_date signature.
4843 * tests/date/Test.pm (test_vector): New tests epoch, ns-10, ns-max32,
4846 2004-03-15 Jim Meyering <jim@meyering.net>
4848 * Makefile.maint (alpha beta major): `Make' the emit_upload_commands
4849 target before updating $(prev_version_file).
4851 * tests/misc/date-sec: New file, to test for just-fixed bug in date.
4852 See today's change in lib/getdate.y.
4853 * tests/misc/Makefile.am (TESTS): Add date-sec.
4855 2004-03-14 Jim Meyering <jim@meyering.net>
4857 * announce-gen (print_changelog_deltas): Use `.sig' suffix for
4858 signature files, not `.asc'. Reported by angico@yahoo.com.
4860 2004-03-13 Jim Meyering <jim@meyering.net>
4862 * src/cp.c (do_copy): Tweak wording in a diagnostic.
4863 Suggestion from Karl Berry.
4864 Include "quoatearg.h".
4865 (do_copy): Use quotearg_colon (not quote) for diagnostics
4866 that begin with `"%s:'.
4868 * src/nl.c (usage): Specify that nl uses _basic_ regular expressions.
4869 Suggestion from Dan Jacobson.
4871 2004-03-12 Jim Meyering <jim@meyering.net>
4875 Sometimes, when source and destination partition are different,
4876 mv mistakenly fails to preserve a hard link. Reported by IIDA Yosiaki.
4878 * src/copy.c: When moving a set of N hard-linked files between
4879 partitions, via two or more command line arguments where the
4880 command line argument containing the Nth link contains no other
4881 link to that same file, mv would mistakenly copy the file, rather
4882 than hard-linking it to the other(s). That happens because when the
4883 final link is processed, its link count has been reduced to 1 since
4884 the other links have been `copied' to the destination partition
4885 and the source links have been removed.
4886 (copy_internal): When in move mode, use the source dev/inode
4887 pair to look up destination name even when st_nlink == 1.
4888 * src/cp-hash.c (src_to_dest_lookup): New function.
4889 * src/cp-hash.h (src_to_dest_lookup): Add prototype.
4890 * tests/mv/part-hardlink: New file. Test for the above fix.
4891 * tests/mv/Makefile.am (TESTS): Add part-hardlink.
4893 * announce-gen: Sync with autoconf.
4895 * tests/ls/time-1: Exit 77 (not 1) if we can't set up for the test.
4896 This was triggered on a Linux-2.2.19 system using a file system
4897 NFS-mounted from some sort of Sun.
4899 2004-03-11 Jim Meyering <jim@meyering.net>
4901 * Use automake-1.8.3. Regenerate dependent files.
4903 2004-03-10 Jim Meyering <jim@meyering.net>
4905 * tests/du/deref-args: Also convert sizes in the 70-79 kB range,
4906 so that this test works with SELinux-enabled systems.
4907 Based on a patch from Tim Waugh.
4909 `join -1 x' would give a misleading diagnostic
4910 * src/join.c (string_to_join_field): Report that a non-numeric field
4911 number is invalid, rather than `so large that it is not representable'.
4912 * tests/join/Test.pm (invalid-j): New partial test for the above fix.
4914 2004-03-06 Jim Meyering <jim@meyering.net>
4916 cp --sparse=always sparse-image-file.img /dev/hda1 could
4917 produce an invalid copy on the destination device.
4919 * src/copy.c (copy_reg): Even with --sparse=always, try to
4920 make `holes' only if the destination is a regular file.
4921 Reported by Szakacsits Szabolcs.
4923 2004-03-03 Paul Eggert <eggert@twinsun.com>
4925 * src/nohup.c (main): Don't invoke set_cloexec_flag with
4926 a file descriptor of -1.
4928 2004-03-02 Dmitry V. Levin <ldv@altlinux.org>
4930 * src/nohup.c: Include "cloexec.h".
4931 (main): Set the copy of stderr to close on exec.
4933 2004-03-01 Paul Eggert <eggert@twinsun.com>
4935 * configure.ac: Include <signal.h> when checking for strsignal,
4936 sys_siglist, and friends. Problem reported by Tony Leneis in
4937 <http://mail.gnu.org/archive/html/bug-coreutils/2004-02/msg00136.html>.
4939 2004-02-25 Paul Eggert <eggert@twinsun.com>
4941 * tests/du/deref-args, tests/du/exclude, tests/du/slash:
4942 * tests/du/trailing-slash: Run envvar-check in case BLOCK_SIZE
4945 2004-02-23 Paul Eggert <eggert@twinsun.com>
4947 * NEWS: Document how chown's USER.GROUP argument is now parsed.
4949 2004-02-23 Jim Meyering <jim@meyering.net>
4951 * src/seq.c (usage): Remove stray space after \n in --help output.
4953 2004-02-22 Jim Meyering <jim@meyering.net>
4955 * src/du.c (usage): Separate -H and --si. Say that the meaning
4956 of -H will soon change to that of --dereference-args (-D).
4958 2004-02-21 Jim Meyering <jim@meyering.net>
4960 * src/comm.c (usage): Tell what comm does when there are no options.
4961 Reword in terms of FILE1 and FILE2 rather than `left file' and
4962 `right file'. Suggestion from Dan Jacobson.
4964 2004-02-15 Paul Eggert <eggert@twinsun.com>
4966 Fix some POSIX-conformance bugs in expr.
4968 * NEWS: document the following changes to src/expr.c.
4969 * doc/coreutils.texi (expr invocation): Likewise.
4970 Document what forms integers may take, and say "integer"
4971 consistently instead of "number". Warn about operands
4972 that "expr" can misinterpret, and how to work around the
4974 * src/expr.c (eval, eval7, eval6, eval5, eval4, eval3, eval2, eval1):
4975 Accept a bool argument specifying whether to evaluate the
4976 expression. This is to allow short-circuit evaluation. All
4978 (null): Report that a string is zero even if it has
4979 a form like "-0" or "00".
4980 (eval1, eval): Use short-circuit evaluation for | and &.
4981 (eval): Return 0 if both arguments are null or zero, instead
4982 of returning the first argument.
4983 * tests/expr/basic: Add some tests for the above.
4985 2004-02-17 Jim Meyering <jim@meyering.net>
4989 `make check' from a build inside a chroot environment would fail
4990 * tests/help-version: Specify an argument (`/') for df, in the
4991 unusual event that there is no valid entry in /etc/mtab.
4992 Likewise for id: add the -u option, so we don't get spurious
4993 failures when there are no user or group names.
4996 * src/sort.c (usage) [-u]: Add punctuation so that the description in
4997 the help2man-generated (line-joined) man page is more readable.
4998 Reported by Tim Waugh.
4999 [-T]: Add a semicolon, for the same reason.
5001 2004-02-15 Jim Meyering <jim@meyering.net>
5003 * Makefile.am (dist-hook): Qualify target with $(srcdir)/ prefix.
5005 2004-02-11 Jim Meyering <jim@meyering.net>
5007 * tests/Makefile.am.in ($(srcdir)/Makefile.am): Use more portable
5008 $(srcdir)/../Makefile.am.in, rather than $<.
5009 Suggestion from Michael Elizabeth Chastain.
5011 2004-02-10 Jim Meyering <jim@meyering.net>
5013 * config/install-sh: Make this script executable.
5014 * Makefile.am (dist-hook): New target, to ensure that config/install-sh
5015 is executable. Otherwise, on systems that lack a suitable install
5016 binary, `make install' would fail, because of the way this script
5017 is invoked (without `$SHELL ' prefix).
5018 Reported by Bob Proulx.
5020 2004-02-08 Jim Meyering <jim@meyering.net>
5024 * tests/rm/rm5: Avoid triggering a bug in OSF/Tru64's sed
5025 that would cause an unwarranted test failure.
5026 * tests/rm/rm3: Likewise.
5028 2004-02-07 Jim Meyering <jim@meyering.net>
5030 Remove xstat function pointer member. The way it was used was not
5031 portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
5032 inline `stat' and `lstat' functions, thus making the tests of
5033 `xstat == lstat' in copy.c always fail.
5034 * src/copy.h (struct cp_options) [xstat]: Remove member.
5036 * src/copy.c (copy_dir): Set `.dereference' member, not .xstat.
5037 (copy_internal): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.
5038 Use `x->dereference == DEREF_NEVER' in place of `x->xstat == lstat'.
5039 (valid_options): Remove now-obsolete FIXME comments.
5041 * src/cp.c (re_protect): Use `XSTAT (x, ...)' in place of
5042 `*(x->xstat) (...)'.
5043 (do_copy): Declare/use local xstat rather than x->xstat.
5044 (main): Remove code that set x.xstat.
5045 * src/mv.c (cp_option_init): Don't initialize xstat member.
5046 * src/install.c (cp_option_init): Likewise.
5048 * Makefile.cfg (gnu_ftp_host-alpha, etc.): Un-factor .gnu.org suffix,
5049 so that emit_upload_commands can use these variables, too.
5051 2004-02-06 Jim Meyering <jim@meyering.net>
5053 * tests/rm/deep-1: Remove `du' stack space test.
5054 Apparently, `ulimit -s N' isn't portable enough.
5055 This test will be restored (with a guard against losing ulimit)
5056 in its own file later.
5058 * tests/rm/deep-1 (deep): Remove progress-style diagnostics,
5059 since this test doesn't take long enough to merit them.
5060 Run du on $tmp (the containing dir), not $deep, the full path to leaf.
5062 * Makefile.maint (signatures): Remove definition.
5063 Now, automake's gnupload handles this.
5064 (%.sig: %): Remove now-unused rule.
5065 (rel-files): Use automake's $(DIST_ARCHIVES), rather than
5066 `$(distdir).tar.bz2 $(distdir).tar.gz'.
5067 (emit-upload-commands): Adjust to use gnupload.
5069 2004-02-05 Jim Meyering <jim@meyering.net>
5071 * src/system.h (ST_TIME_CMP_NS, ST_TIME_CMP): Remove definitions.
5072 (ATIME_CMP, CTIME_CMP, MTIME_CMP, TIMESPEC_NS): Likewise.
5073 Now, those are all defined in timespec.h.
5076 * src/date.c: Don't include timespec.h, now that system.h does it.
5078 2004-02-02 Paul Eggert <eggert@twinsun.com>
5080 Don't dump core if localtime returns NULL (possible on
5081 hosts with 64-bit time_t and 32-bit int).
5082 * src/date.c: Include "inttostr.h".
5083 (batch_convert, main):
5084 If time conversion fails, exit with nonzero status.
5085 (show_date): Return int to report conversion failure.
5086 Print the time as an int if localtime fails.
5087 * src/uptime.c: Print "??" if the current clock can't
5088 be converted by localtime. This won't happen until the year
5089 2*31 + 1900, but we don't want to dump core even if the current
5090 clock has the wrong value.
5092 * src/stat.c: Include "inttostr.h".
5093 (human_time): Print the date/time as a number of seconds since the
5094 epoch if it can't be converted by localtime. This is better than
5095 just saying "invalid", and is consistent with what "ls" does.
5096 Don't dump core if the year has more than 48 digits; this isn't
5097 possible on any contemporary host, but we might as well do it right.
5099 2004-01-31 Paul Eggert <eggert@twinsun.com>
5101 * src/stat.c (human_time): Accept time rather than
5102 pointer-to-const-time parameter, for clarity. All callers changed.
5104 2004-02-02 Jim Meyering <jim@meyering.net>
5106 * src/stat.c (do_stat): Remove extra trailing newline from
5107 default formats. Reported by Nelson H. F. Beebe.
5109 Print actual fractional seconds in time stamps, not just `.00000000'.
5110 * src/stat.c (human_time): Add and use new parameter, t_ns.
5111 (print_stat): Update callers.
5112 * src/ls.c (TIMESPEC_NS): Remove definition.
5113 * src/system.h (TIMESPEC_NS): Define here, instead, now that stat.c
5114 also uses this macro.
5115 Nelson H. F. Beebe noticed that ls --full-time printed nonzero
5116 fractional seconds for files on an XFS file system, but that stat's
5117 fractional seconds were always zero.
5119 2004-01-28 Paul Eggert <eggert@twinsun.com>
5121 * src/seq.c (print_numbers): Use 'double' for loop index, not
5122 'int', to avoid problems with integer overflow. On almost all
5123 machines 'double' works in every case where 'int' works, and
5124 it works on other cases besides.
5126 2004-01-27 Jim Meyering <jim@meyering.net>
5128 * src/seq.c (usage): Mention that if INCREMENT is omitted,
5129 it defaults to 1, even when FIRST is larger than LAST.
5130 Reword so as not to exclude the possibility that INCREMENT be zero.
5132 2004-01-25 Jim Meyering <jim@meyering.net>
5136 * Makefile.maint (signatures): Comment out definition.
5138 2004-01-23 Jim Meyering <jim@meyering.net>
5140 * Makefile.maint (header_regexp): Add exitfail.
5142 * man/Makefile.am (EXTRA_DIST): Add help2man.
5143 Reported by Nelson H. F. Beebe.
5145 * man/Makefile.am (.x.1): Prefix help2man invocation with `$(PERL) --'
5146 so it works on systems with Perl installed somewhere other than in
5149 * src/paste.c (paste_parallel): Declare local, chr, to be of type
5150 `int', not `char', since it must hold EOF. This bug would make
5151 paste infloop on some systems. Test failures reported by
5152 Nelson H. F. Beebe and Christian Krackowizer.
5154 2004-01-22 Jim Meyering <jim@meyering.net>
5156 * tests/rmdir/fail-perm: New file. Test for just-fixed rmdir bug.
5157 * tests/rmdir/Makefile.am (TESTS): Add fail-perm.
5159 * man/help2man: Fix it so using --info-page='coreutils PROG' works.
5160 * man/Makefile.am (.x.1): Invoke our own (tweaked) copy of help2man.
5161 Use --info-page='coreutils PROG' option.
5162 Now, readlink.1 refers the user to `info coreutils readlink'
5163 rather than to `info readlink'. Reported by Matt Swift.
5165 2004-01-21 Paul Eggert <eggert@twinsun.com>
5167 Exit status cleanup.
5169 * src/basename.c (usage): Use EXIT_SUCCESS, not 0, for clarity.
5170 * src/cat.c, src/chgrp.c, src/chmod.c, src/chown.c, src/chroot.c,
5171 * src/cksum.c, src/comm.c, src/cp.c, src/csplit.c, src/cut.c,
5172 * src/date.c, src/dd.c, src/df.c, src/dircolors.c, src/dirname.c,
5173 * src/du.c, src/echo.c, src/env.c, src/expand.c, src/expr.c,
5174 * src/factor.c, src/fmt.c, src/fold.c, src/head.c, src/hostid.c,
5175 * src/hostname.c, src/id.c, src/install.c, src/join.c, src/kill.c,
5176 * src/link.c, src/ln.c, src/logname.c, src/ls.c, src/md5sum.c,
5177 * src/mkdir.c, src/mkfifo.c, src/mknod.c, src/mv.c, src/nice.c,
5178 * src/nl.c, src/nohup.c, src/od.c, src/paste.c, src/pathchk.c,
5179 * src/pinky.c, src/pr.c, src/printenv.c, src/printf.c, src/pwd.c,
5180 * src/rm.c, src/rmdir.c, src/seq.c, src/setuidgid.c, src/shred.c,
5181 * src/sleep.c, src/sort.c, src/split.c, src/stat.c, src/stty.c,
5182 * src/su.c, src/sum.c, src/sync.c, src/tac.c, src/tail.c, src/tee.c,
5183 * src/test.c, src/touch.c, src/tr.c, src/tsort.c, src/tty.c,
5184 * src/uname.c, src/unexpand.c, src/uniq.c, src/unlink.c, src/uptime.c,
5185 * src/users.c, src/wc.c, src/who.c, src/whoami.c, src/yes.c: Likewise.
5187 * src/cat.c (usage): Don't bother normalizing exit status
5188 since the arg is already the correct exit status now.
5189 * src/cksum.c, src/comm.c, src/csplit.c, src/cut.c,
5190 * src/dircolors.c, src/expand.c, src/fmt.c, src/fold.c, src/head.c,
5191 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c,
5192 * src/pr.c, src/split.c, src/sum.c, src/tac.c, src/tail.c, src/tr.c,
5193 * src/tsort.c, unexpand.c, src/src/uniq.c, src/src/wc.c: Likewise.
5195 * src/chown.c (main): Removed unused local 'fail'.
5197 * src/chroot.c (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE):
5200 * src/chroot.c (main): Initialize exit_failure to EXIT_FAIL.
5201 * src/env.c, src/nice.c, src/su.c: Likewise.
5202 * src/nohup.c (main): Likewise, to NOHUP_FAILURE.
5203 * src/setuidgid.c (main): Likewise, to SETUIDGID_FAILURE.
5204 * src/expr.c (main): Use initialize_exit_failure rather than
5205 setting exit_failure directly; this optimizes away redundant
5207 * src/printenv.c, src/sort.c, src/test.c, src/tty.c: Likewise.
5209 * src/chroot.c (main): Exit with status 1 rather than 127
5210 if chroot itself fails, as per documentation.
5212 * src/chroot.c (main): Use EXIT_ENOENT and EXIT_CANNOT_INVOKE
5213 rather than roll-your-own symbols or integers.
5214 * src/env.c (main): Likewise.
5215 * src/nohup.c (main): Likewise.
5216 * src/su.c (run_shell): Likewise.
5218 * src/cp.c (exit_status): Remove static var....
5219 (main): Making it local here instead. Use =, not |=, to set it.
5221 * src/cut.c (FATAL_ERROR, main): Exit with status EXIT_FAILURE,
5223 * src/date.c (batch_convert, main): Likewise.
5224 * src/dd.c (dd_copy): Likewise.
5225 * src/pr.c (first_last_page, main, getoptarg): Likewise.
5226 * src/tr.c (main): Likewise.
5227 * src/date.c (main): Don't assume EXIT_FAILURE == 1, as
5228 POSIX doesn't require it.
5229 * src/dd.c (write_output, skip, dd_copy): Likewise.
5230 * src/df.c (main): Likewise.
5231 * src/id.c (main): Likewise.
5232 * src/install.c (main): Likewise.
5233 * src/ln.c (main): Likewise.
5234 * src/ls.c (main): Likewise.
5235 * src/mv.c (main): Likewise.
5236 * src/shred.c (main): Likewise.
5238 * src/env.c (main): Exit with status 1, not 2, on errors detected
5240 * src/hostname.c (main): Likewise.
5241 * src/nl.c (main): Likewise.
5242 * src/stty.c (main): Likewise.
5244 * src/expr.c (EXPR_FAILURE): Renamed from EXPR_ERROR, for
5245 consistency with the other programs' naming conventions.
5248 * src/factor.c (main): Do not report a usage error simply
5249 because stdin has bad numbers.
5251 * src/id.c (problems): Now a boolean int, not a counter,
5252 so that we don't have to worry about int overflow. All uses changed.
5253 * src/touch.c (err): Likewise.
5255 * src/md5sum.c (main): Use int, not size_t, to store boolean int.
5257 * src/mkfifo.c (main): Exit with status 1, not 4, if not implemented.
5258 * src/mknod.c: Likewise.
5260 * src/nice.c (main): Exit with status EXIT_FAIL, not EXIT_FAILURE,
5261 on error; this is in case EXIT_FAILURE is unusual.
5262 * src/su.c (main): Likewise.
5264 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE): Remove; all uses
5265 changed to EXIT_CANNOT_INVOKE.
5267 * src/printenv.c (PRINTENV_FAILURE): New constant.
5268 (main): Exit with status PRINTENV_FAILURE, not EXIT_FAILURE, on
5269 command-line syntax problems.
5271 * src/rmdir.c (remove_parents): Don't set 'fail' to a negative number.
5272 (main): Avoid integer overflow when seeing whether errors occurred.
5274 * src/seq.c (print_numbers): Now returns void, not (zero) int.
5275 All callers changed.
5276 (main): Remove unused local variable 'errs'. Always exit successfully
5277 if we reach the end.
5279 * src/setuidgid.c (SETUIDGID_FAILURE): Renamed from FAIL_STATUS,
5280 for consistency with other programs here. All uses changed.
5281 (main): Use 'error' to exit rather than invoking 'exit' here.
5283 * src/sort.c: Don't include <assert.h>.
5284 (SORT_OUT_OF_ORDER, SORT_FAILURE): Now enums, not macros.
5285 (usage): Don't use 'assert'.
5286 (main): Remove redundant assignment to exit_failure.
5288 * src/system.h (EXIT_FAIL, EXIT_CANNOT_INVOKE, EXIT_ENOENT):
5290 (initialize_exit_failure): New inline function.
5291 Include exitfail.h here, since we refer to exit_failure.
5292 All callers changed to not include exitfail.h.
5294 * src/tty.c (TTY_FAILURE, TTY_WRITE_ERROR): New enum values;
5295 substitute them for the corresponding integer constants.
5297 * tests/help-version (expected_failure_status_date): Remove, as
5298 'date' is now normal.
5299 (expected_failure_status_nohup): New var.
5301 2004-01-21 Jim Meyering <jim@meyering.net>
5303 * tests/touch/relative: Remove `command' syntax.
5304 Thanks to Nelson H. F. Beebe and Paul Eggert.
5306 * tests/touch/relative: Test only year/month/day, not hours/min/sec,
5307 so as to avoid problems with systems using TAI clocks.
5308 Although it's no longer necessary, set TZ=UTC0 also for the
5309 initial touch command. Reported by Paul Jarc here:
5310 http://article.gmane.org/gmane.comp.gnu.core-utils.bugs/1504
5312 2004-01-20 Diego Biurrun <diego@biurrun.de>
5314 * src/dircolors.hin: Add .mov to the list of media files.
5316 2004-01-19 Paul Eggert <eggert@twinsun.com>
5318 * tests/touch/relative: Use TZ=UTC0, not TZ=utc (which isn't
5319 portable). Problem reported by Christian Krackowizer. Also, use
5320 +0000 rather than +0 to specify a time zone, as the documentation
5321 requires four digits.
5323 2004-01-19 Jim Meyering <jim@meyering.net>
5325 * tests/mv/hard-4: Run envvar-check in case SIMPLE_BACKUP_SUFFIX is set.
5326 * tests/mv/backup-is-src: Likewise.
5327 Problem reported by Peter Horst
5329 2004-01-17 Jim Meyering <jim@meyering.net>
5331 * announce-gen (print_changelog_deltas): Use .sig suffix, not .asc.
5335 2003-12-15 Paul Eggert <eggert@twinsun.com>
5337 * NEWS, doc/coreutils.texi: touch -r and -d can now both be specified,
5338 with -r specifying the origin for -d.
5339 * src/touch.c (flexible_date): Remove static var.
5340 (get_reldate): New function.
5341 (main): Use it, to implement this new behavior.
5343 2004-01-16 Jim Meyering <jim@meyering.net>
5345 * tests/touch/relative: New test for the above.
5346 * tests/touch/Makefile.am (TESTS): Add relative.
5348 2004-01-13 Jim Meyering <jim@meyering.net>
5350 * src/system.h: Include contents of sys2.h.
5351 * src/sys2.h: Remove file.
5352 * src/Makefile.am (noinst_HEADERS): Remove sys2.h.
5354 * Use automake-1.8.2. Regenerate dependent files.
5356 * Update to gettext-0.13.1.
5357 * configure.ac: Use gettext-0.13.1.
5358 * .x-sc_space_tab: Add m4/po.m4 to the list of exceptions.
5360 2004-01-12 Jim Meyering <jim@meyering.net>
5362 * Makefile.maint (%.sig): Use .sig suffix rather than .asc.
5364 * Makefile.maint (po-check): Ensure that cvsu works before using it.
5365 Reported by Alexandre Duret-Lutz.
5367 * src/tail.c (main): Warn about following stdin only when it's a tty.
5369 * configure.ac: Use gl_DEFAULT_POSIX2_VERSION.
5371 2004-01-10 Jim Meyering <jim@meyering.net>
5373 * tests/misc/stat-fmt: Use backticks, not `$()' notation.
5375 2004-01-09 Jim Meyering <jim@meyering.net>
5377 * configure.ac: Quote underquoted `jm_DUMMY_1' to avoid new warning.
5379 2004-01-08 Jim Meyering <jim@meyering.net>
5381 * src/stat.c (human_fstype): Use %lx, not %x format for `unsigned long'.
5382 From Andreas Schwab.
5384 * tests/Makefile.am (TESTS_ENVIRONMENT): Remove `/vg' (prerelease test
5385 remnant) from PATH component. That would cause tests in this directory
5386 not to run the just-built binaries, but rather whatever happened
5387 to be in one's PATH. Reported by Christian Krackowizer.
5389 2004-01-04 Jim Meyering <jim@meyering.net>
5391 * src/csplit.c (new_control_record): Use x2nrealloc
5392 rather than xrealloc.
5394 * src/cp.c (re_protect): Use ASSIGN_STRDUPA rather than
5396 (make_path_private): Likewise.
5398 2004-01-03 Jim Meyering <jim@meyering.net>
5400 * src/paste.c: Use `bool' (not int) as the type for a few
5402 (collapse_escapes): Rewrite to set globals rather than modifying
5404 Use size_t (not int) for all counters and related index variables.
5405 (paste_parallel): Remove needless complexity of
5406 using xrealloc in the loop; just allocate the buffers up front.
5407 Free the two temporary buffers.
5408 Move declarations of locals `down' into scope where used.
5409 (paste_serial): Remove `register' attributes.
5410 (main): Simplify delim-related code.
5411 Free `delims', now that it's malloc'd.
5413 2004-01-02 Jim Meyering <jim@meyering.net>
5415 * src/chroot.c: Include "quote.h".
5416 (CHROOT_FOUND_BUT_CANNOT_INVOKE, CHROOT_FAILURE): Define.
5417 (main): Exit with status of 127, not 1, for too-few-args,
5418 chroot failure, or chdir failure.
5419 Give a better diagnostic upon execvp failure.
5421 * src/du.c (usage): Mention that, with its current meaning,
5424 * src/tail.c (main): Warn about following stdin when it's a tty.
5425 Fail when following by name but no names are specified.
5427 2003-12-30 Jim Meyering <jim@meyering.net>
5429 * src/fold.c (main): Use memcpy, not strcpy.
5431 * src/copy.c (copy_internal): Use ASSIGN_STRDUPA rather than
5434 2003-12-28 Jim Meyering <jim@meyering.net>
5436 * src/unexpand.c (n_tabs_allocated): New global.
5437 (add_tabstop): Use x2nrealloc rather than xrealloc.
5438 * src/expand.c: Likewise.
5440 * tests/misc/expand: New file.
5441 * tests/misc/Makefile.am (TESTS): Add expand.
5443 * src/sort.c (add_temp_dir): Use x2nrealloc rather than xrealloc.
5444 (fillbuf): Use x2nrealloc rather than xrealloc.
5445 (sort): Use xnmalloc rather than xmalloc.
5448 2003-12-27 Jim Meyering <jim@meyering.net>
5450 * src/tee.c (tee): Use xnmalloc rather than xmalloc.
5452 2003-12-29 Paul Eggert <eggert@twinsun.com>
5454 * NEWS: Remove support for join -j1 FIELD, -j2 FIELD, and -o LIST1
5455 LIST2 in POSIX 1003.1-2001 hosts, as required by POSIX.
5457 * doc/coreutils.texi (join invocation): Remove documentation
5458 accordingly. Document that -t makes all separators significant.
5460 * src/join.c: Include posixver.h.
5461 (obsolete_usage): New var.
5462 (longopts): Put obsolete options first.
5463 (OBSOLETE_LONG_OPTIONS): New constant.
5464 (get_option, add_file_name): New functions.
5465 (main): Use them to support new behavior.
5466 (usage): Remove documentation for -j1 FIELD and -j2 FIELD.
5467 Do not mark -j FIELD as obsolescent; it is longstanding
5468 UNIX tradition and is a valid extension to POSIX.
5470 * tests/join/Test.pm (tv): Avoid obsolete -o usage.
5472 2003-12-28 Paul Eggert <eggert@twinsun.com>
5474 * src/join.c (add_field_list): Don't use alloca with unbounded
5475 size; just modify the argument, which is no longer const *.
5477 Various other minor cleanups, mostly to avoid the need for casts.
5479 (extract_field): Renamed from ADD_FIELD, as it's now a function.
5481 (struct field.beg): Now char *, not unsigned char const *. All
5482 uses changed. It shouldn't be const since xmemcoll writes on its
5484 (extract_field): Likewise, for 2nd arg.
5485 (keycmp): Remove now-unnecessary cast of xmemcoll args.
5487 (is_blank): New function, to avoid need to cast arg to unsigned char.
5488 (extract_field): Use it.
5490 (xfields): Rewrite pretty much from scratch.
5492 (hard_LC_COLLATE): Now bool, not int.
5493 (get_line, getseq, add_field_list): Now returns bool, not int.
5494 (decode_field_spec, add_field_list): Return true on success (not
5495 false), for consistency with the rest of the code. All uses changed.
5497 (tab): Now char, not unsigned char. This wasn't 100% necessary
5498 but is slightly cleaner.
5499 (prjoin): Hoist (tab ? tab : ' ') expression, to help the compiler.
5501 (empty_filler): Now const *.
5503 (make_blank): Remove; wasn't needed. Remove all calls.
5504 (main): Don't set uni_blank.nfields; zero is fine.
5506 2003-12-27 Jim Meyering <jim@meyering.net>
5508 * src/join.c: Include "quote.h".
5509 (min, max): Remove definitions.
5510 Make a few function parameters and corresponding
5511 locals `const'. Use bool for boolean variables.
5512 Use size_t (not int) for all counters and related index variables.
5513 (prjoin): Remove now-useless assertion.
5514 (string_to_join_field): New function.
5515 (main): Accept join fields as large as SIZE_MAX.
5516 (keycmp): Rename `min' to MIN and max to MAX.
5518 2003-12-26 Jim Meyering <jim@meyering.net>
5520 fold -s didn't work on e.g., alpha-based systems.
5521 * src/fold.c (fold_file): Adjust types (int->size_t) so that using
5522 x2nrealloc works properly on systems with differing sizes for int
5523 and size_t. Reported by Nelson Beebe.
5525 * src/fold.c: Use `bool' (not int) as the type for a few
5528 2003-12-23 Paul Eggert <eggert@twinsun.com>
5530 * src/ls.c (length_of_file_names_and_frills):
5531 Remove forward decl; not needed.
5532 (print_file_name_and_frills, length_of_file_name_and_frills):
5533 With -m, don't output spaces before inum or size.
5534 (print_with_commas): Don't output space just before newline.
5536 2003-12-24 Jim Meyering <jim@meyering.net>
5538 * tests/ls/Makefile.am (TESTS): Add m-option.
5539 * tests/ls/m-option: New file. Test for above fixes.
5541 2003-12-20 Jim Meyering <jim@meyering.net>
5545 * src/pr.c: Change type of global, buff_allocated, to size_t.
5547 * src/join.c [struct seq]: Change types of members count and alloc
5548 from `int' to `size_t'.
5550 * tests/Makefile.am (root-hint): Tweak wording.
5552 * src/du.c: Accept new option (-0, --null) that makes it so each
5553 output line is NUL-terminated rather than newline-terminated.
5555 * src/dd.c (apply_translations): Don't prohibit conv=unblock,sync.
5556 Reported by Volker Paul.
5557 * tests/dd/Makefile.am (TESTS): Add unblock-sync.
5558 * tests/dd/unblock-sync: New test for the above.
5560 2003-12-19 Jim Meyering <jim@meyering.net>
5562 * tests/misc/nohup: Double quote back-ticked expression,
5563 in case it ends up having an unexpected value.
5565 * tests/ls/no-arg: Use ls's -1 option in both runs.
5567 * src/du.c (fts_debug): New global.
5568 (FTS_CROSS_CHECK, DEBUG_OPT): Define.
5569 (main): Make fts use FTS_TIGHT_CYCLE_CHECK.
5570 (main) [DU_DEBUG]: Accept -d option.
5572 2003-12-18 Jim Meyering <jim@meyering.net>
5574 * src/ls.c (format_user): Increment dired_pos via two statements,
5575 `dired_pos += width; dired_pos++;' rather than one,
5576 `dired_pos += width + 1;' since the latter could conceivably overflow.
5577 (format_group): Likewise.
5580 * configure.ac: Require automake-1.8.
5582 2003-12-12 Jim Meyering <jim@meyering.net>
5584 * Use automake-1.8. Regenerate dependent files.
5586 2003-12-08 Jim Meyering <jim@meyering.net>
5588 * Makefile.maint (news-date-check): New rule.
5589 (alpha beta major): Depend on it.
5591 2003-12-03 Paul Eggert <eggert@twinsun.com>
5593 * NEWS: ls -l (and similar options) now adjust all columns to
5594 fit the data. Generalized from a suggestion by Leah Q for file sizes.
5595 * src/ls.c (INODE_DIGITS, LOGIN_NAME_MAX, ID_LENGTH_MAX): Remove.
5596 (format_user_width, format_group_width, unsigned_file_size,
5597 format_group): New functions.
5598 (block_size_width): Renamed from block_size_size.
5599 (inode_number_width, nlink_width, owner_width, group_width,
5600 author_width, major_device_number_width, minor_device_number_width,
5601 file_size_width): New vars.
5602 (clear_files): Initialize them.
5603 (gobble_file): Set them. Don't ceiling block_size_width to 7.
5604 (print_long_file): Use them.
5605 (gobble_file): Use a new local variable 'f' to make the code
5606 smaller and more consistent with other functions.
5607 (format_user): Output to stdout, not to a buffer, so that we
5608 don't have to worry about buffer overrun. Update dired_pos.
5609 (print_long_file): Don't put owner, group, author into buffer;
5610 just print them directly. Don't assume link counts and
5611 major and minor numbers fit into unsigned long int.
5612 * tests/cp/same-file, tests/mv/part-symlink: Don't assume that
5613 'ls' output is fixed-width.
5615 2003-12-02 Jim Meyering <jim@meyering.net>
5617 * src/md5sum.c: Include sha1.h (reflect renaming: sha.h -> sha1.h.
5619 2003-11-27 Jim Meyering <jim@meyering.net>
5621 * Use automake-1.7f. Regenerate dependent files.
5623 2003-11-24 Paul Eggert <eggert@twinsun.com>
5625 Parse floating-point operands and options in the C locale.
5626 POSIX requires this for printf, and we might as well be
5627 consistent elsewhere (tail, sleep, seq).
5629 * src/printf.c: Remove decls of strtod, strtol, strtoul; no longer
5630 needed now that we assume C89. Include "c-strtod.h".
5631 (xstrtod): Call c_strtod, not strtod.
5632 * src/sleep.c: Include "c-strtod.h".
5633 (main): Update xstrtod call to include new argument, c_strtod.
5634 * src/seq.c (scan_double_arg): Likewise.
5635 * src/tail.c (parse_options): Likewise.
5637 2003-11-24 Jim Meyering <jim@meyering.net>
5639 * tests/rm/fail-2eperm: Handle another errno variant (HPUX, EPERM).
5640 Reported by Mark Conty.
5642 2003-11-22 Jim Meyering <jim@meyering.net>
5644 * Makefile.maint (sc_xalloc_h_in_src): Remove rule. Subsumed by...
5645 (sc_system_h_headers): Do this test only if sys2.h exists.
5647 2003-11-20 Jim Meyering <jim@meyering.net>
5649 * tests/help-version: Ensure that the bug-reporting address is
5650 included in the --help output for every program.
5651 * tests/Makefile.am (TESTS_ENVIRONMENT): Add $PACKAGE_BUGREPORT.
5653 * src/ptx.c (usage): Output bug-reporting address.
5654 Reported by Dan Jacobson.
5656 2003-11-19 Jim Meyering <jim@meyering.net>
5658 * src/join.c (usage): Mention that FILE1 and FILE2 must be sorted
5659 on the join fields. Suggestion from Bruce Robertson.
5661 2003-11-18 Jim Meyering <jim@meyering.net>
5663 `od -c -w9999999' could segfault
5664 * src/od.c (dump): Use xnmalloc/free, not alloca.
5666 2003-11-16 Jim Meyering <jim@meyering.net>
5668 * Use autoconf-2.59. Regenerate dependent files.
5670 * tests/du/hard-link: Minor tweak: use mkdir -p.
5672 Fix read-from-free'd-buffer error detected by valgrind.
5673 * src/csplit.c (remove_line): Don't return a pointer to data in
5674 a freed buffer. Instead, arrange to free the buffer on the
5677 * tests/misc/csplit: New test for above fix.
5679 2003-11-11 Jim Meyering <jim@meyering.net>
5681 * src/ls.c (extract_dirs_from_files): Avoid useless copy operations.
5682 This avoids a warning from valgrind about memcpy with overlapping
5683 source and destination.
5685 * configure.ac: Require automake-1.7.8.
5687 2003-11-09 Jim Meyering <jim@meyering.net>
5689 * Use automake-1.7.9. Regenerate dependent files.
5691 * src/rm.c: Support new options: --preserve-root and --no-preserve-root.
5692 * src/chown.c: Likewise.
5694 * src/chown-core.c: Include "root-dev-ino.h".
5695 (chopt_init): Initialize new member.
5696 (change_file_owner): Support rm's new --preserve-root option.
5698 * src/remove.c: Include "root-dev-ino.h".
5699 (remove_cwd_entries): Remove now-obsolete FIXME comment.
5700 (remove_dir): Support rm's new --preserve-root option.
5702 * src/chown.c: Include "root-dev-ino.h".
5703 Add new options: --preserve-root and --no-preserve-root.
5705 * src/chmod.c: Include "root-dev-ino.h".
5706 (process_file): Use newly-factored-out ROOT_DEV_INO_CHECK and
5707 ROOT_DEV_INO_WARN macros.
5708 (get_root_dev_ino): Remove function definition, now that it's
5709 been moved to a separate file.
5710 (usage): Describe new options.
5712 * src/mv.c (rm_option_init): Initialized new member.
5714 * src/remove.h: Include "dev-ino.h".
5715 (struct rm_options): Add new member: root_dev_ino.
5716 * src/chown-core.h: Include "dev-ino.h".
5717 (struct Chown_option): Add new member: root_dev_ino.
5719 2003-11-06 Jim Meyering <jim@meyering.net>
5721 * src/paste.c (paste_parallel): Use `sizeof *var' rather than
5722 hard-coding `sizeof FILE*'.
5724 2003-11-05 Dennis Smit <ds@nerds-incorporated.org>
5726 * src/wc.c (main): Free `fstatus' so there is no confusion about
5727 whether it's leaked or not.
5728 * src/who.c (who): Likewise for `utmp_buf'.
5730 2003-11-05 Paul Eggert <eggert@twinsun.com>
5732 Fix 'cut' problems with size_t overflow and unsigned int.
5733 More generally, resize integer variables to fit use more precisely.
5734 * src/cut.c (ADD_RANGE_PAIR): Remove unnecessary parens.
5735 (struct range_pair): Make members to be of type size_t, not unsigned.
5736 (max_range_endpoint, eol_range_start): Now size_t, not unsigned.
5737 (suppress_non_delimited, output_delimiter_specified,
5738 have_read_stdin, print_kth, set_fields): Now bool, nt int.
5739 (delim): Now unsigned char, not int.
5740 (mark_printable_field, is_printable_field, is_range_start_index,
5741 set_fields, set_fields, cut_bytes, cut_fields):
5742 Use size_t, not unsigned, for field and byte counts.
5743 (hash_int): Use uintptr_t, not unsigned, for pointers converted
5744 to integers. This squeezes more info out of them.
5745 (set_fields, cut_bytes, cut_fields, main):
5746 Use bool, not int, for booleans.
5747 (set_fields): Allocate zeroed byte array with xzalloc, not xcalloc.
5749 2003-11-05 Paul Eggert <eggert@twinsun.com>
5751 * man/Makefile.am (check-programs-vs-x):
5752 Work even if $(programs) contains '$'.
5753 Work even if 'missing=1' in environment.
5754 Don't report an error simply because $(programs) outputs nothing.
5756 2003-11-05 Jim Meyering <jim@meyering.net>
5758 * Use autoconf-2.58. Regenerate dependent files.
5760 * src/tr.c (spec_init): Fix typo in last change.
5762 * src/sys2.h (case_GETOPT_VERSION_CHAR): Cast NULL to `(char *)' in
5763 call to variadic version_etc function, so that it works even on systems
5764 for which sizeof char* != sizeof int.
5765 * src/true.c (main): Likewise.
5766 * basename.c, chroot.c, cksum.c, dd.c, dirname.c, echo.c, expr.c:
5767 * factor.c, hostid.c, hostname.c, link.c, logname.c, nice.c, nohup.c:
5768 * pathchk.c, printenv.c, printf.c, pwd.c, setuidgid.c, sleep.c, stty.c:
5769 * sync.c, test.c, tsort.c, unlink.c, uptime.c, users.c, whoami.c, yes.c:
5770 Similarly, cast NULL to `(char *)' in call to variadic function,
5771 parse_long_options, so that it works even on systems for which
5772 sizeof char* != sizeof int.
5773 A similar problem was reported by Harti Brandt in
5774 http://mail.gnu.org/archive/html/bug-gnu-utils/2003-10/msg00320.html.
5776 * src/users.c (users): Free `utmp_buf' explicitly so that people
5777 don't mistake this for a real leak.
5778 Patch by Dennis Smit <ds@nerds-incorporated.org.
5780 2003-11-04 Paul Eggert <eggert@twinsun.com>
5782 * README: Document _POSIX2_VERSION.
5784 2003-11-04 Jim Meyering <jim@meyering.net>
5786 * src/tac.c (memrchr): Remove #if-0'd function.
5787 (tac_stdin_to_mem): Clean up #if-0'd code.
5789 * src/od.c (decode_format_string): Remove unnecessary casts.
5790 Use more maintainable `sizeof *var'.
5791 (main): Call decode_format_string rather than decode_one_format,
5792 now that `spec' may be NULL.
5794 * src/chmod.c (AUTHORS): Add my name.
5796 * src/split.c (next_file_name): Use `sizeof *var' rather than
5797 hard-coding `sizeof size_t'.
5799 * src/sort.c (new_key): Use xzalloc, not xcalloc (1, ...).
5801 * src/cut.c (ADD_RANGE_PAIR): Use x2nrealloc rather than xrealloc,
5802 to avoid potential overflow in pointer arithmetic.
5803 (set_fields): Use not `1', but rather `sizeof *printable_field' as
5804 second argument to xcalloc.
5805 * src/od.c (decode_format_string, dump_strings): Use x2nrealloc
5806 rather than xrealloc.
5807 * src/date.c (show_date): Likewise.
5808 * src/join.c (ADD_FIELD, initseq, getseq): Likewise.
5809 * src/pr.c (store_char): Likewise.
5810 * src/fold.c (fold_file): Likewise.
5812 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
5813 type changes (unsigned int -> size_t) in hash.c.
5814 * src/cp-hash.c (src_to_dest_hash): Likewise.
5815 * src/du.c (entry_hash): Likewise.
5816 * src/ls.c (dev_ino_hash): Likewise.
5817 * src/cut.c (hash_int): Likewise. Declare function as static.
5819 2003-11-03 Jim Meyering <jim@meyering.net>
5821 * tests/misc/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
5822 * tests/misc/fold: Fail the test immediately if we're not running
5823 the expected version of fold.
5825 2003-11-02 Jim Meyering <jim@meyering.net>
5827 * src/tr.c (append_normal_char, append_range, append_char_class)
5828 (append_repeated_char, append_equiv_class, spec_init): Use `sizeof *var'
5829 rather than `sizeof EXPLICIT_TYPE'. The former is more maintainable
5830 and usually shorter.
5831 * src/copy.c (copy_internal): Likewise.
5832 * src/join.c (initseq, add_field, make_blank): Likewise.
5833 * src/od.c (main): Likewise.
5834 * src/cp.c (make_path_private): Likewise.
5835 * src/tsort.c (new_item, record_relation): Likewise.
5837 * src/df.c (add_fs_type, add_excluded_fs_type, main): Likewise.
5838 (main): Also remove anachronistic cast of xmalloc return value.
5839 * src/ptx.c (alloc_and_compile_regex, main): Likewise.
5840 (main): Also remove anachronistic cast of xmalloc return value.
5841 * src/sort.c (inittables): Likewise.
5842 (sort): Also Split a long line.
5844 2003-10-25 Jim Meyering <jim@meyering.net>
5846 * src/copy.c (triple_hash, triple_hash_no_name): Adjust to reflect
5847 type changes (unsigned int -> size_t) in hash.c.
5848 * src/cp-hash.c (src_to_dest_hash): Likewise.
5849 * src/du.c (entry_hash): Likewise.
5850 * src/ls.c (dev_ino_hash): Likewise.
5851 * src/cut.c (hash_int): Likewise. Declare function as static.
5853 2003-10-21 Jim Meyering <jim@meyering.net>
5855 Don't fail when run with VERBOSE=yes.
5856 * tests/chgrp/basic: Do `set +x' before starting the subshell
5857 from which we invoke chgrp. Otherwise, the output from the
5858 VERBOSE=yes-induced `set -x' would result in spurious differences.
5859 Reported by Russel Coker via Michael Stone.
5861 2003-10-19 Jim Meyering <jim@meyering.net>
5863 chmod now uses fts to perform a directory traversal when -R is
5864 specified. Before, it operated on full path names, and as such
5865 would encounter the PATH_MAX (often 4096) limit.
5867 * src/chmod.c: Include "xfts.h".
5868 (process_file): Rename from change_file_mode.
5869 Adapt to be used with fts.
5870 (process_files): New function.
5872 2003-10-18 Jim Meyering <jim@meyering.net>
5874 * tests/du/deref-args: Ensure that du -D now dereferences all
5875 symlinks specified on the command line, not just those that
5876 reference directories.
5878 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
5879 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
5880 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
5881 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
5882 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
5883 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
5884 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
5885 * who.c, whoami.c, yes.c (AUTHORS): Revert the WRITTEN_BY/AUTHORS change
5886 of 2003-09-19. Now, AUTHORS is a comma-separated list of strings.
5887 Update the call to parse_long_options so that `AUTHORS, NULL' are the
5889 * src/true.c (main): Append NULL to version_etc argument list.
5890 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
5892 2003-10-17 Andreas Schwab <schwab@suse.de>
5894 * tests/mk-script: Get $srcdir from first parameter instead of
5896 (main): Update usage.
5898 * tests/Makefile.am.in ($(srcdir)/$x-tests): Pass $(srcdir) as
5899 first argument of mk-script.
5900 ($(srcdir)/Makefile.am): Likewise. Prepend $(srcdir) to target.
5902 2003-10-17 Jim Meyering <jim@meyering.net>
5904 * src/mv.c (usage): Tweak descriptions of -i and -f so that the
5905 generated `man' page is more readable. Suggestion from Dan Jacobson.
5907 * src/chown-core.c (change_file_owner): Handle the cases in
5908 which fts_info indicates an error with the given entry.
5910 * src/du.c (main): Simply assign to bit_flags.
5911 Don't bother with bit arithmetic.
5913 * tests/chmod/no-x: New file.
5914 * tests/chgrp/no-x: New file.
5915 * tests/chmod/Makefile.am (TESTS): Add no-x.
5916 * tests/chgrp/Makefile.am (TESTS): Likewise.
5918 * src/du.c: Include "xfts.h".
5919 (du_files): Use xfts_open, rather than fts_open.
5920 * src/chown-core.c (chown_files): Likewise.
5922 2003-10-16 Jim Meyering <jim@meyering.net>
5924 * src/chgrp.c (main): Simply assign to bit_flags.
5925 Don't bother with bit arithmetic.
5926 * src/chown.c (main): Likewise.
5927 Rename a couple of local variables.
5928 Remove unnecessary casts.
5930 * src/tail.c (start_bytes): Rename local, remainder, to avoid
5931 gcc's warning about shadowing a global.
5933 2003-10-15 Jim Meyering <jim@meyering.net>
5935 chown and chgrp now accept POSIX-mandated -H, -L, -P options and
5936 use fts to perform a directory traversal when -R is specified.
5937 Before, they operated on full path names, and as such would
5938 encounter the PATH_MAX (often 4096) limit.
5939 They are more efficient. For example, before, chgrp -R would
5940 take almost 5 seconds to change about 2000 directories and fail
5941 (with `File name too long'), while now it succeeds on a hierarchy
5942 of depth 20,000 in 1/10 the time.
5944 * src/chown.c: Include "userspec.h" and "fts_.h".
5945 (WRITTEN_BY): Add my name.
5946 (getpwnam, getgrnam, getgrgid): Remove declarations.
5947 (endpwent): Remove definition.
5949 (main): Handle new options.
5950 Call new function, chown_files rather than change_file_owner.
5952 * src/chgrp.c: Include "fts_.h".
5953 (WRITTEN_BY): Add my name.
5954 (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of
5957 (main): Handle new options.
5958 Call new function, chown_files rather than change_file_owner.
5960 Rewrite to iterate through hierarchies using fts rather than
5961 via explicit recursion.
5962 * src/chown-core.c: Include "fts_.h"
5963 (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate
5964 on a single file at a time.
5965 (chown_files): New function.
5966 * src/chown-core.h [enum Dereference_symlink]: Remove declaration.
5967 [struct Chown_option] (recurse, force_silent): Change type to `bool'.
5968 [struct Chown_option] (dereference): Remove member with ambiguous name.
5969 [struct Chown_option] (affect_symlink_referent): New member.
5970 (chown_files): New prototype.
5972 * tests/chgrp/recurse: Update tests accordingly.
5973 * tests/chgrp/posix-H: New tests for the above.
5974 * tests/chgrp/Makefile.am (TESTS): Add posix-H.
5976 * src/ln.c (usage): Clarify that --directory, -d, -F probably won't
5977 work even for superuser. Suggestion from Dan Jacobson.
5979 2003-10-14 Paul Eggert <eggert@twinsun.com>
5981 Fix some number-parsing bugs, e.g., "head -n 100k@" wasn't
5983 * lib/human.c, lib/xstrtoimax.c, lib/xstrtol.c, lib/xstrtol.h,
5984 lib/xstrtoul.c, lib/xstrtoumax.c: Sync with gnulib.
5985 * src/sort.c (parse_field_count): Handle the case where overflow
5986 and invalid suffix char are both reported.
5988 2003-10-14 Jim Meyering <jim@meyering.net>
5990 * src/ls.c (decode_switches) [TIOCGWINSZ]: Comment out the
5991 warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always
5994 2003-10-13 Paul Eggert <eggert@twinsun.com>
5996 Fix to avoid a denial-of-service attack if the display width is
5997 enormous. Also, clean up the code a bit by removing duplicate code.
5999 * src/ls.c (init_column_info): Remove forward decl; no longer needed.
6000 (calculate_columns): New function, that contains code that used
6001 to be common to print_many_per_line and print_horizontal.
6002 (print_many_per_line, print_horizontal): Use it.
6003 (decode_switches): Set max_idx here, not in calculate_columns.
6004 (print_current_files): Don't call init_column_info; calculate_columns
6006 (init_column_info): Don't allocate a lot more space than is needed
6007 to represent the current set of files. Allocate all the new
6008 size_t cells in one call to xnmalloc, rather than a row at a time.
6010 2003-10-13 Jim Meyering <jim@meyering.net>
6012 * src/ls.c (init_column_info): Add another FIXME comment.
6014 2003-10-13 Paul Eggert <eggert@twinsun.com>
6016 Fix address-arithmetic bug in 'ls', reported by Georgi Guninski.
6017 Remove several arbitrary limits on hosts where int cannot represent
6020 * src/ls.c (struct bin_str.len, length_of_file_name_and_frills, indent,
6021 nfiles, files_index, tabsize, line_length, struct column_info.line_len,
6022 struct column_info.col_arr[0], max_idx):
6023 Now size_t, not int.
6024 (get_funky_string): Return bool indicating success, instead of
6025 a negative count to indicate failure. Store number of columns
6026 through new parameter OUTPUT_COUNT; that way, they can never
6027 go negative. Change equals_end from int to bool. All uses
6029 (struct column_info.valid_len): Now bool, not int. All uses changed.
6030 (dired_dump_obstack, get_funky_string, clear_files,
6031 extract_dirs_from_files, print_current_files,
6032 print_many_per_line, print_horizontal, init_column_info,
6033 put_indicator, length_of_file_name_and_frills,
6034 print_with_commas): Use size_t, not int, for local variables
6036 (decode_switches): Decode sizes using xstrtoul, not xstrtol.
6037 Check for TIOCGWINSZ returing negative values (or values greater
6039 (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern,
6041 Use xmalloc and xnmalloc, not XMALLOC.
6042 (gobble_file): Use xnrealloc, not XREALLOC.
6043 (print_color_indicator): Remove now-unnecessary cast to size_t.
6045 2003-10-12 Paul Eggert <eggert@twinsun.com>
6047 * tests/du/no-x: Change wording of diagnostic to match latest du.c.
6048 * tests/sort/sort-tests: Remove from CVS; assume that people
6049 brave enough to check coreutils out from CVS can rebuild it.
6051 2003-10-12 Jim Meyering <jim@meyering.net>
6053 New options: --preserve-root and --no-preserve-root.
6054 * src/chmod.c (change_file_mode): Honor new option.
6055 (change_file_mode): Strip trailing slashes on directory
6056 argument passed to change_dir_mode.
6057 (get_root_dev_ino): New function.
6058 (main): Initialize global, root_dev_ino.
6060 * src/copy.c (copy_internal): Don't #ifdef-out simple uses of
6061 S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined
6063 * src/chmod.c (change_file_mode): Likewise.
6065 2003-10-08 Jim Meyering <jim@meyering.net>
6067 * src/csplit.c (main): Remove obsolete FIXME.
6069 2003-10-07 Jim Meyering <jim@meyering.net>
6071 * Use automake-1.7.8. Regenerate dependent files.
6073 2003-09-29 Paul Eggert <eggert@twinsun.com>
6077 * doc/coreutils.texi (csplit invocation):
6078 The regexp offset need not have a sign; POSIX requires support
6079 for signless offets.
6081 Be more careful about int widths. For example, remove some
6082 arbitrary limits by replacing 'unsigned' with 'size_t',
6083 'uintmax_t', etc. Use standard bool rather than a homegrown type.
6084 * lib/Makefile.am (libfetish_a_SOURCES): Add xstrtoimax.c.
6085 * src/csplit.c (FALSE, TRUE, boolean): Remove. All uses changed
6086 to <stdbool.h> usage.
6087 (struct control): offset is now intmax_t, not int.
6088 repeat_forever is now bool, not int.
6089 (struct cstring): len is now size_t, not unsigned int.
6090 (struct buffer_record): bytes_alloc, bytes_used, num_lines are now
6091 size_t, not unsigned. start_line, first_available are now
6092 uintmax_t, not unsigned.
6093 (hold_count, control_used): Now size_t, not unsigned.
6094 (last_line_number, current_line, bytes_written):
6095 Now uintmax_t, not unsigned.
6096 (save_to_hold_area, red_input, keep_new_line, record_line_starts,
6097 create_new_buffer, get_new_buffer, load_buffer, find_line,
6098 process_regexp, split_file, new_control_record, extract_regexp,
6099 get_format_width, get_format_prec, max_out):
6100 size args, locals, and returned values are now size_t, not unsigned
6102 (get_first_line_in_buffer, find_line, write_to_file,
6103 handle_line_error, process_line_count, regexp_error, process_regexp,
6105 File line, byte, and repetition counts are now uintmax_t, not unsigned.
6106 (check_for_offset): Don't require a sign before the offset.
6107 Use xstrtoimax to do the real work.
6108 (extract_regexp): Remove harmful cast of size to unsigned.
6109 256 -> 1<<CHAR_BIT, for clarity.
6110 (get_format_flags): Return at most 3, to avoid worries about overflow.
6112 (bytes_to_octal_digits): Remove.
6114 (cleanup): Don't check whether output_stream is NULL, since
6115 close_output_file does that for us.
6117 (new_line_control, create_new_buffer): Use "foo *p = xmalloc
6118 (sizeof *p);" instead of the more long-winded alternatives.
6120 (get_new_buffer): Use O(1) algorithm for resizing a buffer
6121 to a much larger size, instead of an O(N) algorithm.
6123 (process_regexp): Use plain NULL rather than casted 0.
6125 (make_filename): Use %u, not %d, to format unsigned file number.
6127 (new_control_record): Use xrealloc exclusively, since it handles
6130 (extract_regexp): Change misspelled word in diagnostic.
6132 (get_format_width): Even if a minimum field width is specified,
6133 allow room for enough octal digits to represent the value of
6134 the maximum representible integer. This fixes a potential
6135 buffer overrun. Calculate this room at compile-time, not
6136 at run-time; this removes the need for bytes_to_octal_digits.
6137 Check for overflow; this removes a FIXME.
6139 (get_format_prec): Don't allow precision to be signed; it's
6140 not ANSI. Check for overflow. Remove hardcoded "11" as
6141 default precision; this fixes a potential buffer overrun
6142 on hosts with wider size_t.
6144 (get_format_conv_type): Change local variable to be of type
6145 unsigned char, not int; this removes a potential subscript
6146 violation on hosts where char is signed.
6148 (max_out): Replace "for (;*p;)" with more-standard "while (*p)".
6149 Allow "%%" in format. Don't overflow when
6150 counting lots of percents.
6152 (usage): Default sprintf format is %02u, not %d.
6154 2003-10-05 Jim Meyering <jim@meyering.net>
6156 * src/chown-core.c (change_file_owner): Remove set-but-not-used local.
6158 * src/du.c (du_files): Mark diagnostic for translation.
6160 2003-10-04 Jim Meyering <jim@meyering.net>
6162 * src/du.c (du_files): Ignore any failure of fts_close.
6163 Give better diagnostics for failed fts_open.
6165 * src/du.c (MAX_N_DESCRIPTORS): Remove now-unused definition.
6167 Deprecate existing use of -H (aka --si).
6168 * src/du.c (enum) [HUMAN_SI_OPTION]: New member.
6169 [long_options]: Use HUMAN_SI_OPTION, not 'H'.
6170 (main): Warn that the meaning of -H will soon change to be
6173 2003-10-03 Jim Meyering <jim@meyering.net>
6175 * src/du.c: Accept --no-dereference (-P).
6177 2003-10-02 Jim Meyering <jim@meyering.net>
6179 * tests/du/trailing-slash: Adjust for slightly different output.
6181 Rewrite du.c to use fts.
6182 * src/du.c: Include "fts_.h", not ftw.h.
6183 (opt_dereference_arguments, arg_length, suffix_length): Remove globals.
6184 (IS_FTW_DIR_TYPE): Remove definition.
6185 (IS_DIR_TYPE): Define.
6186 (is_symlink_to_dir): Remove now-unnecessary function.
6187 (process_file, du_files): Rewrite to use fts.
6189 * tests/du/inaccessible-cwd: Ensure that even when run from an
6190 inaccessible directory, du can still operate on accessible
6191 directories elsewhere.
6192 * tests/du/Makefile.am (TESTS): Add inaccessible-cwd.
6194 * tests/rm/deep-1: Ensure that du can process a hierarchy
6195 of depth 400 while using no more than 50KB of stack space.
6197 2003-10-01 Akim Demaille <akim@epita.fr>
6199 * announce-gen (print_news_deltas): New function, extracted from main.
6200 (main): Make `news_file' an array.
6201 Use '...=s' => \@var for --news and --url-directory specs.
6202 Before there were a couple of portability problems.
6204 2003-09-28 Jim Meyering <jim@meyering.net>
6206 * Makefile.maint (sc_cast_of_alloca_return_value): New rule.
6207 (syntax-check-rules): Add it.
6209 * src/copy.c: Remove unnecessary cast of alloca, since now it's
6210 guaranteed to be (void *).
6211 * src/cp.c: Likewise.
6212 * src/join.c: Likewise.
6213 * src/ln.c: Likewise.
6214 * src/ls.c: Likewise.
6215 * src/od.c: Likewise.
6216 * src/sys2.h (ASSIGN_STRDUPA): Likewise.
6218 2003-09-27 Jim Meyering <jim@meyering.net>
6220 Don't exhaust virtual memory when processing large inputs.
6221 Fix this by removing csplit's internal free-list management;
6222 instead rely on malloc for that.
6224 * src/csplit.c (free_list): Remove global.
6225 (clear_all_line_control): Remove function.
6226 (get_new_buffer): Always use create_new_buffer to obtain a
6227 new buffer, rather than searching free_list.
6228 (free_buffer): Just call free.
6229 Reported by Nikola Milutinovic.
6231 2003-09-26 Jim Meyering <jim@meyering.net>
6233 * man/rm.x: Also list `chattr' in SEE ALSO section.
6234 Suggestion from Mark Hubbart.
6236 2003-09-25 Jim Meyering <jim@meyering.net>
6238 * configure.ac: Don't invoke AC_AIX or AC_MINIX explicitly, now
6239 that we use gl_USE_SYSTEM_EXTENSIONS, since it AC_REQUIREs them.
6241 * Use autoconf-2.57d. Regenerate dependent files.
6243 2003-09-24 Jim Meyering <jim@meyering.net>
6245 Minor efficiency tweak.
6246 * src/ln.c (PATH_BASENAME_CONCAT): Use memcpy rather than strcpy.
6247 (do_link): Likewise.
6249 2003-09-23 Jim Meyering <jim@meyering.net>
6251 * src/paste.c (paste_serial): Save errno after input error,
6252 to report proper errno value.
6253 Based on a patch from Paul Eggert.
6255 * src/tee.c (tee): Adjust fwrite arguments so that the return
6256 value is the number of bytes written.
6258 2003-09-16 Paul Eggert <eggert@twinsun.com>
6260 Don't assume ferror sets errno. Bug reported by Bruno Haible.
6262 * src/comm.c (compare_files): Save errno after input error,
6263 to report proper errno value.
6264 * src/fold.c (fold_file): Likewise.
6265 * src/od.c (check_and_close, skip, read_char, read_block): Likewise.
6266 * src/unexpand.c (unexpand): Likewise.
6268 * src/csplit.c (close_output_file): Don't report bogus errno value
6269 after ferror discovers an output error. We don't know the proper
6270 errno value, since it might have been caused by any of a whole
6271 bunch of calls, and it might have been trashed in the meantime.
6272 Fixing this problem will require much more extensive changes;
6273 in the meantime just say "write error".
6274 * src/od.c (check_and_close, dump, dump_strings): Likewise.
6275 * src/uniq.c (check_file): Likewise.
6277 * src/join.c (get_line): Report error right away if I/O fails,
6278 so that the proper errno value is used.
6279 * src/tac.c (tac_seekable, tac_file, save_stdin): Likewise.
6280 * src/tee.c (tee): Likewise.
6281 * src/uniq.c (check_file): Likewise.
6283 * src/od.c (skip): If a read fails, don't retry it later, so
6284 that we report the proper errno.
6286 * src/tac.c (tac_mem): Don't return a value; nobody uses it.
6288 * src/tee.c (tee): Once a write failure has occurred, don't bother
6289 writing anything more to that stream.
6291 * src/uniq.c (check_file): Check for ferror (stdout) even if
6294 * src/yes.c (UNROLL): Remove.
6295 (main): Exit immediately when write failure is detected.
6296 Simplify code by assigning to argv when argc == 1.
6298 2003-09-21 Paul Eggert <eggert@twinsun.com>
6300 * src/ptx.c: Switch encoding from Latin-1 to UTF-8.
6301 (WRITTEN_BY): Change "Franc,ois" (actually using
6302 c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as
6305 2003-09-19 Jim Meyering <jim@meyering.net>
6307 `du -D symlink-to-dir' would mistakenly omit the slash in
6308 lines like this: 24 symlink-to-dir/subdir
6309 * src/du.c (process_file): Fix offset calculation.
6310 Reported by Jeff Sheinberg as Debian bug #211591;
6311 http://bugs.debian.org/205251
6313 * tests/du/deref-args: New file/test for the above.
6314 * tests/du/Makefile.am (TESTS): Add deref-args.
6316 * src/du.c (process_file): Remove useless disjunct.
6318 * src/sys2.h (case_GETOPT_VERSION_CHAR): Rename parameter, Authors,
6320 * nearly all src/*.c files (WRITTEN_BY): Rename from AUTHORS.
6321 Begin each WRITTEN_BY string with `Written by ' and end it with `.'.
6322 Mark each WRITTEN_BY string as translatable.
6324 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
6325 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
6326 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
6327 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
6328 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
6329 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
6330 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
6331 * who.c, whoami.c, yes.c: Revert yesterday's changes.
6332 Instead, a subsequent change will embed `Written by ' in
6333 each string along with the author names.
6335 * src/true.c: Revert yesterday's changes.
6336 * src/sys2.h: Likewise.
6338 2003-09-18 Jim Meyering <jim@meyering.net>
6340 * basename.c, cat.c, chroot.c, cksum.c, comm.c, cp.c, csplit.c, cut.c:
6341 * dd.c, df.c, dirname.c, du.c, echo.c, env.c, expr.c, factor.c, head.c:
6342 * hostid.c, hostname.c, id.c, link.c, ln.c, logname.c, ls.c, md5sum.c:
6343 * mv.c, nice.c, nl.c, nohup.c, paste.c, pathchk.c, pinky.c, pr.c:
6344 * printenv.c, printf.c, pwd.c, rm.c, setuidgid.c, sleep.c, sort.c:
6345 * split.c, stty.c, sum.c, sync.c, tac.c, tail.c, tee.c, test.c:
6346 * touch.c, tsort.c, uniq.c, unlink.c, uptime.c, users.c, wc.c:
6347 * who.c, whoami.c, yes.c: Update AUTHORS definition to be a
6348 comma-separated list of strings and/or update the call to
6349 parse_long_options so that `AUTHORS, NULL' are the last parameters.
6350 * src/true.c (main): Append NULL to version_etc argument list.
6351 * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
6353 * src/sort.c (numcompare): Rename local, logb, to log_b to avoid
6354 shadowing the math function name. Also rename loga to log_a.
6356 2003-09-14 Jim Meyering <jim@meyering.net>
6358 * src/factor.c (print_factors): Give a separate diagnostic
6359 for numbers that are too large, but otherwise valid.
6360 Reported by Dániel Varga.
6362 2003-09-10 Jim Meyering <jim@meyering.net>
6364 * Use automake-1.7.7. Regenerate dependent files.
6366 * tests/Makefile.am (all_programs): Use ../src/tr -s ' ' '\n' in place
6367 of `fmt -1'. Using the just-built tr is a little cleaner.
6368 Christian Krackowizer reported that HPUX 10.20 doesn't have fmt.
6369 * man/Makefile.am (programs, check-x-vs-1): Likewise.
6371 2003-09-09 Jim Meyering <jim@meyering.net>
6373 * src/copy.c: Alphabetize includes.
6374 Remove duplicate inclusion of "same.h".
6376 2003-09-08 Jim Meyering <jim@meyering.net>
6378 * Makefile.maint (GZIP_ENV): Remove --rsyncable.
6379 Didn't give enough of a benefit, mainly because it's not yet
6384 * man/Makefile.am (programs): Use ../src, not $(srcdir)/../src.
6385 (check-programs-vs-x): Fail if $(programs) is empty.
6387 * src/remove.c: Add a comment.
6389 2003-09-07 Jim Meyering <jim@meyering.net>
6391 * src/remove.c (D_INO, ENABLE_CYCLE_CHECK) [D_INO_IN_DIRENT]:
6392 Don't define. These symbols are no longer used.
6394 * tests/misc/tty-eof: Write ^D as \cD.
6395 Complete the change of 2003-08-02.
6397 * Makefile.maint (po-check): Use cvsu, so that a temporary source
6398 file in lib/ or src/ doesn't induce an unwarranted failure.
6399 Add a kludge to filter out the sole generated source file that
6400 also has translatable messages: src/false.c.
6402 2003-09-06 Jim Meyering <jim@meyering.net>
6404 * src/tail.c (enum): Add ALLOW_MISSING_OPTION.
6405 (parse_options): Give a diagnostic for (but still accept) the
6406 deprecated --allow-missing option.
6408 2003-09-04 Paul Eggert <eggert@twinsun.com>
6410 Don't ignore -S if input is a pipe. Bug report by Michael McFarland in
6411 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00008.html>.
6413 * src/sort.c (sort_buffer_size): Omit SIZE_BOUND arg. Compute the
6414 size_bound ourselves. if an input file is a pipe and the user
6415 specified a size, use that size instead of trying to guess the
6416 pipe size. This has the beneficial side effect of avoiding the
6417 overhead of default_sort_size in that case. All callers changed.
6418 (sort): Remove static var size; now done by sort_buffer_size.
6420 2003-09-05 Jim Meyering <jim@meyering.net>
6422 * Use automake-1.7.6b and autoconf-2.57b. Regenerate dependent files.
6424 * tests/tail-2/tail-n0f: Wait .5 seconds for backgrounded process
6425 to start, rather than just .1. Upon failure, print unexpected state.
6427 2003-09-04 Paul Eggert <eggert@twinsun.com>
6429 * src/head.c (elide_tail_lines_pipe): Don't assign 0 or
6430 SAFE_READ_ERROR to tmp->nbytes.
6431 * src/tail.c (pipe_lines, pipe_bytes): Likewise.
6433 * src/head.c (struct linebuffer): Change nbytes and nlines
6434 from unsigned int to size_t. unsigned int is safe (after the
6435 2003-09-03 patch) but size_t is cleaner.
6436 * src/tail.c (struct linebuffer, struct charbuffer): Likewise.
6437 (pipe_bytes): Likewise for local variable 'i', which was 'int'.
6439 Standardize on BUFSIZ as opposed to other macro names and values.
6440 * src/head.c (BUFSIZE): Remove. All uses changed to BUFSIZ.
6441 * src/tail.c (BUFSIZ) [!defined BUFSIZ]: Remove.
6442 stdio.h has always defined it,
6443 and other code already assumes it's defined.
6444 * src/tr.c (BUFSIZ) [!defined BUFSIZ]: Likewise.
6445 (IO_BUF_SIZE): Remove; replace all uses with sizeof io_buf.
6446 (io_buf): IO_BUF_SIZE -> BUFSIZ.
6448 2003-09-04 Paul Eggert <eggert@twinsun.com>
6450 * src/seq.c (step): Default to 1.
6451 (print_numbers): Allow the output to be empty.
6452 (main): The default step is 1, even if LAST < FIRST;
6453 as per documentation.
6454 * tests/seq/basic (onearg-2): Output should be empty.
6456 2003-09-05 Jim Meyering <jim@meyering.net>
6458 * Makefile.cfg (wget_files): Temporarily disable, until master
6459 versions are restored to ftp.gnu.org.
6461 * configure.ac (AM_INIT_AUTOMAKE): Specify automake-1.7.6.
6463 Make seq's --width (-w) option work properly even when the
6464 endpoint requiring the larger width is negative and smaller than
6466 * src/seq.c (get_width_format): Include `-' in the set of bytes
6467 allowed in a `simple' number (no decimal point, no exponent).
6468 Reported by Patrick Mauritz.
6470 2003-09-02 Paul Eggert <eggert@twinsun.com>
6472 * NEWS: sort -t '\0' now uses a NUL tab.
6473 sort option order no longer matters, unless POSIX requires it.
6474 * src/sort.c (usage): Say "blanks" instead of "whitespace",
6475 Similar fixes for many comments.
6476 (TAB_DEFAULT): New constant, so that we can support NUL as
6477 the field separator.
6478 (tab): Now int, not char. Initialize to TAB_DEFAULT.
6479 (specify_sort_size): If multiple sizes are specified, use the largest.
6480 (begfield, limfield): Support NUL tab char.
6481 (set_ordering): Do not let -i override -d.
6482 (main): Report an error if incompatible -o or -t options are given.
6483 Report an error for "-t ''". Allow "-t '\0'" to specify a NUL tab.
6485 2003-09-05 Jim Meyering <jim@meyering.net>
6487 * tests/sort/Test.pm [o2, nul-tab]: New tests for the above.
6489 2003-09-03 Andreas Schwab <schwab@suse.de>
6491 Bug report and patch here:
6492 <http://mail.gnu.org/archive/html/bug-coreutils/2003-09/msg00009.html>
6493 * src/tail.c (pipe_lines): Don't truncate return value from safe_read.
6494 * src/head.c (elide_tail_lines_pipe): Likewise.
6496 2003-09-03 Jim Meyering <jim@meyering.net>
6498 * src/du.c (AUTHORS): Remove Larry McVoy's name, since the relatively
6499 small amount of code from him was first moved to lib/human.c, and was
6500 subsequently rewritten entirely.
6501 * src/df.c (AUTHORS): Likewise.
6503 2003-08-22 Lawrence Teo <lcteo@uncc.edu>
6505 * src/md5sum.c (split_3): Accept the BSD format for generic
6506 message digest modes. Currently works with BSD's MD5 and SHA1
6507 formats since these are the two algorithms presently used in
6508 coreutils. Updated comments to reflect this change.
6509 (bsd_split_3): Updated comments.
6511 * tests/md5sum/basic-1: New test to make sure that
6512 `md5sum --check' doesn't accept the BSD SHA1 format (adapted
6513 from `check-bsd' test in tests/sha1sum/basic-1).
6515 * tests/sha1sum/basic-1 (check-bsd2, check-bsd3): New tests for
6516 --check exit status and BSD SHA1 format (adapted from tests
6517 in tests/md5sum/basic-1).
6519 2003-08-30 Jim Meyering <jim@meyering.net>
6521 * src/ln.c (do_link): Use SAME_INODE rather than open-coding it.
6523 When source and destination arguments refer to the same file, reside
6524 on a partition (e.g. VFAT) on which distinct names may refer to the
6525 same directory entry (often due to variations in case), and when the
6526 link count for the file is 1, mv no longer unlinks the file. Instead,
6527 it gives the expected diagnostic that the source and destination are
6528 the same. WARNING: this is an incomplete fix. If the file happens
6529 to have a link count of 2 or greater, such an erroneous mv command
6530 will still unlink it.
6531 Although that is not possible on vfat or umsdos, it is possible on
6532 other file system types, e.g., ntfs, and hpfs.
6533 * src/copy.c (same_file_ok): Invoke same_name (which might still
6534 return false for names that refer to the same directory entry)
6535 only if the link count is 2 or more.
6536 * tests/mv/vfat: Show how to demonstrate the above problem.
6537 This test is not run.
6538 * tests/mv/Makefile.am (EXTRA_DIST): Add vfat.
6540 2003-08-27 Jim Meyering <jim@meyering.net>
6542 * src/who.c: Change meaning of -l from --lookup to --login, per POSIX.
6543 who's -l option has been eliciting an unconditional warning about
6544 this impending change since sh-utils-2.0.12 (April 2002).
6546 * src/paste.c (paste_parallel): Don't output `EOF' (aka -1) as a `char'.
6547 This would happen for nonempty files not ending with a newline.
6548 Reported by Dan Jacobson.
6549 * tests/misc/paste-no-nl: New file. Test for above-fixed bug.
6550 * tests/misc/Makefile.am (TESTS): Add paste-no-nl.
6552 * src/stat.c (print_it): Avoid buffer overrun that would
6553 occur when the user-specified format string ends with `%'.
6554 Patch by Tommi Kyntola.
6555 * tests/misc/stat-fmt: New file. Test for above-fixed bug.
6556 * tests/misc/Makefile.am (TESTS): Add stat-fmt.
6558 2003-08-26 Jim Meyering <jim@meyering.net>
6560 Apply changes from bison.
6561 * GNUmakefile (SHELL): Define to `sh', if necessary.
6563 * Makefile.maint (WGETFLAGS): Define to `-C off'.
6564 Update all uses of $(WGET).
6566 2003-08-22 Akim Demaille <akim@epita.fr>
6568 * Makefile.cfg (local-checks-to-skip): New.
6569 * Makefile.maint (local-check): Rename as...
6570 (local-checks-available): this.
6573 2003-08-26 Akim Demaille <akim@epita.fr>
6575 * announce-gen (print_changelog_deltas): Neutralize "<#" as
6576 "<\#" to avoid magic from Gnus when posting parts of this script.
6578 2003-08-25 Jim Meyering <jim@meyering.net>
6580 * src/stat.c (main): Warn about use of deprecated `-l' option.
6582 2003-08-22 Jim Meyering <jim@meyering.net>
6584 * src/stat.c (do_stat): For link count at end of line, use %h format,
6585 instead of %-5h. The latter would make stat emit trailing spaces.
6586 Reported by Dan Jacobson.
6588 2003-08-20 Jim Meyering <jim@meyering.net>
6590 * Makefile.am (EXTRA_DIST): Add .x-sc_space_tab .x-sc_sun_os_names
6592 2003-08-19 Jim Meyering <jim@meyering.net>
6594 * src/system.h: Include stdlib.h unconditionally,
6595 as we're now assuming that part of hosted C89.
6597 2003-08-18 Jim Meyering <jim@meyering.net>
6599 * src/sys2.h (textdomain, bindtextdomain) [! ENABLE_NLS]: Define away,
6600 to avoid warnings from gcc.
6602 2003-08-17 Jim Meyering <jim@meyering.net>
6604 Avoid unnecessary and sometimes time-consuming hostname lookups.
6605 * src/who.c (print_user): Use strchr, not strrchr.
6606 * src/pinky.c (print_entry): Likewise.
6607 Patch by Michael Stone.
6608 This fixes a typo I introduced in who-users.c on 1996-02-23.
6610 * Makefile.maint (makefile-check): Add 0-9 to the range of characters
6611 disallowed between `@...@'.
6613 2003-08-16 Paul Eggert <eggert@twinsun.com>
6615 * configure.ac (fu_cv_sys_truncating_statfs): Remove; now
6616 done by gnulib .m4 files.
6617 (jm_DUMMY_1): Require gl_READUTMP, not jm_PREREQ_READUTMP.
6618 * src/sys2.h (strtoull): Remove unused declaration.
6620 2003-08-16 Jim Meyering <jim@meyering.net>
6622 * man/Makefile.am (.x.1): Ensure that generated PROGRAM.1 files
6625 * src/tail.c (tail_lines): Fix a potential (but very hard to exercise)
6626 race condition bug. The bug would be triggered when tailing a file
6627 with file pointer not at beginning of file, and where the file was
6628 truncated to have a length of less than the initial offset at just
6629 the right moment (between the two lseek calls in this function).
6631 An invalid initial value for *read_pos would result in
6632 `tail -n0 -f FILE' and `tail -c0 -f FILE' doing what amounted to a
6633 busy-wait rather than sleeping between iterations. The bug manifests
6634 itself only when tailing regular files that are initially nonempty.
6635 * src/tail.c (tail_bytes): Set *read_pos to new file offset after
6637 (tail_lines): Likewise, after lseek calls.
6638 Reported by Nick Estes. See http://bugs.debian.org/205251 for details.
6639 * tests/tail-2/tail-n0f: New file. Test for above fix.
6640 * tests/tail-2/Makefile.am (TESTS): Add tail-n0f.
6642 2003-08-15 Jim Meyering <jim@meyering.net>
6644 * Makefile.maint (sc_space_tab): Use exclusion list in separate file.
6645 (sc_sun_os_names): Likewise.
6646 * .x-sc_space_tab, .x-sc_sun_os_names: New files.
6648 * man/help2man: Remove some SPACEs before TAB.
6650 2003-08-14 Paul Eggert <eggert@twinsun.com>
6652 * Makefile.maint (LC_ALL): Set to C.
6653 * man/Makefile.am (ASSORT): New var.
6654 (check-x-vs-1, programs): Use it.
6655 * src/Makefile.am (ASSORT, check-README, ../AUTHORS): Likewise.
6656 * tests/Makefile.am (ASSORT, all_programs): Likewise.
6658 2003-08-11 Jim Meyering <jim@meyering.net>
6660 fold -s -wN would infloop for N < 8 with TABs in the input.
6661 E.g., this would not terminate: printf 'a\tb' | fold -w2 -s
6662 * src/fold.c (fold_file): Move contents of `else'-block
6663 out of conditional so it's used also for --spaces (-s).
6664 * tests/misc/fold: Test for the above fix.
6665 * tests/misc/Makefile.am (TESTS): Add fold.
6667 2003-08-10 Jim Meyering <jim@meyering.net>
6669 * src/nice.c [!NICE_PRIORITY]: Include <sys/resource.h> after
6670 system.h so the types from time.h and sys/time.h are available.
6671 It appears that this is necessary for OpenBSD, NetBSD, and
6672 Darwin 6.5 (MacOS 10.2.5). Reported by Nelson Beebe.
6674 2003-08-06 Paul Eggert <eggert@twinsun.com>
6676 * NEWS: Add support for setting file timestamps to microsecond
6677 resolution, on hosts that support this.
6678 * src/copy.c, src/cp.c, src/install.c, src/touch.c: Include utimens.h.
6679 * src/copy.c (copy_internal):
6680 Set file timestamps with utimens, not utime.
6681 * src/cp.c (re_protect): Likewise.
6682 * src/install.c (change_timestamps): Likewise.
6683 * src/touch.c (newtime, touch, main): Likewise.
6685 2003-08-09 Jim Meyering <jim@meyering.net>
6687 * Makefile.maint (sc_sun_os_names): New rule based on a regexp
6689 (syntax-check-rules): Add it.
6691 * src/tail.c (main): Tweak Solaris OS version number in comment.
6692 * src/wc.c (wc): Likewise
6693 * tests/tail-2/fflush: Likewise.
6695 * src/tail.c: Add new undocumented option, --presume-input-pipe.
6696 (pipe_lines): Use memchr to skip lines, rather than an explicit loop.
6698 2003-08-08 Paul Eggert <eggert@twinsun.com>
6700 Use new gnulib 'extensions' module.
6701 * configure.ac: Invoke gl_USE_SYSTEM_EXTENSIONS instead of
6704 2003-08-08 Paul Eggert <eggert@twinsun.com>
6706 * tests/du/basic: Ensure that a/b/F has at least 65 bytes too.
6708 2003-08-09 Jim Meyering <jim@meyering.net>
6710 * tests/misc/split-fail: Reflect that `split -a 0' is now accepted.
6711 For tests of obsolete behavior, don't presume that unsetting
6712 _POSIX2_VERSION is equivalent to _POSIX2_VERSION=199209.
6714 2003-08-07 Paul Eggert <eggert@twinsun.com>
6716 * doc/coreutils.texi (split invocation):
6717 Add -d or --numeric-suffixes option to 'split'.
6718 From a suggestion by Jesse Kornblum.
6719 * src/split.c (suffix_alphabet): New var.
6720 (longopts, usage, next_file_name, main): Support -d.
6721 (next_file_name, main): Allow -a0, as POSIX requires.
6722 (next_file_name): Don't assume ASCII-like encoding;
6723 'a' through 'z' are not contiguous in EBCDIC.
6725 2003-08-05 Paul Eggert <eggert@twinsun.com>
6727 Merge getline from gnulib.
6728 * lib/getline.h, lib/getline.c, m4/getline.m4: Merge from gnulib.
6729 * lib/getndelim2.h, lib/getndelim2.c, m4/getndelim2.m4, m4/ssize_t.m4:
6730 New files, from gnulib.
6731 * lib/getdelim2.c, lib/getdelim2.h: Remove.
6732 * lib/Makefile.am (libfetish_a_SOURCES): Change getdelim2.c and
6733 getdelim2.h to getndelim2.c and getndelim2.h.
6734 * m4/jm-macros.m4 (jm_MACROS): Use gl_GETNDELIM2 rather than
6735 checking for getdelim.
6736 (jm_CHECK_ALL_TYPES): Use gt_TYPE_SSIZE_T for ssize_t rather
6737 than rolling our own.
6738 * src/cut.c: Include getndelim2.h rather than getdelim2.h.
6739 (cut_fields): Invoke getndelim2 rather than getdelim2.
6741 2003-08-04 Jim Meyering <jim@meyering.net>
6743 * src/sort.c (main): Use unsigned int instead of int for `nsigs'
6744 and for the indices to iterate through nsigs.
6746 2003-08-02 Paul Eggert <eggert@twinsun.com>
6748 * src/sort.c: Minor code cleanups, mostly to use more accurate
6749 types and to remove unnecessary casts.
6750 (min, max): Remove. All uses changed to MIN and MAX.
6751 (hard_lc_collate, hard_LC_TIME, struct buffer.eof, struct
6752 keyfield.skipsblanks, struct keyfield.skipeblanks, struct
6753 keyfield.numeric, struct keyfield.general_numeric, struct
6754 keyfield.month, struct keyfield.reverse, reverse, unique,
6755 have_read_stdin): Now bool, not int. All uses changed.
6756 (eolchar): Now char, not int.
6757 (struct keyfield.ignore): Now bool const *, not int *.
6758 (struct keyfield.translate): Now char const *, not char *.
6759 (struct month.name): Likewise.
6760 (blanks, nonprinting, nondictionary): Now bool[], not int[].
6761 (cleanup, inittables, keycompare, check, mergefps, first_same_file,
6762 check, sort, main): Use const * pointers when possible.
6763 (month_cmp): Rewrite to avoid casts.
6764 (inittables): Initialize tables unconditionally, to avoid branches.
6765 (fillbuf): Return bool, not int. All uses changed.
6766 (fillbuf, keycompare, new_key, main):
6767 Use SIZE_MAX rather than (size_t) -1.
6768 (trailing_blanks): Renamed from trim_trailing_blanks.
6769 Return the number of blanks to trim. All uses changed.
6770 (getmonth): Use trailing_blanks rather than open code.
6771 (keycompare): Do not cast char * to unsigned char *; not needed.
6772 CMP_WITH_IGNORE converts args to UCHAR, so no need to convert it
6774 (compare, main): Use | rather than || to avoid jumps.
6775 Replace "diff = NONZERO (alen)" with "diff = 1", since alen must
6777 (check, first_same_file, sort, main):
6778 Use bool instead of int local vars when possible.
6779 (check): Merge the old 'checkfp' and 'check' into a single function,
6780 that returns a boolean (true if the file was ordered).
6782 (main): Use int instead of unsigned for iterating through nsigs.
6783 Rename local var "posix_pedantic" to "posixly_correct".
6785 2003-08-02 Jim Meyering <jim@meyering.net>
6787 * src/nice.c [!NICE_PRIORITY]: Include <time.h> before <sys/resource.h>
6788 to avoid compilation error on Ultrix. Reported by Christian Krackowizer.
6790 * src/cut.c (cut_fields): Don't read again after encountering an
6791 initial EOF. E.g., `cut -f2' would do so.
6792 * tests/misc/tty-eof: Add a test for the above fix.
6794 * src/sort.c (sortlines): Add description and references.
6797 * tests/Makefile.am (TESTS_ENVIRONMENT): Set PATH so that
6798 the tests in help-version will use the just-built binaries.
6799 Reported by Christian Krackowizer.
6801 2003-07-31 Paul Eggert <eggert@twinsun.com>
6803 * NEWS: Add --rfc-2822 option to GNU date.
6804 * doc/coreutils.texi (Time directives, Options for date, Examples
6806 * src/date.c (long_options, usage, main): Likewise.
6807 * doc/getdate.texi (General date syntax): Likewise.
6808 * doc/coreutils.texi (Options for date): Fix a typo in format:
6809 it's now %d not %_d. Add URLs.
6811 2003-08-01 Jim Meyering <jim@meyering.net>
6813 * tests/shred/remove: Ensure that $? is 0 for the final `exit 0'.
6814 Otherwise, with at least the /bin/sh from HPUX 10.20,
6815 the trap code would end up converting that to exit 1 and thus an
6816 unexpected test failure. Reported by Christian Krackowizer.
6818 2003-07-31 Paul Eggert <eggert@twinsun.com>
6820 * src/ptx.c: Do not include bumpalloc.h.
6821 (WORD_TABLE): New member alloc.
6822 (ALLOC_NEW_WORD): Remove.
6823 (occurs_alloc): New var.
6824 (digest_word_file, find_occurs_in_text): Check for arithmetic
6825 overflow when computing table size. Use xrealloc rather than
6826 bumpalloc primitives.
6828 2003-07-29 Jim Meyering <jim@meyering.net>
6832 * README: When running tests as root, suggest using
6833 sudo with NON_ROOT_USERNAME=$USER.
6835 * tests/Makefile.am (all_programs): Makefile is in ../src, not
6838 2003-07-28 Jim Meyering <jim@meyering.net>
6840 * Makefile.maint (GZIP_ENV): Try Debian/gzip's new --rsyncable option.
6842 2003-07-28 Paul Eggert <eggert@twinsun.com>
6844 * lib/stdbool.hin (_Bool): Make it signed char, instead of
6845 an enum type, so that it's guaranteed to promote to int.
6846 * src/sort.c (sortlines_temp): Undo previous change.
6848 2003-07-28 Jim Meyering <jim@meyering.net>
6850 * src/sort.c (sortlines_temp): Declare local `swap' to be `int', not
6851 `bool'. Otherwise, at least one buggy compiler (alpha gcc-2.95.4)
6852 would cause lines[-1 - swap] (with swap = false) to evaluate to
6855 2003-07-27 Jim Meyering <jim@meyering.net>
6857 * tests/priv-check (my_uid): Use `!', not `^' in case pattern `[!0-9]',
6858 since /bin/sh of at least NetBSD 1.6 and OpenBSD 3.2 don't accept `^'.
6860 * src/remove.c (prompt) [! recursive]: Don't prompt about unwritable
6861 directories, as required by POSIX. Reported by Karl Berry.
6862 * tests/rm/dir-no-w: New file. Test for the above fix.
6863 * tests/rm/Makefile.am (TESTS): Add dir-no-w.
6865 * tests/mk-script: Emit `$xx', not its expansion.
6867 2003-07-27 Paul Eggert <eggert@twinsun.com>
6869 This change was inspired by a similar proposal by Stepan Kasal.
6870 * src/sort.c (mergelines, sortlines_temp): New functions.
6871 (sortlines): Use them, to reduce the number of times that
6872 we need to copy 'struct line' values. This improved CPU
6873 performance by about 30% on one 18 MB test.
6874 (sort): Don't invoke sortlines unless we have 2 or more lines.
6876 2003-07-26 Stepan Kasal <kasal@ucw.cz>
6878 * src/sort.c (sort): Don't require two `struct line's per text line,
6879 the new sort algorithm requires just 1.5.
6881 2003-07-27 Jim Meyering <jim@meyering.net>
6883 * src/pathchk.c (validate_path): Use %lu, not %ld.
6885 * src/cut.c (is_printable_field): Simplify bit arithmetic.
6887 * src/ls.c (sort_files): Put `volatile' in the right place.
6890 2003-07-26 Jim Meyering <jim@meyering.net>
6892 Use only one bit per field/offset in array, not one `int'.
6893 * src/cut.c (printable_field): Change type to `unsigned char'.
6894 (mark_printable_field, is_printable_field): New functions.
6895 Use them in place of all direct accesses of `printable_field'.
6897 * src/expand.c (parse_tabstops): Detect overflow properly.
6898 * src/cut.c (set_fields): Likewise.
6900 * src/rm.c: Include "dirname.h".
6901 (usage): Use base_name (program_name) in body of --help output.
6903 * man/Makefile.am (.x.1): ...back out the kludge of 2003-07-22.
6904 Idea from Brendan O'Dea, who suggested using
6905 `program_name = basename (argv[0]);' everywhere --
6906 can't do that, but using base_name works just fine here.
6908 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Exempt test.
6910 2003-07-24 Paul Eggert <eggert@twinsun.com>
6912 Fix some POSIX-compliance problems with 'test'. This makes
6913 'test' more compatible with Bash.
6915 * NEWS, doc/coreutils.texi: Document the following.
6916 * src/test.c: Include exitfail.h.
6917 (TEST_FAILURE): New constant, used for exit status if 'test' fails.
6918 (test-syntax_error): Use it.
6919 (binary_operator): Now takes bool arg specifying whether left operand
6920 is -l ARG, so that caller determines this rather than us.
6922 (term): Use posixtest to evaluate parenthesized subexpressions.
6923 (unary_operator, one_argument): Remove support for -t without operand.
6924 (one_argument): Take argument from argv[pos].
6925 (one_argument, two_arguments, three_arguments): Advance pos.
6926 All callers changed.
6927 (three_arguments): Look for binary ops before "!". Then look
6928 for parenthesized one_argument expressions, instead of trusting
6929 expr () to do the right thing.
6930 (posixtest): Now takes number of args. All callers changed.
6931 Treat "( A B )" like "A B".
6932 (main): Set exit_failure to TEST_FAILURE. Don't depend on
6933 POSIXLY_CORRECT, as we now conform to POSIX by default.
6934 (main) [!LBRACKET]: Do not recognize "--help" or "--verbose" unless.
6935 * tests/test/Test.pm (test_vector): Add several tests to check
6936 the above. Syntax errors now exit with status 2, not 1.
6937 * man/Makefile.am (mapped_name): Use `../src/[' binary to create test.1.
6939 2003-07-26 Jim Meyering <jim@meyering.net>
6941 * tests/help-version: Adjust for above change in test behavior:
6942 `[' exits with 2, not 1, and test doesn't accept --help or --version.
6944 * Makefile.maint (ME): Don't use trick suggested in Make manual.
6945 It doesn't work for make-3.79.1. Reported by Christian Krackowizer.
6947 * Makefile.maint (sc_system_h_headers): Another syntax check.
6948 (syntax-check-rules): Add it to the list.
6950 * src/pathchk.c (validate_path): Cast strlen value to `unsigned long'
6951 so it matches `%ld' format even on 32-bit systems.
6953 * src/fmt.c (flush_paragraph): Cast field width to `int' to
6954 avoid warning on 64-bit systems.
6956 * src/ls.c (sort_files): Make `func' volatile, so it can't be
6957 clobbered by a `longjmp' into this function.
6959 2003-07-25 Jim Meyering <jim@meyering.net>
6961 * src/pathchk.c (validate_path): Use %ld format (not %d) for size_t
6964 * tests/misc/split-fail: Disable the --line-bytes=$_4gb test,
6965 because it'd evoke spurious failure on 64-bit systems.
6967 2003-07-24 Jim Meyering <jim@meyering.net>
6969 * src/dd.c (usage): Document the fact that SIGUSR1 makes dd
6970 output its current record counts. Reported by Jurriaan.
6972 * tests/wc/Test.pm (test_vector): Disable the `PIPE' tests when running
6973 `wc' with no options. This goes along with the change of 2003-07-20.
6975 2003-07-23 Jim Meyering <jim@meyering.net>
6977 Don't include headers already included by system.h:
6978 * src/tr.c: Don't include errno.h.
6979 * src/true.c: Don't include version-etc.h.
6980 * src/test.c: Don't include limits.h or error.h.
6981 * src/stat.c: Don't include unistd.h or time.h.
6982 * src/readlink.c: Don't include stdlib.h, unistd.h, or limits.h.
6983 * src/pr.c: Don't include time.h.
6984 * src/pathchk.c: Don't include errno.h.
6985 * src/nice.c: Don't include sys/time.h.
6986 * src/ls.c: Don't include stdlib.h.
6988 * basename.c, cat.c, chroot.c, cksum.c, comm.c, csplit.c, cut.c, date.c:
6989 * dd.c, dirname.c, echo.c, env.c, expand.c, expr.c, factor.c, fmt.c:
6990 * fold.c, head.c, hostid.c, hostname.c, id.c, join.c, kill.c, logname.c:
6991 * md5sum.c, nice.c, nl.c, nohup.c, od.c, paste.c, pathchk.c, pinky.c:
6992 * pr.c, printenv.c, printf.c, ptx.c, pwd.c, seq.c, setuidgid.c, shred.c:
6993 * sleep.c, sort.c, split.c, stat.c, stty.c, su.c, sum.c, tac.c, tail.c:
6994 * tee.c, test.c, tr.c, true.c, tsort.c, tty.c, uname.c, unexpand.c:
6995 * uniq.c, uptime.c, users.c, wc.c, who.c, whoami.c, yes.c:
6996 Don't include closeout.h.
6998 * tests/rm/fail-2eperm: Add a check for whether $NON_ROOT_USERNAME
6999 can access the required version of rm.
7000 * tests/rm/Makefile.am (TESTS_ENVIRONMENT): Define PACKAGE_VERSION.
7002 * tests/cut/Test.pm (out-delim3a): New test.
7004 * man/help2man: Update to version 1.33.
7006 * src/expand.c (parse_tabstops): Detect overflow in tabstop sizes.
7008 * src/dircolors.c: Include xstrndup.h.
7009 (xstrndup): Remove function, now that it's been factored out into
7012 2003-07-22 Paul Eggert <eggert@twinsun.com>
7014 * src/wc.c (wc): Fix typo in computation of file from file_x,
7015 which caused the former to be used uninitialized if file_x was
7018 2003-07-22 Jim Meyering <jim@meyering.net>
7020 * src/cut.c (set_fields): Use xcalloc in place of xmalloc+memset.
7022 * man/Makefile.am (.x.1): Substitute 's,$t/$*,$*,' on output of
7023 help2man, to avoid having `rm.td/rm' appear in rm.1. Reported by
7024 Thomas Luzat. See http://bugs.debian.org/202413 for details.
7026 * src/cut.c (main) [lint]: Initialize spec_list_string to avoid warning.
7028 * src/hostid.c: Don't include <unistd.h>. system.h already does that.
7030 * src/cut.c (set_fields): Mark all selected indices before trying to
7031 determine range endpoints.
7032 * tests/cut/Test.pm: New test for the above fix.
7034 Begin to address this comment: What if someone wants to
7035 extract the 1,000,000-th field of some huge input file?
7036 The first step is to rearrange things so that the values
7037 in the printable_field array are all 0/1 rather than 0/1/2.
7038 * src/cut.c (RANGE_START_SENTINEL): Remove.
7039 Store range-start indices in a hash table, rather than
7040 overloading the `printable_field' array.
7041 (range_start_ht): New global.
7042 (hash_int, hash_compare_ints, is_range_start_index): New functions.
7043 (print_kth): Use is_range_start_index; don't test printable_field.
7044 (set_fields): Detect overflow.
7045 (set_fields): Insert each range-start index into range_start_ht.
7046 (main): Call set_fields only once, and only after
7047 output_delimiter_specified and (if required) range_start_ht have
7050 2003-07-20 Paul Eggert <eggert@twinsun.com>
7052 * src/wc.c (get_input_fstatus): Fix typo: `stat' was being
7053 invoked with a null pointer when there were no file arguments.
7055 2003-07-20 Jim Meyering <jim@meyering.net>
7057 * Makefile.maint (sc_changelog): Add another nit-picky check.
7059 * src/wc.c (write_counts): Add a comment.
7060 (wc): Rename `file' parameter.
7061 Set new local, `file', to be the file name, or (when it's NULL)
7062 _("standard output") so that all uses of `file' use the proper value.
7063 Use STREQ, not strcmp.
7065 2003-07-20 Paul Eggert <eggert@twinsun.com>
7067 wc count field widths now are heuristically adjusted depending
7068 on the input size, if known. If only one count is printed, it
7069 is guaranteed to be printed without leading spaces.
7071 Previously, wc did not align the count fields if
7072 POSIXLY_CORRECT was set, but POSIX did not actually require
7073 this undesirable behavior, so it has been removed.
7075 * NEWS: Document this.
7076 * doc/coreutils.texi (wc invocation): Likewise.
7078 * src/wc.c (number_width): New var.
7079 (posixly_correct): Remove.
7080 (struct fstatus): New struct.
7081 (write_counts): Output fields of width number_width.
7082 Do not worry about POSIXLY_CORRECT.
7083 Use null file, not empty-string file, to denote stdin,
7084 since "" is a valid file name on some hosts.
7085 (wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
7087 (wc): Avoid problems if end_pos - current_pos overflows.
7088 Do not print odd message if stdin has a read error.
7089 (get_input_fstatus, compute_number_width): New functions.
7090 (main): Use them to implement the new behavior.
7091 Ignore POSIXLY_CORRECT.
7093 * tests/wc/Test.pm: Adjust to the new output widths.
7095 2003-07-19 Jim Meyering <jim@meyering.net>
7097 * tests/rm/fail-eperm: Don't create temporary directory --
7100 * tests/shred/remove: Don't open-code test for UID != 0.
7101 Use priv-check's require-non-root instead.
7102 Update to use newer framework.
7104 * tests/help-version (expected_failure_status_expr): Record that
7105 expr exits with status of 3 for e.g., a write error.
7107 * tests/priv-check: Use `id -u' to see if we're running as root,
7108 rather than trying go write to an write-protected file.
7109 When running as root, ensure $NON_ROOT_USERNAME is valid.
7110 When running as root with `require-non-root', ensure that `.'
7111 is writable by $NON_ROOT_USERNAME, then reinvoke $0 set-user-ID
7112 to $NON_ROOT_USERNAME. If `.' is not writable, then skip the test.
7114 * src/printenv.c: Include "exitfail.h".
7115 (main): Set exit_failure rather than calling close_stdout_set_status.
7116 * src/date.c: Likewise.
7117 * src/sort.c: Likewise.
7118 * src/tty.c: Likewise.
7120 2003-07-18 Jim Meyering <jim@meyering.net>
7122 * tests/touch/not-owner: Update to use newer framework.
7124 * tests/rm/fail-eperm: Use $srcdir/../priv-check, create a temporary
7125 directory, and remove Perl-coded `you may not run as root' test.
7126 * tests/cp/fail-perm: Use $srcdir/../priv-check, rather than
7127 hard-coding something not quite equivalent.
7128 Paul Jarc reported the inconsistent diagnostics.
7130 * src/sort.c (main): Use close_stdout via atexit.
7131 Now `sort --version' and `sort --help' fail, as they should
7132 when their output is redirected to /dev/full.
7134 * src/su.c (usage): Don't call close_stdout here.
7135 (main): Use close_stdout via atexit.
7136 Now `su --version > /dev/full' fails, as it should.
7137 Somehow, the change of 2000-05-07 that purports to fix this
7140 * tests/help-version (--help/--version vs. /dev/full): Special-case
7141 `[' to protect it from expected_failure_status-`eval'.
7143 * src/uniq.c (writeline): Use a SPACE, not a TAB between the
7144 count and the corresponding line, as required by POSIX.
7145 Reported by Clement Wang.
7146 * tests/uniq/Test.pm (101, 102): Update tests of -c accordingly.
7148 * tests/expr/basic: Add tests for when exit status is 2.
7150 * src/nohup.c (NOHUP_FOUND_BUT_CANNOT_INVOKE, NOHUP_FAILURE):
7151 Use an anonymous `enum', rather than #define.
7153 2003-07-17 Paul Eggert <eggert@twinsun.com>
7155 * src/expr.c: Include "exitfail.h", "quotearg.h".
7156 (EXPR_INVALID, EXPR_ERROR): New constants.
7157 (nomoreargs, null, toarith, nextarg): Return bool, not int.
7158 (syntax_error): New function, exiting with status 2. Use it
7159 insteading of printing "syntax error" ourselves.
7160 (main): Initialize exit_failure to EXPR_ERROR.
7161 Exit with EXPR_INVALID on syntax error (too few arguments).
7162 (nextarg): Use strcmp, not strcoll; strcoll might return
7163 an undesirable 0, or might fail.
7164 (docolon, eval4, eval3): Exit with status 3 on invalid argument type
7165 or other such error.
7166 (eval2): Report an error if strcoll fails in a string comparison.
7167 * src/sort.c: Include "exitfail.h".
7168 (main): Set exit_failure, not xalloc_exit_failure and
7169 xmemcoll_exit_failure.
7170 * tests/expr/basic: Invalid value exits with status 3, not 2.
7172 2003-07-16 Jim Meyering <jim@meyering.net>
7174 * configure.ac (AC_INIT): Use 5.0.90 as the version, rather than 5.0.2,
7175 per GNU maintainer guidelines. The next non-beta release will be 5.1.
7177 This script would have caught at least two recent bugs:
7178 those in [ and kill.
7179 * tests/help-version: Revive this script.
7180 It wasn't doing anything useful, since $all_programs wasn't being
7181 defined by the invoking Makefile.am.
7182 Reflect that nohup is no longer a script, so don't exclude it.
7183 Add framework to handle the programs added since it was last run:
7184 kill, stat, unlink, [, link, readlink.
7185 Fix path-related problems deriving from the move of this script
7186 from src/ to its present location.
7187 * tests/Makefile.am (all_programs): Define.
7188 (TESTS_ENVIRONMENT): Use it.
7190 * src/kill.c (main): Fix bug introduced on 2003-05-10 (for 5.0.1)
7191 whereby kill would always attempt to operate on argv[0] and fail.
7193 * src/test.c (integer_expected_error): Improve diagnostic -- now,
7194 it also matches the one from bash's builtin test.
7195 (binary_operator): Add \n at end of diagnostic.
7197 * tests/rm/fail-2eperm: Remove setuidgid-related code. Move it to ...
7198 * tests/priv-check: Move setuidgid-related and
7199 NON_ROOT_USERNAME-checking code to this file.
7201 * README: Update section on testing as `root'.
7202 Suggestion from Paul Jarc.
7204 * src/test.c (AUTHORS): Replace 3-letter usernames with the actual
7205 names of authors that I just found in bash's builtins/test.def.
7207 Running `[' with no arguments would evoke a segfault.
7208 * src/test.c (main) [LBRACKET]: Move initialization of argv to
7209 precede potential use via test_syntax_error.
7211 * src/Makefile.am (AM_CPPFLAGS): Rename from `INCLUDES', to avoid
7212 warning from automake -Wall.
7214 2003-07-15 Jim Meyering <jim@meyering.net>
7218 * Makefile.maint (%.asc): Remove target first, so gpg doesn't
7221 * announce-gen (print_changelog_deltas): Relax tests for matching
7222 version-number line in NEWS.
7223 Change the .sig suffix to .asc here, too.
7225 2003-07-14 Jim Meyering <jim@meyering.net>
7227 * Makefile.maint (%.asc): Renamed from %.sig.
7228 Generate and use ascii-armored signatures.
7229 Use gpg's -o option.
7231 2003-07-13 Jim Meyering <jim@meyering.net>
7233 * src/nohup.c (NOHUP_FAILURE, NOHUP_FOUND_BUT_CANNOT_INVOKE): Define.
7236 * Makefile.maint (syntax-check): Move each individual check into
7238 (syntax-check-rules): This is the list of syntax-check targets.
7239 (sc_unmarked_diagnostics, sc_cast_of_argument_to_free):
7240 (sc_cast_of_x_alloc_return_value, sc_space_tab):
7241 (sc_error_exit_success, sc_xalloc_h_in_src): New targets.
7243 2003-07-12 Jim Meyering <jim@meyering.net>
7245 * configure.ac: Remove uses of OPTIONAL_BIN_ZCRIPTS and last
7246 traces of the nohup script.
7248 * src/Makefile.am (bin_SCRIPTS): Remove use of just-removed
7249 $(OPTIONAL_BIN_ZCRIPTS).
7251 * src/Makefile.am (localedir.h): Put the `2>&1' after the redirect
7252 target, not before the `>'.
7254 * src/remove.c (remove_dir): Give a diagnostic upon failed save_cwd,
7255 now that that function no longer calls `error'.
7257 * src/df.c (find_mount_point): Emit a diagnostic for each
7258 failed syscall, rather than relying on caller to do that.
7259 The caller couldn't do a good job, anyhow -- too many different
7260 ways to fail (each with a different referent).
7261 Give a diagnostic upon failed save_cwd, now that that function
7262 no longer calls `error'.
7263 (show_point): Don't diagnose find_mount_point's errors, now that
7264 it handles them itself.
7266 * src/df.c (find_mount_point): Don't let free clobber errno upon
7269 * src/sys2.h: Remove alloca-related block.
7270 * src/system.h: Include <alloca.h> here, instead.
7272 It appears that the `#pragma alloca' included via "system.h" is
7273 adequate, since join.c uses alloca, yet lacked an in-file #pragma.
7274 * src/copy.c, src/cp.c, src/df.c, src/install.c, src/ln.c:
7275 * src/ls.c, src/mv.c, src/remove.c: Remove `#pragma alloca'.
7277 * src/chown-core.c (change_file_owner): Do not restore any special
7278 permission bits (e.g., set-user-ID, set-group-ID) that are reset
7279 by chown(2) on some systems. Suggestion and insistence :-) from
7282 * tests/input-tty: Also check `test -t 1'.
7283 This is necessary on linux-2.4.21. Otherwise, the stty/basic-1
7284 test would block when run in the background.
7286 2003-07-11 Jim Meyering <jim@meyering.net>
7288 * tests/sample-test: Also fail if cat-to-create-expected-output
7289 fails. Otherwise, if both `exp' and `out' were to end up empty
7290 because of e.g., a full disk, they would mistakenly compare equal.
7292 * src/nohup.c: New file. Rewrite of nohup.sh in C.
7293 This solves a portability problem: on at least Solaris systems,
7294 when nohup.sh used the vendor /bin/sh, it would exit with status
7295 of `1' rather than the required 126 or 127 upon failure to exec
7296 the specified program.
7298 * src/Makefile.am (EXTRA_SCRIPTS): Remove definition.
7299 (bin_PROGRAMS): Add nohup.
7300 (EXTRA_DIST): Remove nohup.sh.
7301 (all_programs): Remove use of $(EXTRA_SCRIPTS).
7302 * src/nohup.sh: Remove file.
7303 * man/Makefile.am (nohup.1): Depend on nohup.c, rather than nohup.sh.
7305 * tests/misc/nohup: Tests for the above.
7306 * tests/misc/Makefile.am (TESTS): Add nohup.
7308 * src/head.c (diagnose_copy_fd_failure): New function, renamed from
7309 the macro, COPY_FD_DIAGNOSE.
7310 (diagnose_copy_fd_failure): Enclose diagnostic in _(...).
7311 (head_file): Likewise.
7313 * src/date.c: Include "quote.h".
7314 (batch_convert): Use the quote function rather than using literal `...'
7317 * src/setuidgid.c (main): Enclose diagnostic in _(...).
7318 * src/fmt.c (main): Likewise.
7319 * src/mknod.c (main): Likewise.
7320 * src/tac.c (tac_seekable): Likewise.
7321 * src/yes.c (main): Likewise.
7322 * src/od.c (main): Likewise.
7323 * src/install.c (change_attributes): Likewise.
7325 2003-07-10 Jim Meyering <jim@meyering.net>
7327 * src/head.c (usage): Use 1024*1024 in place of 1048576.
7328 * src/tail.c (usage): Likewise.
7330 * tests/rm/fail-2eperm: Now that we have setuidgid, use it in
7331 place of the kludge in this test. Suggestion from Paul Jarc.
7333 * src/Makefile.am (noinst_PROGRAMS): Define to setuidgid.
7334 * src/setuidgid.c: New program, solely for testing (not installed).
7336 * src/chown-core.c (change_file_owner): Don't leak file descriptors
7337 when dereferencing symlinks.
7339 2003-07-09 Jim Meyering <jim@meyering.net>
7341 * tests/du/slash: New file/test for today's lib/ftw.c fix.
7342 * tests/du/Makefile.am (TESTS): Add slash
7344 * src/tail.c (xlseek): Avoid warning about ``return without value
7345 from function returning non-void''.
7347 2003-07-08 Jim Meyering <jim@meyering.net>
7349 * man/help2man: Update to version 1.29.
7351 * man/help2man: Add END handler to close STDOUT and check for errors.
7353 2003-06-30 Paul Eggert <eggert@twinsun.com>
7355 Add support for a "[" that conforms to the GNU coding standards,
7356 i.e., that does not depend on its name.
7357 * src/lbracket.c: New file.
7359 * man/Makefile.am (programs): Ignore "[", since it doesn't have
7360 a separate man page.
7361 * src/Makefile.am (bin_PROGRAMS): Add "[".
7362 (__SOURCES): New var.
7363 * src/test.c (LBRACKET): Define to 0 if not defined.
7364 (main): Use LBRACKET rather than argv[0].
7366 * src/test.c (one_argument): Do not check for -t if POSIXLY_CORRECT.
7367 Reported by Paul Jarc and Dan Jacobson.
7369 * src/test.c (main): Do not recognize --help or --version if
7370 POSIXLY_CORRECT, when invoked as "test". Handle "[ ]" correctly.
7371 Do not bother testing that margv[margc] is non-null.
7373 2003-07-04 Jim Meyering <jim@meyering.net>
7375 * src/who.c (print_line): Rewrite to use asprintf, in order to be
7376 able to avoid emitting trailing spaces. Reported by Dan Jacobson.
7378 * tests/misc/head-elide-tail: Add tests of head's new --lines=-N
7379 option, and perform the +1600 invocations of head IFF the envvar
7380 RUN_EXPENSIVE_TESTS is set.
7382 2003-07-03 Jim Meyering <jim@meyering.net>
7384 * src/cp.c (do_copy): Give a better diagnostic when failing due
7385 to nonexistent destination directory. Reported by Dmitry Rutsky.
7386 See http://bugs.debian.org/199730 for details.
7388 2003-06-27 Jim Meyering <jim@meyering.net>
7390 split's --verbose option did nothing [broken in 4.5.10 and 5.0]
7391 * src/split.c (longopts): Use `1', not `0' as the value for
7392 for &verbose. Reported by Keith Thompson.
7394 Test for the above fix.
7395 * tests/misc/split-a: Also use --verbose and compare stderr
7396 output with what we'd expect.
7398 2003-06-20 Jim Meyering <jim@meyering.net>
7400 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
7401 Use `error_t' (rather than int) as type for local `err'.
7402 From Alfred M. Szmidt.
7404 2003-06-19 Marcus Brinkmann <marcus@gnu.org>
7406 * src/copy.c (copy_internal) [HAVE_STRUCT_STAT_ST_AUTHOR]:
7407 Fix author preservation code.
7409 2003-06-19 Jim Meyering <jim@meyering.net>
7411 * src/ln.c (ENABLE_HARD_LINK_TO_SYMLINK_WARNING): Define to 0.
7412 (do_link): Don't warn about hard link to symlink.
7414 2003-06-18 Jim Meyering <jim@meyering.net>
7416 * src/cut.c: Include "getdelim2.h", not "getstr.h".
7417 Reflect renaming: getstr -> getdelim2.
7419 * src/comm.c, src/join.c, src/nl.c, src/uniq.c: Reflect renaming:
7420 readline -> readlinebuffer.
7422 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
7424 * src/readlink.c: Include <sys/types.h> before system.h (because
7425 the latter includes <sys/stat.h>). Required on Ultrix 4.3.
7427 2003-06-17 Jim Meyering <jim@meyering.net>
7429 * src/system.h (initialize_main): Define.
7430 Use it in every `main'. Applied via this:
7431 p='initialize_main (&argc, &argv);'
7432 perl -ni -e '/program_name.=.argv.0/ and print " '"$p"'\n"; print' \
7433 $(grep -l program_name.=.argv.0 *.c)
7434 test.c uses margc/margv, so I made the change manually for that file.
7435 Based on a patch from Bernard Giroud.
7437 2003-06-09 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
7439 Fix for build failure on Ultrix 4.3.
7440 * src/stat.c: Include sys/statvfs.h in preference to sys/vfs.h.
7441 Include sys/param.h and sys/mount.h on ultrix.
7443 2003-06-16 Jim Meyering <jim@meyering.net>
7445 * src/touch.c (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Remove
7447 * src/system.h (O_NDELAY, O_NONBLOCK, O_NOCTTY, EISDIR): Define
7448 them here instead, but with one change: define EISDIR to -1, not 0.
7450 * src/cat.c (cat): Remove `#ifndef ENOSYS', now that it's
7451 guaranteed to be defined.
7452 * src/system.h (ENOSYS, ENOTSUP): Define to -1 if not defined.
7454 * README: Mention the CVS repository.
7455 Encourage addition of test cases.
7457 2003-06-12 Jim Meyering <jim@meyering.net>
7459 * src/touch.c (touch): Call close only if necessary.
7462 * src/wc.c (usage): Correct wording: wc prints counts in the order
7463 `newline, word, byte'. Reported by Keith M. Briggs.
7464 * man/wc.x: Fix it here, too. And change `lines' to `newlines'.
7466 2003-06-10 Jim Meyering <jim@meyering.net>
7468 * tests/date/Test.pm: Add a test for the new format, e.g., May-23-2003.
7470 2003-06-07 Jim Meyering <jim@meyering.net>
7472 * Makefile.maint (syntax-check): Add commented-out (over-aggressive)
7475 2003-06-06 Jim Meyering <jim@meyering.net>
7477 * src/extract-magic (main): Avoid newer 3-arg form of open,
7478 so this script works also with e.g., perl5.005_03.
7479 Patch by John David Anglin.
7481 2003-06-04 Paul Eggert <eggert@twinsun.com>
7483 * src/system.h: Include <stdbool.h> unconditionally.
7485 2003-06-04 Jim Meyering <jim@meyering.net>
7487 * man/Makefile.am (check-programs-vs-x): Rename target
7488 from check-programs-vs-1. Adjust rule to check for the
7489 primary (.x) file, not the generated one (.1).
7491 2003-06-03 Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu>
7493 * man/kill.x: New file.
7494 * man/Makefile.am (dist_man_MANS): Add kill.1.
7497 2003-06-04 Jim Meyering <jim@meyering.net>
7499 Ensure that the .x file for a new program is never forgotten again.
7500 * man/Makefile.am (programs): Define.
7501 (check-programs-vs-1): New phony target.
7502 (check-local): Depend on it.
7504 2003-06-03 Jim Meyering <jim@meyering.net>
7506 Avoid unnecessary copying of environment.
7507 * src/env.c (main): Rather than clearing the environment and --
7508 unless told to ignore environment -- copying all settings from
7509 the saved, original environment, clear the environment only when
7510 that is requested. Suggested by Jens Elkner.
7512 2003-06-02 Jim Meyering <jim@meyering.net>
7514 * src/system.h: Always include <string.h>, since we assume C89.
7515 Include <limits.h> without checking for HAVE_LIMITS_H.
7517 * src/test.c [!TEST_STANDALONE]: Remove #if-0'd block.
7518 (STREQ, S_IXUGO): Remove redundant (in system.h) definitions.
7520 2003-06-01 Jim Meyering <jim@meyering.net>
7522 Avoid a race condition in `tail -f' described by Ken Raeburn in
7523 http://mail.gnu.org/archive/html/bug-textutils/2003-05/msg00007.html
7524 * src/tail.c (file_lines): Add new parameter, *read_pos, and set it.
7525 (pipe_lines, pipe_bytes, start_bytes, start_lines): Likewise.
7526 (tail_bytes, tail_lines, tail): Likewise.
7527 (tail_file): Use the new `read_pos' value as the size,
7528 rather than stats.st_size from the fstat call.
7530 2003-05-28 Jim Meyering <jim@meyering.net>
7532 * src/extract-magic: Allow expansion of `$file' in the here-
7533 document corresponding to the comment at the top of fs.h.
7535 2003-05-26 Jim Meyering <jim@meyering.net>
7537 * src/stat.c: Fix portability problem on FreeBSD5.0: don't include
7538 <sys/statvfs.h> on systems without HAVE_STRUCT_STATVFS_F_BASETYPE.
7539 Use #if/#elif/... cascade so we get only one set of include files.
7540 Reported by Nelson Beebe.
7542 2003-05-24 Jim Meyering <jim@meyering.net>
7544 * src/md5sum.c (split_3): Accept the BSD format only when in MD5 mode.
7545 * tests/sha1sum/basic-1: Make sure `sha1sum --check' doesn't
7546 accept the BSD format.
7548 2003-03-28 Joe Orton <jorton@redhat.com>
7550 * src/md5sum.c (bsd_split_3): New function.
7551 (split_3): Detect checksums from BSD 'md5' command and handle them
7554 * tests/md5sum/basic-1: New tests for --check exit status, and for
7555 BSD-style checksum files.
7557 2003-05-21 Jim Meyering <jim@meyering.net>
7559 * src/head.c (elide_tail_lines_pipe): Fix a thinko.
7560 This sort of thing is why it'd be *Really Good* to factor
7561 out the common code used here and in tail.c.
7563 2003-05-14 Jim Meyering <jim@meyering.net>
7565 * src/head.c (usage): Document new feature: --bytes=-N and --lines=-N.
7567 * tests/du/slink: Skip this test if `.' is on an XFS file system.
7569 * tests/du/fd-leak: New file. Test for the bug in du that
7570 was fixed by the 2003-05-12 change to lib/ftw.c.
7571 * tests/du/Makefile.am (TESTS): Add fd-leak.
7573 * src/head.c (AUTHORS): Enclose string in N_(...), now that it
7574 includes a translatable word, `and'.
7576 * src/dd.c (usage): Don't use `,' as the thousands separator
7577 in e.g. 1,000,000 and 1,048,576. Instead, do this:
7578 `SIZE may be ..., MB 1000*1000, M 1024*1024 and so on...'
7579 * src/df.c (usage): Likewise.
7580 * src/du.c (usage): Likewise.
7581 * src/ls.c (usage): Likewise.
7583 * Makefile.maint (syntax-check): Add another check.
7585 2003-05-13 Paul Eggert <eggert@twinsun.com>
7587 Fix uniq to conform to POSIX, which requires that "uniq -d -u"
7588 must output nothing. Problem reported by Josh Hyman.
7590 * src/uniq.c (enum output_mode, mode): Remove, replacing with:
7591 (output_unique, output_first_repeated, output_later_repeated):
7592 New vars. All uses of "mode" changed to use these variables,
7593 which are not mutually exclusive as "mode" was.
7594 (writeline): New arg "match", used to control whether to
7595 obey output_first_repeated or output_later_repeated.
7596 All callers changed.
7597 (check_file, main): Adjust to above changes.
7599 * tests/uniq/Test.pm: Test that 'uniq -d -u' outputs nothing.
7601 2003-05-14 Jim Meyering <jim@meyering.net>
7603 * tests/rm/rm3: Use tr's \n notation rather than \012.
7604 This package can afford to do that, since its tests are guaranteed use
7605 GNU tr, which has accepted the more modern notation for 10 years.
7606 * tests/rm/rm5: Likewise.
7607 * tests/cp/same-file: Likewise.
7608 * tests/stty/row-col-1: Likewise.
7609 * tests/stty/basic-1: Likewise.
7610 * tests/rm/deep-1: Likewise.
7611 * tests/mv/part-symlink: Likewise.
7612 * tests/mkdir/perm: Likewise.
7613 * tests/misc/nice: Likewise.
7615 2003-05-13 Jim Meyering <jim@meyering.net>
7617 * src/copy.c (struct F_triple) [name]: Remove const attribute.
7618 (triple_free): Don't apply cast to argument of free.
7619 (seen_file): Add cast here instead.
7621 * src/cp-hash.c (struct Src_to_dest) [name]: Remove const attribute.
7622 (src_to_dest_free): Don't apply cast to argument of free.
7624 * src/sort.c (zaptemp): Don't apply cast to argument of free.
7625 * src/pr.c (init_fps, init_store_cols): Likewise.
7626 * src/join.c (delseq, freeline): Likewise.
7627 * src/expr.c (OLD): Likewise.
7628 * src/sort.c (sort): Likewise.
7629 * src/head.c (elide_tail_lines_pipe): Likewise.
7631 * src/tail.c: Include "quote.h".
7632 Use quote in diagnostics. Change many error format strings
7633 from just `%s' to e.g., `error reading %s'.
7634 (pipe_lines): Change type of parameter, n_lines, to uintmax_t.
7635 Rewrite newline-counting loop to use memchr.
7637 * src/head.c (elide_tail_lines_pipe): Use `if', not assert.
7638 Now that assert is no longer used, don't include <assert.h>.
7640 2003-05-12 Jim Meyering <jim@meyering.net>
7642 * src/head.c: Include <assert.h>.
7643 (AUTHORS): Add my name.
7644 (elide_tail_lines_pipe): New function.
7646 2003-05-10 Jim Meyering <jim@meyering.net>
7648 * Makefile.maint (syntax-check): Check for `error (EXIT_SUCCESS,'.
7650 * src/readlink.c (main): Set program_name before first use.
7651 Remove that (redundant) first use.
7652 Don't exit successfully just because --verbose was specified.
7653 Pass 0, not EXIT_SUCCESS, as first argument to error; when that
7654 parameter is 0, error does not exit.
7656 * src/uname.c (main): When failing due to too many arguments, also say
7657 that, rather than just "Try `uname --help' for more information.".
7658 * src/comm.c (main): Likewise, but for too few arguments.
7659 * src/logname.c: Include error.h.
7660 (main): Say why we're failing.
7662 * src/uniq.c (main): Don't segfault when argc < optind.
7663 * src/who.c (main): Handle argc < optind.
7664 * src/df.c (main): Likewise.
7665 * src/install.c (main): Likewise.
7666 * src/mv.c (main): Likewise.
7667 * src/pwd.c (main): Likewise.
7668 * src/tty.c (main): Likewise.
7669 * src/chroot.c (main): Likewise.
7670 * src/hostname.c: Likewise.
7671 * src/du.c (main): Likewise.
7672 * src/expand.c (main): Likewise.
7673 * src/env.c (main): Likewise.
7674 * src/unexpand.c (main): Likewise.
7675 * src/printenv.c (main): Likewise.
7676 * src/sync.c (main): Handle argc == 0.
7677 * src/expr.c (main): Likewise.
7678 * src/printf.c (main): Likewise.
7679 * src/basename.c (main): Likewise.
7680 * src/ln.c (main): Test for `missing argument' before computing n_files.
7681 * src/tail.c (main): Test for the case of no arguments before
7684 * src/kill.c (send_signals): Don't check command line arguments here.
7685 (main): Check them here instead. Handle argc < optind.
7687 * src/logname.c (main): Use error, rather than fprintf, for the sake
7690 * src/rm.c (main): Don't overrun array bound if argc is 0.
7692 2003-05-09 Jim Meyering <jim@meyering.net>
7694 * src/sort.c (main): Don't overrun array bound if argc is 0.
7695 That would happen when invoked via: execl ("/usr/bin/sort", NULL);
7696 Reported by Wartan Hachaturow.
7698 2003-05-07 Jim Meyering <jim@meyering.net>
7700 Implement support so that `head --lines=-N' works on seekable files.
7701 * src/head.c (enum Copy_fd_status): Define.
7702 (COPY_FD_DIAGNOSE): New macro.
7703 (elide_tail_lines_seekable): New funtion.
7704 (elide_tail_lines_file): Call it here.
7706 2003-05-06 Jim Meyering <jim@meyering.net>
7708 * src/sys2.h (CHAR_BIT): Remove duplicate definition.
7710 2003-05-04 Jim Meyering <jim@meyering.net>
7712 * tests/head/Test.pm: Remove tests of --bytes=-N; using that framework
7713 caused the addition of thousands of small files to the tar archive.
7714 * tests/misc/head-elide-tail: New file. Add them here instead.
7715 * tests/misc/Makefile.am (TESTS): Add head-elide-tail.
7717 2003-05-04 Paul Eggert <eggert@twinsun.com>
7719 * src/remove.c (HAVE_WORKING_READDIR): Define to 0 if not defined.
7720 (IF_READDIR_NEEDS_REWINDDIR): Remove.
7721 (remove_cwd_entries): Rewrite to avoid IF_READDIR_NEEDS_REWINDDIR,
7722 which was a bit weird because it couldn't be emulated by a function.
7724 2003-05-03 Jim Meyering <jim@meyering.net>
7726 Extend head to accept --lines=-N (--bytes=-N) and to print all
7727 but the N lines (bytes) at the end of the file.
7728 * src/head.c: Include full-write.h, full-read.h, inttostr.h, quote.h.
7729 Use quote() in diagnostics, rather than literal `' marks.
7730 (copy_fd, elide_tail_bytes_pipe, elide_tail_bytes_file):
7732 (elide_tail_lines_pipe, elide_tail_lines_file): New functions.
7733 (head_file): Reorganize so as to call head from only one place.
7734 (main): Likewise, for head_file.
7735 Handle new, undocumented option, --presume-input-pipe.
7736 Handle negative line and byte counts.
7737 * tests/head/Test.pm: Add lots of tests to exercise --bytes=-N.
7739 * tests/du/8gb: Skip test if the file system of `.' doesn't support
7740 sparse files -- otherwise it'd create a file of size 8GB.
7742 2003-05-02 Jim Meyering <jim@meyering.net>
7744 * src/fmt.c (usage): Don't mention obsolescent -WIDTH option.
7745 Instead explain about `-' and standard input.
7746 (main): Give a proper diagnostic for e.g., `fmt -c -72'.
7747 Reported by Keith Thompson.
7748 * tests/fmt/basic: Add test for the above fix.
7750 * src/fmt.c: Include "quote.h".
7751 Use quote() in diagnostics, rather than literal `' marks.
7752 (main): Exit nonzero when unable to open an input file.
7753 * tests/fmt/basic: Add test for the above fix.
7755 * src/fmt.c (main): Diagnose invalid suffix on obsolescent width
7756 specifications like `-72x'.
7757 * tests/fmt/basic: Add test for the above fix.
7759 Work around nasty readdir bug on Darwin6.5.
7760 * src/remove.c (IF_READDIR_NEEDS_REWINDDIR): Define.
7761 [! HAVE_WORKING_READDIR] (remove_cwd_entries): If readdir has just
7762 returned NULL and there has been at least one successful unlink or
7763 rmdir call since the opendir or previous rewinddir, then call
7764 rewinddir and reiterate the loop.
7766 Factor out common code.
7767 * src/remove.c (readdir_ignoring_dotdirs): New function.
7768 (is_empty_dir): Use it here.
7769 (remove_cwd_entries): Use it here.
7771 2003-05-01 Jim Meyering <jim@meyering.net>
7773 * tests/rm/r-3: Create 500 rather than just 300 files.
7774 There's a bug in Darwin6.5's readdir that shows up only with
7776 Fix a bug in this test: `cd $pwd' (not to `..'), now that $tmp
7780 Change type of n_units, n_bytes, n_lines to be `uintmax_t'.
7781 (dump_remainder): Move two declarations `down' into the scope
7782 where they are used.
7783 (xlseek): Return the resulting offset.
7784 (file_lines): Rename parameter, file_length, to end_pos.
7785 (pipe_lines): Don't coerce safe_read return value to `int'.
7786 Adapt tests accordingly.
7787 (pipe_bytes) [struct charbuffer] (nbytes): Change type from `int'
7789 Change type of `total_bytes' from `int' to `size_t',
7790 since the former wouldn't always be wide enough.
7791 Don't coerce safe_read return value to `int',
7792 and adapt tests accordingly.
7793 Now that testing for a read error no longer involves
7794 using `tmp', handle that case *after* freeing `tmp'.
7795 (start_bytes): Clean up.
7796 (tail_bytes): Now that `n_bytes' may be larger than
7797 OFF_T_MAX, test for that condition and, if it's true, don't
7798 use lseek optimizations.
7799 (parse_options): Don't fail just because N_UNITS is larger than
7800 the maximum size of a file -- tail may be applied to an input
7801 stream (e.g., a pipe) with more data than that.
7803 * Makefile.maint (syntax-check): Rename from alloc-check.
7804 Also check for SPACE-TAB sequences.
7805 Also check for malloc/calloc/realloc casts.
7807 2003-05-01 Jim Meyering <jim@meyering.net>
7809 * src/tail.c (start_lines): Rewrite to use memchr. Clean up.
7811 2003-04-28 Jim Meyering <jim@meyering.net>
7813 * tests/misc/tty-eof: Send two tokens, not just one, so we don't
7814 make the now-more-picky tsort fail.
7816 2003-04-24 Jim Meyering <jim@meyering.net>
7818 * src/tsort.c (tsort): Remove unnecessary test of have_read_stdin.
7819 (main): Minor syntactic clean-up.
7821 * src/tsort.c (tsort): Fail if the input contains an odd number of
7822 tokens. Reported by junkio@cox.net.
7824 * tests/tsort/basic-1: Test for the above fix.
7826 2003-04-21 Jim Meyering <jim@meyering.net>
7828 * tests/misc/printf: Add tests for the printf fixes below.
7830 * Makefile.cfg (cvs_files): Add $(srcdir)/config/depcomp to the list.
7832 2003-04-20 Paul Eggert <eggert@twinsun.com>
7834 Fix printf POSIX compatibility bug reported by Ben Harris in
7835 <http://mail.gnu.org/archive/html/bug-coreutils/2003-04/msg00070.html>.
7836 * doc/coreutils.texi (printf invocation): It's \NNN in the format,
7837 \0NNN in the %b operand.
7838 * src/printf.c (usage): Likewise.
7839 (print_esc): New arg OCTAL0 to specify whether \0NNN or \NNN
7840 is desired. All uses changed. Behave like Bash printf if %b
7841 operand uses \NNN where the initial N is not 0.
7843 2003-04-17 Jim Meyering <jim@meyering.net>
7845 * src/stty.c: Remove uses of PROTOTYPE macro.
7847 2003-04-15 Jim Meyering <jim@meyering.net>
7849 * Makefile.maint: Remove (or replace-with-TAB(s) to retain alignment)
7850 each sequence of spaces before a TAB character.
7852 2003-04-13 Jim Meyering <jim@meyering.net>
7854 * src/remove.c (is_empty_dir): Don't closedir (NULL).
7856 2003-04-12 Jim Meyering <jim@meyering.net>
7858 Giving nl an invalid STYLE argument (in --header-numbering=STYLE (-h),
7859 --body-numbering=STYLE (-b), or --footer-numbering=STYLE (-f)) or
7860 FORMAT (--number-format=FORMAT (-n)) would not give a useful diagnostic.
7861 * src/nl.c (main): Fix those problems and remove literal quote marks
7862 (e.g., "`%s'") from format string; instead use "%s" in each format
7863 string and `quote (optarg)' as the corresponding argument.
7864 Also, diagnose all invalid command line options before failing.
7866 * src/nl.c (proc_text): Fix a bug that would make nl output extra
7867 newlines in some cases. Details here: http://bugs.debian.org/177256.
7868 This bug was introduced on 2001-11-10 for textutils-2.0.17.
7869 * tests/misc/nl: Add test for the above-fixed bug.
7871 * tests/misc/readlink: New file. Test the --canonicalize option.
7872 * tests/misc/Makefile.am (TESTS): Add readlink.
7874 2003-04-11 Jim Meyering <jim@meyering.net>
7877 * src/chown.c, src/cp.c, src/dircolors.hin, src/du.c, src/ln.c:
7878 * src/mkfifo.c, src/ptx.c, src/spline.c, src/stty.c, src/tail.c:
7879 * src/test.c, src/unexpand.c: Remove (or replace-with-TAB(s) to
7880 retain alignment) each sequence of spaces before a TAB character.
7882 * src/ls.c: Include <stdlib.h> unconditionally.
7884 * Makefile.maint (xalloc-check): Rename from header-check.
7886 * src/yes.c: Include error.h after system.h, not before.
7889 * src/copy.c, src/cp-hash.c, src/cp.c, src/csplit.c, src/cut.c:
7890 * src/date.c, src/df.c, src/du.c, src/expand.c, src/expr.c, src/id.c:
7891 * src/join.c, src/md5sum.c, src/nl.c, src/od.c, src/paste.c, src/pr.c:
7892 * src/ptx.c, src/sort.c, src/split.c, src/su.c, src/tail.c, src/tee.c:
7893 * src/tr.c: * src/unexpand.c, src/users.c:
7894 Remove anachronistic casts of xmalloc, xrealloc, and xcalloc
7895 return values and of xrealloc's first argument.
7896 Fix the former with this:
7897 perl -pi -e 's/\([^(]*?\*\) *(x(m|c|re)alloc)\b/$1/'
7899 2003-04-10 Jim Meyering <jim@meyering.net>
7901 * src/stty.c (wrapf): Declare with format attribute.
7903 The S_MAGIC_... names shouldn't be maintained in two places (prior
7904 to this change, one would have to keep stat.c and fs.h in sync).
7905 This change makes it so those names and the corresponding
7906 hexadecimal constants all reside in stat.c. fs.h is now generated.
7907 * src/Makefile.am (fs.h): New rule to generate fs.h from stat.c.
7908 (BUILT_SOURCES): Add fs.h, now that it's generated.
7909 (EXTRA_DIST): Add extract-magic.
7910 * src/extract-magic: New script to extract fs.h definitions from stat.c.
7911 * src/stat.c (human_fstype) [__linux__]: Append each hex constant from
7912 fs.h in a comment after the corresponding `case S_MAGIC_...:' statement.
7914 * tests/tail-2/big-4gb: Skip this test (don't fail) if creating a
7915 file with nominal length > 4GB fails. Reported by Michael Deutschmann.
7917 * man/unexpand.x: Add `SEE ALSO' reference to expand.
7918 * man/expand.x: Add `SEE ALSO' reference to unexpand.
7919 Suggestion from Dan Jacobson.
7921 2003-04-10 Maciej W. Rozycki <macro@ds2.pg.gda.pl>
7923 * src/fs.h (S_MAGIC_DEVPTS): New magic for Linux's devpts.
7924 * src/stat.c (human_fstype): Handle Linux's devpts.
7926 2003-04-09 Paul Eggert <eggert@twinsun.com>
7928 * src/split.c (line_bytes_split): Arg is of type size_t, since
7929 that's all that is supported for now.
7930 (main): Check for overflow in obsolescent line count option.
7932 2003-04-09 Jim Meyering <jim@meyering.net>
7934 * tests/misc/split-fail: Add a new test for the above fix.
7936 * src/split.c (bytes_split): Use size_t temporary (rather than
7937 uintmax_t original) in remaining computations. From Paul Eggert.
7939 Handle command line option arguments larger than 2^31.
7940 This allows e.g., splitting into files of size 2GB and larger,
7941 and running split --lines=N with N=2^31 or more.
7942 But for --line-bytes=N, the restriction that N <= SIZE_MAX
7943 remains (for now), due to the way it is implemented.
7945 * src/split.c: Include "inttostr.h".
7946 (bytes_split, lines_split, line_bytes_split, main):
7947 Use uintmax_t, not size_t, for file sizes.
7948 (main): Give a better diagnostic for option arguments == 0.
7949 Use umaxtostr to print file sizes.
7950 Reported by Luke Hassell.
7952 2003-04-08 Jim Meyering <jim@meyering.net>
7954 * src/rm.c (usage): Mention that --directory (-d) works only
7955 on some systems. Suggestion from Samuel Tardieu.
7957 * tests/basename/basic: Run $PERL to see if it is available,
7958 rather than testing its value.
7959 * tests/sum/sysv, tests/tsort/basic-1, tests/unexpand/basic-1:
7960 * tests/basename/basic, tests/dd/skip-seek, tests/dircolors/simple:
7961 * tests/expr/basic, tests/factor/basic, tests/fmt/basic:
7962 * tests/ls-2/tests, tests/md5sum/basic-1, tests/md5sum/newline-1:
7963 * tests/misc/sort, tests/misc/tty-eof, tests/mv/i-1:
7964 * tests/rm/empty-name, tests/rm/fail-eperm, tests/rm/unreadable:
7965 * tests/seq/basic, tests/sha1sum/basic-1, tests/sha1sum/sample-vec:
7966 * tests/sum/basic-1, tests/seq/basic: Likewise.
7968 * tests/misc/Makefile.am (TESTS): Add split-fail.
7969 * tests/misc/split-fail: New file.
7971 * src/split.c: Rename local variables: nchars -> n_bytes.
7972 (lines_split): Rename local, nlines -> n_lines.
7973 (main): Rename local variable: s/accum/n_units/.
7974 (main): Use STDIN_FILENO, not literal `0'.
7976 2003-04-07 Jim Meyering <jim@meyering.net>
7978 * src/stat.c: Add #include directives for Ultrix 4.4.
7979 Based on a suggested change from Bert Deknuydt.
7981 2003-04-06 Jim Meyering <jim@meyering.net>
7983 * Makefile.maint (makefile-check): New rule.
7984 (local-check): Add it.
7986 2003-04-05 Jim Meyering <jim@meyering.net>
7988 * Makefile.am (nearly all of them):
7989 Use $(VAR) rather than @VAR@, now that we can rely on automake to
7990 emit a definition for each substituted variable.
7991 * tests/Makefile.am.in: Likewise.
7993 * tests/rm/rm5: Add a comment explaining why this test fails when
7994 using Tru64's broken sed.
7995 * tests/rm/rm3: Likewise.
7997 Make `kill -t' output signal descriptions (not `?') on Tru64.
7998 * src/kill.c (sys_siglist): Also check for __sys_siglist.
7999 Patch by Tony Leneis.
8000 * configure.ac: Also check for declaration of __sys_siglist.
8001 Required for Tru64 4.0D, 4.0F, and 5.1.
8002 Reported by Tony Leneis.
8004 2003-04-04 Jim Meyering <jim@meyering.net>
8006 * src/Makefile.am (PERL): Remove unnecessary definition.
8008 Because of inappropriate (but POSIX-mandated) behavior of rename,
8009 `mv a b' would not remove `a' in some unusual cases. Work around
8010 this by unlinking `a' when necessary.
8012 * src/copy.c (same_file_ok): Add an output parameter.
8013 Set it in the offending case.
8014 (copy_internal): When necessary, unlink SRC_PATH and inform caller.
8015 Reported by Ed Avis.
8016 * tests/mv/hard-4: New test for the above.
8017 * tests/mv/Makefile.am (TESTS): Add hard-4.
8019 Clean up rules for automatically generated sources:
8020 * src/Makefile.am (dircolors.h, wheel-size.h, wheel.h, false.c):
8021 Make each generated file be read-only.
8022 Add each file name to BUILT_SOURCES separately.
8023 (MAINTAINERCLEANFILES): Set to $(BUILT_SOURCES).
8025 Put LOCALEDIR macro definition in new file: localedir.h.
8026 * src/Makefile.am (DEFS): Remove definition.
8027 (localedir.h): New rule.
8028 (BUILT_SOURCES, DISTCLEANFILES): Add localedir.h.
8029 * src/system.h: Include "localedir.h".
8031 2003-04-02 Jim Meyering <jim@meyering.net>
8035 * tests/misc/Makefile.am (TESTS): Add false.
8037 * Makefile.maint (TMPDIR): Make sure it's defined.
8038 (my-distcheck): Build in $(TMPDIR), not `.'.
8040 * src/Makefile.am (false.c): Change all occurrences of
8041 `(EXIT_SUCCESS)' to `(EXIT_FAILURE)' so that false exits
8042 unsuccessfully also with --help. Reported by Paul Jarc,
8043 * tests/misc/false: New test for the above.
8045 2003-03-30 Jim Meyering <jim@meyering.net>
8047 * NEWS: Note the location of older NEWS files.
8049 * src/remove.c (is_empty_dir): Don't let a failing closedir
8050 clobber errno. Spotted by Arnold Robbins.
8052 * src/env.c: Fix typo in comment. From Arnold Robbins.
8054 2003-03-29 Jim Meyering <jim@meyering.net>
8058 * README: Note to expect build problems for stat.c on Ultrix 4.3.
8059 Note that there are some harmless test failures when running
8060 `make check' as root on some systems.
8062 2003-03-28 Jim Meyering <jim@meyering.net>
8064 * tests/stty/row-col-1: Skip this test if stty can't get window size.
8065 This happens when connecting to sparc-solaris5.7 via ssh from within
8066 emacs. Reported by Karl Berry.
8068 * tests/du/basic: Use seq, not `yes' to generate 4KB of data.
8069 Otherwise, on systems (DJGPP) that emulate pipes using files,
8070 this test would never complete, waiting for `yes' to terminate.
8071 * tests/du/slink: As above, use seq, not `yes' to generate link target.
8072 * tests/rm/hash: As above, use seq, not `yes' to generate dir name.
8073 Reported by Rich Dawe.
8075 2003-03-27 Jim Meyering <jim@meyering.net>
8077 * src/id.c: Remove Arnold Robbins' obsolete e-mail address
8078 from `written by...' comment, at his request.
8080 2003-03-24 Paul Eggert <eggert@twinsun.com>
8082 Fix buffer overrun problem reported by TAKAI Kousuke, along
8083 with some other POSIX incompatibilities.
8085 * src/printf.c (print_esc): Do not treat \x specially if
8086 POSIXLY_CORRECT. Avoid buffer overrun if the format ends
8087 in backslash. Treat incomplete escape sequences as strings
8088 of characters, as POSIX requires.
8089 (print_formatted): Allow multiple flags. Avoid buffer overrun
8090 if the format is incomplete.
8092 2003-03-24 Jim Meyering <jim@meyering.net>
8094 * tests/misc/printf: Add tests for the above fixes and changes.
8096 2003-03-26 Jim Meyering <jim@meyering.net>
8098 * src/copy.h (struct cp_options): Add a comment.
8100 2003-03-23 Jim Meyering <jim@meyering.net>
8102 * README: Describe problem with 64-bit mode on HPUX 11.x,
8103 with patch for /usr/include/inttypes.h.
8104 * TODO: Plan to add an autoconf test to work around the bug.
8106 2003-03-22 Jim Meyering <jim@meyering.net>
8108 * src/stat.c: Don't include <sys/sysmacros.h>.
8109 That is already done via system.h. Otherwise, the multiple
8110 inclusion would evoke redefinition warnings from Cray's /bin/cc,
8111 aka Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28.
8112 (human_fstype): Factor some directives `up', out of this function.
8113 Cast away `const' to avoid error from Cray's /bin/cc.
8115 2003-03-20 Jim Meyering <jim@meyering.net>
8117 * announce-gen (print_changelog_deltas): Ensure that a newline
8118 precedes each row of `*'s.
8120 2003-03-20 Jim Meyering <jim@meyering.net>
8124 * src/seq.c (valid_format): Also accept ` ' and `'' as valid
8125 format flag characters.
8126 Do not require that a field width be specified.
8127 Do not fail when given a field width of `0'.
8128 Reported by Dan Jacobson.
8129 * tests/seq/basic: Add new tests for the above-fixed bug.
8131 * src/Makefile.am (all-local): Append $(EXEEXT) to use of `su'
8132 (install-root): Likewise.
8133 (install-exec-local): Likewise.
8134 Based on a patch from Richard Dawe.
8136 2003-03-19 Jim Meyering <jim@meyering.net>
8138 * man/Makefile.am (.x.1): Use $(LN_S) instead of 'ln -s',
8139 because the DJGPP 2.03 port of 'ln -s' doesn't work.
8140 Include $(EXEEXT) in program names.
8141 Since $(LN_S) may degenerate to `cp -p', be careful
8142 to invoke it from the destination directory.
8143 Mostly from Richard Dawe.
8144 * configure.ac: Use AC_PROG_LN_S.
8146 * tests/mv/part-symlink: Unset CDPATH. Otherwise, having the
8147 CDPATH shell variable set could cause this test to fail.
8148 Reported by Karl Berry.
8150 2003-03-18 Jim Meyering <jim@meyering.net>
8152 * src/fmt.c [struct Word] (paren, period, punct, final): Change the
8153 type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
8154 AIX 5.1's xlc could not compile the former.
8155 Patch by Petter Reinholdtsen. Also reported by Mike Jetzer.
8157 2003-03-17 Richard Dawe <rich@phekda.freeserve.co.uk>
8159 * configure.ac: Include $(EXEEXT) in OPTIONAL_BIN_PROGS'
8160 program names, since automake only adds $(EXEEXT) to programs
8163 2003-03-16 Jim Meyering <jim@meyering.net>
8165 * src/remove.c (rm): Put two local variables in static storage,
8166 so they can't be clobbered by the potential longjmp.
8168 2003-03-15 Jim Meyering <jim@meyering.net>
8170 * Makefile.cfg (gnu_rel_host): Fix code to match the comment
8171 so that a version number with a two-digit component can still count
8172 as an alpha release. Reported by Richard A Downing.
8173 (gnu_rel_host): Define in terms of $(RELEASE_TYPE) instead.
8175 2003-03-14 Jim Meyering <jim@meyering.net>
8177 * src/ansi2knr.c: Remove no-longer-used file.
8178 * src/ansi2knr.1: Likewise.
8180 * Makefile.maint (prev_version_file): Don't use ?= for this particular
8181 assignment, since it causes trouble with old versions of GNU make
8182 (e.g. 3.76.1). The other uses of `?=' are inoffensive. Details here.
8183 http://mail.gnu.org/archive/html/bug-coreutils/2003-03/msg00028.html
8184 Patch from Alexandre Duret-Lutz.
8186 * Use patched automake-1.7.3. Regenerate Makefile.in files in
8187 subdirectories so that each includes a definition of ACLOCAL_M4.
8189 * announce-gen (main): Label the compressed source URLs.
8193 * tests/du/slink: Relax the test for the `local'ness of a file system,
8194 so that now it works also for tmpfs.
8196 * tests/du/hard-link: Transform output from first du, so that this
8197 test doesn't fail on file systems like tmpfs that order directory
8198 entries differently.
8200 2003-03-13 Jim Meyering <jim@meyering.net>
8202 * tests/du/8gb: Work around what appears to be an NFS failure that
8203 would make this test fail on some systems.
8205 2003-03-11 Jim Meyering <jim@meyering.net>
8207 * tests/du/basic: Make the test file exactly 4k bytes long.
8209 * src/split.c (longopts): Don't hard-code `2' here.
8210 Instead, just specify `&verbose', and ...
8211 (main): ... remove the `case 2:' block for --verbose.
8213 * tests/du/basic: Make the test file larger than 64 bytes, so that
8214 we don't immediately disqualify file systems (e.g., NetApp) on which
8215 smaller files take up zero disk blocks. Reported by Vin Shelton.
8217 2003-03-10 Jim Meyering <jim@meyering.net>
8219 Don't segfault for a negative field width or precision in format string.
8220 Note that this is just a stopgap fix. The longer term solution may
8221 involve adapting bash's builtins/printf.def.
8223 * src/printf.c: (UNSPECIFIED): Define.
8224 (print_direc): Use the special value, UNSPECIFIED, to indicate
8225 that field_width or precision has not been specified.
8226 (print_formatted): Fail if field_width or precision is the
8227 special value, UNSPECIFIED.
8228 Reported by Oliver Kiddle <okiddle@yahoo.co.uk>
8230 * src/sys2.h (INT_MIN): Define, if necessary.
8231 * tests/misc/printf: Add a test for the above-fixed bug.
8233 2003-03-09 Jim Meyering <jim@meyering.net>
8235 * src/remove.c (AD_stack_pop): Cast sizeof... to int before
8236 changing its sign. This avoids a warning from gcc on 64-bit systems.
8237 Reported by Bob Proulx.
8238 (pop_dir): Reverse order of sign change and cast, to be consistent
8241 2003-03-08 Jim Meyering <jim@meyering.net>
8243 * tests/Makefile.am (evar-check): Check for POSIXLY_CORRECT not as a
8244 shell variable, but only in the environment. With /bin/sh->bash, the
8245 shell variable is set to `y', and that would cause a spurious warning.
8246 Reported by Bob Proulx.
8248 * tests/Makefile.am (check-root): Remove touch/fifo.
8249 It doesn't appear to have to be run as root.
8251 * tests/rm/fail-2eperm: Rather than simply using the first non-root
8252 user name, make sure that the selected user name has a usable shell.
8253 Reported by Paul Jarc.
8255 Before, when using shred on a device, one had to specify --exact,
8256 or be careful to choose a size that would not be rounded up and
8257 exceed the maximum value; that could result in a failure of
8259 * src/shred.c (do_wipefd): --exact is now the default for non-regular
8260 files. Suggestion from Ben Elliston.
8263 * tests/misc/tty-eof: Require at least version 1.11 of Expect.pm.
8264 Old versions of Expect.pm (e.g., 1.07) lack the log_user function.
8265 Patch by Bob Proulx.
8267 * src/Makefile.am (check-misc): Check for use of `defined' in
8269 Change to $(srcdir) before running grep.
8271 * src/sleep.c: Remove now-unused #include and #define directives.
8273 * src/du.c (process_file): If a file's size is not being counted
8274 e.g., because it's a hard link to a file we've already counted,
8275 then don't print a line for it.
8277 * tests/du/hard-link: New test for the above-fixed bug.
8278 * tests/du/Makefile.am (TESTS): Add hard-link.
8281 * src/du.c: Revert most of the `reorganization' change of 2003-02-20,
8282 and make the two-array approach work.
8284 * tests/du/basic: Correct/add tests for the above fix.
8285 Set LC_ALL, etc., now that we use sort.
8286 Check the block/size of a small file, too.
8287 Correct expected results for simple dir1/dir2/file case.
8288 Add another test of du -S.
8290 2003-03-07 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
8292 Avoid build failure with gcc on hppa1.1-hp-hpux10.20 (see GCC PR
8293 middle-end/9986). As one of GCC's optimizations, it transforms a
8294 fputs_unlocked call to a fputc_unlocked call when the string is
8295 one character long. However, hpux doesn't have fputc_unlocked.
8297 * expr.c (usage): Use putchar, not fputs, to output a single character.
8298 * ls.c (dired_dump_obstack): Likewise.
8299 * ptx.c (output_one_tex_line, output_one_dumb_line): Likewise.
8300 * stat.c (print_it): Likewise.
8302 2003-03-07 Jim Meyering <jim@meyering.net>
8304 * src/cp.c: Remove everything associated with mmap-stack.c.
8305 This reverts the two changes of 2003-02-21.
8306 * src/du.c: Remove everything associated with mmap-stack.c.
8307 This reverts the change of 2003-02-19.
8309 2003-03-06 Jim Meyering <jim@meyering.net>
8311 * tests/cp/same-file: Unset CDPATH. Otherwise, having the
8312 CDPATH shell variable set could cause this test to fail.
8313 Reported by Karl Berry.
8315 2003-03-05 Jim Meyering <jim@meyering.net>
8319 * src/printf.c (print_esc): Remove pointless comparison of unsigned
8320 integer with zero, to avoid a warning from Intel's ecc.
8321 Reported by Nelson Beebe.
8323 * src/du.c (process_file): Sizes must all be of type uintmax_t.
8324 Otherwise, for files or totals that are too big, numbers would
8325 be truncated. Patch mostly by Michael Stone.
8326 Reported by Ingo Saitz as Debian bug #183210.
8328 * tests/du/8gb: New test for the above-fixed bug.
8329 * tests/du/Makefile.am (TESTS): Add 8gb.
8331 * src/du.c (MAX_N_DESCRIPTORS): Use 3 * UTILS_OPEN_MAX / 4
8332 rather than UTILS_OPEN_MAX - 10.
8334 2003-03-04 Jim Meyering <jim@meyering.net>
8336 * README: Refer new feature discussion to bug-coreutils@gnu.org,
8337 rather than bug-gnu-utils, now that the former is better known.
8338 Suggestion from Göran Uddeborg.
8340 * src/stat.c (usage): Capitalize consistently.
8341 Reported by Göran Uddeborg.
8343 * Makefile.maint (rel-files): Include $(signatures), so that
8344 those files are also copied into $(release_archive_dir).
8346 * src/df.c (find_mount_point): Call error here, now that restore_cwd
8348 * src/remove.c (AD_pop_and_chdir): Likewise.
8350 * tests/Makefile.am (check-root): Add fail-2eperm.
8352 2003-03-03 Jim Meyering <jim@meyering.net>
8354 * src/remove.c (remove_cwd_entries): Include the full filename of
8355 the offending file, not just the basename.
8357 * tests/misc/tty-eof: Set $ME properly.
8359 * Makefile.maint (THIS_VERSION_REGEXP, PREV_VERSION_REGEXP):
8360 Remove now-unused variables.
8361 (tag-prev-version, prev-cvs-tag): Likewise.
8363 * src/remove.c (remove_cwd_entries) [!ROOT_CAN_UNLINK_DIRS]: Give an
8364 accurate diagnostic when failing to remove a file owned by some other
8365 user. Reported by Ivo Timmermans via Michael Stone.
8366 This fixes Debian bug# 178471.
8368 * tests/rm/Makefile.am (TESTS): Add fail-2eperm.
8369 * tests/rm/fail-2eperm: New test, for the above-fixed bug.
8370 Based on a report from Ivo Timmermans.
8372 2003-03-02 Jim Meyering <jim@meyering.net>
8374 * src/copy.c (copy_internal) [un_backup]: When recovering from a
8375 failure to create a hard link, do not remove the entry associating
8376 the source dev/ino with the destination file name.
8377 * tests/mv/Makefile.am (TESTS): Add hard-3.
8378 * tests/mv/hard-3: New test, for the above-fixed bug.
8379 Inspired by a report from Iida Yosiaki.
8381 2003-03-01 Jim Meyering <jim@meyering.net>
8383 * src/df.c (print_header): Don't embed spaces in a separate `Type'
8384 header string. Instead, put `Filesystem' and `Type' headers in the
8385 same string, so translators can use horizontal space as needed.
8386 Reported by Jean Charles Delepine.
8388 2003-02-28 Jim Meyering <jim@meyering.net>
8390 * src/copy.c (copy_internal): When link fails because of an
8391 existing destination file, unlink that file and try again.
8392 Reported by Iida Yosiaki.
8394 * tests/mv/Makefile.am (TESTS): Add hard-2.
8395 * tests/mv/hard-2: New test for the above-fixed bug.
8396 Based on a test case from Iida Yosiaki.
8398 2003-02-26 Jim Meyering <jim@meyering.net>
8400 * tests/du/basic: Don't test du's -b option here. Directory byte
8401 counts are smaller (512 rather than 4096) on at least OSF/1 5.1
8402 and IBM AIX 4.2. Reported by Nelson Beebe.
8404 2003-02-25 Jim Meyering <jim@meyering.net>
8406 * Makefile.maint (announcement): Now that ChangeLog entries
8407 are output by announce-gen, don't do it here.
8408 * announce-gen (print_changelog_deltas): New function.
8411 2003-02-22 Jim Meyering <jim@meyering.net>
8413 * announce-gen: New option: --release-type=TYPE
8414 * Makefile.maint (beta, major): New targets. Remove `release'.
8415 Put them all together on a line.
8416 Pass the release type (via RELEASE_TYPE envvar) to the MAKE
8417 invocation of `announcement'.
8418 (announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
8420 * announce-gen: New option: --news=NEWS_FILE.
8421 Extract NEWS entries here, not via rules in Makefile.maint.
8422 * Makefile.maint (announcement): Now that NEWS entries are
8423 extracted by announce-gen, don't do it here.
8424 (news-r1, news-r2): Remove now-unused definitions.
8426 2003-02-21 Jim Meyering <jim@meyering.net>
8430 Merge in changes from autoconf's version of this file.
8431 * Makefile.maint (www-gnu): Define.
8432 (standards.texi-url_prefix): Use $(www-gnu).
8433 (make-stds.texi-url_prefix): Likewise.
8435 * src/cp.c: Include "mmap-stack.h".
8436 (main): Invoke `run' through a macro that (when possible) runs it
8437 with a large, mmap'd stack.
8439 * src/cp.c (run): New function, preparing for the above.
8440 Exit from this function, not from main
8443 * src/du.c: New option: --apparent-size.
8444 (enum) [APPARENT_SIZE_OPTION]: New member.
8445 (long_options): Add it.
8446 (usage): Describe it.
8448 ['b']: Set apparent_size.
8449 David Eisner reported that the behavior of --bytes had changed.
8450 Paul Eggert proposed the use of a new option, --apparent-size.
8452 * src/du.c (apparent_size): New global.
8453 (print_only_size): Reflect the fact that we're printing byte counts,
8454 not ST_NBLOCKSIZE-byte-block counts.
8455 (print_size): Call print_only_size rather than duplicating its code.
8456 (process_file): Accumulate byte counts, rather than block counts.
8458 * src/du.c (process_file): Always reset size_to_propagate_to_parent
8459 for --separate-dirs (-S).
8461 2003-02-20 Jim Meyering <jim@meyering.net>
8463 * Use automake-1.7.3. Regenerate dependent files.
8465 * src/stat.c (print_stat): New format: %B (to print ST_NBLOCKSIZE).
8466 This makes %b (number of ST_NBLOCKSIZE-byte blocks) more useful.
8467 (usage) [%B]: Describe it.
8470 * src/du.c (process_file): Reorganize the code to use only
8471 one `sum' array, and change how -S works back to the way it was
8472 before 2003-01-31. Patch by Bruno Haible.
8474 * tests/du/basic: New test.
8475 * tests/du/Makefile.am (TESTS): Add basic.
8477 * tests/envvar-check: Add checks for the following:
8478 BLOCK_SIZE, DU_BLOCK_SIZE, DF_BLOCK_SIZE, LS_BLOCK_SIZE.
8480 * tests/Makefile.am: Rename phony target envvar-check to evar-check
8481 so as not to conflict with the distributed file by the same name.
8483 * src/du.c (process_file): Set info->skip before any possible return.
8485 Report correct usage for directories, not 0.
8486 * src/du.c (process_file): Return for `file_type == FTW_DPRE'
8487 _before_ recording the dev/ino of a directory.
8488 Reported by Bruno Haible.
8490 Now, df always displays the device file name corresponding to the
8491 listed mount point under `Filesystem'. Before, for an unmounted
8492 block- or character-special file argument, it would display the
8493 command-line argument instead.
8494 * src/df.c (show_disk): Return a value indicating whether
8495 there was a match. Don't try to find a mount point here.
8496 (show_entry): If show_disk doesn't find a match, call show_point.
8498 2003-02-19 Jim Meyering <jim@meyering.net>
8500 * src/du.c: Include "mmap-stack.h".
8501 (du_files): Add prototype with ATTRIBUTE_NORETURN.
8502 Exit from this function, not from...
8504 Instead, if possible, invoke du_files through a macro that
8505 runs it with a large, mmap'd stack.
8507 * src/join.c (usage): Change wording in --help output:
8508 use FILENUM instead of `SIDE' and say what FILENUM means.
8509 Reported by Bernhard Gabler.
8511 * src/df.c (print_header): Rather than using a hard-coded literal
8512 string of spaces matching the length of the English `...Type' header,
8513 output the right number of spaces to match the selected translation.
8514 Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
8516 * src/split.c (bytes_split): Remove unnecessary `else' after break.
8517 (lines_split): Likewise. and correct misleading indentation.
8519 * src/split.c: Include "full-read.h".
8520 (bytes_split, lines_split, line_bytes_split): Use full_read,
8521 not safe_read. The way split was using the latter, a short read
8522 could cause split to terminate before EOF.
8524 * tests/misc/tty-eof: Test all programs that can read stdin,
8525 requiring no arguments and that write to standard output.
8527 * tests/misc/tty-eof: New file. Renamed from ...
8528 * tests/misc/cat-tty-eof: Remove file. Rename to tty-eof.
8529 * tests/misc/Makefile.am (TESTS): Reflect renaming.
8531 2003-02-18 Jim Meyering <jim@meyering.net>
8533 cksum would perform an extra read after encountering EOF
8534 * src/cksum.c (cksum): Exit the loop upon EOF, too.
8535 Patch by Michael Bacarella.
8537 Test for the bug fixed today in cksum, md5sum, and sha1sum.
8538 * tests/misc/cat-tty-eof: Generalize, clean-up, and test for
8539 cat, cksum, md5sum, and sha1sum all in the same loop.
8541 2003-02-14 Jim Meyering <jim@meyering.net>
8543 * src/remove.c: Include "euidaccess.h".
8544 Remove declaration of euidaccess.
8546 2003-02-12 Jim Meyering <jim@meyering.net>
8548 * src/pathchk.c (portable_chars_only): Remove unnecessary `const'
8549 in cast to avoid warning from icc. Reported by Alexandre Duret-Lutz.
8551 2003-02-10 Jim Meyering <jim@meyering.net>
8553 * src/test.c: Don't include group-member.h.
8554 Include euidaccess.h.
8555 (eaccess): Rewrite function to set the real uid and gid temporarily
8556 to the effective uid and gid, then invoke 'access', and then set the
8557 real uid and gid back. On systems that lack setreuid or setregid,
8558 fall back on the kludges in euidaccess. Before, it would not work
8559 for e.g., files with ACLs, files that were marked immutable,
8560 or on file systems mounted read-only. Nelson Beebe raised the issue.
8561 Paul Eggert suggested the new implementation.
8563 2003-02-09 Jim Meyering <jim@meyering.net>
8565 * src/test.c (test_stat): Remove function. It's job is done (only
8566 when necessary) by the wrapper in lib/stat.c. Adjust all uses.
8568 2003-02-08 Jim Meyering <jim@meyering.net>
8572 * tests/mv/part-symlink: Don't assume that the file owner username
8573 length is less than 9 in ls output: instead, omit that field
8574 altogether. Reported by, and suggested fix from, Ferdinand.
8576 * tests/du/restore-wd: New test for just-fixed bug in ftw.c.
8577 * tests/du/Makefile.am (TESTS): Add restore-wd.
8579 * src/rm.c: Correct now-invalid comment about cycle-detection.
8581 2003-02-06 Jim Meyering <jim@meyering.net>
8583 * NEWS: Add entries from old/*/NEWS
8584 from fileutils-4.1 through 4.1.11 and
8585 from sh-utils-2.0 through 2.0.15. Suggestion from Karl Berry.
8589 * src/du.c (process_file): Don't return early for excluded files
8590 or for files whose dev/inode we've already seen.
8592 2003-02-05 Jim Meyering <jim@meyering.net>
8594 * tests/du/exclude: New file.
8595 * tests/du/Makefile.am (TESTS): Add exclude.
8597 2003-02-04 Dmitry V. Levin <ldv@altlinux.org>
8599 * src/who.c (print_boottime, print_deadprocs, print_runlevel):
8600 Fix memory allocation arithmetic.
8602 2003-02-04 Jim Meyering <jim@meyering.net>
8604 `df /dev/block-or-char-device-file--not-mounted' now reports
8605 the name of the file system on which the file resides, usually `/'.
8606 Before, it would leave the `Mounted on' field blank.
8607 * src/df.c (show_disk): Move function to precede find_mount_point.
8608 (show_disk): Add parameter: STATP.
8609 If we don't find a matching device name, then resort to calling
8610 find_mount_point. Reported by Bob Proulx.
8612 2003-02-03 Andreas Schwab <schwab@suse.de>
8614 * tests/rm/cycle: Require non-root.
8615 * tests/rm/isatty: Likewise.
8617 2003-02-02 Jim Meyering <jim@meyering.net>
8621 * man/Makefile.am (check-x-vs-1): Use @PATH_SEPARATOR@, not `:'.
8623 Ensure that there are no offending uses of `:'.
8624 * Makefile.maint (makefile_path_separator_check): New rule.
8625 (local-check): Add it to the list.
8627 2003-02-01 Jim Meyering <jim@meyering.net>
8629 * src/du.c (MAX_N_DESCRIPTORS): Define.
8631 * src/stat.c (G_fail): New global.
8632 (human_time): Diagnose failed localtime, not failed nstrftime.
8633 (main): Fail if G_fail is set.
8635 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
8637 * tests/basename/Makefile.am: Use @PATH_SEPARATOR@ instead of
8638 hard-coding the path-separator. Also double-quote the new PATH,
8639 to avoid problems when the path-separator is a semi-colon or when
8640 `pwd` contains e.g. a space.
8641 * tests/chgrp/Makefile.am: Likewise.
8642 * tests/chmod/Makefile.am: Likewise.
8643 * tests/chown/Makefile.am: Likewise.
8644 * tests/cp/Makefile.am: Likewise.
8645 * tests/dd/Makefile.am: Likewise.
8646 * tests/dircolors/Makefile.am: Likewise.
8647 * tests/du/Makefile.am: Likewise.
8648 * tests/expr/Makefile.am: Likewise.
8649 * tests/factor/Makefile.am: Likewise.
8650 * tests/fmt/Makefile.am: Likewise.
8651 * tests/install/Makefile.am: Likewise.
8652 * tests/ln/Makefile.am: Likewise.
8653 * tests/ls/Makefile.am: Likewise.
8654 * tests/ls-2/Makefile.am: Likewise.
8655 * tests/md5sum/Makefile.am: Likewise.
8656 * tests/misc/Makefile.am: Likewise.
8657 * tests/mkdir/Makefile.am: Likewise.
8658 * tests/mv/Makefile.am: Likewise.
8659 * tests/od/Makefile.am: Likewise.
8660 * tests/rm/Makefile.am: Likewise.
8661 * tests/rmdir/Makefile.am: Likewise.
8662 * tests/seq/Makefile.am: Likewise.
8663 * tests/sha1sum/Makefile.am: Likewise.
8664 * tests/shred/Makefile.am: Likewise.
8665 * tests/stty/Makefile.am: Likewise.
8666 * tests/sum/Makefile.am: Likewise.
8667 * tests/tail-2/Makefile.am: Likewise.
8668 * tests/touch/Makefile.am: Likewise.
8669 * tests/tsort/Makefile.am: Likewise.
8670 * tests/unexpand/Makefile.am: Likewise.
8672 2003-01-31 Jim Meyering <jim@meyering.net>
8674 * src/stat.c: Include "file-type.h"
8675 (print_human_type): Remove function.
8676 (human_access): Rename from print_human_access. Return a string.
8677 (human_time): Rename from print_human_time. Return a string.
8678 (print_stat): Arrange so that field width and an alignment specifier
8679 are honored for the %A, %F, %x, %y, and %z formats.
8680 [%F]: Use file_type; this gives slightly different file type strings,
8681 e.g., `directory' instead of `Directory' and `regular file' or
8682 `regular empty file' instead of `Regular file'.
8683 Prompted by a report from Richard Dawe that the uses of
8684 S_IFSOCK and S_IFIFO in print_human_time were not portable
8685 to systems using e.g., DJGPP.
8687 2003-01-31 Richard Dawe <rich@phekda.freeserve.co.uk>
8689 * src/stat.c (print_stat): Use S_ISLNK rather than an explicit
8690 test using S_IFMT and S_IFLNK. S_IFLNK may not be defined.
8692 2003-01-31 Jim Meyering <jim@meyering.net>
8694 * src/du.c (main): Upon processing an invalid option or an invalid
8695 --exclude-from or --max-depth option argument, don't exit right away,
8696 in case there are others. Rather record the failure and exit after
8697 processing other options.
8699 * GNUmakefile (TAR_OPTIONS): Set and export, in order to make
8700 tar archive easier to reproduce.
8702 Rewrite to perform directory traversal using nftw.
8704 * src/du.c: Include "dirname.h", "ftw.h", and "quotearg.h".
8705 (AUTHORS): Add self.
8706 (opt_one_file_system): Move global into `main'.
8707 (path, xstat, exit_status): Remove declarations.
8708 (arg_length, suffix_length): New globals.
8709 (G_fail): New global, sort of like the old `exit_status'.
8710 (IS_FTW_DIR_TYPE): Define.
8711 (print_only_size): New function.
8712 (process_file): New function.
8713 (str_init, ensure_space, str_copyc, str_concatc): Remove functions.
8714 (str_trunc, pop_dir, count_entry): Likewise.
8715 (du_files): Rewrite to use nftw.
8717 2003-01-30 Jim Meyering <jim@meyering.net>
8719 * tests/du/trailing-slash: Ensure that du/ftw follows a command-line
8720 symlink-to-directory with -L, even without the trailing slash.
8722 2003-01-27 Jim Meyering <jim@meyering.net>
8724 * src/Makefile.am (check-misc): Check for st_blocks, too.
8726 * src/stat.c (print_stat): Use ST_NBLOCKS rather than `->st_blocks'.
8727 Reported by Richard Dawe.
8729 2003-01-27 Andreas Schwab <schwab@suse.de>
8731 * src/ls.c (quote_name): Add fourth parameter, width, into which to
8732 store the screen columns, and return the number of bytes instead.
8733 (print_dir): Pass NULL as fourth parameter of quote_name.
8734 (print_name_with_quoting): Likewise.
8735 (length_of_file_name_and_frills): Get the width from the fourth
8736 parameter of quote_name instead of return value.
8738 2003-01-27 Jim Meyering <jim@meyering.net>
8740 * src/ls.c (decode_switches): If `dired' is set without
8741 `format == long_format', then silently reset dired. This doesn't
8742 change the behavior of ls (all prior uses of dired were protected
8743 by `&& format == long_format'), and lets us...
8744 (DIRED_INDENT): ... remove the `format == long_format' conjunct.
8745 (PUSH_CURRENT_DIRED_POS): Likewise.
8748 2003-01-22 Jim Meyering <jim@meyering.net>
8750 * tests/du/no-x: New test, for functionality added to lib/ftw.c.
8751 * tests/du/Makefile.am (TESTS): Add no-x.
8753 2003-01-21 Jim Meyering <jim@meyering.net>
8755 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS
8756 && HAVE_STRUCT_DIRENT_D_TYPE]: If a file has d_type == DT_UNKNOWN
8757 it may still be a directory -- or not (e.g., with FreeBSD on an
8758 NFS-mounted file system), so resort to calling lstat to find out.
8759 Based on a patch by Michael van Elst.
8761 * tests/cp/same-file: Don't assume that the file owner username
8762 length is less than 9 in ls output: instead, omit that field
8763 altogether. Reported by, and suggested fix from, Ferdinand.
8765 2003-01-20 Jim Meyering <jim@meyering.net>
8767 * tests/date/Test.pm (wide-fmt): New test to demonstrate that
8768 large format widths no longer cause strftime to infloop.
8770 * Makefile.maint (mail_gpg_sign_cookie): Remove now-unused definition.
8772 2003-01-19 Jim Meyering <jim@meyering.net>
8774 * src/readlink.c: Include "canonicalize.h".
8776 2003-01-18 Jim Meyering <jim@meyering.net>
8778 * src/ls.c (Dereference_symlink) [DEREF_COMMAND_LINE_SYMLINK_TO_DIR]:
8780 (enum) [DEREFERENCE_COMMAND_LINE_SYMLINK_TO_DIR_OPTION]: New member.
8781 (long_options): Add option --dereference-command-line-symlink-to-dir.
8782 (main): Make DEREF_COMMAND_LINE_SYMLINK_TO_DIR be the default,
8783 rather than DEREF_COMMAND_LINE_ARGUMENTS, when none of the
8784 -d, -F, -l options is specified.
8785 (decode_switches): Handle --dereference-command-line-symlink-to-dir.
8786 (gobble_file): Honor DEREF_COMMAND_LINE_SYMLINK_TO_DIR.
8787 Change --dereference-command-line (-H) to dereference *all*
8788 command line arguments, including broken symlinks.
8790 2003-01-15 Paul Eggert <eggert@twinsun.com>
8792 Change ls -H back to the way it was yesterday, since this is
8793 compatible with FreeBSD and the POSIX spec is confusing
8794 and somewhat contradictory.
8796 * src/ls.c (DEREF_COMMAND_LINE_ARGUMENTS): Change name back
8797 from DEREF_COMMAND_LINE_SYMLINK_TO_DIR, updating all uses.
8798 (long_options): Change the long option name back.
8799 (usage): Change the usage back.
8800 (gobble_file): When -H is specified, dereference a top-level
8801 arg even if it points to a non-directory.
8803 2003-01-15 Jim Meyering <jim@meyering.net>
8805 * src/ls.c (gobble_file): Fall back on using lstat when required:
8806 when --dereference (-L) is not specified, and
8807 - when operating on a dangling symlink
8808 - when operating on command-line-symlink-to-directories
8809 This fixes numerous problems. Here are examples:
8810 - `ls dangling-symlink' would fail with `no such file...'
8811 Now it prints `dangling-symlink'.
8812 - `ls -i symlink' would mistakenly print the inode of the referent.
8813 Now it prints the inode of the symlink. Likewise for --size (-s).
8814 Based on a patch from Michael Stone.
8815 Reported by Deepak Goel as Debian bug #173793.
8817 Rename ls's --dereference-command-line (-H)
8818 option to --dereference-command-line-symlink-to-dir.
8819 * src/ls.c [enum Dereference_symlink]
8820 (DEREF_COMMAND_LINE_SYMLINK_TO_DIR): Rename from
8821 DEREF_COMMAND_LINE_ARGUMENTS. Update all uses.
8822 (long_options): Rename the long option.
8823 (usage): Say that --dereference-... changes how ls treats
8824 only symlinks to directories specified on the command line.
8826 2003-01-14 Jim Meyering <jim@meyering.net>
8828 * tests/ls/dangle: New file/test, for the above fix.
8829 * tests/ls/inode: Another new file/test, for the above fix.
8830 * tests/ls/Makefile.am (TESTS): Add dangle and inode.
8832 * src/ls.c (gobble_file): Fix a bug introduced in 4.5.4 that made it
8833 so that ls --color would no longer highlight the names of files with
8834 the execute bit set when not specified on the command line.
8835 Patch by Michael Stone. Reported by Stephen Depooter as
8838 * tests/ls-2/tests (color-exe): New test, for the above fix.
8840 2003-01-13 Jim Meyering <jim@meyering.net>
8842 * tests/shred/exact: Also test for just fixed bug with --zero.
8844 * src/shred.c (long_opts): --zero does not require an argument.
8845 Patch by Michael Stone. Reported by Roland Turner as Debian bug 172019.
8847 2003-01-12 Jim Meyering <jim@meyering.net>
8849 * Makefile.maint (cvs-update): Skip any file with local modifications.
8851 * src/unexpand.c (usage): Document --first-only and mention that
8852 --tabs=N (-t) enables --all (-a). Reported by wiregauze@yahoo.com.
8854 2002-12-01 Dmitry V. Levin <ldv@altlinux.org>
8856 * src/df.c: Include "canonicalize.h".
8857 Use canonicalize_file_name unconditionally.
8859 2003-01-09 Jim Meyering <jim@meyering.net>
8861 * README: Add readlink.
8863 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
8865 * src/df.c: Include "xgetcwd.h".
8866 * src/pwd.c: Likewise.
8868 2002-11-30 Dmitry V. Levin <ldv@altlinux.org>
8870 * src/shred.c: Remove declaration of xstrdup.
8871 We already get it via xalloc.h which is included via system.h.
8873 2002-08-27 Dmitry V. Levin <ldv@altlinux.org>
8875 New program: readlink.
8877 * src/Makefile.am (bin_PROGRAMS): Add readlink.
8878 * src/readlink.c: New file.
8880 * man/readlink.x: New file.
8881 * man/Makefile.am (dist_man_MANS): Add readlink.1.
8882 (readlink.1): New rule.
8884 2003-01-09 Jim Meyering <jim@meyering.net>
8886 When selecting ranges of byte offsets (as opposed to ranges of fields)
8887 and when --output-delimiter=STRING is specified, output STRING between
8888 ranges of selected bytes.
8889 * src/cut.c (RANGE_START_SENTINEL): Define.
8890 (output_delimiter_specified): New global.
8891 (print_kth): Add parameter. Adjust all callers.
8892 (set_fields): Mark each range-start index with RANGE_START_SENTINEL.
8893 (cut_bytes): When requested, output STRING between ranges of
8895 (main): Make a diagnostic a little clearer.
8896 Based on a patch from Jan Nieuwenhuizen.
8898 * tests/cut/Test.pm: New tests for the above.
8900 * src/cut.c (set_fields): Make code agree with comment:
8901 Don't merge abutting ranges like 4- and 2-3. This makes no
8902 difference currently, but is required to support an upcoming change.
8904 2003-01-07 Jim Meyering <jim@meyering.net>
8906 * src/cut.c (set_fields): Fix typo in comment.
8908 * tests/touch/not-owner: New test, mostly extracted from fail-diag.
8909 * tests/touch/Makefile.am (TESTS): Add not-owner.
8910 * tests/touch/fail-diag: Remove the test for non-owner diagnostic.
8911 Now, this tests only the nonexistent-directory diagnostic.
8912 Suggestion from Michael Stone.
8914 * tests/touch/fail-diag: Fix typo: s/ld/ls/.
8916 2003-01-04 Jim Meyering <jim@meyering.net>
8918 * src/copy.h: Remove use of PARAMS.
8919 * src/remove.h: Likewise.
8920 * src/chown-core.h: Likewise.
8922 rm could be tricked into mistakenly reporting a cycle.
8923 * src/remove.c: [cycle_check_state]: New global.
8924 (remove_cwd_entries): Adapt to new semantics of cycle_check.
8925 (rm): Call cycle_check_init and cycle_check_free for each file.
8926 * tests/rm/cycle (rm): New test, for the above fix.
8927 * tests/rm/Makefile.am (TESTS): Add cycle.
8929 When rm detects a cycle, don't abort the entire command,
8930 but rather just the affected command line argument.
8931 * src/remove.c: Include <setjmp.h>
8932 (struct dirstack_state) [current_arg_jumpbuf]: New member.
8933 (remove_cwd_entries): Call longjmp if we detect a cycle.
8934 (rm): Call setjmp here.
8936 * src/remove.c (cycle_check, is_power_of_two): Remove functions.
8937 Instead, include cycle-check.h and use it.
8939 * src/remove.h (struct dev_ino): Remove declaration.
8941 * src/remove.c (remove_cwd_entries): Fix typos in comment.
8943 Don't include trailing /. in diagnostics about directories.
8944 * src/remove.c (full_filename_): When FILENAME is just `.'
8945 and there is a nonempty directory-name part, don't append `/.'.
8946 * tests/rm/unread2: Remove trailing /. from diagnostic.
8947 * tests/rm/rm2: Likewise.
8949 * src/remove.c (struct dirstack_state): Define.
8950 To be used in place of these file-scoped globals ...
8951 (dir_stack, len_stack, Active_dir): Remove globals.
8952 (ds_init, ds_free): New functions.
8953 (full_filename): Define.
8954 (full_filename_): Rename from full_filename.
8956 Begin to make AD_* functions more generic.
8957 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
8958 (AD_push): Likewise.
8959 (AD_INIT_OTHER_MEMBERS): Define.
8960 (remove_dir): Define the `status' member manually after each
8961 call to AD_push or AD_push_initial.
8963 * src/Makefile.am (check-misc): New rule, to ensure that no more
8964 S_IS* macro definitions sneak into the code.
8965 (check): Depend on check-misc.
8967 * src/remove.c [S_ISLNK]: Don't define. It's already defined in sys2.h.
8968 * src/du.c (count_entry) [S_ISLNK]: Don't define.
8969 * src/shred.c [S_ISLNK, S_ISFIFO, S_ISSOCK]: Don't define.
8971 2003-01-03 Jim Meyering <jim@meyering.net>
8973 * src/true.c: Add copyright.
8974 (AUTHORS): I suppose I've written it.
8976 * src/Makefile.am (false.c): Make the generated file be read-only.
8978 2003-01-04 Jim Meyering <jim@meyering.net>
8980 * src/ls.c: Include "dev-ino.h".
8981 [struct dev_ino]: Remove declaration.
8983 2003-01-02 Jim Meyering <jim@meyering.net>
8985 * src/cp.c (do_copy): Tweak diagnostic to be consistent with the one
8986 from mv: s/missing file arguments/missing file argument/.
8987 With --target-directory=DIR, cp and mv work with a single file argument.
8988 Reported by Karl Berry.
8990 * tests/rm/isatty: Enable this test.
8992 2002-12-31 Jim Meyering <jim@meyering.net>
8994 * src/remove.c (AD_push_initial): Don't set status to RM_OK here.
8995 (AD_push): Likewise.
8996 (AD_INIT_OTHER_MEMBERS): Define.
8997 (remove_dir): Define the `status' member manually after each
8998 call to AD_push or AD_push_initial.
9000 * src/ls.c [struct dev_ino]: Remove definition.
9001 Include "dev-ino.h" instead.
9003 2002-12-28 Jim Meyering <jim@meyering.net>
9005 * tests/du/Makefile.am (TESTS): Add no-deref.
9006 * tests/du/no-deref: New script.
9008 2002-12-23 Jim Meyering <jim@meyering.net>
9010 * src/remove.c (remove_cwd_entries): Fix typo in comment.
9012 2002-12-21 Jim Meyering <jim@meyering.net>
9014 * announce-gen: Generate MML-formatted announcement.
9015 This makes it a *lot* harder to send stale MD5/SHA1 signatures.
9017 2002-12-20 Jim Meyering <jim@meyering.net>
9019 * src/touch.c (touch): Change the wording of a diagnostic so
9020 that it makes sense both when the file exists and when it doesn't.
9021 Suggestion from Michael Stone.
9023 2002-12-18 Jim Meyering <jim@meyering.net>
9025 * src/stty.c (valid_options): Declare to be static.
9027 2002-12-15 Jim Meyering <jim@meyering.net>
9029 * Makefile.cfg: Remove rules related to generating m4/jm-glibc-io.m4.
9031 * src/chmod.c, src/copy.c, src/copy.h, src/cp-hash.h, src/csplit.c:
9032 * src/date.c, src/expr.c, src/fmt.c, src/id.c, src/install.c:
9033 * src/ls.c, src/od.c, src/pathchk.c, src/pr.c, src/remove.c:
9034 * src/shred.c, src/sort.c, src/stat.c, src/stty.c, src/sum.c:
9035 * src/tee.c, src/test.c: Remove all uses of `PARAMS'.
9037 * src/remove.c (PARAMS): Remove definition.
9038 * src/sys2.h: Likewise.
9040 * src/ls.c, src/stat.c, src/date.c: Remove declaration of nstrftime.
9041 Include strftime.h instead.
9043 2002-12-14 Jim Meyering <jim@meyering.net>
9045 * Makefile.cfg ($(url_dir_list)): Use .../coreutils, not .../fetish.
9047 * src/system.h [! HAVE_DECL_MEMRCHR]: Declare memrchr.
9048 This is necessary at least for Irix6.5 when using c89.
9049 Reported by Nelson Beebe.
9051 * tests/misc/Makefile.am (TESTS): Add cat-tty-eof.
9053 * tests/misc/cat-tty-eof: New test.
9055 * src/mknod.c (usage): Specify how major and minor mode numbers
9056 are interpreted. Report forwarded by Kristin E Thomas.
9057 * src/mknod.c: Remove now-redundant usage-specifying comment.
9059 2002-12-13 Jim Meyering <jim@meyering.net>
9063 * tests/du/trailing-slash: Allow for a directory of size `0'.
9064 That happens at least on file systems of type tmpfs on linux-2.4.18.
9066 * announce-gen: New script to begin replacing the commands
9067 associated with the rule here...
9068 * Makefile.maint (announcement): Invoke announce-gen.
9069 * Makefile.am (EXTRA_DIST): Add announce-gen.
9071 * tests/cp/preserve-2: New file/test, for latest fix.
9072 * tests/cp/Makefile.am (TESTS): Add preserve-2.
9074 2002-12-11 TAKAI Kousuke <takai@vlsi.kuee.kyoto-u.ac.jp>
9076 Fix a bug whereby cp would fail to parse an option like
9077 --preserve=mode,ownership.
9078 * src/cp.c (decode_preserve_arg): Advance `comma' to
9079 point the character following the comma.
9081 2002-12-11 Jim Meyering <jim@meyering.net>
9083 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Undefine before defining,
9084 in case it's already defined.
9086 2002-12-09 Jim Meyering <jim@meyering.net>
9088 * tests/touch/fail-diag: Don't get a test failure if /no exists.
9089 Instead, evoke a framework failure if /no-$$ exists.
9090 Reported by Michael Stone.
9092 2002-12-08 Jim Meyering <jim@meyering.net>
9094 * src/du.c (lstat) [! LSTAT_FOLLOWS_SLASHED_SYMLINK]:
9095 Define to rpl_lstat, so that even on systems like Solaris 5.8,
9096 du honors (per POSIX) the trailing slash on an argument referring
9097 to a symlink-to-directory.
9099 2002-12-06 Jim Meyering <jim@meyering.net>
9101 * Use autoconf-2.57. Regenerate dependent files.
9102 * Use automake-1.7.2. Regenerate dependent files.
9104 * src/ls.c (gobble_file): Also stat the file if it's a
9105 regular file and --indicator-style=classify (aka -F).
9106 Thanks to Ed Santiago for opening my eyes.
9108 * tests/ls/file-type: New file. Test for the above.
9109 A test to contrast ls -F and ls --indicator-style=file-type.
9110 * tests/ls/Makefile.am (TESTS): Add file-type.
9112 2002-12-04 Jim Meyering <jim@meyering.net>
9114 * tests/ls/follow-slink: Make sure the symlink was created.
9115 Richard Dawe reported that `ln -s link link' succeeds, but creates
9116 no file on systems running some version of the DJGPP libc.
9118 2002-12-03 Jim Meyering <jim@meyering.net>
9120 * src/Makefile.am (AUTOMAKE_OPTIONS): Remove definition (to ansi2knr)
9121 since this package no longer panders to K&R compilers.
9123 2002-12-02 Jim Meyering <jim@meyering.net>
9125 * tests/du/slink: Skip this test if `.' is on a non-local file system.
9127 * tests/Fetish.pm (_at_replace): Do the substitution only if there's
9128 something to replace.
9130 2002-12-01 Jim Meyering <jim@meyering.net>
9132 * src/stat.c: Don't include <string.h> or <ctype.h>.
9133 That's already done via system.h.
9134 * src/dircolors.c: Don't include <ctype.h>.
9136 2002-11-30 Jim Meyering <jim@meyering.net>
9138 * ls.c (gobble_file): Remove the block of code that caused
9139 `ls --color -F symlink-to-dir' to list the files in
9140 `symlink-to-dir/.'. Now, it prints `symlink-to-dir@', (just
9141 like `ls -F symlink-to-dir') but with the addition of highlighting.
9142 Similarly, `ls --color -dF symlink-to-dir' would print
9143 `symlink-to-dir/'; now it prints `symlink-to-dir@'.
9144 Reported by Jeff Sheinberg as Debian bug #168203.
9145 * tests/ls-2/tests (sl-F-color, sl-dF-color): New tests for the above.
9147 ls is now more efficient: with certain options, it no longer needs
9148 to stat each directory entry on systems with valid dirent.d_type.
9149 * src/ls.c (print_dir): Add DT_LNK and DT_REG.
9150 (main): Make --recursive set format_needs_type, not format_needs_stat.
9151 (gobble_file): Remove a FIXME comment, now that it's fixed.
9153 2002-11-24 Jim Meyering <jim@meyering.net>
9155 * src/du.c (du_files): Don't strip any trailing slash.
9156 Rewrite so that `/' is no longer represented internally as
9158 (count_entry): When appending a file name component,
9159 account for the fact that the current path may end in `/'.
9160 François Pinard reported that `du symlink-to-dir/' was not
9161 equivalent to `du symlink-to-dir/.'. Now it is.
9162 * tests/du/trailing-slash: New file/test, for the above fix.
9163 * tests/du/Makefile.am (TESTS): Add trailing-slash.
9165 2002-11-23 Jim Meyering <jim@meyering.net>
9167 * src/tac.c (output): Declare some local variables to be of type size_t,
9168 rather than `int' to avoid warnings from gcc.
9170 2002-11-21 Paul Eggert <eggert@twinsun.com>
9172 * src/ls.c (decode_switches): Use case-sensitive matching to
9173 decode the QUOTING_STYLE environment variable. This is more
9174 consistent with the documentation, and with --quoting-style.
9176 2002-11-21 Martin Buck <martin.buck@ascom.ch
9178 * src/stty.c (struct speeds): Add support for all baud rates defined
9181 2002-11-19 Jim Meyering <jim@meyering.net>
9183 * tests/sum/sysv: Export LC_ALL=C, to avoid failure when
9184 run in a UTF locale. Report and suggested fix by Bruno Haible.
9185 * tests/fmt/basic: Likewise.
9187 2002-11-17 Jim Meyering <jim@meyering.net>
9189 * configure.ac: Update via autoupdate.
9190 Add `AM_GNU_GETTEXT_VERSION(0.11.5)'.
9192 * src/mv.c (movefile): Don't remove trailing slashes from SOURCE.
9193 Reported by Hans Ginzel.
9195 2002-11-15 Jim Meyering <jim@meyering.net>
9197 * Makefile.cfg (gnu_rel_host): Define.
9198 (url_dir_list): Choose from (alpha|ftp).gnu.org depending
9199 on whether $(VERSION) looks like a major release number.
9201 * Makefile.maint (mail_gpg_sign_cookie): Backslash-escape `#'.
9202 (release): Rename from `alpha'.
9203 (alpha): Depend on release.
9205 * Makefile.maint (signatures): Define with ?=, so it's easy to override.
9207 2002-11-14 Jim Meyering <jim@meyering.net>
9209 * Makefile.maint (mail_gpg_sign_cookie): Make optional.
9210 (announcement): Use the new variable.
9212 * Makefile.maint: Sync with Bison, i.e.:
9213 (po-check): Scan .l and .y files instead of the
9214 .c and the .h files that they generate. This fixes the bug
9215 reported by Tim Van Holder in:
9216 <http://mail.gnu.org/pipermail/bison-patches/2002-November/001352.html>
9217 Look for N_ as well as for _. Try to avoid matching #define for
9221 2002-11-12 Jim Meyering <jim@meyering.net>
9223 * src/ls.c (HAVE_SYMLINKS): Remove unnecessary macro definition.
9224 Replace sole use with equivalent `#ifdef S_ISLNK'.
9225 Inconsistency reported by Dmitry V. Levin.
9227 2002-11-11 Jim Meyering <jim@meyering.net>
9229 * src/stat.c (usage): Transform --help items output via s/ - / /,
9230 so that help2man produces properly formatted man pages.
9231 Reported by Herbert Xu as Debian bug #168400.
9233 2002-11-10 Jim Meyering <jim@meyering.net>
9235 * src/ls.c (sighandler): Handle SIGTSTP specially.
9236 Based on suggestions from Solar Designer and Dmitry V. Levin.
9239 * Makefile.cfg (cvs_files): Define. From autoconf.
9240 (local_updates): Likewise.
9242 * src/ls.c (restore_default_color_handler, sigtstp_handler):
9244 (sighandler): New function, based on the one in sort.c.
9245 (main): Use sigaction, if possible; otherwise signal.
9246 Handle these signals:
9247 SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGTSTP.
9248 Don't register our handler if the signal is already being ignored.
9250 * src/dd.c (interrupt_handler): Use raise, rather than kill+getpid.
9251 * src/csplit.c (interrupt_handler): Likewise.
9252 * src/sort.c (sighandler): Likewise.
9253 (main): Declare `i' and `nsigs' to be unsigned, not int.
9255 2002-11-09 Jim Meyering <jim@meyering.net>
9257 ls --color: restore terminal text color upon signal.
9258 * src/ls.c: Include "full-write.h" and <signal.h>.
9259 (restore_default_color, restore_default_color_handler): New functions.
9260 (sigtstp_handler, put_indicator_direct): New functions.
9261 (main) [print_with_color]: Register signal handlers.
9262 Patch mostly by Solar Designer and Stanislav Ievlev.
9264 Update from autoconf.
9265 * Makefile.maint (AMTAR): Remove definition.
9266 (update, cvs-update, po-update, do-po-update): New rules.
9267 (wget-update): Update (thus renaming to cvs-update).
9268 (automake_repo): Use anoncvs@sources.redhat.com.
9270 2002-11-06 Jim Meyering <jim@meyering.net>
9272 * tests/misc/Makefile.am (TESTS): Add printf-hex.
9274 * tests/misc/printf: Be careful to test the code in this package,
9275 not the shell built-in function.
9277 * src/printf.c (print_esc): A hexadecimal escape sequence has
9278 at most two hex. digits, not three. Reported by Padraig Brady.
9279 (usage): Update description.
9280 * tests/misc/printf-hex: New file/test, for the above fix.
9282 2002-10-07 Paul Eggert <eggert@twinsun.com>
9284 Add support for locale-specific size indications (e.g.,
9285 thousands-separators) and for explicit size suffixes on output.
9287 * doc/coreutils.texi (Block size): Say that:
9288 This affects display format as well as block size.
9289 Fractional block counts are rounded up.
9290 ls file size blocksize defaults to 1.
9291 A block size spec preceded by ' generates thousands separators.
9292 A suffix without a preceding integer generates suffixes.
9293 (tail invocation): 32k -> 32 KiB.
9294 (What information is listed): ls -h is now equivalent to
9295 ls --block-size=human, and ls -H is now equivalent to
9296 ls --block-size=si. Displayed file size is now always affected by
9299 * lib/inttostr.c, lib/inttostr.h, lib/imaxtostr.c, lib/offtostr.c,
9300 lib/umaxtostr.c: New files, taken from GNU tar.
9302 * lib/Makefile.am (libfetish_a_SOURCES): Add imaxtostr.c, offtostr.c,
9304 (EXTRA_DIST): Add inttostr.c.
9306 * lib/human.c, lib/human.h: Rewrite to support locale-specific
9307 notations like thousands separators.
9308 Specify what includer of include.h must include beforehand.
9309 (human_group_digits, human_suppress_point_zero, human_autoscale,
9310 human_base_1024, human_SI, human_B): New enum values.
9311 (human_readable): Rename from human_readable_inexact; put the
9312 options before the sizes. All uses changed. The old human_readable
9313 function has been removed; use inttostr.h instead.
9314 (human_options): Renamed from human_block_size, with new signature
9315 that allows block sizes up to UINTMAX_MAX. All callers changed.
9317 * m4/prereq.m4 (jm_PREREQ_HUMAN): Check for locale.h, localeconv,
9318 AC_HEADER_STDBOOL. No need to check for limits.h since it's in
9319 freestanding C89. No need to check for stdlib.h or string.h since
9320 autoconf does this now.
9322 * src/cksum.c (cksum): Use primitives from inttostr.h, not
9323 human.h, to print large numbers simply.
9324 * src/csplit.c (handle_line_error, parse_patterns): Likewise.
9325 * src/dd.c (print_stats, main): Likewise.
9326 * src/df.c (print_header): Likewise.
9327 * src/factor.c (print_factors): Likewise.
9328 * src/ls.c (print_long_format, print_file_name_and_frills): Likewise.
9329 * src/shred.c (dopass): Likewise.
9330 * src/sort.c (checkfp): Likewise.
9331 * src/sum.c (bsd_sum_file, sysv_sym_file): Likewise.
9332 * src/tail.c (xlseek): Likewise.
9333 * src/wc.c (write_counts, wc): Likewise.
9335 * src/df.c (human_output_opts): New var.
9336 (output_block_size): Now uintmax_t, not int, to handle larger
9337 block sizes. All uses changed.
9338 * src/du.c: Likewise.
9339 * src/ls.c: Likewise.
9341 * src/df.c (print_header): In the header line, prefer SI to human
9342 representation if it's shorter; if neither is shorter, try to
9343 intuit what the user would prefer.
9345 * src/expr.c (inttostr): Remove; use new imaxtostr library
9348 * src/ls.c (file_output_block_size): New var, to distinguish
9349 file sizes from other sizes.
9350 (decode_switches): Set it.
9352 * src/shred.c (OUTPUT_BLOCK_SIZE): remove.
9353 (dopass): When printing progress, use floor for what has been done
9354 so far (since we should be conservative there), and ceiling for
9355 what needs to be done (since that's what other programs use).
9357 2002-10-19 Jim Meyering <jim@meyering.net>
9359 * src/pinky.c (print_heading): Align TTY and Name headings.
9360 Reported by Karl Eichwalder.
9362 2002-10-18 Jim Meyering <jim@meyering.net>
9364 * src/split.c (cwrite): Change type of `bytes' parameter to size_t
9365 Remove now-useless cast.
9366 (stdread): Remove function.
9367 (bytes_split): Use size_t instead of int.
9368 Use safe_read, not stdread.
9369 (lines_split): Likewise.
9370 Use memchr rather than a `while' loop.
9371 (line_bytes_split): Use size_t instead of int.
9372 Use safe_read, not stdread.
9373 (main): Add some FIXME comments to remind me to remove casts.
9375 * src/system.h (ST_BLKSIZE): Correct comment describing how to
9376 reproduce HPUX-11 cat failure. From Petter Reinholdtsen.
9378 2002-10-17 Jim Meyering <jim@meyering.net>
9380 Fix a problem that could make e.g., `cat' misbehave on systems which
9381 give invalid (unreasonably large) values for stat.st_blksize.
9382 * src/system.h (ST_BLKSIZE): Ensure that the result is in [1..4MB].
9383 Reported by Petter Reinholdtsen.
9385 2002-10-14 Jim Meyering <jim@meyering.net>
9387 Specifying a printf conversion specifer as nl's separator string
9388 could cause nl to segfault.
9389 * src/nl.c (build_print_fmt): Don't include separator string
9390 in the printf format; it might contain `%'.
9391 Use a better bound on the length of the print_fmt buffer.
9392 (print_lineno): Print the separator here instead.
9393 Reported by Doug Coleman.
9395 * tests/misc/nl: New file/tests, including a test for the above.
9396 * tests/misc/Makefile.am (TESTS): Add nl.
9398 * tests/misc/split-l: New test, to make sure `split --lines=N' works.
9399 * tests/misc/Makefile.am (TESTS): Add split-l.
9401 2002-10-13 Jim Meyering <jim@meyering.net>
9405 * src/du.c (usage): Tweak description of --dereference-args/-D.
9407 * src/du.c (count_entry): Also save cwd when dereferencing (via
9408 --dereference-args, -D) a command-line argument.
9409 Reported by Michal Svec. Based on a patch by Andreas Schwab.
9411 * src/Makefile.am (../AUTHORS): New target/rule.
9413 2002-10-12 Jim Meyering <jim@meyering.net>
9415 * src/paste.c (paste_parallel): Declare local, `delims_saved', to be
9416 of type size_t, since that's the way it's used and avoids a warning.
9418 * src/csplit.c (struct cstring) [len]: Declare to be unsigned int,
9419 since that's how it's always used and avoids a new warning from gcc.
9420 (read_input): Adapt to new safe_read ABI.
9422 * src/cut.c (cut_fields): Add a temporary size_t variable, n_bytes,
9425 * src/pinky.c (print_long_entry): fread returns size_t.
9426 Declare local `bytes' accordingly, to avoid warning.
9428 tail -c +N would perform an extra read after encountering EOF
9429 [this change is analogous (bytes vs. lines) to the one of 2002-01-27]
9430 * src/tail.c (start_bytes): Detect EOF, inform caller.
9431 (tail_bytes): Upon EOF in start_bytes, return immediately.
9432 (file_lines): Reorganize to use memrchr rather than an explicit loop.
9433 Adapt to new safe_read ABI.
9435 2002-10-11 Jim Meyering <jim@meyering.net>
9437 * tests/du/deref: New file/test, for the above fix.
9438 * tests/du/Makefile.am (TESTS): Add deref.
9440 2002-10-10 Jim Meyering <jim@meyering.net>
9442 * tests/ln/Makefile.am (TESTS): Add target-1.
9443 * tests/ln/target-1: New file/test, for the fix on 2002-10-08.
9445 2002-10-09 Jim Meyering <jim@meyering.net>
9447 * tests/cp/backup-is-src: Ensure that certain environment variables
9448 are not set (e.g., SIMPLE_BACKUP_SUFFIX). Reported by Duncan Roe.
9450 * tests/tail-2/big-4gb: Mark this as an expensive test; it would
9451 consume 4GB of disk space on systems without support for sparse files.
9452 Fix a logic error that'd make it `cat err' even though dd didn't fail.
9454 * src/dircolors.hin (.jar): Fix typo: s/;3$/;31/.
9455 Patch by steven@magelico.net, forwarded by Michael Stone.
9457 * tests/ls/dired: Ensure that ls produces English messages.
9458 Patch by Alexey Vyskubov, forwarded by Michael Stone.
9460 2002-10-08 Dmitry V. Levin <ldv@altlinux.org>
9462 * src/ln.c (main): Fix target_directory parsing when n_files == 1.
9464 2002-10-08 Jim Meyering <jim@meyering.net>
9466 * tests/tail-2/big-4gb: Use double quotes around diagnostic.
9467 Fix syntax in test: use =, not ==.
9468 Reported by Bob Proulx.
9469 Change all the rest like this: grep -lR "testing framework'" .\
9470 |xargs perl -pi -e 's/'\''(\$0: failure in testing framework)'\''/"$1"/'
9472 * src/sum.c (sysv_sum_file): Adapt to new safe_read ABI.
9473 * src/tr.c (squeeze_filter, read_and_delete, read_and_xlate): Likewise.
9474 * src/tac.c (save_stdin, tac_stdin_to_mem): Likewise.
9475 * src/wc.c (wc): Likewise.
9477 2002-10-07 Paul Eggert <eggert@twinsun.com>
9480 Don't advance the write pointer past the end of the write buffer.
9481 * src/sort.c (begfield, limfield): Likewise.
9483 2002-10-07 Jim Meyering <jim@meyering.net>
9485 * src/cat.c (simple_cat, cat): Adapt to new safe_read ABI.
9486 * src/head.c (head_bytes, head_lines): Likewise.
9488 2002-10-06 Jim Meyering <jim@meyering.net>
9490 * src/dd.c (scanargs): Ensure that specified block sizes (specified
9491 via ibs=N, obs=N, and bs=N) are no larger than SSIZE_MAX.
9492 (skip, dd_copy): Adapt to new safe_read ABI.
9494 * Makefile.maint (signatures): Define.
9496 (announcement): Depend on $(signatures).
9498 * Makefile.maint (announcement): Output all URLs for detached
9499 signatures, not just the last one from the previous loop.
9501 2002-10-05 Jim Meyering <jim@meyering.net>
9505 * src/remove.c (remove_entry) [ROOT_CAN_UNLINK_DIRS]: With `rm -i DIR',
9506 don't recurse into directory, DIR. Prompted by a report from
9509 * tests/rm/i-no-r: New file/test, for the above fix.
9510 * tests/rm/Makefile.am (TESTS): Add i-no-r.
9512 * tests/tail-2/big-4gb: New file/test, for the fix of 2002-09-27.
9513 * tests/tail-2/Makefile.am (TESTS): Add big-4gb.
9515 2002-10-03 Jim Meyering <jim@meyering.net>
9517 * src/rm.c (AUTHORS): Mark translatable string with `N_ (...)'.
9518 * src/df.c (AUTHORS): Likewise.
9519 * src/du.c (AUTHORS): Likewise.
9520 * src/tail.c (AUTHORS): Likewise.
9521 * src/touch.c (AUTHORS): Likewise.
9523 2002-10-02 Jim Meyering <jim@meyering.net>
9525 * Makefile.am (SUBDIRS): Remove `old'.
9526 (EXTRA_DIST): List the files in old/.
9527 * configure.ac (AC_CONFIG_FILES): Remove old/* names.
9528 Suggestion from Akim Demaille.
9530 2002-10-01 Jim Meyering <jim@meyering.net>
9532 * src/sys2.h (SSIZE_MAX): Define.
9534 2002-09-30 Jim Meyering <jim@meyering.net>
9536 * src/csplit.c: Don't include stdlib.h here. It's already included
9539 2002-09-29 Jim Meyering <jim@meyering.net>
9541 * src/tr.c (find_bracketed_repeat): Rearrange pointer/integer
9542 expression to avoid bogus warning from gcc.
9544 * src/cat.c (simple_cat): Use a temporary to avoid bogus warnings.
9545 (cat): Declare insize and outsize to be of type size_t, not int.
9546 Rearrange pointer/integer expressions to avoid bogus warnings.
9547 (main): Declare insize and outsize to be of type size_t, not int.
9549 * src/tail.c (parse_options): Give a sensible diagnostic for
9550 an invalid byte or line count. Reported by Mikko Tuumanen.
9552 * src/touch.c (main): Split a long line.
9554 * tests/du/Makefile.am (TESTS): Add slink.
9555 * tests/du/slink: New test for system.h change of 2002-08-31.
9557 In move mode, always first try to rename. Before, upon failure to
9558 rename a directory, this code would never attempt to rename any
9559 other file in that directory, but would thenceforth always copy.
9560 On some systems (e.g., NetApp's OnTap-6.4), renaming a directory
9561 may fail with EXDEV, yet renaming files within that directory to
9562 a newly-created destination directory succeeds.
9563 * src/copy.c (copy_internal): Remove local, move_mode;
9564 use x->move_mode instead. Based on a patch from Tom Haynes.
9566 2002-09-28 Jim Meyering <jim@meyering.net>
9568 * src/split.c (FAIL_ONLY_ONE_WAY): New macro.
9569 Factor out some duplication.
9571 [case 'a']: Use strtoul rather than strtol to avoid compiler warnings.
9573 * src/sort.c (begfield, limfield): Rearrange comparisons to avoid
9575 (fillbuf, keycompare): Cast literal `-1' to size_t in comparisons,
9576 to avoid compiler warnings.
9578 * src/shred.c (dopass): Use a uintmax_t temporary to avoid bogus
9581 Fix things so `mkdir -p' can create very deep directories, e.g.,
9582 mkdir -p $(perl -e 'print "a/" x 40000') now works.
9583 * src/mkdir.c (main): For --parents (-p), call make_path with the
9584 entire directory name, so we don't ever require that file operations
9585 like stat or chmod be performed on the entire command line argument.
9586 * makepath.c (make_path): Restore umask *before* creating the final
9589 2002-09-27 Andreas Schwab <schwab@suse.de>
9591 * src/tail.c (tail_bytes): Change type of bytes_remaining to off_t
9592 to avoid overflow. Reported by Hans Lermen.
9594 2002-09-26 Jim Meyering <jim@meyering.net>
9596 * src/install.c (get_ids): Use strtoul, not strtol. Remove some casts.
9598 2002-09-25 Jim Meyering <jim@meyering.net>
9600 * src/test.c (eaccess): Change type of local `euid' from int to uid_t
9601 and add a cast, to avoid a warning about `signed and unsigned type in
9602 conditional expression'.
9604 2002-09-22 Jim Meyering <jim@meyering.net>
9606 * src/rmdir.c: Include "dirname.h", for declaration of
9607 strip_trailing_slashes.
9609 * src/stat.c (PRIdMAX, PRIuMAX): Remove definitions.
9610 Now they're defined through system.h.
9612 * src/cp-hash.c, src/dd.c, src/df.c, src/du.c, src/ls.c,
9613 * src/stat.c, src/wc.c: Remove all inclusions of inttypes.h,
9614 since it's already included from sys2.h via system.h.
9616 * Use automake-1.6f. Regenerate dependent files.
9618 * src/Makefile.am (PERL): Remove duplicate definition.
9620 fmt's -s, -t, -c options didn't work properly for long lines.
9621 Since get_line may end up calling put_paragraph (for long lines),
9622 be sure to set global, `other_indent', before it is used there.
9624 * src/fmt.c (set_other_indent): New function, factored out of...
9625 (get_paragraph): ... here. Call it.
9626 (get_line): Call set_other_indent before calling flush_paragraph,
9627 which calls fmt_paragraph, which in turn calls put_paragraph,
9628 which uses other_indent.
9630 * tests/fmt/Makefile.am (TESTS): Add long-line.
9631 * tests/fmt/long-line: New file/test, for the above fix.
9633 2002-09-21 Jim Meyering <jim@meyering.net>
9635 * src/od.c: No longer include deprecated <values.h>.
9636 It was required solely for now-removed reference to BITSPERBYTE.
9637 * src/install.c: Likewise.
9638 Suggestion from Bruno Haible.
9640 2002-09-06 Andreas Schwab <schwab@suse.de>
9642 `rmdir -p dir-specified-with-trailing-slash/' would fail.
9643 * src/rmdir.c (remove_parents): Strip trailing slashes.
9645 2002-09-20 Jim Meyering <jim@meyering.net>
9647 * tests/rmdir/t-slash: New file/test, for the above fix.
9648 * tests/rmdir/Makefile.am (TESTS): Add t-slash.
9650 * Makefile.maint (announcement): Arrange to gpg-sign the message.
9651 Add a URL for each detached signature file.
9653 2002-09-07 Bruno Haible <bruno@clisp.org>
9655 * configure.ac: Add need-ngettext to AM_GNU_GETTEXT invocation.
9657 2002-09-18 Jim Meyering <jim@meyering.net>
9659 `od -t x8' used the wrong (`l'-prefixed) printf format.
9660 Likewise for the o8 and u8 formats.
9661 * src/od.c (ISPEC_TO_FORMAT): Define macro.
9662 (decode_one_format): Use PRIdMAX, PRIoMAX, etc. for LONG_LONG.
9663 Reported by Arun Sharma.
9665 2002-09-17 Jim Meyering <jim@meyering.net>
9667 * src/sys2.h (PRIdMAX, PRIoMAX, PRIuMAX, PRIxMAX): Define if necessary.
9668 From gettext's intl/loadmsgcat.c.
9670 * tests/od/x8: New file/test, for the above fix.
9671 * tests/od/Makefile.am (TESTS): Add x8.
9673 2002-09-15 Jim Meyering <jim@meyering.net>
9675 * Use autoconf-2.54. Regenerate dependent files.
9677 * src/csplit.c (get_format_width): Add cast to avoid
9678 warning about `signed and unsigned type in conditional expression'.
9680 2002-09-14 Jim Meyering <jim@meyering.net>
9682 * src/who.c (print_user): Change type of local to size_t
9683 to avoid warnings about `comparison between signed and unsigned'.
9684 * src/ptx.c (generate_all_output): Likewise.
9686 * src/dd.c (main, skip): Add casts to avoid warnings about
9687 `comparison between signed and unsigned'.
9689 * src/id.c (print_full_info, print_group_list): Add casts to avoid
9690 warnings about `signed and unsigned type in conditional expression'.
9692 * src/md5sum.c: Change type of global, digest_hex_bytes, to size_t
9693 to avoid warnings about `comparison between signed and unsigned'.
9694 (split_3): Change parameter names to be readable and add comment.
9695 Clean up the test for whether a line may be ignored.
9697 2002-09-13 Jim Meyering <jim@meyering.net>
9699 * src/printf.c (main): Handle leading command line argument of `--'.
9700 Reported by Raul: DervishD <raul@pleyades.net>
9701 * tests/misc/printf: New file: test for the above.
9702 * tests/misc/Makefile.am (TESTS): Add printf.
9704 * src/date.c (usage): Explain that %S's range of [0..60] is required --
9705 rather than 0..59 -- to accommodate the occasional positive leap second.
9706 Reported by Richard Neill.
9708 2002-09-12 Jim Meyering <jim@meyering.net>
9710 * src/Makefile.am (nanosec_libs): Define.
9711 (sleep_LDADD, tail_LDADD): Use it here.
9713 Factor nanosleep-related code into ../lib/xnanosleep.c.
9714 * src/sleep.c: Include xnanosleep.h.
9715 Factor out fenv.h-related code.
9716 (timespec_subtract): Remove function.
9717 (main): Remove code that deals with computing start and stop times
9718 as well as the loop around nanosleep. Now that's in xnanosleep.c.
9720 Allow S (in --sleep-interval=S) to be a floating point value.
9721 * src/tail.c: Include xnanosleep.h and xstrtod.h.
9722 Move declaration of global variable, sleep_interval, to ...
9724 (usage): Update description of --sleep-interval option.
9725 (tail_forever): New parameter, sleep_interval. Update caller.
9726 Use xnanosleep, rather than sleep.
9727 (parse_options): New parameter, sleep_interval. Update caller.
9728 Use xstrtod, now that we accept floating point values.
9729 Prompted by a patch from Augey Mikus.
9731 2002-09-06 Jim Meyering <jim@meyering.net>
9733 * src/remove.c (prompt): Change comment to give a better note to
9734 translators. From Michael Piefel.
9736 2002-09-02 Jim Meyering <jim@meyering.net>
9738 * README: A good problem report/patch includes diffs against
9739 the most recent test release.
9741 * src/pathchk.c (NEED_PATHCONF_WRAPPER): Define.
9742 (pathconf_wrapper): Define only if NEED_PATHCONF_WRAPPER is set.
9744 * src/kill.c (print_table_row): Use an unsigned type for widths
9745 to avoid warning about comparison between signed and unsigned.
9746 (list_signals): Likewise.
9748 * src/od.c (skip): Add a cast to avoid warning about comparison
9749 between signed and unsigned.
9750 * src/install.c (get_ids): Likewise. Also rearrange range-checking
9751 comparisons to make them more readable.
9753 2002-09-01 Jim Meyering <jim@meyering.net>
9757 2002-08-31 Jim Meyering <jim@meyering.net>
9759 Symlinks were always reported as using 0 blocks.
9760 * src/system.h (ST_NBLOCKS): Don't depend on file type.
9761 This reverts the change of 2000-01-30.
9762 Based on a report and patch from Neil Brown via Michael Stone.
9763 This fixes Debian Bug#156358.
9765 * Most files: Change `exit (0)' to `exit (EXIT_SUCCESS)',
9766 `exit (1)' to `exit (EXIT_FAILURE)', and
9767 `usage (1)' to `usage (EXIT_FAILURE)'.
9769 * chgrp.c, chmod.c, chown.c, chroot.c, cp.c, date.c, dd.c, du.c,
9770 * hostname.c, id.c, install.c, ln.c, mkdir.c, mkfifo.c, mknod.c,
9771 * nice.c, pinky.c, printf.c, pwd.c, shred.c, sleep.c, stty.c,
9772 * su.c, tac-pipe.c, tail.c, tee.c, touch.c, uname.c, uptime.c,
9773 * users.c, who.c: Change `error (1, ...' to `error (EXIT_FAILURE, ...'.
9774 But don't change `error (0, ...' to `error (EXIT_SUCCESS, ...', since
9775 error never exits successfully.
9777 2002-08-29 Jim Meyering <jim@meyering.net>
9779 * src/remove.c (remove_cwd_entries): Use closedir (not CLOSEDIR)
9780 when ignoring any return value.
9782 * src/remove.c (remove_cwd_entries): Detect and diagnose readdir
9783 failures. On some systems (at least EMC Celerra and Solaris5.8),
9784 this appears to be necessary.
9785 (is_empty_dir): Likewise. Also, always close directory handle.
9786 * src/ls.c (print_dir): Likewise.
9787 (print_dir): Rename local variable: reading -> dirp.
9788 Reported by Mike Coleman.
9790 2002-08-28 Jim Meyering <jim@meyering.net>
9792 * src/remove.c (remove_cwd_entries): Use CLOSEDIR, not closedir.
9793 Give a diagnostic and fail if closedir fails.
9795 2002-08-26 Jim Meyering <jim@meyering.net>
9797 * Makefile.am (THANKS-to-translators): New rule.
9798 (EXTRA_DIST): Add both THANKS-to-translators and THANKStt.in.
9799 * THANKStt.in: New file.
9801 * src/cat.c (close_stdout_wrapper): New, kludgey, function and
9803 (main): Register it with atexit.
9804 Close STDOUT_FILENO, to avoid a problem when writing to
9805 /dev/audio on at least Solaris 5.7 and 5.8 systems.
9806 Reported by Shing-Shong Shei.
9808 2002-08-25 Jim Meyering <jim@meyering.net>
9810 * src/cat.c (main): Close STDIN_FILENO rather than a literal `0'.
9811 * src/tac.c (main): Likewise.
9812 * src/tail.c (main): Likewise.
9813 * src/tee.c (main): Likewise.
9814 * src/tr.c (main): Likewise.
9815 * src/wc.c (main): Likewise.
9817 2002-08-20 Jim Meyering <jim@meyering.net>
9819 * tests/mv/setup: Rewrite not to use `: ${VAR=not_set}' paradigm.
9821 2002-08-10 Paul Eggert <eggert@twinsun.com>
9823 * src/nohup.sh: Don't use "exec --"; it's not portable and
9824 shouldn't be needed.
9826 2002-08-09 Jim Meyering <jim@meyering.net>
9828 * src/pr.c (main): Don't ignore -COLUMN if it's the last option.
9829 (usage): Clarify help text for the -COLUMN option.
9830 Patch by Padraig Brady.
9831 * tests/pr/Test.pm [col-last]: New test for the above.
9833 * configure.ac: Start with version 4.5.1, chosen so that it's larger
9834 than the latest version numbers of the component packages.
9836 * man/Makefile.am (check-x-vs-1): Set and export PATH so we use
9839 2002-08-08 Jim Meyering <jim@meyering.net>
9841 * src/date.c: Guard inclusion of <langinfo.h> with
9842 `#if HAVE_LANGINFO_CODESET', not `#if HAVE_LANGINFO_H'.
9843 * src/sort.c: Likewise.
9844 Patch by GOTO Masanori.
9846 2002-08-05 Paul Eggert <eggert@twinsun.com>
9848 Fix some minor time-related bugs with POSIX time arguments.
9849 Some valid time stamps were being rejected (notably -1, and
9850 time stamps before 1900 on 64-bit hosts). And some invalid
9851 time stamps were being accepted, e.g. September 31.
9853 * src/date.c (main): Adjust to posixtime signature change.
9854 * src/touch.c (main): Likewise. Remove unnecessary initialization.
9855 Use localtime, not posixtm, to warn about obsolete "touch".
9857 2002-08-05 Jim Meyering <jim@meyering.net>
9859 * tests/misc/Makefile.am (TESTS): Add nice and pathchk1.
9861 2002-08-04 Jim Meyering <jim@meyering.net>
9863 * src/Makefile.am (check-README): New target/rule.
9864 (check): Depend on it.
9866 * configure.ac (AC_CONFIG_FILES): Add old/Makefile and old/*/Makefile.
9868 2002-08-03 Jim Meyering <jim@meyering.net>
9870 * Makefile.am (SUBDIRS): Add old.
9871 * old/: New directory, containing legacy ChangeLog* and NEWS files
9872 from the fileutils, sh-utils, and textutils packages.
9874 * src/Makefile.am (AM_INSTALLCHECK_STD_OPTIONS_EXEMPT): Set to false.
9876 2002-08-02 Paul Eggert <eggert@twinsun.com>
9878 * NEWS, doc/coreutils.texi: uniq now obeys LC_COLLATE.
9880 * src/uniq.c: Include hard-locale.h, xmemcoll.h.
9881 (hard_LC_COLLATE): New var.
9882 (different): Args are now char *, not const char *.
9883 Use xmemcoll instead of memcmp to compare lines, so that
9884 LC_COLLATE has effect. However, use memcmp if it is an
9886 (check_file): Do not include newline in comparison, so that
9887 xmemcoll has a byte to stomp on temporarily.
9888 (main): Set hard_LC_COLLATE.
9890 2002-07-29 Jim Meyering <jim@meyering.net>
9892 * Makefile.am (SUBDIRS): Remove djgpp, for now.
9894 2002-07-20 Jim Meyering <jim@meyering.net>
9896 * Makefile.am (false.c): Convert only the final EXIT_SUCCESS
9897 into EXIT_FAILURE. Otherwise, false --help and false --version
9900 2002-07-08 Jim Meyering <jim@meyering.net>
9902 * src/Makefile.am (uninstall-local): Search for @GNU_PACKAGE@,
9903 rather than the hard-coded `sh-utils'.
9905 2002-07-01 Jim Meyering <jim@meyering.net>
9907 * configure.ac: Merge the three files from fileutils,
9908 textutils, and sh-utils.
9909 * Makefile.am: Likewise.
9910 * src/Makefile.am: Likewise.