From: Jim Meyering Date: Sat, 18 Aug 2001 17:10:32 +0000 (+0000) Subject: (main): Handle a leading "--" option as POSIX requires. X-Git-Tag: TEXTUTILS-2_0_15~373 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a39a7f8ada727f8fd1e399fa3c55159c5f1f97aa;p=thirdparty%2Fcoreutils.git (main): Handle a leading "--" option as POSIX requires. --- diff --git a/src/expr.c b/src/expr.c index 8702dd19cf..31966629b4 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) {