]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(main): Handle leading command line argument of `--'.
authorJim Meyering <jim@meyering.net>
Fri, 13 Sep 2002 09:50:23 +0000 (09:50 +0000)
committerJim Meyering <jim@meyering.net>
Fri, 13 Sep 2002 09:50:23 +0000 (09:50 +0000)
src/printf.c

index b7eceffa4926543aaca507f99c086cd528eeea1e..f8fb51065cc8f9c5fc47dde6a28bc9cc1b34a809 100644 (file)
@@ -545,6 +545,14 @@ main (int argc, char **argv)
     parse_long_options (argc, argv, PROGRAM_NAME, GNU_PACKAGE, VERSION,
                        AUTHORS, usage);
 
+  /* The above handles --help and --version.
+     Since there is no other invocation of getopt, handle `--' here.  */
+  if (1 < argc && STREQ (argv[1], "--"))
+    {
+      --argc;
+      ++argv;
+    }
+
   if (argc == 1)
     {
       fprintf (stderr, _("Usage: %s format [argument...]\n"), program_name);