summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenys Vlasenko2009-07-18 04:49:20 +0200
committerDenys Vlasenko2009-07-18 04:49:20 +0200
commit38dd8aa657d80232d8bbce4ed359af2022f605c7 (patch)
treedf326bb4ee6a083cc5b435a7b12d8ecb1331df8c /coreutils
parent7aca89a7a32a1e560c447952c28a8b1e7fb775fc (diff)
downloadbusybox-38dd8aa657d80232d8bbce4ed359af2022f605c7.zip
busybox-38dd8aa657d80232d8bbce4ed359af2022f605c7.tar.gz
touch: implement -t TIME (needed for testsuite)
This changes date -d TIME format a bit, makes it more compatible function old new delta parse_datestr 391 618 +227 touch_main 360 361 +1 packed_usage 26624 26615 -9 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/touch.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/coreutils/touch.c b/coreutils/touch.c
index 1b4a5f0..e79092f 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -64,10 +64,14 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
#if ENABLE_DESKTOP && ENABLE_LONG_OPTS
applet_long_options = touch_longopts;
#endif
- opts = getopt32(argv, "c" IF_DESKTOP("r:d:")
+ /* -d and -t both set time. In coreutils,
+ * accepted data format differs a bit between -d and -t.
+ * We accept the same formats for both */
+ opts = getopt32(argv, "c" IF_DESKTOP("r:d:t:")
/*ignored:*/ "fma"
IF_DESKTOP(, &reference_file)
IF_DESKTOP(, &date_str)
+ IF_DESKTOP(, &date_str)
);
opts &= 1; /* only -c bit is left */