From ecf66fc91edb6640fbf590c1e3473c5b8d77a8d1 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Mon, 18 Oct 1999 17:19:14 +0000 Subject: [PATCH] change `-l' flag to use arg_collect (this makes `-ll' work again) git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@7186 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/ftp/ftpd/ftpd.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/appl/ftp/ftpd/ftpd.c b/appl/ftp/ftpd/ftpd.c index ca8e95630..16372de19 100644 --- a/appl/ftp/ftpd/ftpd.c +++ b/appl/ftp/ftpd/ftpd.c @@ -208,12 +208,25 @@ int use_builtin_ls; static int help_flag; static int version_flag; +static int +log_collect(int short_flag, int argc, char **argv, + int *optind, int *optarg, void *data) +{ + (*(int*)data)++; + return 0; +} + +static getarg_collect_info log_collect_info = { + log_collect, + &logflag +}; + struct getargs args[] = { { NULL, 'a', arg_string, &auth_string, "required authentication" }, { NULL, 'i', arg_flag, &interactive_flag, "don't assume stdin is a socket" }, { NULL, 'p', arg_string, &port_string, "what port to listen to" }, { NULL, 'g', arg_string, &guest_umask_string, "umask for guest logins" }, - { NULL, 'l', arg_flag, &logflag, "log more stuff" }, + { NULL, 'l', arg_collect, &log_collect_info, "log more stuff", "" }, { NULL, 't', arg_integer, &ftpd_timeout, "initial timeout" }, { NULL, 'T', arg_integer, &maxtimeout, "max timeout" }, { NULL, 'u', arg_string, &umask_string, "umask for user logins" }, @@ -236,7 +249,7 @@ usage (int code) int main(int argc, char **argv) { - int addrlen, ch, on = 1, tos; + int addrlen, on = 1, tos; char *cp, line[LINE_MAX]; FILE *fd; int port; @@ -259,7 +272,7 @@ main(int argc, char **argv) #endif if(getarg(args, num_args, argc, argv, &optind)) usage(1); - + if(help_flag) usage(0);