[BACK]Return to date.y CVS log [TXT][DIR] Up to [local] / src / usr.bin / rcs

Diff for /src/usr.bin/rcs/date.y between version 1.7 and 1.8

version 1.7, 2010/07/23 09:14:58 version 1.8, 2010/07/23 21:46:05
Line 805 
Line 805 
 }  }
   
 /*  /*
  * rcs_date_parse()   * date_parse()
  *   *
  * Returns the number of seconds since the Epoch corresponding to the date.   * Returns the number of seconds since the Epoch corresponding to the date.
  */   */
 time_t  time_t
 rcs_date_parse(const char *p)  date_parse(const char *p)
 {  {
         struct tm       gmt, tm;          struct tm       gmt, tm;
         time_t          Start, tod, nowtime, tz;          time_t          Start, tod, nowtime, tz;
Line 819 
Line 819 
   
         if (time(&nowtime) == -1 || !gmtime_r(&nowtime, &gmt) ||          if (time(&nowtime) == -1 || !gmtime_r(&nowtime, &gmt) ||
             !localtime_r(&nowtime, &tm))              !localtime_r(&nowtime, &tm))
                 errx(1, "cvs_date_parse failed");                  errx(1, "date_parse failed");
   
         tz = difftm(&gmt, &tm) / 60;          tz = difftm(&gmt, &tm) / 60;
   
Line 884 
Line 884 
         (void)printf("Enter date, or blank line to exit.\n\t> ");          (void)printf("Enter date, or blank line to exit.\n\t> ");
         (void)fflush(stdout);          (void)fflush(stdout);
         while (fgets(buff, sizeof(buff), stdin) && buff[0]) {          while (fgets(buff, sizeof(buff), stdin) && buff[0]) {
                 d = rcs_date_parse(buff);                  d = date_parse(buff);
                 if (d == -1)                  if (d == -1)
                         (void)printf("Bad format - couldn't convert.\n");                          (void)printf("Bad format - couldn't convert.\n");
                 else                  else

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8