aboutsummaryrefslogtreecommitdiff
path: root/notmuch-new.c
diff options
context:
space:
mode:
authorJani Nikula <jani@nikula.org>2016-12-17 18:28:43 +0200
committerDavid Bremner <david@tethera.net>2017-01-27 22:05:05 -0400
commit3f5257cec271c05d82f8fda129066e9f285689f5 (patch)
tree3b0a5f284bbf25f46e4c217a746ae70ce9b68a97 /notmuch-new.c
parentf8d5c9b80ebeac65a93c80ec2a0d3e514f8ea771 (diff)
cli: don't call _entry_in_ignore_list twice in count files debug
Split file ignores in count_files to fixed and user configured in order to not have to call _entry_in_ignore_list twice when debugging is enabled. Minor detail.
Diffstat (limited to 'notmuch-new.c')
-rw-r--r--notmuch-new.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/notmuch-new.c b/notmuch-new.c
index cc680b41..13212639 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -738,18 +738,20 @@ count_files (const char *path, int *count, add_files_state_t *state)
entry = fs_entries[i];
/* Ignore special directories to avoid infinite recursion.
- * Also ignore the .notmuch directory and files/directories
- * the user has configured to be ignored.
+ * Also ignore the .notmuch directory.
*/
if (strcmp (entry->d_name, ".") == 0 ||
strcmp (entry->d_name, "..") == 0 ||
- strcmp (entry->d_name, ".notmuch") == 0 ||
- _entry_in_ignore_list (entry->d_name, state))
- {
- if (state->debug && _entry_in_ignore_list (entry->d_name, state))
+ strcmp (entry->d_name, ".notmuch") == 0)
+ continue;
+
+ /* Ignore any files/directories the user has configured to be
+ * ignored
+ */
+ if (_entry_in_ignore_list (entry->d_name, state)) {
+ if (state->debug)
printf ("(D) count_files: explicitly ignoring %s/%s\n",
- path,
- entry->d_name);
+ path, entry->d_name);
continue;
}