Add HAVE_STRVERSCMP, guard the only usage of strverscmp with #ifdef
[platform/upstream/busybox.git] / coreutils / touch.c
index 3521771..0f980fd 100644 (file)
@@ -26,7 +26,7 @@
 //config:        touch is used to create or change the access and/or
 //config:        modification timestamp of specified files.
 
-//applet:IF_TOUCH(APPLET_NOFORK(touch, touch, _BB_DIR_BIN, _BB_SUID_DROP, touch))
+//applet:IF_TOUCH(APPLET_NOFORK(touch, touch, BB_DIR_BIN, BB_SUID_DROP, touch))
 
 //kbuild:lib-$(CONFIG_TOUCH) += touch.o
 
@@ -34,7 +34,6 @@
 //usage:       "[-c]" IF_DESKTOP(" [-d DATE] [-r FILE]") " FILE [FILE]..."
 //usage:#define touch_full_usage "\n\n"
 //usage:       "Update the last-modified date on the given FILE[s]\n"
-//usage:     "\nOptions:"
 //usage:     "\n       -c      Don't create files"
 //usage:       IF_DESKTOP(
 //usage:     "\n       -d DT   Date/time to use"
@@ -120,9 +119,10 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
                struct tm tm_time;
                time_t t;
 
-               //time(&t);
-               //localtime_r(&t, &tm_time);
-               memset(&tm_time, 0, sizeof(tm_time));
+               //memset(&tm_time, 0, sizeof(tm_time));
+               /* Better than memset: makes "HH:MM" dates meaningful */
+               time(&t);
+               localtime_r(&t, &tm_time);
                parse_datestr(date_str, &tm_time);
 
                /* Correct any day of week and day of year etc. fields */