1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-04-21 11:16:16 +02:00

Include posixver.h.

(usage): Document only the intersection of the old and new behaviors,
to encourage portability.
(main): Use `posix2_version ()' in place of POSIX2_VERSION.
This commit is contained in:
Jim Meyering
2002-02-20 16:06:20 +00:00
parent 12756a214f
commit 69e2127485

View File

@@ -28,6 +28,7 @@
#include "error.h"
#include "getdate.h"
#include "posixtm.h"
#include "posixver.h"
#include "quote.h"
#include "safe-read.h"
@@ -226,9 +227,6 @@ usage (int status)
else
{
printf (_("Usage: %s [OPTION]... FILE...\n"), program_name);
if (POSIX2_VERSION < 200112)
printf (_(" or: %s [-acm] MMDDhhmm[YY] FILE... (obsolete)\n"),
program_name);
fputs (_("\
Update the access and modification times of each FILE to the current time.\n\
\n\
@@ -254,10 +252,6 @@ Mandatory arguments to long options are mandatory for short options too.\n\
fputs (_("\
\n\
Note that the -d and -t options accept different time-date formats.\n\
"), stdout);
if (POSIX2_VERSION < 200112)
fputs (_("\
Also, the obsolete time-date format differs from both other formats.\n\
"), stdout);
puts (_("\nReport bugs to <bug-fileutils@gnu.org>."));
}
@@ -358,8 +352,8 @@ main (int argc, char **argv)
/* The obsolete `MMDDhhmm[YY]' form is valid IFF there are
two or more non-option arguments. */
if (POSIX2_VERSION < 200112
&& !date_set && 2 <= argc - optind && !STREQ (argv[optind - 1], "--"))
if (!date_set && 2 <= argc - optind && !STREQ (argv[optind - 1], "--")
&& posix2_version () < 200112)
{
newtime = posixtime (argv[optind], PDS_TRAILING_YEAR);
if (newtime != (time_t) -1)