X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-new.c;h=d45d0af8642a3f2f4815808c91509e5a0145eda6;hp=514e06a4d1f31326a805d1cabef4fb6631ab4b9d;hb=391d9f94204234d6ef3dd701d69bfdf92dbad8f0;hpb=f76d8f82dd004cf14426a91e8a80dcd2a4b97317 diff --git a/notmuch-new.c b/notmuch-new.c index 514e06a4..d45d0af8 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -878,8 +878,11 @@ _remove_directory (void *ctx, goto DONE; } + status = notmuch_directory_delete (directory); + DONE: - notmuch_directory_destroy (directory); + if (status) + notmuch_directory_destroy (directory); return status; } @@ -924,7 +927,11 @@ int notmuch_new_command (notmuch_config_t *config, int argc, char *argv[]) { notmuch_database_t *notmuch; - add_files_state_t add_files_state; + add_files_state_t add_files_state = { + .verbosity = VERBOSITY_NORMAL, + .debug = FALSE, + .output_is_a_tty = isatty (fileno (stdout)), + }; struct timeval tv_start; int ret = 0; struct stat st; @@ -939,10 +946,6 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[]) notmuch_bool_t quiet = FALSE, verbose = FALSE; notmuch_status_t status; - add_files_state.verbosity = VERBOSITY_NORMAL; - add_files_state.debug = FALSE; - add_files_state.output_is_a_tty = isatty (fileno (stdout)); - notmuch_opt_desc_t options[] = { { NOTMUCH_OPT_BOOLEAN, &quiet, "quiet", 'q', 0 }, { NOTMUCH_OPT_BOOLEAN, &verbose, "verbose", 'v', 0 }, @@ -1077,9 +1080,6 @@ notmuch_new_command (notmuch_config_t *config, int argc, char *argv[]) talloc_free (dot_notmuch_path); dot_notmuch_path = NULL; - add_files_state.processed_files = 0; - add_files_state.added_messages = 0; - add_files_state.removed_messages = add_files_state.renamed_messages = 0; gettimeofday (&add_files_state.tv_start, NULL); add_files_state.removed_files = _filename_list_create (config);