projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9102874
)
(main): Manually handle `--', since we no longer
author
Jim Meyering
<jim@meyering.net>
Sat, 1 May 1999 02:29:17 +0000
(
02:29
+0000)
committer
Jim Meyering
<jim@meyering.net>
Sat, 1 May 1999 02:29:17 +0000
(
02:29
+0000)
call getopt. Reported by Joseph S. Myers.
src/basename.c
patch
|
blob
|
history
diff --git
a/src/basename.c
b/src/basename.c
index
802c5dc
..
ffdb675
100644
(file)
--- 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)
{