X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-new.c;h=e2822e23060786ee9674e3d9371cec44782315ba;hp=cc680b412a45e023e1b1b6cec0b92d37cf8c774c;hb=3071fc04fbf3c43f18291cb8e61b566cdf85d762;hpb=f5185881f7b01f67b5b64218804749b733f08d44 diff --git a/notmuch-new.c b/notmuch-new.c index cc680b41..e2822e23 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; } @@ -903,10 +905,9 @@ print_results (const add_files_state_t *state) state->processed_files == 1 ? "file" : "total files"); notmuch_time_print_formatted_seconds (elapsed); if (elapsed > 1) - printf (" (%d files/sec.).\033[K\n", + printf (" (%d files/sec.)", (int) (state->processed_files / elapsed)); - else - printf (".\033[K\n"); + printf (".%s\n", (state->output_is_a_tty) ? "\033[K" : ""); } if (state->added_messages)