From: Carl Worth Date: Mon, 19 Oct 2009 19:52:46 +0000 (-0700) Subject: notmuch: Ignore .notmuch when counting files. X-Git-Tag: 0.1~842 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9bc4253fa804b62ff31e8de82a139b2cb12b118f;p=notmuch.git notmuch: Ignore .notmuch when counting files. We were correctly ignoring this when adding files, but not when doing the initial count. Clearly we need better code sharing here. --- diff --git a/notmuch.c b/notmuch.c index 25aa6c5f..e4b5dff6 100644 --- a/notmuch.c +++ b/notmuch.c @@ -253,9 +253,14 @@ count_files (const char *path, int *count) if (e == NULL) break; - /* Skip these special directories to avoid infinite recursion. */ + /* Ignore special directories to avoid infinite recursion. + * Also ignore the .notmuch directory. + */ + /* XXX: Eventually we'll want more sophistication to let the + * user specify files to be ignored. */ if (strcmp (entry->d_name, ".") == 0 || - strcmp (entry->d_name, "..") == 0) + strcmp (entry->d_name, "..") == 0 || + strcmp (entry->d_name, ".notmuch") == 0) { continue; }