(main): Handle a leading "--" option as POSIX requires.
authorJim Meyering <jim@meyering.net>
Sat, 18 Aug 2001 17:10:32 +0000 (17:10 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 18 Aug 2001 17:10:32 +0000 (17:10 +0000)
src/expr.c

index 8702dd19cf1f239c27f8ddedc141034e70ab43d8..31966629b4562a83062e7e07a683b86c78773b1e 100644 (file)
@@ -165,6 +165,13 @@ main (int argc, char **argv)
   if (!posixly_correct)
     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 == 1)
     {