]> git.notmuchmail.org Git - notmuch/commitdiff
cli/new: ignore special directories also in pass 2
authorJani Nikula <jani@nikula.org>
Fri, 1 Sep 2017 15:53:09 +0000 (18:53 +0300)
committerDavid Bremner <david@tethera.net>
Mon, 2 Oct 2017 10:59:30 +0000 (07:59 -0300)
Avoid passing . and .. to ignore check. We also don't need to check
their dirent type either.

notmuch-new.c

index 378bf4c2a15a7dd2a1215b77998d8f73daad1943..2ce3af872f0ed95eb6ab8f036e01edda302f2856 100644 (file)
@@ -521,6 +521,10 @@ add_files (notmuch_database_t *notmuch,
     for (i = 0; i < num_fs_entries && ! interrupted; i++) {
         entry = fs_entries[i];
 
     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)
        /* Ignore files & directories user has configured to be ignored */
        if (_entry_in_ignore_list (entry->d_name, state)) {
            if (state->debug)