aboutsummaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/touch.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/coreutils/touch.c b/coreutils/touch.c
index 352177111..6c2b948e6 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -120,9 +120,10 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
120 struct tm tm_time; 120 struct tm tm_time;
121 time_t t; 121 time_t t;
122 122
123 //time(&t); 123 //memset(&tm_time, 0, sizeof(tm_time));
124 //localtime_r(&t, &tm_time); 124 /* Better than memset: makes "HH:MM" dates meaningful */
125 memset(&tm_time, 0, sizeof(tm_time)); 125 time(&t);
126 localtime_r(&t, &tm_time);
126 parse_datestr(date_str, &tm_time); 127 parse_datestr(date_str, &tm_time);
127 128
128 /* Correct any day of week and day of year etc. fields */ 129 /* Correct any day of week and day of year etc. fields */