summaryrefslogtreecommitdiff
path: root/src/touch.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-12-09 15:39:38 +0000
committerJim Meyering <jim@meyering.net>1999-12-09 15:39:38 +0000
commit6cbabe63d4b26342e5900d657618f0342a14053e (patch)
tree36b6c8f838d20fc63c2bc2e8c45196c6d66277d8 /src/touch.c
parent1aa50fd72e8c9da09e2447d09521ca5aca24676e (diff)
downloadcoreutils-6cbabe63d4b26342e5900d657618f0342a14053e.tar.xz
(anonymous enum): Define TIME_OPTION, and ...
(longopts): ...use it here instead of `CHAR_MAX + 1'. (main): Likewise.
Diffstat (limited to 'src/touch.c')
-rw-r--r--src/touch.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/touch.c b/src/touch.c
index 2db00d304..5e638005a 100644
--- a/src/touch.c
+++ b/src/touch.c
@@ -78,9 +78,16 @@ static char *ref_file;
/* Info about the reference file. */
static struct stat ref_stats;
+/* For long options that have no equivalent short option, use a
+ non-character as a pseudo short option, starting with CHAR_MAX + 1. */
+enum
+{
+ TIME_OPTION = CHAR_MAX + 1
+};
+
static struct option const longopts[] =
{
- {"time", required_argument, 0, CHAR_MAX + 1},
+ {"time", required_argument, 0, TIME_OPTION},
{"no-create", no_argument, 0, 'c'},
{"date", required_argument, 0, 'd'},
{"file", required_argument, 0, 'r'}, /* FIXME: phase out --file */
@@ -276,7 +283,7 @@ main (int argc, char **argv)
date_set++;
break;
- case CHAR_MAX + 1: /* --time */
+ case TIME_OPTION: /* --time */
change_times |= XARGMATCH ("--time", optarg,
time_args, time_masks);
break;