]> diplodocus.org Git - nmh/blobdiff - uip/flist.c
lock_file.c: close(2) file descriptor on failure, avoiding leak.
[nmh] / uip / flist.c
index 02d6f5e7d6d1ebf19af39bff94ea82417bf711b5..f40f010dee9e7b8afd42b35050e27a17683055df 100644 (file)
@@ -15,6 +15,7 @@
 
 #include <h/mh.h>
 #include <h/utils.h>
+#include "sbr/m_maildir.h"
 
 /*
  * We allocate space to record the names of folders
@@ -72,11 +73,11 @@ static int maxfolders;
 /* info on sequences to search for */
 static svector_t sequencesToDo;
 
-static int all        = FALSE;  /* scan all folders in top level?           */
-static int alphaOrder = FALSE; /* want alphabetical order only             */
-static int recurse    = FALSE; /* show nested folders?                     */
-static int showzero   = TRUE;  /* show folders even if no messages in seq? */
-static int Total      = TRUE;  /* display info on number of messages in    *
+static bool all;                /* scan all folders in top level? */
+static bool alphaOrder;         /* want alphabetical order only */
+static bool recurse;            /* show nested folders? */
+static bool showzero = true;    /* show folders even if no messages in seq? */
+static bool Total = true;       /* display info on number of messages in
                                 * sequence found, and total num messages   */
 
 static char curfolder[BUFSIZ]; /* name of the current folder */
@@ -157,41 +158,41 @@ main(int argc, char **argv)
                break;
 
            case ALLSW:
-               all = TRUE;
+               all = true;
                break;
            case NOALLSW:
-               all = FALSE;
+               all = false;
                break;
 
            case SHOWZERO:
-               showzero = TRUE;
+               showzero = true;
                break;
            case NOSHOWZERO:
-               showzero = FALSE;
+               showzero = false;
                break;
 
            case ALPHASW:
-               alphaOrder = TRUE;
+               alphaOrder = true;
                break;
            case NOALPHASW:
-               alphaOrder = FALSE;
+               alphaOrder = false;
                break;
 
            case NOFASTSW:
            case TOTALSW:
-               Total = TRUE;
+               Total = true;
                break;
 
            case FASTSW:
            case NOTOTALSW:
-               Total = FALSE;
+               Total = false;
                break;
 
            case RECURSE:
-               recurse = TRUE;
+               recurse = true;
                break;
            case NORECURSE:
-               recurse = FALSE;
+               recurse = false;
                break;
            }
        } else {
@@ -409,7 +410,7 @@ BuildFolderListRecurse(char *dirName, struct stat *s, int searchdepth)
        /* Check to see if the name of the file is a number
         * if it is, we assume it's a mail file and skip it
         */
-       for (n = dp->d_name; *n && isdigit((unsigned char) *n); n++);
+       for (n = dp->d_name; isdigit((unsigned char)*n); n++);
        if (!*n)
            continue;
        strncpy (name, base, sizeof(name) - 2);