httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jerenkra...@apache.org
Subject svn commit: r231183 - /httpd/mod_mbox/trunk/module-2.0/mod-mbox-util.c
Date Wed, 10 Aug 2005 07:10:17 GMT
Author: jerenkrantz
Date: Wed Aug 10 00:10:15 2005
New Revision: 231183

URL: http://svn.apache.org/viewcvs?rev=231183&view=rev
Log:
* mod-mbox-util.c
  (scan_dir): Skip empty mbox files for purposes of determing list info.

Modified:
    httpd/mod_mbox/trunk/module-2.0/mod-mbox-util.c

Modified: httpd/mod_mbox/trunk/module-2.0/mod-mbox-util.c
URL: http://svn.apache.org/viewcvs/httpd/mod_mbox/trunk/module-2.0/mod-mbox-util.c?rev=231183&r1=231182&r2=231183&view=diff
==============================================================================
--- httpd/mod_mbox/trunk/module-2.0/mod-mbox-util.c (original)
+++ httpd/mod_mbox/trunk/module-2.0/mod-mbox-util.c Wed Aug 10 00:10:15 2005
@@ -128,7 +128,7 @@
     apr_dir_t *dir;
     apr_finfo_t finfo;
     apr_array_header_t* files;
-    char* file;
+    char* file = NULL;
     char* ml;
     char* domain;
     char* list;
@@ -178,7 +178,14 @@
                         files->nelts);
     }
 
-    file = ((char**)files->elts)[0];
+    /* Look for first non-empty file. */
+    for (i = 0; i < files->nelts; i++) {
+      file = ((char**)files->elts)[i];
+      rv = apr_stat(&finfo, file, APR_FINFO_SIZE, mpool);
+      if (rv == APR_SUCCESS && finfo.size > 0) {
+        break;
+      }
+    }
 
     if (verbose) {
         apr_file_printf(errfile, "Scaning %s for Mailing List info" NL,



Mime
View raw message