Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 43373431FC0 for ; Tue, 24 Nov 2009 20:58:31 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T+bY1WGzKNSz for ; Tue, 24 Nov 2009 20:58:30 -0800 (PST) Received: from e23smtp02.au.ibm.com (e23smtp02.au.ibm.com [202.81.31.144]) by olra.theworths.org (Postfix) with ESMTP id 304EF431FC4 for ; Tue, 24 Nov 2009 20:58:29 -0800 (PST) Received: from d23relay05.au.ibm.com (d23relay05.au.ibm.com [202.81.31.247]) by e23smtp02.au.ibm.com (8.14.3/8.13.1) with ESMTP id nAP4toGN022951 for ; Wed, 25 Nov 2009 15:55:50 +1100 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.234.96]) by d23relay05.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id nAP4svwH1445966 for ; Wed, 25 Nov 2009 15:54:57 +1100 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVout) with ESMTP id nAP4wRsi008144 for ; Wed, 25 Nov 2009 15:58:27 +1100 Received: from localhost.localdomain ([9.124.31.111]) by d23av01.au.ibm.com (8.14.3/8.13.1/NCO v10.0 AVin) with ESMTP id nAP4wQYO008088; Wed, 25 Nov 2009 15:58:26 +1100 From: "Aneesh Kumar K.V" To: notmuch@notmuchmail.org Date: Wed, 25 Nov 2009 10:28:24 +0530 Message-Id: <1259125104-18785-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> X-Mailer: git-send-email 1.6.5.2.74.g610f9 Subject: [notmuch] [PATCH] notmuch-new: Fix notmuch new to look at files within symbolic links X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 04:58:31 -0000 We look at the modified time of the database and the directory to decide whether we need to look at only the subdirectories. ie, if directory modified time is < database modified time then we have already looking at all the files withing the directory. So we just need to iterate through the subdirectories But with symlinks we need to make sure we follow them even if the directory modified time is less than database modified time Signed-off-by: Aneesh Kumar K.V --- notmuch-new.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/notmuch-new.c b/notmuch-new.c index e32b92a..ba5bb5a 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -149,7 +149,7 @@ add_files_recursive (notmuch_database_t *notmuch, /* If this directory hasn't been modified since the last * add_files, then we only need to look further for * sub-directories. */ - if (path_mtime <= path_dbtime && entry->d_type != DT_DIR) + if (path_mtime <= path_dbtime && entry->d_type == DT_REG) continue; /* Ignore special directories to avoid infinite recursion. -- 1.6.5.2.74.g610f9