[BACK]Return to touch.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / touch

Diff for /src/usr.bin/touch/touch.c between version 1.4 and 1.5

version 1.4, 2000/09/20 13:26:55 version 1.5, 2000/09/20 22:25:26
Line 59 
Line 59 
 #include <string.h>  #include <string.h>
 #include <locale.h>  #include <locale.h>
 #include <time.h>  #include <time.h>
   #include <tzfile.h>
 #include <unistd.h>  #include <unistd.h>
   
 int     rw __P((char *, struct stat *, int));  int     rw __P((char *, struct stat *, int));
Line 226 
Line 227 
                 } else {                  } else {
                         yearset = ATOI2(arg);                          yearset = ATOI2(arg);
                         if (yearset < 69)                          if (yearset < 69)
                                 t->tm_year = yearset + 2000;                                  t->tm_year = yearset + 2000 - TM_YEAR_BASE;
                         else                          else
                                 t->tm_year = yearset + 1900;                                  t->tm_year = yearset + 1900 - TM_YEAR_BASE;
                 }                  }
                 t->tm_year -= 1900;     /* Convert to UNIX time. */  
                 /* FALLTHROUGH */                  /* FALLTHROUGH */
         case 8:                         /* MMDDhhmm */          case 8:                         /* MMDDhhmm */
                 t->tm_mon = ATOI2(arg);                  t->tm_mon = ATOI2(arg);
Line 271 
Line 271 
         t->tm_hour = ATOI2(arg);          t->tm_hour = ATOI2(arg);
         t->tm_min = ATOI2(arg);          t->tm_min = ATOI2(arg);
         if (year) {          if (year) {
                 t->tm_year = ATOI2(arg);                  year = ATOI2(arg);
                 if (t->tm_year < 69)                  if (year < 69)
                         t->tm_year += 100;                          t->tm_year = year + 2000 - TM_YEAR_BASE;
                   else
                           t->tm_year = year + 1900 - TM_YEAR_BASE;
         }          }
           t->tm_sec = 0;
   
         t->tm_isdst = -1;               /* Figure out DST. */          t->tm_isdst = -1;               /* Figure out DST. */
         tvp[0].tv_sec = tvp[1].tv_sec = mktime(t);          tvp[0].tv_sec = tvp[1].tv_sec = mktime(t);

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5