status = notmuch_database_begin_atomic (notmuch);
if (status)
return status;
- message = notmuch_database_find_message_by_filename (notmuch, path);
+ status = notmuch_database_find_message_by_filename (notmuch, path, &message);
+ if (status || message == NULL)
+ return status;
status = notmuch_database_remove_message (notmuch, path);
if (status == NOTMUCH_STATUS_DUPLICATE_MESSAGE_ID) {
add_files_state->renamed_messages++;
add_files_state.verbose = 0;
add_files_state.output_is_a_tty = isatty (fileno (stdout));
+ argc--; argv++; /* skip subcommand argument */
+
for (i = 0; i < argc && argv[i][0] == '-'; i++) {
if (STRNCMP_LITERAL (argv[i], "--verbose") == 0) {
add_files_state.verbose = 1;