summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2002-09-13 09:50:23 +0000
committerJim Meyering <jim@meyering.net>2002-09-13 09:50:23 +0000
commit5bd4fe2400c3002bd07d0306fbbca223f10ab961 (patch)
tree1f01601e5d9c91432cfe46f7a33be76ad7b0f503 /src
parentb4994d29a1c606e58439f0b529626f9612acb6b5 (diff)
downloadcoreutils-5bd4fe2400c3002bd07d0306fbbca223f10ab961.tar.xz
(main): Handle leading command line argument of `--'.
Diffstat (limited to 'src')
-rw-r--r--src/printf.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/printf.c b/src/printf.c
index b7eceffa4..f8fb51065 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -545,6 +545,14 @@ 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 (1 < argc && STREQ (argv[1], "--"))
+ {
+ --argc;
+ ++argv;
+ }
+
if (argc == 1)
{
fprintf (stderr, _("Usage: %s format [argument...]\n"), program_name);