From: Jani Nikula Date: Fri, 1 Sep 2017 15:53:09 +0000 (+0300) Subject: cli/new: ignore special directories also in pass 2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9d48ee2eaacce7323622e6017f7bdb01a915e885;p=notmuch.git cli/new: ignore special directories also in pass 2 Avoid passing . and .. to ignore check. We also don't need to check their dirent type either. --- diff --git a/notmuch-new.c b/notmuch-new.c index 378bf4c2..2ce3af87 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -521,6 +521,10 @@ add_files (notmuch_database_t *notmuch, for (i = 0; i < num_fs_entries && ! interrupted; i++) { entry = fs_entries[i]; + /* Ignore special directories early. */ + if (_special_directory (entry->d_name)) + continue; + /* Ignore files & directories user has configured to be ignored */ if (_entry_in_ignore_list (entry->d_name, state)) { if (state->debug)