From d30e0ab2baf4d155ea6e50eb8a2b32fdacd9fcaf Mon Sep 17 00:00:00 2001 From: djcb Date: Wed, 16 Nov 2016 20:20:15 +0200 Subject: [PATCH] mu: fix contacts callback return value The callbacks for the contacts functions should return TRUE (or be terminated early), but were void. Seems on Linux this usually still worked, not so on OpenBSD at least (unit test broke). So, fix this. --- lib/mu-store-write.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/mu-store-write.cc b/lib/mu-store-write.cc index 85731775..08990636 100644 --- a/lib/mu-store-write.cc +++ b/lib/mu-store-write.cc @@ -195,7 +195,7 @@ mu_store_flush (MuStore *store) if (store->in_transaction()) store->commit_transaction (); store->db_writable()->commit (); - + } MU_XAPIAN_CATCH_BLOCK; if (store->contacts()) @@ -626,16 +626,16 @@ add_address_subfields (Xapian::Document& doc, const char *addr, g_free (f2); } -static void +static gboolean each_contact_info (MuMsgContact *contact, MsgDoc *msgdoc) { /* for now, don't store reply-to addresses */ if (mu_msg_contact_type (contact) == MU_MSG_CONTACT_TYPE_REPLY_TO) - return; + return TRUE; const std::string pfx (xapian_pfx(contact)); if (pfx.empty()) - return; /* unsupported contact type */ + return TRUE; /* unsupported contact type */ if (!mu_str_is_empty(contact->name)) { Xapian::TermGenerator termgen; @@ -660,16 +660,18 @@ each_contact_info (MuMsgContact *contact, MsgDoc *msgdoc) msgdoc->_personal, mu_msg_get_date(msgdoc->_msg)); } + + return TRUE; } -static void +static gboolean each_contact_check_if_personal (MuMsgContact *contact, MsgDoc *msgdoc) { GSList *cur; if (msgdoc->_personal || !contact->address) - return; + return TRUE; for (cur = msgdoc->_my_addresses; cur; cur = g_slist_next (cur)) { if (g_ascii_strcasecmp ( @@ -678,6 +680,8 @@ each_contact_check_if_personal (MuMsgContact *contact, MsgDoc *msgdoc) break; } } + + return TRUE; } Xapian::Document