Age | Commit message (Collapse) | Author |
|
invoking savedir, and assume that errno is nonzero if savedir fails.
|
|
|
|
|
|
for that purpose instead.
(count_entry): Also save the directory if we're saving more
than one level.
Fix file descriptor and memory leak when chdir fails.
|
|
(count_entry): Factor out common code (pop_dir), and call the new
function instead.
Move declaration of global, `stat_buf' into this function.
(du_files): Don't stat `.' or call save_cwd, since count_entry
never returns with a changed working directory.
|
|
(main): Likewise, for add_exclude_file.
|
|
Define these and use them instead of `CHAR_MAX + n'.
|
|
|
|
|
|
via sys2.h.
|
|
Include version-etc.h instead.
(PROGRAM_NAME, AUTHORS): Define.
[long_options]: Add entries for --help and --version.
Remove parse_long_options call.
(main) [getopt switch]: Add a case for each of --help and --version.
|
|
[long_options]: Remove the "help" and "version" entries.
(main): Use parse_long_options, including author name(s).
Remove the show_version and show_help blocks.
|
|
|
|
xargmatch.
|
|
|
|
in place of `1', and `NULL' in place of opt_* pointer in initialization.
|
|
|
|
|
|
replace with new variable output_block_size. All uses changed.
(long_options, usage, main): Add --block-size.
(main, decode_switches): Use new human_block_size function to
initialize output block size consistently with other programs.
From Paul Eggert.
|
|
|
|
|
|
Include "closeout.h".
|
|
|
|
|
|
(exclude): New static var.
(long_options, usage, main): Add --exclude and --exclude-from or -X.
(count_entry): Skip excluded entries.
|
|
(exclude): New static var.
(long_options, usage, main): Add --exclude and --exclude-from or -X.
(count_entry): Skip excluded entries.
|
|
|
|
(String *): Rename from parameter-shadowed `string'.
(stringstruct): Remove typedef.
|
|
|
|
("human.h"): Include.
(LONGEST_HUMAN_READABLE, enum Output_units): Remove.
(count_entry): Now returns uintmax_t, not long.
(human_readable_base): Renamed from opt_human_readable; value is now
zero or positive integer, not just zero or nonzero.
(output_units): Now an integer giving output size.
(tot_size): Now uintmax_t, not long.
(long_options, usage): Add --si or -H.
(main): Adjust to renamed option variables.
Use -H if BLOCKSIZE is SI. Add -H.
(human_readable): Remove; rewritten and now in lib/human.c.
(print_size): Rewrite in terms of human_readable.
Accept extra arg to be printed after size; all callers changed.
|
|
|
|
|
|
Include savedir.h for prototype.
|
|
(enum Output_units): Rename from output_size.
Rename size_* to Unit_*.
Add Unit_variable to correspond to --human-readable.
(convert_blocks): Remove now-unused definition.
(human_readable): Rename paramater n_bytes to n_blocks.
Adjust conversions to reflect fact that input is now number of
512-byte blocks, not bytes.
(print_size): New function.
(du_files): Use print_size instead of open coding it.
(count_entry): Always count in units of 512-byte blocks to delay.
This lets du accumulate totals corresponding to a terabyte before
overflowing 32-bit long int.
Use print_size instead of open coding it.
|
|
(du_files): Pass output_size unchanged to convert_blocks. No need
to test output_size for size_bytes, convert_blocks handles that
correctly.
(count_entry): Likewise.
|
|
Based on the idea and a patch from Torbjorn Lindgren.
(du_files): Likewise.
(count_entry): Likewise.
[AIX]: Remove unused #pragma alloca.
|
|
Based on the idea and a patch from Torbjorn Lindgren.
(du_files): Likewise.
(count_entry): Likewise.
|
|
|
|
|
|
|
|
*) 0' as last parameter in getopt_long call.
|
|
--megabytes report numbers in units of kilobytes.
Reported by Galen Hazelwood.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|