diff options
author | Austin Clements <amdragon@MIT.EDU> | 2012-05-18 00:13:40 -0400 |
---|---|---|
committer | David Bremner <bremner@debian.org> | 2012-05-23 22:31:47 -0300 |
commit | cdd698f96976dc8fc43efd19c452d0fca48e2618 (patch) | |
tree | cb8329441478258beaf883228d2cc465490457d5 /lib/database.cc | |
parent | f1f1e3963910a845e2bc0ebe6b9b5c852b4564eb (diff) |
lib: Make notmuch_database_find_message_by_filename not crash on read-only databases
Previously, _notmuch_database_filename_to_direntry would abort with an
internal error when called on a read-only database. Now that creating
the directory document is optional,
notmuch_database_find_message_by_filename can disable directory
document creation (as it should) and, as a result, not abort on
read-only databases.
Diffstat (limited to 'lib/database.cc')
-rw-r--r-- | lib/database.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/database.cc b/lib/database.cc index e27a0e16..761dc1a2 100644 --- a/lib/database.cc +++ b/lib/database.cc @@ -1895,8 +1895,8 @@ notmuch_database_find_message_by_filename (notmuch_database_t *notmuch, try { status = _notmuch_database_filename_to_direntry ( - local, notmuch, filename, NOTMUCH_FIND_CREATE, &direntry); - if (status) + local, notmuch, filename, NOTMUCH_FIND_LOOKUP, &direntry); + if (status || !direntry) goto DONE; term = talloc_asprintf (local, "%s%s", prefix, direntry); |