summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2003-10-19chmod now uses fts to perform a directory traversal when -R isJim Meyering
specified. Before, it operated on full path names, and as such would encounter the PATH_MAX (often 4096) limit. Include "xfts.h". (process_file): Rename from change_file_mode. Adapt to be used with fts. (process_files): New function.
2003-10-18.Jim Meyering
2003-10-18Most .c files (AUTHORS): Revert the WRITTEN_BY/AUTHORS changeJim Meyering
of 2003-09-19. Now, AUTHORS is a comma-separated list of strings. Update the call to parse_long_options so that `AUTHORS, NULL' are the last parameters. * src/true.c (main): Append NULL to version_etc argument list. * src/sys2.h (case_GETOPT_VERSION_CHAR): Likewise.
2003-10-18.Jim Meyering
2003-10-18(usage): Tweak descriptions of -i and -f so that theJim Meyering
generated `man' page is more readable. Suggestion from Dan Jacobson.
2003-10-17.Jim Meyering
2003-10-17(change_file_owner): Handle the cases inJim Meyering
which fts_info indicates an error with the given entry.
2003-10-17(main): Simply assign to bit_flags.Jim Meyering
Don't bother with bit arithmetic.
2003-10-17Include "xfts.h".Jim Meyering
(chown_files): Use xfts_open, rather than fts_open.
2003-10-17Include "xfts.h".Jim Meyering
(du_files): Use xfts_open, rather than fts_open.
2003-10-17tweak commentJim Meyering
2003-10-17tweak commentJim Meyering
2003-10-16(main): Simply assign to bit_flags.Jim Meyering
Don't bother with bit arithmetic. Rename a couple of local variables. Remove unnecessary casts.
2003-10-16(main): Simply assign to bit_flags.Jim Meyering
Don't bother with bit arithmetic.
2003-10-16(start_bytes): Rename local, remainder, to avoidJim Meyering
gcc's warning about shadowing a global.
2003-10-15.Jim Meyering
2003-10-15.Jim Meyering
2003-10-15Include "fts_.h".Jim Meyering
(WRITTEN_BY): Add my name. (MAXUID, MAXGID): Remove definitions. Use GID_T_MAX instead of the latter. (usage): Update. (main): Handle new options. Call new function, chown_files rather than change_file_owner.
2003-10-15chown now accepts POSIX-mandated -H, -L, -P options and usesJim Meyering
fts to perform a directory traversal when -R is specified. Before, it used explicit recursion, and as such was limited by the user's stack size to handling hierarchies no deeper than about 30,000 levels. Include "userspec.h" and "fts_.h". (WRITTEN_BY): Add my name. (getpwnam, getgrnam, getgrgid): Remove declarations. (endpwent): Remove definition. (usage): Update (main): Handle new options. Call new function, chown_files rather than change_file_owner.
2003-10-15[enum Dereference_symlink]: Remove declaration.Jim Meyering
[struct Chown_option] (recurse, force_silent): Change type to `bool'. [struct Chown_option] (dereference): Remove member with ambiguous name. [struct Chown_option] (affect_symlink_referent): New member. (chown_files): New prototype.
2003-10-15Rewrite to iterate through hierarchies using fts rather thanJim Meyering
via explicit recursion. Include "fts_.h" (change_file_owner): Rewrite to use FTS* and FTSENT* and to operate on a single file at a time. (chown_files): New function.
2003-10-15(usage): Clarify that --directory, -d, -F probably won'tJim Meyering
work even for superuser. Suggestion from Dan Jacobson.
2003-10-15(parse_field_count): Handle the case where overflowJim Meyering
and invalid suffix char are both reported.
2003-10-14(decode_switches) [TIOCGWINSZ]: Comment out theJim Meyering
warning-inducing test, ws.ws_col <= SIZE_MAX, since it was always true on Linux.
2003-10-14Fix to avoid a denial-of-service attack if the display width isJim Meyering
enormous. Also, clean up the code a bit by removing duplicate code. (init_column_info): Remove forward decl; no longer needed. (calculate_columns): New function, that contains code that used to be common to print_many_per_line and print_horizontal. (print_many_per_line, print_horizontal): Use it. (decode_switches): Set max_idx here, not in calculate_columns. (print_current_files): Don't call init_column_info; calculate_columns now does that. (init_column_info): Don't allocate a lot more space than is needed to represent the current set of files. Allocate all the new size_t cells in one call to xnmalloc, rather than a row at a time.
2003-10-13(init_column_info): Add another FIXME comment.Jim Meyering
2003-10-13(struct bin_str.len, length_of_file_name_and_frills, indent,Jim Meyering
nfiles, files_index, tabsize, line_length, struct column_info.line_len, struct column_info.col_arr[0], max_idx): Now size_t, not int. (get_funky_string): Return bool indicating success, instead of a negative count to indicate failure. Store number of columns through new parameter OUTPUT_COUNT; that way, they can never go negative. Change equals_end from int to bool. All uses changed. (struct column_info.valid_len): Now bool, not int. All uses changed. (dired_dump_obstack, get_funky_string, clear_files, extract_dirs_from_files, print_current_files, print_many_per_line, print_horizontal, init_column_info, put_indicator, length_of_file_name_and_frills, print_with_commas): Use size_t, not int, for local variables that count sizes. (decode_switches): Decode sizes using xstrtoul, not xstrtol. Check for TIOCGWINSZ returing negative values (or values greater than SIZE_MAX!). (visit_dir, main, parse_ls_color, queue_directory, add_ignore_pattern, init_column_info): Use xmalloc and xnmalloc, not XMALLOC. (gobble_file): Use xnrealloc, not XREALLOC. (print_color_indicator): Remove now-unnecessary cast to size_t.
2003-10-13(print_many_per_line): Add FIXME comment.Jim Meyering
2003-10-12New options: --preserve-root and --no-preserve-root.Jim Meyering
(change_file_mode): Honor new option. (change_file_mode): Strip trailing slashes on directory argument passed to change_dir_mode. (get_root_dev_ino): New function. (main): Initialize global, root_dev_ino.
2003-10-12(change_file_mode): Don't #ifdef-out a simple use ofJim Meyering
S_ISLNK. The S_IS* macros are guaranteed to be defined via system.h.
2003-10-12(copy_internal): Don't #ifdef-out simple uses ofJim Meyering
S_ISLNK or S_ISSOCK. The S_IS* macros are guaranteed to be defined via system.h.
2003-10-09tweak commentsJim Meyering
2003-10-08(main): Remove obsolete FIXME.Jim Meyering
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