X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=lib%2Fmessage.cc;h=67875065f5c93f01edbad2387172d3767be59364;hb=b9effbba387924d51d9437ea8186d78d7825f5a7;hp=8f1c4dcd5b40f9492a56a2be5288bccbc3bd9d3e;hpb=21b13c3932a73fcc906f8bbc13a0f2112bcebfb8;p=notmuch diff --git a/lib/message.cc b/lib/message.cc index 8f1c4dcd..67875065 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -495,9 +495,8 @@ _notmuch_message_add_filename (notmuch_message_t *message, if (status) return status; - status = _notmuch_database_filename_to_direntry (local, - message->notmuch, - filename, &direntry); + status = _notmuch_database_filename_to_direntry ( + local, message->notmuch, filename, NOTMUCH_FIND_CREATE, &direntry); if (status) return status; @@ -541,9 +540,9 @@ _notmuch_message_remove_filename (notmuch_message_t *message, notmuch_status_t status; Xapian::TermIterator i, last; - status = _notmuch_database_filename_to_direntry (local, message->notmuch, - filename, &direntry); - if (status) + status = _notmuch_database_filename_to_direntry ( + local, message->notmuch, filename, NOTMUCH_FIND_LOOKUP, &direntry); + if (status || !direntry) return status; /* Unlink this file from its parent directory. */ @@ -1217,8 +1216,6 @@ _new_maildir_filename (void *ctx, if (info == NULL) { info = filename + strlen(filename); } else { - flags = info + 3; - /* Loop through existing flags in filename. */ for (flags = info + 3, last_flag = 0; *flags;