apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: apr/file_io/unix dir.c
Date Tue, 23 Jan 2001 04:40:40 GMT
rbb         01/01/22 20:40:40

  Modified:    file_io/unix dir.c
  Log:
  Fix apr_dir_read on Unix.
  
  Revision  Changes    Path
  1.44      +5 -5      apr/file_io/unix/dir.c
  
  Index: dir.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/unix/dir.c,v
  retrieving revision 1.43
  retrieving revision 1.44
  diff -u -d -b -w -u -r1.43 -r1.44
  --- dir.c	2001/01/23 04:10:46	1.43
  +++ dir.c	2001/01/23 04:40:40	1.44
  @@ -109,7 +109,7 @@
   apr_status_t apr_dir_read(apr_finfo_t *finfo, apr_int32_t wanted,
                             apr_dir_t *thedir)
   {
  -    apr_status_t ret;
  +    apr_status_t ret = 0;
   #if APR_HAS_THREADS && defined(_POSIX_THREAD_SAFE_FUNCTIONS) \
       && !defined(READDIR_IS_THREAD_SAFE)
       dirent *retent;
  @@ -146,15 +146,15 @@
       wanted &= ~(APR_FINFO_NAME);
       if (wanted)
       {
  -        char fspec[_MAXPATH];
  +        char fspec[PATH_MAX];
           int off;
  -        apr_strcpyn(fspec, sizeof(fspec), thedir->dirname);
  +        apr_cpystrn(fspec, thedir->dirname, sizeof(fspec));
           off = strlen(fspec);
           if (fspec[off - 1] != '/')
               fspec[off++] = '/';
  -        apr_strcpyn(fspec + off, sizeof(fspec) - off, thedir->entry->d_name);
  +        apr_cpystrn(fspec + off, thedir->entry->d_name, sizeof(fspec) - off);
           /* ??? Or lstat below?  What is it we really want? */
  -        ret = apr_stat(finfo, wanted, fspec, thedir->cntxt);
  +        ret = apr_stat(finfo, fspec, wanted, thedir->cntxt);
       }
       if (!wanted || ret) {
           finfo->cntxt = thedir->cntxt;
  
  
  

Mime
View raw message