summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2003-10-08csplit cleanup.Jim Meyering
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-07.Jim Meyering
2003-10-05(change_file_owner): Remove set-but-not-used local.Jim Meyering
2003-10-05s/nftw/fts/g in a commentJim Meyering
2003-10-05(du_files): Mark diagnostic for translation.Jim Meyering
2003-10-05.Jim Meyering
2003-10-04(du_files): Ignore any failure of fts_close.Jim Meyering
2003-10-04(du_files): Give better diagnostics for failed fts_open.Jim Meyering
2003-10-04(MAX_N_DESCRIPTORS): Remove now-unused definition.Jim Meyering
2003-10-04(enum) [HUMAN_SI_OPTION]: New member.Jim Meyering
[long_options]: Use HUMAN_SI_OPTION, not 'H'. (main): Warn that the meaning of -H will soon change.
2003-10-03Accept --no-dereference (-P).Jim Meyering
2003-10-02.Jim Meyering
2003-10-02Include "fts_.h", not ftw.h.Jim Meyering
(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-09-28Remove unnecessary casts of alloca, since now it's guaranteed to be (void *).Jim Meyering
2003-09-28Remove unnecessary casts of alloca, since now it's guaranteed to be (void *).Jim Meyering
2003-09-28(ASSIGN_STRDUPA):Jim Meyering
Remove unnecessary casts of alloca, since now it's guaranteed to be (void *).
2003-09-28Remove unnecessary casts of alloca, since now it's guaranteed to be (void *).Jim Meyering
2003-09-28Remove unnecessary casts of alloca, since now it's guaranteed to be (void *).Jim Meyering
2003-09-28Remove unnecessary cast of alloca, since now it's guaranteed to be (void *).Jim Meyering
2003-09-28Remove unnecessary cast of alloca, since now it's guaranteed to be (void *).Jim Meyering
2003-09-28Minor efficiency tweak.Jim Meyering
(PATH_BASENAME_CONCAT): Use memcpy rather than strcpy. (do_link): Likewise.
2003-09-27Don't exhaust virtual memory when processing large inputs.Jim Meyering
Fix this by removing csplit's internal free-list management; instead rely on malloc for that. (free_list): Remove global. (clear_all_line_control): Remove function. (get_new_buffer): Always use create_new_buffer to obtain a new buffer, rather than searching free_list. (free_buffer): Just call free.
2003-09-26.Jim Meyering
2003-09-24(check_and_close, dump, dump_strings): Don't report bogus errno valueJim Meyering
after ferror discovers an output error. We don't know the proper errno value, since it might have been caused by any of a whole bunch of calls, and it might have been trashed in the meantime. Fixing this problem will require much more extensive changes; in the meantime just say "write error". (skip): If a read fails, don't retry it later, so that we report the proper errno.
2003-09-23(get_line): Report error right away if I/O fails,Jim Meyering
so that the proper errno value is used.
2003-09-23(close_output_file): Don't report bogus errno valueJim Meyering
after ferror discovers an output error. We don't know the proper errno value, since it might have been caused by any of a whole bunch of calls, and it might have been trashed in the meantime. Fixing this problem will require much more extensive changes; in the meantime just say "write error".
2003-09-23(paste_serial): Save errno after input error,Jim Meyering
to report proper errno value. Based on a patch from Paul Eggert.
2003-09-23(fold_file): Save errno after input error, to report proper errno value.Jim Meyering
2003-09-23(compare_files): Save errno after input error, to report proper errno value.Jim Meyering
2003-09-23(unexpand): Save errno after input error, to report proper errno value.Jim Meyering
2003-09-23(tee): Adjust fwrite arguments so that the returnJim Meyering
value is the number of bytes written.
2003-09-22(tac_mem): Don't return a value; nobody uses it.Jim Meyering
2003-09-22(tee): Once a write failure has occurred, don't botherJim Meyering
writing anything more to that stream.
2003-09-22(check_file): Report error right away if I/O fails,Jim Meyering
so that the proper errno value is used. (check_file): Check for ferror (stdout) even if ostream == stdout. (check_file): Don't report bogus errno value after ferror discovers an output error. We don't know the proper errno value, since it might have been caused by any of a whole bunch of calls, and it might have been trashed in the meantime. Fixing this problem will require much more extensive changes; in the meantime just say "write error".
2003-09-22(UNROLL): Remove.Jim Meyering
(main): Exit immediately when write failure is detected. Simplify code by assigning to argv when argc == 1.
2003-09-22Switch encoding from Latin-1 to UTF-8.Jim Meyering
(WRITTEN_BY): Change "Franc,ois" (actually using c-with-cedilla in Latin-1) to "F.", so that it's ASCII, as xgettext requires.
2003-09-19`du -D symlink-to-dir' would mistakenly omit the slash inJim Meyering
lines like this: 24 symlink-to-dir/subdir (process_file): Fix offset calculation. Reported by Jeff Sheinberg as Debian bug #211591; http://bugs.debian.org/205251
2003-09-19(process_file): Remove useless disjunct.Jim Meyering
2003-09-18*** empty log message ***Jim Meyering
2003-09-18(WRITTEN_BY): Rename from AUTHORS.Jim Meyering
Begin each WRITTEN_BY string with `Written by ' and end it with `.'. Mark each WRITTEN_BY string as translatable.
2003-09-18(case_GETOPT_VERSION_CHAR): Rename parameter, Authors, to Written_by.Jim Meyering
2003-09-18revert previous changeJim Meyering
2003-09-18Update AUTHORS definition to be a comma-separated list of strings and/or updateJim Meyering
the call to parse_long_options so that `AUTHORS, NULL' are the last parameters.
2003-09-18(case_GETOPT_VERSION_CHAR): Append NULL to version_etc argument list.Jim Meyering
2003-09-18(main): Append NULL to version_etc argument list.Jim Meyering
2003-09-18(numcompare): Rename local, logb, to log_b to avoidJim Meyering
shadowing the math function name. Also rename loga to log_a.
2003-09-14(print_factors): Give a separate diagnosticJim Meyering
for numbers that are too large, but otherwise valid.
2003-09-10.Jim Meyering
2003-09-09Alphabetize includes.Jim Meyering
Remove duplicate inclusion of "same.h".
2003-09-09.Jim Meyering