summaryrefslogtreecommitdiff
path: root/coreutils
diff options
context:
space:
mode:
authorDenys Vlasenko2021-04-12 20:12:56 +0200
committerDenys Vlasenko2021-04-12 20:12:56 +0200
commit1a181264d51bc3f3a3c66f756da84ab61b6823d4 (patch)
tree9dcc3649f4150a90b96870a5fff7269838ea7948 /coreutils
parent7ec254467c58047a8105fa688044e88f04a806d6 (diff)
downloadbusybox-1a181264d51bc3f3a3c66f756da84ab61b6823d4.zip
busybox-1a181264d51bc3f3a3c66f756da84ab61b6823d4.tar.gz
touch: unbreak -h
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'coreutils')
-rw-r--r--coreutils/touch.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/coreutils/touch.c b/coreutils/touch.c
index 92e1341..690517e 100644
--- a/coreutils/touch.c
+++ b/coreutils/touch.c
@@ -90,12 +90,12 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
int opts;
enum {
OPT_c = (1 << 0),
- OPT_r = (1 << 1) * ENABLE_FEATURE_TOUCH_SUSV3,
- OPT_d = (1 << 2) * ENABLE_FEATURE_TOUCH_SUSV3,
- OPT_t = (1 << 3) * ENABLE_FEATURE_TOUCH_SUSV3,
- OPT_a = (1 << 4) * ENABLE_FEATURE_TOUCH_SUSV3,
- OPT_m = (1 << 5) * ENABLE_FEATURE_TOUCH_SUSV3,
- OPT_h = (1 << 6) * ENABLE_FEATURE_TOUCH_NODEREF,
+ OPT_h = (1 << 1) * ENABLE_FEATURE_TOUCH_NODEREF,
+ OPT_r = (1 << (1+ENABLE_FEATURE_TOUCH_NODEREF)) * ENABLE_FEATURE_TOUCH_SUSV3,
+ OPT_d = (1 << (2+ENABLE_FEATURE_TOUCH_NODEREF)) * ENABLE_FEATURE_TOUCH_SUSV3,
+ OPT_t = (1 << (3+ENABLE_FEATURE_TOUCH_NODEREF)) * ENABLE_FEATURE_TOUCH_SUSV3,
+ OPT_a = (1 << (4+ENABLE_FEATURE_TOUCH_NODEREF)) * ENABLE_FEATURE_TOUCH_SUSV3,
+ OPT_m = (1 << (5+ENABLE_FEATURE_TOUCH_NODEREF)) * ENABLE_FEATURE_TOUCH_SUSV3,
};
/* NULL = use current time */
const struct timeval *newtime = NULL;
@@ -122,9 +122,10 @@ int touch_main(int argc UNUSED_PARAM, char **argv)
/* -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 = getopt32long(argv, "c" IF_FEATURE_TOUCH_SUSV3("r:d:t:am")
- IF_FEATURE_TOUCH_NODEREF("h")
+ * We accept the same formats for both
+ */
+ opts = getopt32long(argv, "c" IF_FEATURE_TOUCH_NODEREF("h")
+ IF_FEATURE_TOUCH_SUSV3("r:d:t:am")
/*ignored:*/ "f" IF_NOT_FEATURE_TOUCH_SUSV3("am"),
touch_longopts
#if ENABLE_FEATURE_TOUCH_SUSV3