diff options
author | Jim Meyering <jim@meyering.net> | 1999-05-01 02:29:17 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-05-01 02:29:17 +0000 |
commit | 5e1ffee4d676aab97dd766f928876bab6771aa40 (patch) | |
tree | 772be1d21dce659760dab906f6f0b62f26dc266d /src | |
parent | 910287474f91e35ae4b9a477cccad83a5e041c3c (diff) | |
download | coreutils-5e1ffee4d676aab97dd766f928876bab6771aa40.tar.xz |
(main): Manually handle `--', since we no longer
call getopt. Reported by Joseph S. Myers.
Diffstat (limited to 'src')
-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) { |