Commit Graph
4289 Commits
Author SHA1 Message Date
Jim Meyering 1a39890f3c (main): Adjust to new calling convention for set_cloexec_flag. 2004-04-04 06:33:44 +00:00
Jim Meyering dee056cd1b . 2004-03-31 09:01:47 +00:00
Jim Meyering a448e764c3 whoops. Remove old code, too, <blush>. 2004-03-31 08:27:27 +00:00
Jim Meyering 35e3e7e672 Specifying an invalid --width=N (-w) or --gap-size=N (-g)
would not elicit an error.

Include "xstrtol.h" and "quotearg.h".
(main): Don't use atoi.  Use xstrtoul instead.
2004-03-31 08:25:04 +00:00
Jim Meyering d49a6c1a2b . 2004-03-31 07:48:14 +00:00
Jim Meyering ba894b1ea1 [HAVE_SETHOSTNAME && !defined sethostname]:
Declare sethostname, since no Solaris header does it.
2004-03-29 07:30:09 +00:00
Jim Meyering 6de63bb739 Include "vasprintf.h", for asprintf. 2004-03-29 07:29:49 +00:00
Jim Meyering ca6d256f12 Minor optimization:
(process_file): Don't record dev/inode for directories.

Under some circumstances, without -c, du would mistakenly count the
space of hard-linked files, not just the first one it encountered.
Reported by Anthony Thyssen.
(du_files): Don't ever clear the set of `seen' dev/inodes.
2004-03-28 21:43:50 +00:00
Jim Meyering a35cbe5258 (print_grand_total): Rename global from `print_totals'. 2004-03-27 15:44:23 +00:00
Jim Meyering e95d9e93d9 (main): Rearrange filtering loop to be a tiny bit more efficient. 2004-03-27 09:11:25 +00:00
Jim Meyering ba1a527bdd Don't include savedir.h -- no longer needed. 2004-03-27 08:43:36 +00:00
Jim Meyering bb9fed5faa (main): Remove now-unused declaration of `i'. 2004-03-25 17:35:29 +00:00
Jim Meyering ac6954ac17 (main): Filter out file names of length zero before
invoking fts, so that they don't cause fatal errors.
2004-03-25 17:34:11 +00:00
Jim Meyering 210d765150 (EXPECTED_BYTES_PER_FILE_NAME, DEFAULT_PROJECTED_N_FILES):
Remove: not used.
(usage): Say "NUL-terminated", not "NUL-separated".
(main): Check for I/O error when istream is closed.
Allow --files0-from=F even if F is empty; this specifies no files.
(du_files): Now that we allow the list of files to be empty,
handle that case.
2004-03-24 15:13:55 +00:00
Jim Meyering 47ea391c68 (main): Free the hash table, too. 2004-03-23 16:32:11 +00:00
Jim Meyering 805bd8d9c4 . 2004-03-22 22:27:47 +00:00
Jim Meyering 7bafb22e6c (du_files): Return bool, rather than int.
(main): Call readtokens0_free.
2004-03-22 20:17:37 +00:00
Jim Meyering ee6a9e125a Include "readtokens0.h" rather than "readtokens.h".
(main): Use readtoken0 functions rather than readtokens.
Don't use errno when diagnosing readtokens0 failure.
2004-03-22 20:03:38 +00:00
Jim Meyering 51be5c4245 (ds_free): Plug a small leak. 2004-03-21 22:19:09 +00:00
Jim Meyering 03ed43f2b0 (main): whoops. don't use errno for this diagnostic:
_("no files specified in %s"),
2004-03-21 19:18:24 +00:00
Jim Meyering 082a7f8246 . 2004-03-21 18:50:03 +00:00
Jim Meyering f4b7232607 (tsort): Reflect changes in use of readtoken. 2004-03-21 18:45:54 +00:00
Jim Meyering 8def27a37e (do_stdin): Reflect changes in use of readtoken. 2004-03-21 18:45:37 +00:00
Jim Meyering 0fdff6d99a du accepts a new option --from0-file=FILE, where FILE contains
a list of NUL-separated file names.

Include "readtokens.h".
(usage): Describe the new option, and adjust the `Usage':
with this option, no FILE may be specified on the command line.
(main): Handle the new option.
2004-03-21 18:44:25 +00:00
Jim Meyering e0d2db847f . 2004-03-18 06:24:45 +00:00
Jim Meyering 1180a35ccc (touch_LDADD): New macro, since `touch' now needs clock_gettime. 2004-03-17 10:14:17 +00:00
Jim Meyering 1110307672 (enum Time_spec): New enum TIME_SPEC_NS.
(time_spec_string, time_spec, show_date): Support it.
(usage): Remove description of -ITIMESPEC, as it's obsolete and
confusing.  Mention --iso-8601=ns.
(batch_convert): getline returns ssize_t, not int.
2004-03-17 10:07:19 +00:00
Jim Meyering 553e0746b0 (newtime): Now an array of two timespecs, one
for access and one for modification.
(ref_stats): Remove.
(get_reldate): Use get_date's parameter profile.
(touch, main): Adjust to above changes.
(main): Work even if tm_year == INT_MAX (so long as long int is wider).
Use gettime instead of gettimeofday, for new get_date signature.
2004-03-17 10:06:57 +00:00
Jim Meyering ca0f9a0a29 (do_copy): Tweak wording in a diagnostic.
Suggestion from Karl Berry.
Include "quoatearg.h".
(do_copy): Use quotearg_colon (not quote) for diagnostics
that begin with `"%s:'.
2004-03-13 08:09:58 +00:00
Jim Meyering d86b014ebb (usage): Specify that nl uses _basic_ regular expressions. 2004-03-13 07:58:45 +00:00
Jim Meyering ec65003050 (src_to_dest_lookup): Add prototype. 2004-03-12 11:53:46 +00:00
Jim Meyering 83f4f1abd9 (src_to_dest_lookup): New function. 2004-03-12 11:53:29 +00:00
Jim Meyering bcea8e96ea Sometimes, when source and destination partition are different,
mv mistakenly fails to preserve a hard link.  Reported by IIDA Yosiaki.

When moving a set of N hard-linked files between
partitions, via two or more command line arguments where the
command line argument containing the Nth link contains no other
link to that same file, mv would mistakenly copy the file, rather
than hard-linking it to the other(s).  That happens because when the
final link is processed, its link count has been reduced to 1 since
the other links have been `copied' to the destination partition
and the source links have been removed.
(copy_internal): When in move mode, use the source dev/inode
pair to look up destination name even when st_nlink == 1.
2004-03-12 11:53:18 +00:00
Jim Meyering 98ea4dad08 . 2004-03-11 09:25:53 +00:00
Jim Meyering aa18f80de6 `join -1 x' would give a misleading diagnostic
(string_to_join_field): Report that a non-numeric field
number is invalid, rather than `so large that it is not representable'.
2004-03-10 10:44:31 +00:00
Jim Meyering 0ede5ec7f9 cp --sparse=always sparse-image-file.img /dev/hda1 could
produce an invalid copy on the destination device.

(copy_reg): Even with --sparse=always, try to
make `holes' only if the destination is a regular file.
Reported by Szakacsits Szabolcs.
2004-03-06 17:40:56 +00:00
Jim Meyering 118cee9878 . 2004-03-04 13:14:11 +00:00
Jim Meyering 940ffe5e02 (main): Don't invoke set_cloexec_flag with a file descriptor of -1. 2004-03-04 08:50:50 +00:00
Jim Meyering 8d0b9f87dd Include "cloexec.h".
(main): Set the copy of stderr to close on exec.
2004-03-03 22:00:20 +00:00
Jim Meyering 4dd6886e82 . 2004-03-02 22:56:17 +00:00
Jim Meyering 0674aab9db (usage): Remove stray space after \n in --help output. 2004-02-23 21:22:34 +00:00
Jim Meyering 4823b64c29 (usage): Separate -H and --si. Say that the meaning
of -H will soon change to that of --dereference-args (-D).
2004-02-22 21:23:06 +00:00
Jim Meyering fdb3c26e8e (eval, eval7, eval6, eval5, eval4, eval3, eval2, eval1):
Accept a bool argument specifying whether to evaluate the
expression.  This is to allow short-circuit evaluation.  All
callers changed.
(null): Report that a string is zero even if it has
a form like "-0" or "00".
(eval1, eval): Use short-circuit evaluation for | and &.
(eval): Return 0 if both arguments are null or zero, instead
of returning the first argument.
2004-02-22 14:56:58 +00:00
Jim Meyering 3fd433e9d3 (usage): Tell what comm does when there are no options.
Reword in terms of FILE1 and FILE2 rather than `left file' and
`right file'.  Suggestion from Dan Jacobson.
2004-02-21 09:21:15 +00:00
Jim Meyering 317f26ba57 (usage) [-u]: Add punctuation so that the description in
the help2man-generated (line-joined) man page is more readable.
Reported by Tim Waugh.
[-T]: Add a semicolon, for the same reason.
2004-02-17 10:52:49 +00:00
Jim Meyering 666fce05a1 (cp_option_init): Don't initialize xstat member. 2004-02-07 16:01:39 +00:00
Jim Meyering ad31f43350 (cp_option_init): Likewise. 2004-02-07 16:01:31 +00:00
Jim Meyering d9e9327b09 (re_protect): Use XSTAT (x, ...)' in place of *(x->xstat) (...)'.
(do_copy): Declare/use local xstat rather than x->xstat.
(main): Remove code that set x.xstat.
2004-02-07 16:01:20 +00:00
Jim Meyering e80f7332e2 Remove xstat function pointer member. The way it was used was not
portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
inline `stat' and `lstat' functions, thus making the tests of
`xstat == lstat' in copy.c always fail.

(struct cp_options) [xstat]: Remove member.
(XSTAT): New macro.
2004-02-07 16:01:02 +00:00
Jim Meyering c9736bdff0 Remove xstat function pointer member. The way it was used was not
portable, since some systems (OSF V5.1, Solaris 2.5.1) provide static
inline `stat' and `lstat' functions, thus making the tests of
`xstat == lstat' in copy.c always fail.

(copy_dir): Set `.dereference' member, not .xstat.
(copy_internal): Use `XSTAT (x, ...)' in place of `*(x->xstat) (...)'.
Use `x->dereference == DEREF_NEVER' in place of `x->xstat == lstat'.
(valid_options): Remove now-obsolete FIXME comments.
2004-02-07 16:00:28 +00:00