Jim Meyering [Mon, 24 Feb 2003 09:58:02 +0000 (09:58 +0000)]
Include <search.h>.
(struct known_object): Define.
(object_compare, add_object, find_object): New functions, like
those in ftw.c.
(fts_open): Initialize new member.
(fts_close): Free memory allocated for new member.
(fts_stat): Detect a cycle in O(logN) time per directory processed.
Jim Meyering [Mon, 24 Feb 2003 09:09:42 +0000 (09:09 +0000)]
[HAVE_CONFIG_H]: Include <config.h>.
Conditionalize inclusion of <sys/param.h>.
Conditionalize inclusion of <include/sys/stat.h> vs <sys/stat.h>.
Include autoconf-recommended block of dirent/NAMELEN-related
definitions and includes. Use NAMLEN throughout, rather than
_D_EXACT_NAMLEN.
[_LIBC] (close, closedir, fchdir, open, opendir): Define.
[_LIBC] (readdir, tdestroy, tfind, tsearch): Define.
Remove `__' prefix from all uses of the above. This will help
to merge *BSD changes.
[!_LIBC] (internal_function): Define.
[! _LIBC && ! LSTAT_FOLLOWS_SLASHED_SYMLINK]: Define lstat.
(__set_errno): Define if not already defined.
Jim Meyering [Mon, 24 Feb 2003 08:27:59 +0000 (08:27 +0000)]
(fts_open): If fts_alloc returns NULL, don't dereference it.
(fts_read): If fts_safe_changedir fails because it is not
able to chdir into a subdirectory, then inform the caller.
Jim Meyering [Sat, 22 Feb 2003 16:52:36 +0000 (16:52 +0000)]
(beta, major): New targets. Remove `release'.
Put them all together on a line.
Pass the release type (via RELEASE_TYPE envvar) to the MAKE
invocation of `announcement'.
(announcement): Invoke announce-gen with --release-type=$RELEASE_TYPE.
Jim Meyering [Fri, 21 Feb 2003 08:30:18 +0000 (08:30 +0000)]
New option: --apparent-size.
(enum) [APPARENT_SIZE_OPTION]: New member.
(long_options): Add it.
(usage): Describe it.
(main): Handle it.
['b']: Set apparent_size.
Jim Meyering [Fri, 21 Feb 2003 07:47:06 +0000 (07:47 +0000)]
(apparent_size): New global.
(print_only_size): Reflect the fact that we're printing byte counts,
not ST_NBLOCKSIZE-byte-block counts.
(print_size): Call print_only_size rather than duplicating its code.
(process_file): Accumulate byte counts, rather than block counts.
Jim Meyering [Thu, 20 Feb 2003 23:13:11 +0000 (23:13 +0000)]
(process_file): Reorganize the code to use only
one `sum' array, and change how -S works back to the way it was
before 2003-01-31. Patch by Bruno Haible.
Jim Meyering [Thu, 20 Feb 2003 10:37:14 +0000 (10:37 +0000)]
Now, df always displays the device file name corresponding to the
listed mount point under `Filesystem'. Before, for an unmounted
block- or character-special file argument, it would display the
command-line argument instead.
(show_disk): Return a value indicating whether
there was a match. Don't try to find a mount point here.
(show_entry): If show_disk doesn't find a match, call show_point.
Jim Meyering [Wed, 19 Feb 2003 22:20:45 +0000 (22:20 +0000)]
Include "mmap-stack.h".
(du_files): Add prototype with ATTRIBUTE_NORETURN.
Exit from this function, not from...
(main): ...here.
Instead, if possible, invoke du_files through a macro that
runs it with a large, mmap'd stack.
Jim Meyering [Wed, 19 Feb 2003 16:05:07 +0000 (16:05 +0000)]
(print_header): Rather than using a hard-coded literal
string of spaces matching the length of the English `...Type' header,
output the right number of spaces to match the selected translation.
Reported by Yann Dirson and Jean Charles Delepine as Debian bug 131113.
Jim Meyering [Wed, 19 Feb 2003 14:28:50 +0000 (14:28 +0000)]
Include "full-read.h".
(bytes_split, lines_split, line_bytes_split): Use full_read,
not safe_read. The way split was using the latter, a short read
could cause split to terminate before EOF.
(bytes_split): Remove unnecessary `else' after break.
(lines_split): Likewise. and correct misleading indentation.