You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by wr...@apache.org on 2002/05/22 02:57:24 UTC

cvs commit: apr/time/win32 time.c

wrowe       02/05/21 17:57:24

  Modified:    time/win32 time.c
  Log:
    Fix two serious holes in the time calculations.  The first patch was a
    discrepancy with the Unix implementations.  The second patch applies
    to Unix implementations, no?  gmtoff is independent of isdst, since
    gmtoff must be relocatable to another calendar month when dst is
    in it's other state [on/off boolean.]
  
  Reported by: Jon Travis <jt...@covalent.net>
  
  Revision  Changes    Path
  1.33      +2 -2      apr/time/win32/time.c
  
  Index: time.c
  ===================================================================
  RCS file: /home/cvs/apr/time/win32/time.c,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- time.c	15 Apr 2002 00:01:09 -0000	1.32
  +++ time.c	22 May 2002 00:57:24 -0000	1.33
  @@ -215,7 +215,6 @@
       if (days < 0) {
           return APR_EBADDATE;
       }
  -    days -= xt->tm_gmtoff;
       *t = days * APR_USEC_PER_SEC + xt->tm_usec;
       return APR_SUCCESS;
   }
  @@ -225,7 +224,8 @@
   {
       apr_status_t status = apr_time_exp_get(t, xt);
       if (status == APR_SUCCESS)
  -        *t -= (apr_time_t) xt->tm_gmtoff * APR_USEC_PER_SEC;
  +        *t -= (apr_time_t) (xt->tm_isdst * 3600 
  +                          + xt->tm_gmtoff) * APR_USEC_PER_SEC;
       return status;
   }