summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2004-08-03Add a FIXME mentioning that there are manyPaul Eggert
unchecked integer overflows in this file. (TRUE, FALSE): Remove. All uses replaced by true and false. (struct COLUMN, read_line, print_page, print_stored, open_file, skip_to_page, init_fps, parallel_files, align_empty_cols, empty_line, FF_only, explicit_columns, extremities, keep_FF, print_a_FF, print_a_header, use_form_feed, have_read_stdin, print_across_flag, storing_columns, balance_columns, truncate_lines, join_lines, untabify_input, failed_opens, numbered_lines, skip_count, use_esc_sequence, use_cntrl_prefix, double_space, ignore_failed_opens, use_col_separator, pad_vertically, last_line, main, init_parameters, skip_read, read_line, print_stored): Use bool for booleans. (struct COLUMN, char_to_clump, store_char, print_char): Use char for chars. (clump_buff, print_clump): Use char[], not int[], for an array whose elements are always chars. (first_last_page, main, getoptarg, balance, add_line_number, char_to_uclump): Remove unnecessary casts. (init_parameters): Allocate chars, not ints, for clump_buff. (print_char): Use to_uchar before invoking ISPRINT. (char_to_clump): Convert to unsigned char before invoking ISPRINT.
2004-08-03(main): Use bool for booleans.Paul Eggert
Do not assume that the environ has at most one matching entry for each option (integer overflow was possible otherwise).
2004-08-03(validate-path, main, portable_chars_only): Use bool for booleans.Paul Eggert
(portable_chars_only): Use to_uchar rather than a cast.
2004-08-03(paste_parallel, paste_serial, main): Use bool for booleans.Paul Eggert
2004-08-03(main): Use bool for booleans.Paul Eggert
2004-08-03(FMT_BYTES_ALLOCATED): Now an enum, not a decimalPaul Eggert
constant. Do not assume PRIdMAX etc. are strings of length 3 or less. (struct tspec): Use it. fmt_string is now an array, not a pointer, as there's little point to the indirection here. (struct tspec, flag_dump_strings, traditional, flag_pseudo_start, limit_bytes_to_format, abbreviate_duplicate_blocks, have_read_stdin, simple_strtoul, decode_one_format, open_next_file, check_and_close, decode_format_string, skip, write_block, read_char, read_block, parse_old_offset, dump, dump_strings, main): Use bool for booleans. (struct tspec): Use void *, not char *, for generic pointers. (bytes_to_oct_digits, bytes_to_signed_dec_digits, bytes_to_unsigned_dec_digits, bytes_to_hex_digits): Use char, not unsigned int, since char suffices. (print_s_char, print_char, print_s_short, print_short, print_int, print_long, print_long_long, print_float, print_double, print_long_double): Rewrite to avoid casts. These now take void * arguments, instead of char *. Use the same body for all functions, except for the choice of type. Assume C89 to simplify handling of signed char. (dump_hexl_mode_trailer, print_named_ascii, print_ascii): Rewrite to avoid casts. (print_named_ascii, print_ascii): Now takes void *, not char *. (decode_one_format): Use int for printf field widths, not unsigned int. Pass void * to subsidiary printers, not char *. Simplify handling of floating-point formats by factoring out common code dealing with precision and field width. (decode_format_string): Avoid need for temporary copy of each decoded struct tspec. (get_lcm): Remove unnecessary cast. (main): Fix bug where more than INT_MAX failed decodes were ignored.
2004-08-03(TRUE, FALSE): Remove; all uses changed to true, false.Paul Eggert
(enum number_format): Remove. (FORMAT_RIGHT_NOLZ, FORMAT_RIGHT_LZ, FORMAT_LEFT): Now strings, not enum values. (DEFAULT_SECTION_DELIMITERS): Now an array constant, not a macro. (section_del): Now const. (print_fmt): Remove. (starting_line_number, page_incr, blank_join, line_no, print_lineno, proc_text, main): Use intmax_t for line numbers. (reset_numbers, have_read_stdin, build_type_arg, nl_file, main): Use bool for booleans. (lineno_format): Now a string, not an enum value. (build_print_fmt): Remove. All calls removed. This work is now doen within print_lineno. (build_type_arg): Use size_t for sizes. (print_lineno): Check for line number overflow. (proc_text, main): Remove unnecessary cast.
2004-08-03(struct fileinfo, file_interesting,Paul Eggert
extract_dirs_from_files, color_symlink_as_referent, FILE_OR_LINK_MODE, sort_reverse, print_owner, print_group, numeric_ids, print_block_size, dired, print_with_color, check_symlink_color, print_inode, recursive, immediate_dirs, all_files, really_all_files, qmark_funny_chars, print_dir_name, format_needs_stat, format_needs_type, visit_dir, main, decode_switches, parse_ls_color, print_dir, file_interesting, gobble_file, make_link_path, basename_is_dot_or_dotdot, extract_dirs_from_files, print_long_format): Use bool for booleans. (dir_defaulted): Remove; no longer needed. (main): Use int to count files, since it suffices for argv. Rewrite to avoid need for dir_defaulted. (main, print_dir, gobble_file, get_link_name, xstrcoll): Set exit status to EXIT_SUCCES/EXIT_FAILURE rather than 0/1. (decode_switches): Put back check for ws.ws_col <= SIZE_MAX. Remove unnecessary cast to int. Use int instead of unsigned int to count from 0 to 1. (get_funky_string, print_type_indicator): Use char for bytes, not int. (make_link_path): Use NULL for null pointers. (quote_name): Use to_uchar instead of cast.
2004-08-03(symbolic_link, interactive, remove_existing_files,Paul Eggert
verbose, hard_dir_link, dereference_dest_dir_symlinks, do_link, main): Use bool for booleans.
2004-08-03(main): Print uids/gids with %lu, not %ld.Paul Eggert
2004-08-03(use_name, main, print_user, xgetgroups, print_group_list,Paul Eggert
print_full_info): Use bool for booleans. (problems): Remove, replacing with.... (ok): New var (inverted from old sense). (print_user, print_group, print_full_info): Print uids/gids with %lu, not %u. (xgetgroups): Don't run out of memory if getgroups or getugroups returns -1.
2004-08-03(presume_input_pipe, print_headers, have_read_stdin,Paul Eggert
write_header, elide_tail_bytes_pipe, elide_tail_bytes_file, elide_tail_lines_pipe, elide_tail_lines_seekable, elide_tail_lines_file, head_bytes, head_lines, head, head_file, string_to_integer, main): Use bool for booleans. (main): Rewrite to avoid cast.
2004-08-03(TAB_WIDTH): New macro; use it instead of "8".Paul Eggert
(fold_file, main): Use bool for booleans. (fold_file, main): Use size_t for sizes. (main): Allow -w options up to SIZE_MAX - TAB_WIDTH - 1, instead of prohibiting widths greater than INT_MAX.
2004-08-03(wheel_tab): Use unsigned char instead of unsignedPaul Eggert
int, since it suffices. (factor, print_factors): Use size_t for sizes. (print_factors, do_stdin, main): Use bool for booleans.
2004-08-03(nextarg): Use bool for booleans.Paul Eggert
2004-08-03(main): Use bool for booleans.Paul Eggert
2004-08-03(show_date, rfc_format, batch_convert, main): Use bool for booleans.Paul Eggert
2004-08-03(cut_fields): Use to_uchar rather than a cast.Paul Eggert
(cut_file, main): Use bool for booleans.
2004-08-03(struct line): Use size_t for sizes.Paul Eggert
(main): Remove unnecessary cast.
2004-08-03(COST, MAXWORDS): Add a comment describing some ofPaul Eggert
fmt's arbitrary limits. (TRUE, FALSE): Remove; all uses changed to (true, false). (main): Use bool for booleans. Limit maximum width to MAXCHARS / 2. Use xstrtoul, not xstrtol, to parse width. (copy_rest): Remove unnecessary cast. (get_prefix): Rewrite to avoid cast. (check_punctuation): Use char *, not unsigned char *; C89 requires this. Avoid off-by-one buffer read overrun when line is empty. (flush_paragraph): Don't assume wptr-parabuf is <= INT_MAX. Remove unnecessary casts.
2004-08-02(convert_entire_line, have_read_stdin, parse_tabstops,Paul Eggert
next_file, expand, main): Use bool for booleans. (tab_size, tab_list, add_tabstop, parse_tabstops, validate_tabstops, expand, main): Use uintmax_t for column counts. (add_tabstop): Don't reserve -1 (now UINTMAX_MAX) as a special value. All callers changed. (parse_tabstops): Don't pass a negative char to isblank. Avoid memory leak with large tab stops. (validate_tabstops, expand): Don't assume number of tab stops is <= INT_MAX. (next_file, main): Use EXIT_SUCCESS/EXIT_FAILURE rather than 0/1 when storing values into exit_status. (expand): Use same pattern as unexpand for reading chars. Report an error when input line is too long, instead of silently screwing up. Do not mishandle tab stops when backspacing left over start of line.
2004-08-02(have_read_stdin, append_quoted,Paul Eggert
dc_parse_stream, dc_parse_file, main): Use bool for booleans. (dc_parse_stream): Use enum for state, rather than int. Use ssize_t to store getline result.
2004-08-02(translation_needed, parse_integer, scanargs,Paul Eggert
apply_translations, char_is_saved, swab_buffer, skip_via_lseek): Use bool for booleans. (translate_buffer): Use to_uchar rather than a cast. (swab_buffer, copy_simple, copy_with_unblock): Use size_t for sizes.
2004-08-02(struct File_spec, reopen_inaccessible_files, count_lines,Paul Eggert
forever, from_start, print_headers, have_read_stdin, valid_file_spec, write_header, file_lines, pipe_lines, pipe_bytes, recheck, tail_forever, tail_bytes, tail_lines, tail, tail_file, parse_obsolescent_option, parse_options, main): Use bool for booleans. (struct File_spec, max_n_unchanged_stats_between_opens, parse_options): Use uintmax_t, not unsigned int or unsigned long int, for state counters. (tail_bytes, tail_lines): Redo test of return value (-1, 0, 1) to make it a bit clearer.
2004-08-02(apply_suffix): Use bool for booleans.Paul Eggert
2004-08-02(equal_width, valid_format, main): Use bool for booleans.Paul Eggert
2004-08-02Include "xgethostname.h".Paul Eggert
(xgethostname): Remove decl; xgethostname.h has it. (sethostname) [!defined(HAVE_SETHOSTNAME) && defined(HAVE_SYSINFO) && defined (HAVE_SYS_SYSTEMINFO_H) && defined(HAVE_LIMITS_H)]: Use prototypes rather than K&R form. Assume any negative value from sysinfo denotes failure, not just -1. (main): Simplify use of sethostname.
2004-08-02(do_lookup, short_list, short_output, include_idle,Paul Eggert
include_heading, include_mesg, include_exit, need_boottime, need_deadprocs, need_login, need_initspawn, need_clockchange, need_runlevel, need_users, my_line_only, main): Use bool for booleans. (print_runlevel): Use unsigned char for bytes. (list_entries_who, scan_entries, who): Use size_t for sizes. (main): No need to pass a non-NULL last arg to getopt_long.
2004-08-02(list_entries_users, users): Use size_t for sizes.Paul Eggert
(list_entries_users): Use char for bytes. (main): No need to pass a non-NULL last arg to getopt_long.
2004-08-02(print_uptime, uptime): Use size_t for sizes.Paul Eggert
(print_uptime): Remove unused local variable. (main): No need to pass a non-NULL last arg to getopt_long.
2004-08-02(include_idle, include_heading, include_fullname,Paul Eggert
include_project, include_plan, include_home_and_shell, do_short_format, include_where, main): Use bool for booleans. (count_ampersands, create_fullname, scan_entries, short_pinky): Use size_t for sizes. (create_fullname): Check for overflow in size calculations. (idle_string): Don't assume that the number of idle days is less than 10**8 and/or INT_MAX/(24*60*60). (main): No need to pass a non-NULL last arg to getopt_long.
2004-08-02(isdir): Remove decl.Paul Eggert
(install_file_to_path): Rely on make_path to fail if the destination is not a directory, by passing preserve_existing==true to it. Hence we no longer need to call isdir. Free dest_dir immediately when it's no longer needed, rather than waiting until the end of the function. (copy_file): Don't bother calling isdir, as copy will do the right thing if the destination is a directory.
2004-08-02(fts_debug, opt_all, apparent_size, opt_count_all,Paul Eggert
print_grand_total, opt_separate_dirs, hash_ins, process_file, main): Use bool for booleans. (max_depth): Now size_t, not int, to avoid an arbitrary limit of INT_MAX on depth. (G_fail): Remove: no longer needed, now that the relevant functions return bool. (process_file): Use return value to signal success rather than setting a global. Remove first_call static var; not needed, since we can look at n_alloc. Use size_t for depths. Remove FIXME about size_t casts, as it's now fixed. Use xnrealloc rather than the obsolescent XREALLOC. Don't bother to check whether reallocation is needed unless level > prev_level. (du_files): Invert sense of result, for consistency with other coreutils code. All callers changed. (main): Allow --max-depth values up to SIZE_MAX.
2004-08-02(inode_format, show_all_fs, show_local_fs,Paul Eggert
show_listed_fs, posix_format, require_sync, print_type, selected_fstype, excluded_fstype, show_dev, show_point, main): Use bool for booleans. (df_readable, show_dev): Use UINTMAX_MAX instead of -1. (show_dev, show_point, main): Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1. Don't assume disk name lengths are <= INT_MAX. Rewrite pct calculation to avoid cast. (show_point): Don't assume resolved length is <= SSIZE_MAX.
2004-08-02Regenerate.Paul Eggert
2004-08-02(ptr_align): Use size_t; in practice, this is just asPaul Eggert
good as uintptr_t in checking for alignments, and has fewer configuration hassles.
2004-08-02(UINT_MAX_32_BITS): Remove.Paul Eggert
(word32): Remove. All uses changed to uint32_t. (isaac_seed_data): Remove unnecessary cast.
2004-08-02(hash_int) [!defined UINTPTR_MAX]: Use size_t instead of uintptr_t.Paul Eggert
2004-08-01(localedir.h): Make it readonly; thisPaul Eggert
undoes part of the 2004-07-27 patch.
2004-07-30Improve comment for first_same_file.Paul Eggert
2004-07-30(to_uchar): Remove; now in system.h.Paul Eggert
(is_char_class_member): Use bool when appropriate.
2004-07-30(errno, CHAR_BIT): Remove decls;Paul Eggert
no longer needed now we assume C89 or better. Include <inttypes.h> before <stdint.h>, as it's the Autoconf-recommended pattern. (to_uchar): New inline function, moved here from tr.c. Use full names for int types, e.g. "long int" rather than "long".
2004-07-30(UCHAR): Remove; all uses changed to to_uchar.Paul Eggert
(IS_THOUSANDS_SEP): Use bool when appropriate. (numcompare, main): Use char, not int, when the value is always a char. (numcompare): Remove "register"; compilers are smart enough these days.
2004-07-30(create_parents, main): Use bool when appropriate.Paul Eggert
(main): Use EXIT_SUCCESS/EXIT_FAILURE instead of 0/1.
2004-07-30(main): Use EXIT_SUCCESS and EXIT_FAILURE, not 0 and 1.Paul Eggert
2004-07-30(right_justify), full_filename_, AD_pop_and_chdir,Paul Eggert
AD_push, prompt, remove_dir): Use bool when appropriate. (top_dir, pop_dir, full_filename_): Use size_t for sizes.
2004-07-30(rm_option_init, main): Use bool when appropriate.Paul Eggert
(main): Use EXIT_SUCCESS, EXIT_FAILURE instead of 0, 1.
2004-07-30(remove_trailing_slashes, rm_option_init,Paul Eggert
cp_option_init, do_move, movefile, main): Likewise. * src/remove.c (right_justify), full_filename_, AD_pop_and_chdir, AD_push, prompt, remove_dir): Likewise.
2004-07-30(isdir, change_timestamps, change_attributes,Paul Eggert
copy_file, install_file_to_path, install_file_in_dir, install_file_in_file, strip_files, dir_arg, cp_option_init, main, change_attributes, change_timestamps): Likewise.
2004-07-30(struct dir_attr, flag_path, remove_trailing_slashes,Paul Eggert
re_protect, make_path_private, target_directory_operand, do_copy, cp_option_init, decode_preserve_arg, main): Use bool when appropriate. (target_directory_operand): Do not clear *NEW_DST if stat succeeds. It's not necessary in that case, as *NEW_DST is always false already. (do_copy): Rewrite slightly to avoid need for "unreachable" comment. (main): Use EXIT_SUCCESS, EXIT_FAILURE instead of 0, 1.