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 | |
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.
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | src/touch.c | 8 |
3 files changed, 7 insertions, 7 deletions
@@ -14,10 +14,15 @@ GNU coreutils NEWS -*- outline -*- sort -g now uses long doubles for greater range and precision. + touch's --file option is no longer recognized. Use --reference=F (-r) + instead. --file has not been documented for 15 years, and its use has + elicited a warning since coreutils-7.1. + truncate now supports setting file sizes relative to a reference file. Also errors are no longer suppressed for unsupported file types, and relative sizes are restricted to supported file types. + * Noteworthy changes in release 8.5 (2010-04-23) [stable] ** Bug fixes @@ -525,6 +525,7 @@ Robert H. de Vries robert@and.nl Robert Lindgren robert@orcafat.com Robert Millan zeratul2@wanadoo.es Robert Schwebel r.schwebel@pengutronix.de +Robin H. Johnson robbat2@gentoo.org Rogier Wolff R.E.Wolff@BitWizard.nl Roland Huebner ro-huebner@gmx.de Roland Turner raz.tah.bet@raz.cx 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; |