Jim Meyering [Tue, 30 Apr 2002 09:29:45 +0000 (09:29 +0000)]
(keycompare, compare): Replace #ifdef ENABLE_NLS with if (HAVE_SETLOCALE).
(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.
Jim Meyering [Tue, 30 Apr 2002 09:25:37 +0000 (09:25 +0000)]
(keycmp): Replace #ifdef ENABLE_NLS with if (HAVE_SETLOCALE).
(hard_LC_COLLATE): Define even if ! ENABLE_NLS.
(main): Always initialize hard_LC_COLLATE.
Put initialization next to other locale-related stuff.
Jim Meyering [Tue, 30 Apr 2002 09:23:38 +0000 (09:23 +0000)]
(compare_files): Replace #ifdef ENABLE_NLS with if (HAVE_SETLOCALE).
(hard_LC_COLLATE): Define even if ! ENABLE_NLS.
(main): Always initialize hard_LC_COLLATE.
Put initialization next to other locale-related stuff.
Jim Meyering [Tue, 30 Apr 2002 09:20:19 +0000 (09:20 +0000)]
(jm_PREREQ_HARD_LOCALE): Check for stdlib.h.
Do not check for alloca.h (no longer used) or stdbool.h (was never
used?). Add AM_C_PROTOTYPES since hard-locale.h uses it.
Jim Meyering [Mon, 29 Apr 2002 08:23:06 +0000 (08:23 +0000)]
(tail_forever): Do not treat
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.
Jim Meyering [Mon, 29 Apr 2002 06:59:24 +0000 (06:59 +0000)]
(SIGNUM_BOUND): Do not use WTERMSIG, to avoid
depending on <sys/wait.h> and WTERMSIG. Default to 64 instead
of 127, since 64 is the largest conceivable number for ancient
nonstandard hosts.
Jim Meyering [Sun, 28 Apr 2002 21:32:36 +0000 (21:32 +0000)]
Rewrite from scratch. Support everything
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.
Jim Meyering [Sat, 27 Apr 2002 06:33:08 +0000 (06:33 +0000)]
(cycle_check): New function containing code factored
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.
Jim Meyering [Thu, 25 Apr 2002 16:40:04 +0000 (16:40 +0000)]
Remove hash table, active_dir_map, used to detect directory cycles.
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.