aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2012-05-18 00:13:42 -0400
committerGravatar David Bremner <bremner@debian.org>2012-05-23 22:32:12 -0300
commitd9f61c26a1344b123c1812392bc39c32634a099a (patch)
tree899ca254ab5e505439a8f07fc9d3ee736204b54c /lib
parent54508eb78d1c5c1c67c8b220cf2bd826af1203a9 (diff)
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/message.cc4
1 files changed, 2 insertions, 2 deletions
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. */