Age | Commit message (Collapse) | Author |
|
(usage): Update the description of -g.
(decode_switches): Honor the -g option (omit owner information),
now that POSIX specifies it.
(print_long_format): Don't print owner name if -g was specified.
Move declaration of `user_name' into the scope where it's used.
(print_group): Rename global from `inhibit_group'. Update all
uses accordingly.
(decode_switches): Make -n work just like -l, except
with numeric IDs, per POSIX. Before, to have any effect, -n had
to be used with -l. Reported by Dale Scheetz.
(usage): Update the description of -n.
Separate the descriptions of -n and --numeric-uid-gid.
Split string in --help output that had exceeded my limit of 2048 bytes.
|
|
|
|
downcase bulleted items
remove some periods
|
|
some of the filesystem types on which shred is not effective.
|
|
|
|
(WHEEL_START): Adjust definition.
(wheel_tab[]): Remove body of definition.
Include generated file, wheel.h, instead.
|
|
pad with spaces.
|
|
|
|
|
|
|
|
|
|
Add overflow and write error checks. Use uint_fast32_t, not
unsigned long, to do checksum calculation, as C99 says
uint_fast32_t should be no slower and might be faster.
Include <stdio.h> and "system.h" even if CRCTAB is defined,
so that the code will compile if CRCTAB is defined.
Include "human.h" if CRCTAB is not defined.
(uint_fast32_t): Define if it appears that stdint.h didn't.
(BIT, remainder, main, crctab): Use uint_fast32_t, not unsigned long,
for checksums.
(fill_r, remainder, main): Use ANSI prototypes.
(fill_r, remainder, main): Omit duplicate code.
(main): Use uintmax_t, not unsigned long, for file lengths.
Use size_t, not long, for result of fread.
Check for overflow when computing file lengths.
Check for write error immediately after printing a line, so that
we don't write to stdout indefinitely after an error.
|
|
when used with block or unblock.
|
|
that exists is a directory, don't treat it as if it were the only
argument. Before, `mkdir d; ls no-dir d 2>/dev/null' would act like
`ls d' and produce no output. Now, it prints `d:'.
|
|
|
|
|
|
`multi-character' rather than `multibyte' in a diagnostic.
|
|
code, since RLIMIT_RSS is similar (and is not standardized).
(default_sort_size): Don't allocate more than the RSS limit,
if this host has such a limit.
|
|
not always defined correctly.
|
|
(usage, main): Add support for long options, and check option
syntax as POSIX requires, though (as usual for GNU apps)
options can follow file names unless POSIXLY_CORRECT is set.
Many diagnostic revamped.
(long_options): New constant.
(badfieldspec): New arg MSGID. Mark as noreturn.
(parse_field_count): New arg MSGID; if null, just return null on error.
(new_key): Renamed from key_init. All callers changed. Now allocates
the new key.
|
|
|
|
|
|
help2man recognizes it as such.
|
|
|
|
(standard_header, header, test_suite): Remove.
(date_format, date_text, file_text, header_width_available): New vars.
(long_options, main, init_header, usage):
Add new -D or --date-format option.
(CHARS_FOR_DATE_AND_PAGE, T_BUF_FMT, T_BUF_SIZE, NO_DATE): Remove.
(init_header): Allow arbitrary width for date format. Change
"Page %5d" to "Page %d", since the code no longer assumes fixed width.
Do not assume that localtime succeeds.
(init_header, print_header, usage): Do not truncate headers.
(init_header, print_header): Defer width calculations until
page is printed, since "Page 100000" is wider than "Page 1".
Count columns, not bytes, in page headers.
Custom headers take up only the center, not the whole header.
(print_header): Use printf rather than fprintf(stdout).
|
|
better. All callers changed.
|
|
(sort_size): Now the user-specified sort size.
(MIN_MERGE_BUFFER_SIZE): New macro.
(MIN_SORT_SIZE): Use it.
(merge_buffer_size): New variable.
(fillbuf): Increase merge_buffer_size if a longer line is encountered.
(checkfp, mergefps): Do not allocate a buffer smaller than
merge_buffer_size.
(sort): Use the default_sort_size if sort_size is zero.
(main): Do not set sort_size to default_sort_size.
|
|
|
|
the inner scope where they're used.
(sort): Likewise.
|
|
(xfopen): Use stdout if *how != 'r'.
(mergefps): Remove FPS arg.
Open all input files, and close all files when done.
If OFP is null, open the output file (but after opening input files).
All callers changed.
(first_same_file): New function.
(sort, merge): Remove arg OFP; we now open the output file as needed.
All callers changed.
(merge): New arg MAX_MERGE. All callers changed.
(sort): For "sort F -o F", close the input before opening the output.
(main): Do not use close_stdout; 'sort' and 'merge' now close stdout.
(This also fixes a close-stdout-twice bug.)
Remove test for overlapping input and output files, as 'sort' no longer
needs to worry about overlap, and 'merge' checks for overlap itself.
Use first_same_file to inform 'merge' about how much to merge at
the top level, to avoid overlap.
|
|
a byte with the high bit set.
(prefix): Declare to be of type unsigned char, not `char'.
(get_prefix): Likewise for local, `p'.
|
|
|
|
|
|
(main): Pass a `struct stat *', not stat.st_mode to S_TYPEISSHM.
|
|
|
|
(create_temp_file, xfopen, xfclose, write_bytes, sort_buffer_size,
fillbuf, main): Use it to regularize error messages. The only change
in behavior is that write_bytes and the final close used to say "write
error" but now give just the output file name, which should be enough.
|
|
on error. All callers changed.
|
|
the output file in the error message; mention "-" instead.
|
|
Use fopen_safer, not fopen, to avoid subtle bugs when fopen returns
stdin, stdout, or stderr.
(xfclose): stdout is no longer a special case.
(main): Close output file, don't just flush it; there might be
an error on the close.
|
|
allocated, repeatedly halve it until allocation succeeds.
|
|
|
|
representing temp files. This improved CPU performance of
'sort -S 1 *.[ch]' by 17% on my host.
(struct tempnode): name member now uses struct hack.
(temphead): Now a pointer, not a structure. All uses changed.
(create_temp_file): Allocate node using struct hack.
(zaptemp): Free node using struct hack. Use pointer comparison, not
string comparison.
|
|
|
|
Defend against a DoS attack where someone else creates a
temporary file with the same name as ours. Use mkstemp to do
this, supplying our own mkstemp if the system doesn't have one.
Also, fix a race condition during cleanup on hosts without
sigaction.
(NAME_MAX_IN_DIR): Remove.
(sigprocmask, sigset_t): New macros, defined only on older hosts.
(caught_signals): New var.
(xtmpfopen, tempname): Removed.
(create_temp_file): New function, combining the functions of the old
xtmpfopen and tempname. All callers changed.
Use mkstemp to create the file.
(sighandler): On hosts without sigaction, ignore signals while
cleaning up, instead of letting them interrupt cleanup.
(main): Initialize caught_signals. On hosts with sigaction, block all
caught signals while handling one. Remove duplicate code.
|
|
into the inner scope where they are used.
|
|
In fact, remove t_errno altogether.
|
|
consistency with the other enum values.
|
|
(long_options): Use it instead of 'H' for --si.
(decode_switches): Warn that -H will change soon.
(usage): Likewise.
|
|
|
|
Now it prints a trailing `@'.
(gobble_file): Don't clobber lstat stats of command line
arguments when using -d and -F (--directory and --classify) options.
|