apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/file_io/win32 dir.c
Date Sun, 28 Jan 2001 04:03:11 GMT
wrowe       01/01/27 20:03:11

  Modified:    file_io/win32 dir.c
  Log:
    Clean up drivel, and handle both int and huge apr_off_t sizes
  
  Revision  Changes    Path
  1.49      +10 -4     apr/file_io/win32/dir.c
  
  Index: dir.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/win32/dir.c,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- dir.c	2001/01/27 22:25:10	1.48
  +++ dir.c	2001/01/28 04:03:11	1.49
  @@ -216,8 +216,8 @@
           int dirlen = strlen(thedir->dirname);
           if (dirlen >= sizeof(fspec))
               dirlen = sizeof(fspec) - 1;
  -        apr_cpystrn(fspec, sizeof(fspec), thedir->dirname);
  -        apr_cpystrn(fspec + dirlen, sizeof(fspec) - dirlen, fname);
  +        apr_cpystrn(fspec, thedir->dirname, sizeof(fspec));
  +        apr_cpystrn(fspec + dirlen, fname, sizeof(fspec) - dirlen);
           rv = apr_stat(finfo, fspec, wanted, thedir->cntxt);
           if (rv == APR_SUCCESS || rv == APR_INCOMPLETE) {
               finfo->valid |= APR_FINFO_NAME;
  @@ -254,8 +254,14 @@
       FileTimeToAprTime(&finfo->ctime, &thedir->n.entry->ftCreationTime);
       FileTimeToAprTime(&finfo->mtime, &thedir->n.entry->ftLastWriteTime);
       FileTimeToAprTime(&finfo->atime, &thedir->n.entry->ftLastAccessTime);
  -    finfo->size = (thedir->n.entry->nFileSizeHigh * MAXDWORD)
  -                +  thedir->n.entry->nFileSizeLow;
  +#if APR_HAS_LARGE_FILES
  +    finfo->size = ((apr_off_t)thedir->n.entry->nFileSizeHigh << 32)
  +                |  (apr_off_t)thedir->n.entry->nFileSizeLow;
  +#else
  +    finfo->size = (apr_off_t)thedir->n.entry->nFileSizeLow;
  +    if (finfo->size < 0 || FileInformation.nFileSizeHigh)
  +        finfo->size = 0x7fffffff;
  +#endif
       return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS;
   }
   
  
  
  

Mime
View raw message