summaryrefslogtreecommitdiff
path: root/src/tr.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2004-06-06 14:20:16 +0000
committerJim Meyering <jim@meyering.net>2004-06-06 14:20:16 +0000
commit8bf5b1841c8f902a4027ca20110c11e0cf1231ec (patch)
treeb7556942c64e7eed81f3fcea8f096a19fce85903 /src/tr.c
parent8600e5f5f7423108b558c6bc7883aacec39bc356 (diff)
downloadcoreutils-8bf5b1841c8f902a4027ca20110c11e0cf1231ec.tar.xz
(main): "tr -d a b" is now a fatal error even if POSIXLY_CORRECT is set.
The POSIX SYNOPSIS does not allow this option combination.
Diffstat (limited to 'src/tr.c')
-rw-r--r--src/tr.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/tr.c b/src/tr.c
index 0a3f3e517..0cbdb2b3c 100644
--- a/src/tr.c
+++ b/src/tr.c
@@ -1739,19 +1739,11 @@ main (int argc, char **argv)
deleting and squeezing repeats"));
/* If --delete is given without --squeeze-repeats, then
- only one string argument may be specified. But POSIX
- says to ignore any string2 in this case, so if POSIXLY_CORRECT
- is set, pretend we never saw string2. But I think
- this deserves a fatal error, so that's the default. */
+ only one string argument may be specified. */
if ((delete && !squeeze_repeats) && non_option_args != 1)
- {
- if (non_option_args == 2 && getenv ("POSIXLY_CORRECT"))
- --non_option_args;
- else
- error (EXIT_FAILURE, 0,
- _("only one string may be given when deleting \
+ error (EXIT_FAILURE, 0,
+ _("only one string may be given when deleting \
without squeezing repeats"));
- }
if (squeeze_repeats && non_option_args == 0)
error (EXIT_FAILURE, 0,