Jim Meyering [Sun, 21 Apr 1996 03:52:30 +0000 (03:52 +0000)]
(decode_switches): Use xstrtol, not atoi.
Detect and ignore invalid value for COLUMNS environment variable.
In error about invalid TABSIZE, don't reference optarg!
Jim Meyering [Fri, 19 Apr 1996 04:41:27 +0000 (04:41 +0000)]
(basename): Rewrite so it doesn't rely on strrchr,
and hence doesn't need to include string.h -- on some alpha-based
OSF systems, there's a conflicting prototype for basename in string.h.
Reported by Kaveh Ghazi.
Jim Meyering [Sat, 13 Apr 1996 18:11:43 +0000 (18:11 +0000)]
(decode_field_spec): Rename local variable `valid'
to invalid (and reverse sense) to avoid conflict with the
macro definition in /usr/include/locale.h on SunOS 4.1.3.
Jim Meyering [Sat, 13 Apr 1996 03:59:20 +0000 (03:59 +0000)]
(main): Add new option: --verbose.
Remove long-deprecated and nowhere-documented --path, a synonym
for --parents. It was confusing to get an error about `--p'
being ambiguous.
Jim Meyering [Mon, 8 Apr 1996 04:53:54 +0000 (04:53 +0000)]
(mon_week_ISO): New function to implement new %V format.
(sun_week): Make TM parameter `const'.
(mon_week): Likewise.
(mon_week): Rewrite to correctly implement %W format..
Jim Meyering [Sun, 7 Apr 1996 17:46:03 +0000 (17:46 +0000)]
(usage): Give minimal description of the program.
(print_factors): Give a better diagnostic.
(main): Suggest --help upon failure.
Reported by Karl Eichwalder <ke@ke.Central.DE>.
Jim Meyering [Fri, 5 Apr 1996 13:32:39 +0000 (13:32 +0000)]
(main): Use `if' stmt, not while loop, around getopt invocation.
Otherwise, `./nice --a=1 -1 ./nice' (in which old-style option
follows a long option) gets an error.
Jim Meyering [Thu, 4 Apr 1996 23:08:30 +0000 (23:08 +0000)]
The following commands all failed unnecessarily.
tr -cs '[:upper:]' '[X*]'
tr -dcs '[:lower:]' n-rs-z
tr -ds '[:xdigit:]' [:alnum:]'
tr -dcs '[:alnum:]' [:digit:]'
tr -dc '[:upper:]'
Reported by Ross Ridge (ross@worf.mks.com).
(validate): Add missing conjunct (translating) in test for
`translating and complementing character classes' error. Before,
valid uses of tr could fail. E.g. `tr -dcs '[:cntrl:]' '[:alnum:]''.
(homogeneous_spec_list): New function.
(validate): Use it to relax the old (overly restrictive) restriction
that prohibited use of complemented character classes when translating.
Now, that is allowed as long as the translation maps many to one.
(get_spec_stats): Rename and redefine global has_char_class from
has_upper_or_lower.
Jim Meyering [Wed, 3 Apr 1996 05:42:14 +0000 (05:42 +0000)]
Include assert.h (disabled).
(path_concat): New function.
(do_copy): Use path_concat instead of open-coding part of its
functionality in two places. This has the additional benefit
of avoiding forming destination names like `D//file' when the
destination directory D includes a trailing slash -- as would
happen when cp is used like this:
mkdir D; touch file D/file; cp -i file D/
Reported by François Pinard.