summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2002-06-15(st_author) [! HAVE_STRUCT_STAT_ST_AUTHOR]: New macro.Jim Meyering
(print_author): New var. (AUTHOR_OPTION): New enum val. (long_options, decode_switches, print_long_format, usage): Support --author. (format_user): New function. (print_long_format): Use it. Make print buffer a bit bigger.
2002-06-15For GNU libc 2.2 and newer, ensure that <sys/types.h>Jim Meyering
has been included before this file.
2002-06-15(S_ISNAM): Add to list of S_IS* macros.Jim Meyering
Rearrange #if directives for each S_IS macro. From diffutils-2.8.2.
2002-06-12(do_move): Give one diagnostic, not two, when unable toJim Meyering
unlink a destination file. This bug was introduced in fileutils-3.16l. $ /bin/mv /etc/passwd /tmp /bin/mv: cannot unlink `/etc/passwd': Permission denied /bin/mv: cannot remove `/etc/passwd': Permission denied [Exit 1]
2002-06-12(rm): Fix typo in assertion.Jim Meyering
2002-06-07(remove_entry): Use DT_IS_DIR only ifJim Meyering
HAVE_STRUCT_DIRENT_D_TYPE is defined.
2002-06-02(enum RM_status) [RM_NONEMPTY_DIR]: New member.Jim Meyering
(UPDATE_STATUS): New macro. Include save-cwd.h. (struct File_spec): Remove declaration. Update prototypes.
2002-06-02(main): Adapt to new calling sequence for rm.Jim Meyering
2002-06-02(do_move): Adapt to new calling sequence for rm.Jim Meyering
2002-06-02Merge in all changes from no-recursion branch.Jim Meyering
* src/remove.c (enum Ternary): Define type. (prompt): Add a parameter. Adjust callers. (remove_entry): Attempt rmdir here, only if a directory is `known' to be empty. Significant rework. (remove_dir): Propagate failure `up' also when rmdir fails. In interactive mode, prompt only once about an empty directory. * src/remove.c (enum Prompt_action): Define. (prompt): Two new parameters. Adjust all callers. Performance. * src/remove.c (remove_entry) [!ROOT_CAN_UNLINK_DIRS]: Don't call rmdir here. * src/remove.c (AD_pop_and_chdir): Don't use errno (it's not valid) in diagnostic for changed dev/ino. (remove_entry): Tweak diagnostic. * src/remove.c (ROOT_CAN_UNLINK_DIRS): Define. (AD_pop_and_chdir): Propagate status as we traverse back `up' the tree. (DO_UNLINK, DO_RMDIR): Define. (remove_entry) [ROOT_CAN_UNLINK_DIRS]: Add code so this works also on systems where root can use `unlink' to remove directories. * src/remove.c: Include file-type.h. Include file type in prompt when asking whether to remove file. Based on a patch from Paul Eggert. * src/remove.c (prompt): Add comment. * src/remove.c (remove_dir): Fix another (known) leak. * src/remove.c (hash_freer): New function. (AD_mark_helper): Use it. (AD_mark_as_unremovable): xstrdup the filename argument. (remove_dir): Free directory name. * src/remove.c (remove_entry): Fail also when trying to remove a directory without the --recursive option. Change a diagnostic, s/unlink/remove/, now that it can apply also to a directory. * src/remove.c (is_empty_dir): New function. (prompt): New function, factored out of... (remove_entry): ...here. Call it. (remove_dir): Call prompt before rmdir. * src/remove.c (remove_entry): Add support for prompting (e.g., -i). * src/remove.h (UPDATE_STATUS): New macro. * src/remove.c [AD_ent] (status): New member. This lets us propagate the status from a subdirectory to its parent via AD_pop_and_chdir. (AD_push_initial): Set it. (AD_push): Likewise. (remove_cwd_entries): Change return type to enum RM_status, and adjust all callers. (rm): Use UPDATE_STATUS rather than open-coding it. * src/remove.c (remove_entry): New function, factored out of... (remove_cwd_entries): ...here, and... (rm_1): ...here. * src/remove.c (remove_cwd_entries): Add support for --verbose. (remove_dir): Likewise. (rm_1): Likewise. * src/remove.c (rm): Free cwd_state, if necessary. * src/remove.c (rm_1): Remove now useless (always true) user_specified_name parameter. Adjust sole caller. * src/remove.c (rm): New function. This interface allows one to remove multiple arguments at a time. This is important in that it allows us to hide the remove_init/remove_fini functions and the cwd_state parameter. (rm_1): Renamed from rm. (remove_init, remove_fini): Remove functions. Each body is now part of `rm'.
2002-06-01Remove use of D_TYPE_IN_DIRENT, now that that symbol has been renamed.Jim Meyering
2002-05-30(copy_reg): Use a temporary to avoid a warningJim Meyering
from gcc -W about comparison between signed and unsigned. (copy_internal): Likewise, but use a cast.
2002-05-25fix typo: s/S_TYPEISTMO/S_TYPEISMQ/Jim Meyering
2002-05-24(validate_path): Compare the result of the function --Jim Meyering
not its (constant) address -- against zero.
2002-05-22(S_ISREG, S_ISDIR): Define if not already defined.Jim Meyering
(S_TYPEISSEM, S_TYPEISSHM, S_TYPEISTMO): Likewise.
2002-05-22[struct dummy]: Renamed. Don't rely on portability ofJim Meyering
zero-length arrays. Instead, use sizes of -1 or +1.
2002-05-21(S_ISLNK, S_ISFIFO, S_ISSOCK, S_ISCHR, S_ISBLK, S_ISDOOR): Define here instead.Jim Meyering
2002-05-21(S_ISLNK, S_ISFIFO S_ISSOCK S_ISCHR S_ISBLK S_ISDOOR): Remove definitions.Jim Meyering
2002-05-14This bug was introduced with my change of 2000-10-22 (textutils-2.0.8).Jim Meyering
(ulonglong_t): Move declaration to precede new use. [enum size_spec] (N_SIZE_SPECS): New member. (width_bytes): Add initializer corresponding to ulonglong_t type. (struct assert_width_bytes_matches_size_spec_decl): Declare. Based on a patch from Tony Kocurko.
2002-05-03Add FIXME comment.Jim Meyering
2002-05-03(print_uptime): Fix last change so that we use ngettext properly.Jim Meyering
2002-05-03(print_uptime): Use ngettext for day/days and user/users.Jim Meyering
Suggestion from Karl Eichwalder.
2002-05-03(usage): Add a little to the description of --list.Jim Meyering
Uncapitalize first word and remove period at end of each one line option description.
2002-05-03(usage): Tweak description of --users.Jim Meyering
From Karl Eichwalder.
2002-04-30(keycompare, compare): Replace #ifdef ENABLE_NLS with if (HAVE_SETLOCALE).Jim Meyering
(hard_LC_COLLATE): Define even if ! ENABLE_NLS. (main): Always initialize hard_LC_COLLATE. Put initialization next to other locale-related stuff. Include <langinfo.h> even if ! ENABLE_NLS. (decimal_point, th_sep): Depend on HAVE_SETLOCALE, not ENABLE_NLS. (main): Likewise. (MONTHTAB_CONST): Remove; all uses removed. (struct_month_cmp, inittables): Do not depend on ENABLE_NLS. (main): hard_LC_TIME locale does not depend on ENABLE_NLS.
2002-04-30(keycmp): Replace #ifdef ENABLE_NLS with if (HAVE_SETLOCALE).Jim Meyering
(hard_LC_COLLATE): Define even if ! ENABLE_NLS. (main): Always initialize hard_LC_COLLATE. Put initialization next to other locale-related stuff.
2002-04-30(compare_files): Replace #ifdef ENABLE_NLS with if (HAVE_SETLOCALE).Jim Meyering
(hard_LC_COLLATE): Define even if ! ENABLE_NLS. (main): Always initialize hard_LC_COLLATE. Put initialization next to other locale-related stuff.
2002-04-30(HAVE_SETLOCALE): Define to 0 if not defined.Jim Meyering
2002-04-29(tail_forever): Do not treatJim Meyering
max_n_unchanged_stats_between_opens specially (as if it were infinite) if it has its maximal value. Similarly for max_n_consecutive_size_changes_between_opens.
2002-04-29(parse_obsolescent_option): Do not limit the maximumJim Meyering
line/byte count to be less than ULONG_MAX on systems where OFF_T_MAX is larger.
2002-04-28add comment for prev changeJim Meyering
2002-04-28(make_id_equals_comment): Cast sizeof expression (used as fieldJim Meyering
width argument) to `int'.
2002-04-28(PIDSTR_DECL_AND_INIT): Cast ut_pid value to int.Jim Meyering
2002-04-28Don't include xalloc.h.Jim Meyering
It's already included via system.h.
2002-04-28Rewrite from scratch. Support everythingJim Meyering
required by POSIX 1003.1-2001; when this conflicts with Bash, stick with POSIX. The conflicts are kill -l output format, and lower case signal names preceded by `-' (e.g., "kill -hup" is no longer supported). Remove -L or --long-list option. Add -t or --table option. Rename --sigspec to --signal; remove --signum and do not advertise obsolescent option -n. Use str2sig and str2sig to convert between signal names and numbers.
2002-04-28Avoid new warnings from gcc.Jim Meyering
[struct COLUMN] <name>: Declare member to be const. (init_fps): Declare local variable `firstname' to be const.
2002-04-28(integer_expected_error): Add `const' to paramaterJim Meyering
declarations to avoid new warning from gcc.
2002-04-28(test_syntax_error): Add `const' to paramaterJim Meyering
declarations to avoid new warning from gcc.
2002-04-27(cycle_check): Add a comment.Jim Meyering
2002-04-27(cycle_check): New function containing code factoredJim Meyering
out of remove_dir. The sole difference is that upon detecting a cycle, rm now dies unconditionally. Before, in interactive mode, it would ask the user whether to continue. (remove_dir): Call cycle_check.
2002-04-25(usage): Adjust ordering to match that of default output.Jim Meyering
2002-04-25Avoid warnings from gcc.Jim Meyering
Declare input_file and output_file to be `const'. (skip): Declare `file' parameter to be `const', too.
2002-04-25Remove hash table, active_dir_map, used to detect directory cycles.Jim Meyering
Instead, detect them lazily with just O(1) memory. Suggestion from Andi Kleen. (is_power_of_two): New function. (print_nth_dir, make_active_dir_ent): Remove functions. (hash_active_dir_ent, hash_compare_active_dir_ents): Likewise. (remove_dir): Check for cycles here, ... (rm): ... and don't check for cycles here. (rm): Call fspec_get_full_mode here, rather than fspec_get_filetype_mode. We want to get the dev/ino earlier, and at the same time as when we get the file type, to avoid the risk that an attacker would change e.g. a directory to a symlink before we record its dev/ino.
2002-04-25Revert last change.Jim Meyering
2002-04-25Revert last change.Jim Meyering
2002-04-25Remove ENABLE_NLS-related code.Jim Meyering
(_, N_) Remove definitions. Include "gettext.h" instead.
2002-04-22(rm): Call exit with EXIT_FAILURE, not `1'.Jim Meyering
2002-04-22(main): Adjust caller of remove_init.Jim Meyering
2002-04-22(do_move): Adjust caller of remove_init.Jim Meyering
2002-04-22(remove_init): Adjust prototype.Jim Meyering