]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(main): Manually handle `--', since we no longer
authorJim Meyering <jim@meyering.net>
Sat, 1 May 1999 02:28:54 +0000 (02:28 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 1 May 1999 02:28:54 +0000 (02:28 +0000)
call getopt.  Reported by Joseph S. Myers.

src/dirname.c

index 73231986d61a5ed4da9ee2a8d7abc1cd016e0bde..fa584381c924fac887914566e6da2187d197989e 100644 (file)
@@ -73,6 +73,13 @@ 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 (argc > 1 && STREQ (argv[1], "--"))
+    {
+      --argc;
+      ++argv;
+    }
 
   if (argc != 2)
     {