summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2001-08-18 17:10:32 +0000
committerJim Meyering <jim@meyering.net>2001-08-18 17:10:32 +0000
commita39a7f8ada727f8fd1e399fa3c55159c5f1f97aa (patch)
tree1814eb0964a0c23386c7b16f2a121af80ea02bdd /src
parent95143d669fc5e6dcbe061372b191965ffc8d5c4a (diff)
downloadcoreutils-a39a7f8ada727f8fd1e399fa3c55159c5f1f97aa.tar.xz
(main): Handle a leading "--" option as POSIX requires.
Diffstat (limited to 'src')
-rw-r--r--src/expr.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/expr.c b/src/expr.c
index 8702dd19c..31966629b 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -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)
{