aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorGravatar Denis Vlasenko <vda.linux@googlemail.com>2008-04-28 00:25:22 +0000
committerGravatar Denis Vlasenko <vda.linux@googlemail.com>2008-04-28 00:25:22 +0000
commite4ed64067e7de0607cfb23b95a542e29a84bf1fa (patch)
tree43baa202b5a72a3fadc3cd9cd5e2a814ba9f389b /coreutils
parente6520f05328c38333284df5f42b9c2bfb7c4fec9 (diff)
downloadbusybox-e4ed64067e7de0607cfb23b95a542e29a84bf1fa.tar.gz
busybox-e4ed64067e7de0607cfb23b95a542e29a84bf1fa.tar.bz2
date: better version of previous commit; + fix testsuite
to have it checked
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/date.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/coreutils/date.c b/coreutils/date.c
index 2c61aa646..5b0f60f1a 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -79,9 +79,11 @@ int date_main(int argc ATTRIBUTE_UNUSED, char **argv)
if (!(opt & (DATE_OPT_SET | DATE_OPT_DATE))) {
opt |= DATE_OPT_SET;
date_str = argv[0]; /* can be NULL */
- } else if (argv[0]) {
- bb_show_usage();
+ if (date_str)
+ argv++;
}
+ if (*argv)
+ bb_show_usage();
/* Now we have parsed all the information except the date format
which depends on whether the clock is being set or read */