From: Austin Clements Date: Fri, 18 May 2012 04:13:42 +0000 (-0400) Subject: lib: Don't needlessly create directory docs in _notmuch_message_remove_filename X-Git-Tag: 0.13.1~7 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=d9f61c26a1344b123c1812392bc39c32634a099a lib: Don't needlessly create directory docs in _notmuch_message_remove_filename Previously, if passed a filename with a directory that did not exist in the database, _notmuch_message_remove_filename would needlessly create that directory document. Fix it so that doesn't happen. --- diff --git a/lib/message.cc b/lib/message.cc index 8d552f1f..67875065 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -541,8 +541,8 @@ _notmuch_message_remove_filename (notmuch_message_t *message, Xapian::TermIterator i, last; status = _notmuch_database_filename_to_direntry ( - local, message->notmuch, filename, NOTMUCH_FIND_CREATE, &direntry); - if (status) + local, message->notmuch, filename, NOTMUCH_FIND_LOOKUP, &direntry); + if (status || !direntry) return status; /* Unlink this file from its parent directory. */