1 Return-Path: <jan@ryngle.com>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id CC98C431FBC
\r
6 for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 13:21:27 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 Received: from olra.theworths.org ([127.0.0.1])
\r
9 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
10 with ESMTP id zTueoMskyLu4 for <notmuch@notmuchmail.org>;
\r
11 Wed, 25 Nov 2009 13:21:27 -0800 (PST)
\r
12 Received: from ey-out-1920.google.com (ey-out-1920.google.com [74.125.78.148])
\r
13 by olra.theworths.org (Postfix) with ESMTP id 76EF2431FAE
\r
14 for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 13:21:27 -0800 (PST)
\r
15 Received: by ey-out-1920.google.com with SMTP id 4so1524624eyg.6
\r
16 for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 13:21:26 -0800 (PST)
\r
17 Received: by 10.216.87.80 with SMTP id x58mr2802803wee.92.1259184086458;
\r
18 Wed, 25 Nov 2009 13:21:26 -0800 (PST)
\r
19 Received: from x61s.janakj ([213.192.30.141])
\r
20 by mx.google.com with ESMTPS id 5sm3703154eyf.8.2009.11.25.13.21.25
\r
21 (version=TLSv1/SSLv3 cipher=RC4-MD5);
\r
22 Wed, 25 Nov 2009 13:21:25 -0800 (PST)
\r
23 Received: by x61s.janakj (Postfix, from userid 1000)
\r
24 id 6242C440655; Wed, 25 Nov 2009 22:21:24 +0100 (CET)
\r
25 Date: Wed, 25 Nov 2009 22:21:24 +0100
\r
26 From: Jan Janak <jan@ryngle.com>
\r
27 To: Scott Robinson <scott@quadhome.com>
\r
28 Message-ID: <20091125212124.GE25119@ryngle.com>
\r
29 References: <1259178195-30324-1-git-send-email-jan@ryngle.com>
\r
30 <1259179778-sup-5382@lisa>
\r
32 Content-Type: text/plain; charset=us-ascii
\r
33 Content-Disposition: inline
\r
34 In-Reply-To: <1259179778-sup-5382@lisa>
\r
35 User-Agent: Mutt/1.5.18 (2008-05-17)
\r
36 Cc: notmuch <notmuch@notmuchmail.org>
\r
37 Subject: Re: [notmuch] [PATCH] notmuch-new: Test if directory looks
\r
38 like Maildir before skipping tmp.
\r
39 X-BeenThere: notmuch@notmuchmail.org
\r
40 X-Mailman-Version: 2.1.12
\r
42 List-Id: "Use and development of the notmuch mail system."
\r
43 <notmuch.notmuchmail.org>
\r
44 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
45 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
46 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
47 List-Post: <mailto:notmuch@notmuchmail.org>
\r
48 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
49 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
50 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
51 X-List-Received-Date: Wed, 25 Nov 2009 21:21:28 -0000
\r
53 On 25-11 12:12, Scott Robinson wrote:
\r
54 > Excerpts from Jan Janak's message of Wed Nov 25 11:43:15 -0800 2009:
\r
55 > > +/* Test if the directory looks like a Maildir directory.
\r
57 > > + * Search through the array of directory entries to see if we can find all
\r
58 > > + * three subdirectories typical for Maildir, that is "new", "cur", and "tmp".
\r
60 > > + * Return 1 if the directory looks like a Maildir and 0 otherwise.
\r
62 > > +static int is_maildir (struct dirent **entries, int count)
\r
64 > > + int i, found = 0;
\r
66 > > + for (i = 0; i < count; i++) {
\r
67 > > + if (entries[i]->d_type != DT_DIR) continue;
\r
68 > > + if (strcmp(entries[i]->d_name, "new") == 0 ||
\r
69 > > + strcmp(entries[i]->d_name, "cur") == 0 ||
\r
70 > > + strcmp(entries[i]->d_name, "tmp") == 0)
\r
76 > > + return found >= 3;
\r
79 > Maybe put the "found >= 3" in the for loop's stop-condition?
\r
81 You are right, of course. Resubmitted, thanks a lot!
\r