summaryrefslogtreecommitdiff
path: root/coreutils/date.c
diff options
context:
space:
mode:
authorDenys Vlasenko2009-07-18 03:41:29 +0200
committerDenys Vlasenko2009-07-18 03:41:29 +0200
commit7aca89a7a32a1e560c447952c28a8b1e7fb775fc (patch)
treeb988939ee5fc2cf2235847d5f04ba5887b185e05 /coreutils/date.c
parent73b71f381d24218cf6368364be723a7b5c9aeda9 (diff)
downloadbusybox-7aca89a7a32a1e560c447952c28a8b1e7fb775fc.zip
busybox-7aca89a7a32a1e560c447952c28a8b1e7fb775fc.tar.gz
touch: implement -d --date (our own testsuite needs that)
function old new delta static.uname_longopts - 137 +137 touch_main 231 360 +129 static.touch_longopts - 32 +32 validate_tm_time - 28 +28 packed_usage 26616 26624 +8 date_main 687 686 -1 static.longopts 162 - -162 ------------------------------------------------------------------------------ (add/remove: 3/1 grow/shrink: 2/1 up/down: 334/-163) Total: 171 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils/date.c')
-rw-r--r--coreutils/date.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/coreutils/date.c b/coreutils/date.c
index 7f2a5b3..09ced0e 100644
--- a/coreutils/date.c
+++ b/coreutils/date.c
@@ -142,12 +142,11 @@ int date_main(int argc UNUSED_PARAM, char **argv)
} else {
parse_datestr(date_str, &tm_time);
}
+
/* Correct any day of week and day of year etc. fields */
tm_time.tm_isdst = -1; /* Be sure to recheck dst */
- tm = mktime(&tm_time);
- if (tm < 0) {
- bb_error_msg_and_die(bb_msg_invalid_date, date_str);
- }
+ tm = validate_tm_time(date_str, &tm_time);
+
maybe_set_utc(opt);
/* if setting time, set it */