diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-18 04:49:20 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2009-07-18 04:49:20 +0200 |
commit | 38dd8aa657d80232d8bbce4ed359af2022f605c7 (patch) | |
tree | df326bb4ee6a083cc5b435a7b12d8ecb1331df8c /coreutils | |
parent | 7aca89a7a32a1e560c447952c28a8b1e7fb775fc (diff) | |
download | busybox-w32-38dd8aa657d80232d8bbce4ed359af2022f605c7.tar.gz busybox-w32-38dd8aa657d80232d8bbce4ed359af2022f605c7.tar.bz2 busybox-w32-38dd8aa657d80232d8bbce4ed359af2022f605c7.zip |
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.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/coreutils/touch.c b/coreutils/touch.c index 1b4a5f0ea..e79092fc1 100644 --- a/coreutils/touch.c +++ b/coreutils/touch.c | |||
@@ -64,10 +64,14 @@ int touch_main(int argc UNUSED_PARAM, char **argv) | |||
64 | #if ENABLE_DESKTOP && ENABLE_LONG_OPTS | 64 | #if ENABLE_DESKTOP && ENABLE_LONG_OPTS |
65 | applet_long_options = touch_longopts; | 65 | applet_long_options = touch_longopts; |
66 | #endif | 66 | #endif |
67 | opts = getopt32(argv, "c" IF_DESKTOP("r:d:") | 67 | /* -d and -t both set time. In coreutils, |
68 | * accepted data format differs a bit between -d and -t. | ||
69 | * We accept the same formats for both */ | ||
70 | opts = getopt32(argv, "c" IF_DESKTOP("r:d:t:") | ||
68 | /*ignored:*/ "fma" | 71 | /*ignored:*/ "fma" |
69 | IF_DESKTOP(, &reference_file) | 72 | IF_DESKTOP(, &reference_file) |
70 | IF_DESKTOP(, &date_str) | 73 | IF_DESKTOP(, &date_str) |
74 | IF_DESKTOP(, &date_str) | ||
71 | ); | 75 | ); |
72 | 76 | ||
73 | opts &= 1; /* only -c bit is left */ | 77 | opts &= 1; /* only -c bit is left */ |