X-Git-Url: https://git.cworth.org/git?p=notmuch;a=blobdiff_plain;f=lib%2Fmessage.cc;fp=lib%2Fmessage.cc;h=1b1a071aa56e408597fd857787ecce742874f3ad;hp=5ccca95a2a928d1e7fd3322a17871c7574cbfe35;hb=09f2ad8e853375930c63bca847f623bc722b9cc0;hpb=4e6c6c8aac7f581448df525abd09b85c08358dd3 diff --git a/lib/message.cc b/lib/message.cc index 5ccca95a..1b1a071a 100644 --- a/lib/message.cc +++ b/lib/message.cc @@ -941,6 +941,7 @@ _notmuch_message_add_filename (notmuch_message_t *message, { const char *relative, *directory; notmuch_status_t status; + notmuch_private_status_t private_status; void *local = talloc_new (message); char *direntry; @@ -964,10 +965,17 @@ _notmuch_message_add_filename (notmuch_message_t *message, /* New file-direntry allows navigating to this message with * notmuch_directory_get_child_files() . */ - status = COERCE_STATUS (_notmuch_message_add_term (message, "file-direntry", direntry), - "adding file-direntry term"); - if (status) - return status; + private_status = _notmuch_message_add_term (message, "file-direntry", direntry); + switch (private_status) { + case NOTMUCH_PRIVATE_STATUS_SUCCESS: + break; + case NOTMUCH_PRIVATE_STATUS_TERM_TOO_LONG: + _notmuch_database_log (message->notmuch, "filename too long for file-direntry term: %s\n", + filename); + return NOTMUCH_STATUS_PATH_ERROR; + default: + return COERCE_STATUS (private_status, "adding file-direntry term"); + } status = _notmuch_message_add_folder_terms (message, directory); if (status)