Age | Commit message (Collapse) | Author |
|
Don't include version-etc.h.
|
|
Don't include closeout.h.
|
|
Don't include stdlib.h.
|
|
Don't include errno.h.
|
|
Don't include limits.h or error.h.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(xstrndup): Remove function, now that it's been factored out into
it's own file.
|
|
|
|
|
|
which caused the former to be used uninitialized if file_x was
nonzero.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
determine range endpoints.
|
|
extract the 1,000,000-th field of some huge input file?
The first step is to rearrange things so that the values
in the printable_field array are all 0/1 rather than 0/1/2.
(RANGE_START_SENTINEL): Remove.
Store range-start indices in a hash table, rather than
overloading the `printable_field' array.
(range_start_ht): New global.
(hash_int, hash_compare_ints, is_range_start_index): New functions.
(print_kth): Use is_range_start_index; don't test printable_field.
(set_fields): Detect overflow.
(set_fields): Insert each range-start index into range_start_ht.
(main): Call set_fields only once, and only after
output_delimiter_specified and (if required) range_start_ht have
been defined.
|
|
invoked with a null pointer when there were no file arguments.
|
|
|
|
(wc): Rename `file' parameter.
Set new local, `file', to be the file name, or (when it's NULL)
_("standard output") so that all uses of `file' use the proper value.
Use STREQ, not strcmp.
|
|
(posixly_correct): Remove.
(struct fstatus): New struct.
(write_counts): Output fields of width number_width.
Do not worry about POSIXLY_CORRECT.
Use null file, not empty-string file, to denote stdin,
since "" is a valid file name on some hosts.
(wc, wc_file): New arg fstatus. Use it to avoid invoking fstat
if possible.
(wc): Avoid problems if end_pos - current_pos overflows.
Do not print odd message if stdin has a read error.
(get_input_fstatus, compute_number_width): New functions.
(main): Use them to implement the new behavior.
Ignore POSIXLY_CORRECT.
|
|
(main): Set exit_failure rather than calling close_stdout_set_status.
|
|
(main): Set exit_failure rather than calling close_stdout_set_status.
|
|
Now `sort --version' and `sort --help' fail, as they should
when their output is redirected to /dev/full.
|
|
(main): Use close_stdout via atexit.
Now `su --version > /dev/full' fails, as it should.
Somehow, the change of 2000-05-07 that purports to fix this
was not checked in.
|
|
count and the corresponding line, as required by POSIX.
|
|
(main): Set exit_failure, not xalloc_exit_failure and xmemcoll_exit_failure.
|
|
(EXPR_INVALID, EXPR_ERROR): New constants.
(nomoreargs, null, toarith, nextarg): Return bool, not int.
(syntax_error): New function, exiting with status 2. Use it
insteading of printing "syntax error" ourselves.
(main): Initialize exit_failure to EXPR_ERROR.
Exit with EXPR_INVALID on syntax error (too few arguments).
(nextarg): Use strcmp, not strcoll; strcoll might return
an undesirable 0, or might fail.
(docolon, eval4, eval3): Exit with status 3 on invalid argument type
or other such error.
(eval2): Report an error if strcoll fails in a string comparison.
|
|
Use an anonymous `enum', rather than #define.
|
|
|
|
whereby kill would always attempt to operate on argv[0] and fail.
|
|
it also matches the one from bash's builtin test.
(binary_operator): Add \n at end of diagnostic.
|
|
names of authors that I just found in bash's builtins/test.def.
|
|
(main) [LBRACKET]: Move initialization of argv to
precede potential use via test_syntax_error.
|
|
|
|
(main): Use them.
|
|
|
|
|
|
|
|
|
|
|
|
now that that function no longer calls `error'.
|
|
failed syscall, rather than relying on caller to do that.
The caller couldn't do a good job, anyhow -- too many different
ways to fail (each with a different referent).
Give a diagnostic upon failed save_cwd, now that that function
no longer calls `error'.
(show_point): Don't diagnose find_mount_point's errors, now that
it handles them itself.
|