diff options
author | Jim Meyering <meyering@redhat.com> | 2010-06-02 16:23:41 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2010-06-02 17:14:10 +0200 |
commit | d5a5d8309433e8393bce62c3c5e100919cb505eb (patch) | |
tree | 31829ec875fb6fb4da2a018d1e7cdd055ef55623 /src/touch.c | |
parent | c0cfa0defe06fa750530f08d6e0a54521f83292d (diff) | |
download | coreutils-d5a5d8309433e8393bce62c3c5e100919cb505eb.tar.xz |
touch: remove support for --file=REF_FILE option
* src/touch.c (main): Remove support for the deprecated, long-named
--file option, which is an alternate name for --reference (-r).
That option was undocumented with the arrival of --reference, in
the 1995-10-29 commit, 8b92864e1d. Since the 2009-02-09 commit,
ed85df444a, use of --file has elicited a warning. Not only was
this code due for removal, but the long-name-use-detecting code
was buggy in that it would use a stale or uninitialized "long_idx",
as reported by Robin H. Johnson in http://bugs.gentoo.org/322421.
* NEWS (Changes in behavior): Mention it.
Diffstat (limited to 'src/touch.c')
-rw-r--r-- | src/touch.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/touch.c b/src/touch.c index db1bc8d97..e5224a45a 100644 --- a/src/touch.c +++ b/src/touch.c @@ -86,7 +86,6 @@ static struct option const longopts[] = {"time", required_argument, NULL, TIME_OPTION}, {"no-create", no_argument, NULL, 'c'}, {"date", required_argument, NULL, 'd'}, - {"file", required_argument, NULL, 'r'}, /* FIXME: remove --file in 2010 */ {"reference", required_argument, NULL, 'r'}, {"no-dereference", no_argument, NULL, 'h'}, {GETOPT_HELP_OPTION_DECL}, @@ -263,7 +262,6 @@ main (int argc, char **argv) bool date_set = false; bool ok = true; char const *flex_date = NULL; - int long_idx; /* FIXME: remove in 2010, when --file is removed */ initialize_main (&argc, &argv); set_program_name (argv[0]); @@ -276,7 +274,7 @@ main (int argc, char **argv) change_times = 0; no_create = use_ref = false; - while ((c = getopt_long (argc, argv, "acd:fhmr:t:", longopts, &long_idx)) != -1) + while ((c = getopt_long (argc, argv, "acd:fhmr:t:", longopts, NULL)) != -1) { switch (c) { @@ -304,10 +302,6 @@ main (int argc, char **argv) break; case 'r': - if (long_idx == 3) - error (0, 0, - _("warning: the --%s option is obsolete; use --reference"), - longopts[long_idx].name); use_ref = true; ref_file = optarg; break; |