]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(main): "tr -d a b" is now a fatal error even if POSIXLY_CORRECT is set.
authorJim Meyering <jim@meyering.net>
Sun, 6 Jun 2004 14:20:16 +0000 (14:20 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 6 Jun 2004 14:20:16 +0000 (14:20 +0000)
The POSIX SYNOPSIS does not allow this option combination.

src/tr.c

index 0a3f3e5177c215ba10337dca95863a73fb3639b7..0cbdb2b3c7b924cfb7a2aef7f01a5d50d08e416a 100644 (file)
--- 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,