]> diplodocus.org Git - minc/commitdiff
Should not sort by mtime for mh folder.
authorEric Gillespie <epg@pretzelnet.org>
Wed, 10 Dec 2014 08:39:34 +0000 (00:39 -0800)
committerEric Gillespie <epg@pretzelnet.org>
Wed, 10 Dec 2014 08:39:34 +0000 (00:39 -0800)
Shouldn't normally matter, but if someone runs on a sortm'd range of messages,
the assumption about msgnum ordering breaks down.

minc

diff --git a/minc b/minc
index 49fb5fd..31fefa5 100755 (executable)
--- a/minc
+++ b/minc
@@ -898,10 +898,14 @@ if (!caller()) {
     } else {
         @ARGV == 0 or pod2usage();
         chdir("$inbox/new") or die("chdir($inbox/new): $!");
-        @files = getfiles('.');
-    }
-
-    my %folders = filter_mail($inbox, map { $_->[1] }
+        @files = map { $_->[1] }
+          sort { $a->[0] <=> $b->[0] }
+          map {
+              $st = stat($_) or die("stat($_): $!");
+              [ $st->mtime, $_ ]
+          } getfiles('.');
+
+        @files = map { $_->[1] }
                 sort { $a->[0] <=> $b->[0] }
                 map {
                     if (not ($st = stat($_))) {
@@ -909,7 +913,10 @@ if (!caller()) {
                     }
                     [$st->mtime, $_]
                 }
-                @files);
+                getfiles('.');
+    }
+
+    my %folders = filter_mail($inbox, @files);
 
     $run and %folders and update_dot_folders(\%folders);