]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(main): Fix off-by-argc test, so +N-style options are recognized once again.
authorJim Meyering <jim@meyering.net>
Tue, 20 Jun 2000 06:46:28 +0000 (06:46 +0000)
committerJim Meyering <jim@meyering.net>
Tue, 20 Jun 2000 06:46:28 +0000 (06:46 +0000)
Reported by Geoff Keunning.
Fix typo in diagnostic: s/compare/skip/.

src/uniq.c

index fa0fa0e5f1da99900be4e987474012a1b3cc2497..12964a0303e2de67fb8fcf67123b6e375706e018 100644 (file)
@@ -428,7 +428,7 @@ main (int argc, char **argv)
        }
     }
 
-  if (optind >= 2 && !STREQ (argv[optind - 1], "--"))
+  if (argc - optind >= 2 && !STREQ (argv[optind - 1], "--"))
     {
       /* Interpret non-option arguments with leading `+' only
         if we haven't seen `--'.  */
@@ -439,7 +439,7 @@ main (int argc, char **argv)
          if (xstrtol (opt_str, NULL, 10, &tmp_long, "") != LONGINT_OK
              || tmp_long <= 0 || tmp_long > INT_MAX)
            error (EXIT_FAILURE, 0,
-                  _("invalid number of bytes to compare: `%s'"),
+                  _("invalid number of bytes to skip: `%s'"),
                   opt_str);
          skip_chars = (int) tmp_long;
        }