Jim Meyering [Fri, 31 Jan 2003 18:28:39 +0000 (18:28 +0000)]
Include "file-type.h"
(print_human_type): Remove function.
(human_access): Rename from print_human_access. Return a string.
(human_time): Rename from print_human_time. Return a string.
(print_stat): Arrange so that field width and an alignment specifier
are honored for the %A, %F, %x, %y, and %z formats.
[%F]: Use file_type; this gives slightly different file type strings,
e.g., `directory' instead of `Directory' and `regular file' or
`regular empty file' instead of `Regular file'.
Jim Meyering [Fri, 31 Jan 2003 13:35:25 +0000 (13:35 +0000)]
(main): Upon processing a bad --exclude-from or --max-depth
option argument, don't exit right away, in case there are others.
Rather record the failure and exit after processing other options.
Jim Meyering [Fri, 31 Jan 2003 10:39:33 +0000 (10:39 +0000)]
Rewrite to perform directory traversal using nftw.
Include "dirname.h", "ftw.h", and "quotearg.h".
(AUTHORS): Add self.
(opt_one_file_system): Move global into `main'.
(path, xstat, exit_status): Remove declarations.
(arg_length, suffix_length): New globals.
(G_fail): New global, sort of like the old `exit_status'.
(IS_FTW_DIR_TYPE): Define.
(print_only_size): New function.
(process_file): New function.
(str_init, ensure_space, str_copyc, str_concatc): Remove functions.
(str_trunc, pop_dir, count_entry): Likewise.
(du_files): Rewrite to use nftw.
Jim Meyering [Mon, 27 Jan 2003 13:42:26 +0000 (13:42 +0000)]
(quote_name): Add fourth parameter, width, into which to
store the screen columns, and return the number of bytes instead.
(print_dir): Pass NULL as fourth parameter of quote_name.
(print_name_with_quoting): Likewise.
(length_of_file_name_and_frills): Get the width from the fourth
parameter of quote_name instead of return value.
Jim Meyering [Mon, 27 Jan 2003 10:45:48 +0000 (10:45 +0000)]
(decode_switches): If `dired' is set without
`format == long_format', then silently reset dired. This doesn't
change the behavior of ls (all prior uses of dired were protected
by `&& format == long_format'), and lets us...
(DIRED_INDENT): ... remove `format == long_format' conjunct.
(PUSH_CURRENT_DIRED_POS): Likewise.
(main): Likewise.
Jim Meyering [Sat, 25 Jan 2003 20:32:44 +0000 (20:32 +0000)]
[_LIBC] (ISSLASH, FILESYSTEM_PREFIX_LEN): Define.
(base_name): New function.
(ftw_startup): Don't strip trailing slashes.
Use base_name to find the offset of the basename.
Jim Meyering [Wed, 22 Jan 2003 13:13:04 +0000 (13:13 +0000)]
Include autoconf-recommended block of dirent/NAMELEN
related definitions and includes. Use NAMELEN throughout,
rather than _D_EXACT_NAMLEN.
[_LIBC]: Define NAMELEN to _D_EXACT_NAMLEN.
(stpcpy): Declare, if necessary.
(mempcpy): Define, if necessary.
[!_LIBC] (__stpcpy, __mempcpy): Define.
[!_LIBC] (LXSTAT, XSTAT): Define.
Jim Meyering [Tue, 21 Jan 2003 18:49:49 +0000 (18:49 +0000)]
(remove_entry) [ROOT_CAN_UNLINK_DIRS && HAVE_STRUCT_DIRENT_D_TYPE]: If a file
has d_type == DT_UNKNOWN it may still be a directory -- or not (e.g., with
FreeBSD on an NFS-mounted file system), so resort to calling lstat to find out.
Jim Meyering [Tue, 21 Jan 2003 12:36:56 +0000 (12:36 +0000)]
Don't assume that the file owner username
length is less than 9 in ls output: instead, omit that field
altogether. Reported by, and suggested fix from, Ferdinand.
Jim Meyering [Tue, 21 Jan 2003 08:57:13 +0000 (08:57 +0000)]
[! weak_alias]: Define __-prefixed names to publicized ones.
[! defined _LIBC]: Define-away weak_alias and internal_function.
[defined weak_alias]: Guard each use of weak_alias.