summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-10-18 08:11:09 +0000
committerJim Meyering <jim@meyering.net>2003-10-18 08:11:09 +0000
commitcb822ba93f7747ca285c0eb91196495fbbf2d629 (patch)
treebbe40012b5f3f743ead8232e23117237523e01ca /lib
parent79b9e74be5546fdefc840b388796111693b6d585 (diff)
downloadcoreutils-cb822ba93f7747ca285c0eb91196495fbbf2d629.tar.xz
Include stdarg.h.
(parse_long_options): Make this function variadic, too. Call version_etc_va, not version_etc.
Diffstat (limited to 'lib')
-rw-r--r--lib/long-options.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/long-options.c b/lib/long-options.c
index 58bc93c1d..ada070eb0 100644
--- a/lib/long-options.c
+++ b/lib/long-options.c
@@ -23,11 +23,13 @@
# include <config.h>
#endif
+/* Specification. */
#include "long-options.h"
+#include <stdarg.h>
#include <stdio.h>
-#include <getopt.h>
#include <stdlib.h>
+#include <getopt.h>
#include "version-etc.h"
@@ -47,8 +49,8 @@ parse_long_options (int argc,
const char *command_name,
const char *package,
const char *version,
- const char *authors,
- void (*usage_func)())
+ void (*usage_func)(),
+ /* const char *author1, ...*/ ...)
{
int c;
int saved_opterr;
@@ -67,8 +69,12 @@ parse_long_options (int argc,
(*usage_func) (0);
case 'v':
- version_etc (stdout, command_name, package, version, authors);
- exit (0);
+ {
+ va_list authors;
+ va_start (authors, usage_func);
+ version_etc_va (stdout, command_name, package, version, authors);
+ exit (0);
+ }
default:
/* Don't process any other long-named options. */