From a39a7f8ada727f8fd1e399fa3c55159c5f1f97aa Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 18 Aug 2001 17:10:32 +0000 Subject: (main): Handle a leading "--" option as POSIX requires. --- src/expr.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') 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) { -- cgit v1.2.3-70-g09d2