diff options
-rw-r--r-- | src/basename.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/basename.c b/src/basename.c index 802c5dcf4..ffdb6759a 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) { |