]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
Include posixver.h.
authorJim Meyering <jim@meyering.net>
Wed, 20 Feb 2002 16:06:20 +0000 (16:06 +0000)
committerJim Meyering <jim@meyering.net>
Wed, 20 Feb 2002 16:06:20 +0000 (16:06 +0000)
(usage): Document only the intersection of the old and new behaviors,
to encourage portability.
(main): Use `posix2_version ()' in place of POSIX2_VERSION.

src/touch.c

index e4666f03fc849b38f157ce4234f4bbc197a3eb9e..9ede5dd1e9b777b9fc55a73d2a06459d8ba25d1f 100644 (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)