(main): Fix POSIX-conformance bug: "touch --
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 7 Sep 2004 06:21:46 +0000 (06:21 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 7 Sep 2004 06:21:46 +0000 (06:21 +0000)
MMDDhhmm file" must be treated like "touch MMDDhhmm file" when
conforming to pre-2001 POSIX.

src/touch.c

index 6b4c190..c3575f7 100644 (file)
@@ -373,8 +373,7 @@ main (int argc, char **argv)
 
   /* The obsolete `MMDDhhmm[YY]' form is valid IFF there are
      two or more non-option arguments.  */
-  if (!date_set && 2 <= argc - optind && !STREQ (argv[optind - 1], "--")
-      && posix2_version () < 200112)
+  if (!date_set && 2 <= argc - optind && posix2_version () < 200112)
     {
       if (posixtime (&newtime[0].tv_sec, argv[optind], PDS_TRAILING_YEAR))
        {