X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-new.c;h=473201e961cdb61fe51c1807a18b4161d3615f48;hp=2faf2f8e01029d4b933aa9041d3d7be7a5a40f6d;hb=2e7b6494046342872f1f79418679b1554d6d1005;hpb=d3b5533123293fdc1e4177f42018f085c03585c9;ds=sidebyside diff --git a/notmuch-new.c b/notmuch-new.c index 2faf2f8e..473201e9 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -779,7 +779,8 @@ remove_filename (notmuch_database_t *notmuch, return status; status = notmuch_database_find_message_by_filename (notmuch, path, &message); if (status || message == NULL) - return status; + goto DONE; + status = notmuch_database_remove_message (notmuch, path); if (status == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) { add_files_state->renamed_messages++; @@ -790,6 +791,8 @@ remove_filename (notmuch_database_t *notmuch, add_files_state->removed_messages++; } notmuch_message_destroy (message); + + DONE: notmuch_database_end_atomic (notmuch); return status; } @@ -1035,8 +1038,8 @@ notmuch_new_command (void *ctx, int argc, char *argv[]) printf ("\n"); if (ret) - printf ("\nNote: A fatal error was encountered: %s\n", - notmuch_status_to_string (ret)); + fprintf (stderr, "Note: A fatal error was encountered: %s\n", + notmuch_status_to_string (ret)); notmuch_database_close (notmuch);