Commit Graph
20330 Commits
Author SHA1 Message Date
Jim Meyering 20fd309527 (main): Remove obsolete FIXME. 2003-10-08 18:24:04 +00:00
Jim Meyering d0dfb248ae *** empty log message *** 2003-10-08 17:55:26 +00:00
Jim Meyering 59e7627371 *** empty log message *** 2003-10-08 17:55:06 +00:00
Jim Meyering 32533b8cfa (libfetish_a_SOURCES): Add xstrtoimax.c. 2003-10-08 17:55:02 +00:00
Jim Meyering 0b693b7d02 csplit cleanup.
Be more careful about int widths.  For example, remove some
arbitrary limits by replacing 'unsigned' with 'size_t',
'uintmax_t', etc.  Use standard bool rather than a homegrown type.

(FALSE, TRUE, boolean): Remove.  All uses changed
to <stdbool.h> usage.
(struct control): offset is now intmax_t, not int.
repeat_forever is now bool, not int.
(struct cstring): len is now size_t, not unsigned int.
(struct buffer_record): bytes_alloc, bytes_used, num_lines are now
size_t, not unsigned.  start_line, first_available are now
uintmax_t, not unsigned.
(hold_count, control_used): Now size_t, not unsigned.
(last_line_number, current_line, bytes_written):
Now uintmax_t, not unsigned.
(save_to_hold_area, red_input, keep_new_line, record_line_starts,
create_new_buffer, get_new_buffer, load_buffer, find_line,
process_regexp, split_file, new_control_record, extract_regexp,
get_format_width, get_format_prec, max_out):
size args, locals, and returned values are now size_t, not unsigned
or int.
(get_first_line_in_buffer, find_line, write_to_file,
handle_line_error, process_line_count, regexp_error, process_regexp,
split_file):
File line, byte, and repetition counts are now uintmax_t, not unsigned.
(check_for_offset): Don't require a sign before the offset.
Use xstrtoimax to do the real work.
(extract_regexp): Remove harmful cast of size to unsigned.
256 -> 1<<CHAR_BIT, for clarity.
(get_format_flags): Return at most 3, to avoid worries about overflow.

(bytes_to_octal_digits): Remove.

(cleanup): Don't check whether output_stream is NULL, since
close_output_file does that for us.

(new_line_control, create_new_buffer): Use "foo *p = xmalloc
(sizeof *p);" instead of the more long-winded alternatives.

(get_new_buffer): Use O(1) algorithm for resizing a buffer
to a much larger size, instead of an O(N) algorithm.

(process_regexp): Use plain NULL rather than casted 0.

(make_filename): Use %u, not %d, to format unsigned file number.

(new_control_record): Use xrealloc exclusively, since it handles
NULL reliably,

(extract_regexp): Change misspelled word in diagnostic.

(get_format_width): Even if a minimum field width is specified,
allow room for enough octal digits to represent the value of
the maximum representible integer.  This fixes a potential
buffer overrun.  Calculate this room at compile-time, not
at run-time; this removes the need for bytes_to_octal_digits.
Check for overflow; this removes a FIXME.

(get_format_prec): Don't allow precision to be signed; it's
not ANSI.  Check for overflow.  Remove hardcoded "11" as
default precision; this fixes a potential buffer overrun
on hosts with wider size_t.

(get_format_conv_type): Change local variable to be of type
unsigned char, not int; this removes a potential subscript
violation on hosts where char is signed.

(max_out): Replace "for (;*p;)" with more-standard "while (*p)".
Allow "%%" in format.  Don't overflow when
counting lots of percents.

(usage): Default sprintf format is %02u, not %d.
2003-10-08 17:54:19 +00:00
Jim Meyering 1fa0bdedfa *** empty log message *** 2003-10-08 17:53:28 +00:00
Jim Meyering 49e0862ebb (csplit invocation):
The regexp offset need not have a sign; POSIX requires support
for signless offets.
2003-10-08 17:53:18 +00:00
Jim Meyering 5b00b41da4 . 2003-10-08 12:35:00 +00:00
Jim Meyering 37f18d586f . 2003-10-07 15:23:08 +00:00
Jim Meyering 6d9a639624 . 2003-10-07 13:05:04 +00:00
Jim Meyering 9376bfaf9a *** empty log message *** 2003-10-07 07:22:13 +00:00
Jim Meyering 65cf146ccb . 2003-10-07 07:21:37 +00:00
Jim Meyering 159100e710 . 2003-10-06 17:42:22 +00:00
Jim Meyering 8ae169aa8d . 2003-10-06 07:55:11 +00:00
Jim Meyering 43d15f0721 *** empty log message *** 2003-10-06 07:54:45 +00:00
Jim Meyering 7fb1375c83 remove now-unused file 2003-10-06 07:53:44 +00:00
Jim Meyering d3e958c35d *** empty log message *** 2003-10-05 16:26:51 +00:00
Jim Meyering 9f761eaf90 (change_file_owner): Remove set-but-not-used local. 2003-10-05 16:26:45 +00:00
Jim Meyering 77549cb5c3 s/nftw/fts/g in a comment 2003-10-05 15:35:27 +00:00
Jim Meyering 6439683433 *** empty log message *** 2003-10-05 11:43:02 +00:00
Jim Meyering 875c32f4e6 (du_files): Mark diagnostic for translation. 2003-10-05 11:42:55 +00:00
Jim Meyering 6c154f854a *** empty log message *** 2003-10-05 11:42:16 +00:00
Jim Meyering dcd207cd60 (jm_MACROS): Don't require AC_FUNC_FTW. 2003-10-05 11:42:11 +00:00
Jim Meyering b21194d622 . 2003-10-05 11:41:18 +00:00
Jim Meyering 500c410d96 *** empty log message *** 2003-10-04 19:57:06 +00:00
Jim Meyering 74f48809ba *** empty log message *** 2003-10-04 19:56:38 +00:00
Jim Meyering 7da7011b65 (du_files): Ignore any failure of fts_close. 2003-10-04 19:56:32 +00:00
Jim Meyering 6e075a0f87 *** empty log message *** 2003-10-04 17:01:22 +00:00
Jim Meyering e2d3450c72 (du_files): Give better diagnostics for failed fts_open. 2003-10-04 17:01:13 +00:00
Jim Meyering 2190e5a5d8 *** empty log message *** 2003-10-04 12:16:12 +00:00
Jim Meyering b5eef18d40 (MAX_N_DESCRIPTORS): Remove now-unused definition. 2003-10-04 12:16:00 +00:00
Jim Meyering 4a7bc58d00 *** empty log message *** 2003-10-04 12:14:24 +00:00
Jim Meyering 685c7c4707 *** empty log message *** 2003-10-04 12:13:26 +00:00
Jim Meyering 2331952ff1 (enum) [HUMAN_SI_OPTION]: New member.
[long_options]: Use HUMAN_SI_OPTION, not 'H'.
(main): Warn that the meaning of -H will soon change.
2003-10-04 12:11:51 +00:00
Jim Meyering bc7d3363ac *** empty log message *** 2003-10-04 11:58:47 +00:00
Jim Meyering 3596e7186a *** empty log message *** 2003-10-03 20:17:29 +00:00
Jim Meyering 3e2474e7c4 Accept --no-dereference (-P). 2003-10-03 20:17:18 +00:00
Jim Meyering 4bb11ad5bf *** empty log message *** 2003-10-03 20:15:40 +00:00
Jim Meyering b1c0650ca5 (du invocation): Describe -P, --no-dereference. 2003-10-03 20:15:36 +00:00
Jim Meyering 870b12372e . 2003-10-02 20:30:47 +00:00
Jim Meyering 90d369d90a . 2003-10-02 20:30:19 +00:00
Jim Meyering 3efc708abb *** empty log message *** 2003-10-02 20:30:09 +00:00
Jim Meyering 2601bad546 (TESTS): Add inaccessible-cwd. 2003-10-02 20:30:05 +00:00
Jim Meyering 00567c8369 *** empty log message *** 2003-10-02 20:29:21 +00:00
Jim Meyering 2e59a4b3e6 Adjust for slightly different output. 2003-10-02 20:29:12 +00:00
Jim Meyering 95c948b06a Include "fts_.h", not ftw.h.
(opt_dereference_arguments, arg_length, suffix_length): Remove globals.
(IS_FTW_DIR_TYPE): Remove definition.
(IS_DIR_TYPE): Define.
(is_symlink_to_dir): Remove now-unnecessary function.
(process_file, du_files): Rewrite to use fts.
2003-10-02 20:26:41 +00:00
Jim Meyering 43cee1d6fc *** empty log message *** 2003-10-02 20:26:06 +00:00
Jim Meyering 82dfbcee7b . 2003-10-02 20:24:00 +00:00
Jim Meyering a9c27a6da1 *** empty log message *** 2003-10-02 20:23:49 +00:00
Jim Meyering 63082bb3a3 (libfetish_a_SOURCES): Add fts.c fts_.h.
Remove ftw_.h.
2003-10-02 20:23:35 +00:00