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

Diff for /src/usr.bin/cvs/rcs.c between version 1.139 and 1.140

version 1.139, 2006/03/08 09:03:59 version 1.140, 2006/03/09 10:56:33
Line 2531 
Line 2531 
 rcs_expand_keywords(char *rcsfile, struct rcs_delta *rdp, char *data,  rcs_expand_keywords(char *rcsfile, struct rcs_delta *rdp, char *data,
     size_t len, int mode)      size_t len, int mode)
 {  {
         int tzone;  
         int kwtype, sizdiff;          int kwtype, sizdiff;
         u_int i, j, found, start_offset, c_offset;          u_int i, j, found, start_offset, c_offset;
         char *c, *kwstr, *start, *end, *tbuf, *m, *h;          char *c, *kwstr, *start, *end, *tbuf;
         char expbuf[256], buf[256];          char expbuf[256], buf[256];
         struct tm *tb, ltb;          struct tm *tb;
         time_t now;  
         char *fmt;          char *fmt;
   
         kwtype = 0;          kwtype = 0;
Line 2548 
Line 2546 
          * -z support for RCS           * -z support for RCS
          */           */
         tb = &rdp->rd_date;          tb = &rdp->rd_date;
         if (timezone_flag != NULL) {          if (timezone_flag != NULL)
                 if (!strcmp(timezone_flag, "LT")) {                  tb = rcs_set_tz(timezone_flag, rdp);
                         now = mktime(&rdp->rd_date);  
                         tb = localtime(&now);  
                         tb->tm_hour += ((int)tb->tm_gmtoff / 3600);  
                 } else {  
                         switch (*timezone_flag) {  
                         case '-':  
                         case '+':  
                                 break;  
                         default:  
                                 fatal("%s: not a known time zone",  
                                     timezone_flag);  
                         }  
   
                         h = timezone_flag;  
                         if ((m = strrchr(timezone_flag, ':')) != NULL)  
                                 *(m++) = '\0';  
   
                         ltb = rdp->rd_date;  
                         tb = &ltb;  
   
                         tzone = atoi(h);  
   
                         if (tzone >= 24 && tzone <= -24)  
                                 fatal("%s: not a known time zone",  
                                     timezone_flag);  
   
                         tb->tm_hour += tzone;  
                         if (tb->tm_hour >= 24 && tb->tm_hour <= -24)  
                                 tb->tm_hour = 0;  
   
                         tb->tm_gmtoff += (tzone * 3600);  
   
                         if (m != NULL) {  
                                 tzone = atoi(m);  
                                 if (tzone >= 60)  
                                         fatal("%s: not a known time zone",  
                                             timezone_flag);  
   
                                 if ((tb->tm_min + tzone) >= 60) {  
                                         tb->tm_hour++;  
                                         tb->tm_min -= tzone;  
                                 } else {  
                                         tb->tm_min += tzone;  
                                 }  
   
                                 tb->tm_gmtoff += (tzone * 60);  
                         }  
                 }  
         }  
   
         /*          /*
          * Keyword formats:           * Keyword formats:

Legend:
Removed from v.1.139  
changed lines
  Added in v.1.140