X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-new.c;h=6247088ac130067457d74eb1c7b4d7222ea42513;hp=7603d3d7b57f0a61236cef9f76afe5e8bd98740e;hb=4d35c3544d7bb0143cb1a17cc197cfe271670bf8;hpb=37bdd8987094220c84ec39f8f550753219f68bd4 diff --git a/notmuch-new.c b/notmuch-new.c index 7603d3d7..6247088a 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -167,7 +167,7 @@ add_files_recursive (notmuch_database_t *notmuch, if (S_ISREG (st->st_mode)) { /* If the file hasn't been modified since the last * add_files, then we need not look at it. */ - if (st->st_mtime > path_dbtime) { + if (path_dbtime == 0 || st->st_mtime > path_dbtime) { state->processed_files++; status = notmuch_database_add_message (notmuch, next, &message); @@ -410,6 +410,7 @@ notmuch_new_command (void *ctx, if (new_database) { int count; + count = 0; count_files (db_path, &count); add_files_state.ignore_read_only_directories = FALSE; add_files_state.total_files = count;