From 597007a45ea4618eea4b55fb9d58fc60502f320f Mon Sep 17 00:00:00 2001 From: epg <> Date: Fri, 12 Mar 2004 03:44:18 +0000 Subject: [PATCH] (preprocess): Return the @result list sorted by mtime. --- minc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/minc b/minc index 9f006ef..87a7813 100755 --- a/minc +++ b/minc @@ -33,6 +33,7 @@ use Errno; use Fcntl qw(O_WRONLY O_EXCL O_CREAT); use FileHandle; use File::Basename; +use File::stat; use Getopt::Std; use Log::Dispatch; use Log::Dispatch::File; @@ -575,6 +576,7 @@ sub preprocess { my @baton; my $msg; my $i; + my $st; my @result; @baton = spam_start_hook(); @@ -596,7 +598,15 @@ sub preprocess { spam_stop_hook(@baton); - return @result; + return (map { $_->[1] } + sort { $a->[0] <=> $b->[0] } + map { + if (not ($st = stat($_))) { + die("stat($_): $!"); + } + [$st->mtime, $_] + } + @result); } -- 2.56.0