You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by gs...@locus.apache.org on 2000/07/03 12:33:23 UTC

cvs commit: apache-2.0/src/modules/dav/fs repos.c

gstein      00/07/03 03:33:18

  Modified:    src/modules/dav/fs repos.c
  Log:
  APR-ize dav_format_time()
  
  Submitted by: Joe Orton <jo...@orton.demon.co.uk>
  
  Revision  Changes    Path
  1.6       +11 -10    apache-2.0/src/modules/dav/fs/repos.c
  
  Index: repos.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/modules/dav/fs/repos.c,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- repos.c	2000/07/03 08:54:43	1.5
  +++ repos.c	2000/07/03 10:33:11	1.6
  @@ -232,19 +232,20 @@
   
   /* Note: picked up from ap_gm_timestr_822() */
   /* NOTE: buf must be at least DAV_TIMEBUF_SIZE chars in size */
  -static void dav_format_time(int style, time_t sec, char *buf)
  +static void dav_format_time(int style, ap_time_t sec, char *buf)
   {
  -    struct tm *tms;
  +    ap_exploded_time_t tms;
  +    
  +    /* ### what to do if fails? */
  +    (void) ap_explode_gmt(&tms, sec);
   
  -    tms = gmtime(&sec);
  -
       if (style == DAV_STYLE_ISO8601) {
   	/* ### should we use "-00:00" instead of "Z" ?? */
   
   	/* 20 chars plus null term */
   	sprintf(buf, "%.4d-%.2d-%.2dT%.2d:%.2d:%.2dZ",
  -		tms->tm_year + 1900, tms->tm_mon + 1, tms->tm_mday,
  -		tms->tm_hour, tms->tm_min, tms->tm_sec);
  +               tms.tm_year + 1900, tms.tm_mon + 1, tms.tm_mday,
  +               tms.tm_hour, tms.tm_min, tms.tm_sec);
           return;
       }
   
  @@ -253,10 +254,10 @@
       /* 29 chars plus null term */
       sprintf(buf,
   	    "%s, %.2d %s %d %.2d:%.2d:%.2d GMT",
  -	    ap_day_snames[tms->tm_wday],
  -	    tms->tm_mday, ap_month_snames[tms->tm_mon],
  -	    tms->tm_year + 1900,
  -	    tms->tm_hour, tms->tm_min, tms->tm_sec);
  +           ap_day_snames[tms.tm_wday],
  +           tms.tm_mday, ap_month_snames[tms.tm_mon],
  +           tms.tm_year + 1900,
  +           tms.tm_hour, tms.tm_min, tms.tm_sec);
   }
   
   static int dav_sync_write(int fd, const char *buf, ssize_t bufsize)