From 5bd4fe2400c3002bd07d0306fbbca223f10ab961 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 13 Sep 2002 09:50:23 +0000 Subject: (main): Handle leading command line argument of `--'. --- src/printf.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/printf.c') 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); -- cgit v1.2.3-70-g09d2