Jim Meyering [Sun, 21 Dec 1997 12:05:42 +0000 (12:05 +0000)]
Include exclude.h.
(exclude): New static var.
(long_options, usage, main): Add --exclude and --exclude-from or -X.
(count_entry): Skip excluded entries.
Jim Meyering [Sun, 21 Dec 1997 11:47:27 +0000 (11:47 +0000)]
Include exclude.h.
(exclude): New static var.
(long_options, usage, main): Add --exclude and --exclude-from or -X.
(count_entry): Skip excluded entries.
Jim Meyering [Sun, 21 Dec 1997 11:17:20 +0000 (11:17 +0000)]
(rpl_chown): Rename from chown.
Undefine chown just after including config.h.
Include sys/stat.h.
Use correct ordering of uid and gid parameters both in function
definition and in call to chown.
With patches from Kaveh Ghazi.
Jim Meyering [Tue, 16 Dec 1997 15:09:19 +0000 (15:09 +0000)]
(struct bin_str): Make len int, not unsigned, to avoid
bogus comparison < 0.
(quote_filename): Add forward decl.
(decode_switches): -b, -e, -N, -Q are now mutually exclusive.
(print_dir): Quote directory name as per quoting options.
(print_long_format): Don't count color changes as part of file name.
(quote_filename): Revamp interface: now accepts stream to output to
and filename, and returns length of quoted filename.
This removes duplicated code and should make errors less likely.
Also, no longer mallocs storage. All callers changed.
Don't quote ' ' if -Q.
(OUTCHAR): New macro.
(SAVECHAR, SAVE_2_CHARS): Remove.
(print_name_with_quoting): New stack arg. All callers changed.
(print_color_indicator): Cast ext len to size_t to avoid warning
with GCC 2.8.
(length_of_file_name_and_frills): Rewrite to use quote_filename.
This fixes bug when computing file name length with -e.
1997-12-14 Paul Eggert <eggert@twinsun.com>
Add shell style quoting, and make it the default.
* NEWS, doc/fileutils.texi: Describe -e, which is now the default.
Describe change to --dired output.
* src/ls.c (quote_shell): New var.
(long_options, decode_switches, usage): New option -e or --quote-shell.
(dired_dump_obstack): New arg STYLE.
(main): Pass quoting style to dired_dump_obstack.
(decode_switches): -N now clears quote_as_string.
(quote_filename): Add shell style quoting.
Jim Meyering [Sat, 13 Dec 1997 22:49:33 +0000 (22:49 +0000)]
Change --help output to tell the truth: that for of=FILE,
FILE *is* truncated. Reported by Miles Bader.
Remove incomplete, usage-like comment at top of file.
Jim Meyering [Sat, 13 Dec 1997 16:22:58 +0000 (16:22 +0000)]
(do_move): If rename fails for any reason (not just when
errno == EXDEV), then revert to trying copy-then-unlink. This is
necessary to allow moving files within certain types of Linux NFS
mounted filesystems. Reported by Marty Leisner.
Jim Meyering [Thu, 11 Dec 1997 08:40:10 +0000 (08:40 +0000)]
(do_link): Don't require --force when target exists and
using --backup. This changes makes ln consistent with cp and mv in
this respect. Suggestion from Eli Zaretskii.
Jim Meyering [Sun, 30 Nov 1997 10:25:21 +0000 (10:25 +0000)]
(<limits.h>): Include if HAVE_LIMITS_H.
(CHAR_BIT, TYPE_SIGNED, TYPE_MINIMUM, TYPE_MAXIMUM, INT_MAX, UINT_MAX):
New macros.
(ST_NBLOCKS): Now counts actual blocks, not 512-byte blocks.
(ST_NBLOCKSIZE): New macro.
Jim Meyering [Sun, 30 Nov 1997 10:25:16 +0000 (10:25 +0000)]
(<inttypes.h>): Include if HAVE_INTTYPES_H.
("human.h"): Include.
(<limits.h>): Don't include; system.h does it now.
(INT_MAX): Remove.
(longdiff): Remove bogus definition that uses subtraction;
it gives the wrong answer when overflows occur.
(convert_blocks): Remove.
(output_units): New variable;
replaces booleans kilobyte_blocks and megabyte_blocks.
(human_readable_base): New variable.
(long_options, usage): Add -h or --human-readable and -H or --si.
(decode_switches): Adjust to renamed option variables.
Use -H if BLOCKSIZE is SI. Add -h, -H.
(print_dir): Count blocks using uintmax_t, not int.
(gobble_file): Now returns uintmax_t, not int.
Don't convert blocks to 512 byte units, as this might overflow;
let caller handle the problem. Deduce what caller will print
by invoking human_readable.
(print_long_format, print_file_name_and_frills): Don't assume
inode number, block count, file size fit in unsigned long.
Use human_readable to do block count conversion and to print
file sizes.
(prep_non_filename_text): Print decimal string for time if
localtime fails due to enormous time_t.