1 Return-Path: <scott@quadhome.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 ACDCC431FBC
\r
6 for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 12:12:29 -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 LYzVyRwG5zgM for <notmuch@notmuchmail.org>;
\r
11 Wed, 25 Nov 2009 12:12:29 -0800 (PST)
\r
12 Received: from megan.quadhome.com (megan.quadhome.com [209.9.237.126])
\r
13 by olra.theworths.org (Postfix) with ESMTP id 1F61B431FAE
\r
14 for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 12:12:29 -0800 (PST)
\r
15 Received: from elise.quadhome.com (97-126-47-108.tukw.qwest.net
\r
17 by megan.quadhome.com (Postfix) with ESMTPSA id D44A9B8032
\r
18 for <notmuch@notmuchmail.org>; Wed, 25 Nov 2009 12:12:27 -0800 (PST)
\r
19 Content-Type: text/plain; charset=UTF-8
\r
20 From: Scott Robinson <scott@quadhome.com>
\r
21 To: notmuch <notmuch@notmuchmail.org>
\r
22 In-reply-to: <1259178195-30324-1-git-send-email-jan@ryngle.com>
\r
23 References: <1259178195-30324-1-git-send-email-jan@ryngle.com>
\r
24 Date: Wed, 25 Nov 2009 12:12:25 -0800
\r
25 Message-Id: <1259179778-sup-5382@lisa>
\r
27 Content-Transfer-Encoding: 8bit
\r
28 Subject: Re: [notmuch] [PATCH] notmuch-new: Test if directory looks like
\r
29 Maildir before skipping tmp.
\r
30 X-BeenThere: notmuch@notmuchmail.org
\r
31 X-Mailman-Version: 2.1.12
\r
33 List-Id: "Use and development of the notmuch mail system."
\r
34 <notmuch.notmuchmail.org>
\r
35 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
36 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
37 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
38 List-Post: <mailto:notmuch@notmuchmail.org>
\r
39 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
40 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
41 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
42 X-List-Received-Date: Wed, 25 Nov 2009 20:12:29 -0000
\r
44 Excerpts from Jan Janak's message of Wed Nov 25 11:43:15 -0800 2009:
\r
45 > +/* Test if the directory looks like a Maildir directory.
\r
47 > + * Search through the array of directory entries to see if we can find all
\r
48 > + * three subdirectories typical for Maildir, that is "new", "cur", and "tmp".
\r
50 > + * Return 1 if the directory looks like a Maildir and 0 otherwise.
\r
52 > +static int is_maildir (struct dirent **entries, int count)
\r
54 > + int i, found = 0;
\r
56 > + for (i = 0; i < count; i++) {
\r
57 > + if (entries[i]->d_type != DT_DIR) continue;
\r
58 > + if (strcmp(entries[i]->d_name, "new") == 0 ||
\r
59 > + strcmp(entries[i]->d_name, "cur") == 0 ||
\r
60 > + strcmp(entries[i]->d_name, "tmp") == 0)
\r
66 > + return found >= 3;
\r
69 Maybe put the "found >= 3" in the for loop's stop-condition?
\r
71 Scott Robinson | http://quadhome.com/
\r
73 Q: Why are my replies five sentences or less?
\r
74 A: http://five.sentenc.es/
\r