summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko2009-06-05 20:42:40 +0200
committerDenys Vlasenko2009-06-05 20:42:40 +0200
commit035b4d77dc8e45862600d911aaade5e40d7bdee4 (patch)
tree4a357714c7f73e86b86b84945d71ea4e5b12bf5c
parent71016baf5524d739d1dd4d9110b111a7c3ddcaf9 (diff)
downloadbusybox-035b4d77dc8e45862600d911aaade5e40d7bdee4.zip
busybox-035b4d77dc8e45862600d911aaade5e40d7bdee4.tar.gz
ftpd: allow multiple -S options to increase verbosity too, like -v
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--networking/ftpd.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/networking/ftpd.c b/networking/ftpd.c
index 090ed54..a8687fb 100644
--- a/networking/ftpd.c
+++ b/networking/ftpd.c
@@ -1095,17 +1095,19 @@ int ftpd_main(int argc UNUSED_PARAM, char **argv)
#endif
{
unsigned abs_timeout;
+ unsigned verbose_S;
smallint opts;
INIT_G();
abs_timeout = 1 * 60 * 60;
+ verbose_S = 0;
G.timeout = 2 * 60;
- opt_complementary = "t+:T+:vv";
+ opt_complementary = "t+:T+:vv:SS";
#if BB_MMU
- opts = getopt32(argv, "vS" IF_FEATURE_FTP_WRITE("w") "t:T:", &G.timeout, &abs_timeout, &G.verbose);
+ opts = getopt32(argv, "vS" IF_FEATURE_FTP_WRITE("w") "t:T:", &G.timeout, &abs_timeout, &G.verbose, &verbose_S);
#else
- opts = getopt32(argv, "l1vS" IF_FEATURE_FTP_WRITE("w") "t:T:", &G.timeout, &abs_timeout, &G.verbose);
+ opts = getopt32(argv, "l1vS" IF_FEATURE_FTP_WRITE("w") "t:T:", &G.timeout, &abs_timeout, &G.verbose, &verbose_S);
if (opts & (OPT_l|OPT_1)) {
/* Our secret backdoor to ls */
/* TODO: pass -n too? */
@@ -1116,6 +1118,8 @@ int ftpd_main(int argc UNUSED_PARAM, char **argv)
return ls_main(argc, argv);
}
#endif
+ if (G.verbose < verbose_S)
+ G.verbose = verbose_S;
if (abs_timeout | G.timeout) {
if (abs_timeout == 0)
abs_timeout = INT_MAX;