From: Jim Meyering Date: Sat, 1 May 1999 02:29:17 +0000 (+0000) Subject: (main): Manually handle `--', since we no longer X-Git-Tag: SH-UTILS-1_16h~12 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5e1ffee4d676aab97dd766f928876bab6771aa40;p=thirdparty%2Fcoreutils.git (main): Manually handle `--', since we no longer call getopt. Reported by Joseph S. Myers. --- diff --git a/src/basename.c b/src/basename.c index 802c5dcf47..ffdb6759aa 100644 --- a/src/basename.c +++ b/src/basename.c @@ -100,6 +100,13 @@ main (int argc, char **argv) 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 || argc > 3) {