bug-mailutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-mailutils] MH's folder program


From: Sergey Poznyakoff
Subject: Re: [bug-mailutils] MH's folder program
Date: Fri, 12 May 2006 10:33:36 EEST

I have applied the following patch to CVS head. It fixes both
bugs found by Darel: inconsistent exit code and spurios output
when invoked with -fast -nocreate on a non-existent folder.

Regards,
Sergey

Index: mh/folder.c
===================================================================
RCS file: /cvsroot/mailutils/mailutils/mh/folder.c,v
retrieving revision 1.30
diff -p -u -r1.30 folder.c
--- mh/folder.c 20 Jan 2006 16:28:58 -0000      1.30
+++ mh/folder.c 12 May 2006 07:00:53 -0000
@@ -304,20 +304,6 @@ _scan (const char *name, int depth)
   struct stat st;
   size_t uid;
 
-  if (!recurse)
-    {
-      if (fast_mode && depth > 0)
-       {
-         memset (&info, 0, sizeof (info));
-         info.name = strdup (name);
-         install_folder_info (name, &info);
-         return;
-       }
-      
-      if (depth > 1)
-       return;
-    }
-  
   dir = opendir (name);
 
   if (!dir && errno == ENOENT)
@@ -332,10 +318,7 @@ _scan (const char *name, int depth)
          dir = opendir (name);
        }
       else
-       {
-         push_folder = 0;
-         return;
-       }
+       exit (1);
     }
 
   if (!dir)
@@ -344,6 +327,21 @@ _scan (const char *name, int depth)
       return;
     }
 
+  if (!recurse)
+    {
+      closedir (dir);
+      if (fast_mode && depth > 0)
+       {
+         memset (&info, 0, sizeof (info));
+         info.name = strdup (name);
+         install_folder_info (name, &info);
+         return;
+       }
+      
+      if (depth > 1)
+       return;
+    }
+  
   memset (&info, 0, sizeof (info));
   info.name = strdup (name);
   while ((entry = readdir (dir)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]