diff --git a/src/mu-config.c b/src/mu-config.c index caaf8f1e..bceab6bf 100644 --- a/src/mu-config.c +++ b/src/mu-config.c @@ -449,7 +449,7 @@ show_usage (gboolean noerror) static void show_version (void) { - g_print ("mu (mail indexer/searcher) " VERSION "\n" + g_print ("mu (mail indexer/searcher) version " VERSION "\n" "Copyright (C) 2008-2011 Dirk-Jan C. Binnema (GPLv3+)\n"); } diff --git a/src/mu-msg-doc.cc b/src/mu-msg-doc.cc index b7fdde99..8bdde617 100644 --- a/src/mu-msg-doc.cc +++ b/src/mu-msg-doc.cc @@ -105,22 +105,22 @@ mu_msg_doc_get_num_field (MuMsgDoc *self, MuMsgFieldId mfid) g_return_val_if_fail (self, -1); g_return_val_if_fail (mu_msg_field_id_is_valid(mfid), -1); g_return_val_if_fail (mu_msg_field_is_numeric(mfid), -1); - + /* date is a special case, because we store dates as * strings */ try { const std::string s (self->doc().get_value(mfid)); if (s.empty()) - return -1; + return 0; else if (mfid == MU_MSG_FIELD_ID_DATE) { time_t t; t = mu_date_str_to_time_t (s.c_str(), FALSE/*utc*/); return static_cast(t); - } else + } else { return static_cast(Xapian::sortable_unserialise(s)); - - } MU_XAPIAN_CATCH_BLOCK_RETURN(-1); - + } + + } MU_XAPIAN_CATCH_BLOCK_RETURN(-1); } diff --git a/src/mu-msg-file.h b/src/mu-msg-file.h index a6f992e5..0a800ce5 100644 --- a/src/mu-msg-file.h +++ b/src/mu-msg-file.h @@ -106,9 +106,9 @@ GSList* mu_msg_file_get_str_list_field (MuMsgFile *self, * @param self a valid MuMsgFile * @param msfid the message field id to get (must be string-based one) * - * @return the numeric value, or -1 + * @return the numeric value, or -1 in case of error */ -gint64 mu_msg_file_get_num_field (MuMsgFile *self, MuMsgFieldId msfid); +gint64 mu_msg_file_get_num_field (MuMsgFile *self, MuMsgFieldId mfid); #endif /*__MU_MSG_FILE_H__*/