diff options
author | Jim Meyering <jim@meyering.net> | 2001-08-18 17:10:32 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2001-08-18 17:10:32 +0000 |
commit | a39a7f8ada727f8fd1e399fa3c55159c5f1f97aa (patch) | |
tree | 1814eb0964a0c23386c7b16f2a121af80ea02bdd /src/expr.c | |
parent | 95143d669fc5e6dcbe061372b191965ffc8d5c4a (diff) | |
download | coreutils-a39a7f8ada727f8fd1e399fa3c55159c5f1f97aa.tar.xz |
(main): Handle a leading "--" option as POSIX requires.
Diffstat (limited to 'src/expr.c')
-rw-r--r-- | src/expr.c | 7 |
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) { |