*
* TIMESTAMP: The time_t value corresponding to the message's
* Date header.
*
* MESSAGE_ID: The unique ID of the mail mess (see "id" above)
*
*
* TIMESTAMP: The time_t value corresponding to the message's
* Date header.
*
* MESSAGE_ID: The unique ID of the mail mess (see "id" above)
*
* In addition, terms from the content of the message are added with
* "from", "to", "attachment", and "subject" prefixes for use by the
* user in searching. Similarly, terms from the path of the mail
* In addition, terms from the content of the message are added with
* "from", "to", "attachment", and "subject" prefixes for use by the
* user in searching. Similarly, terms from the path of the mail
notmuch_database_open (const char *path,
notmuch_database_mode_t mode)
{
notmuch_database_open (const char *path,
notmuch_database_mode_t mode)
{
- if (asprintf (¬much_path, "%s/%s", path, ".notmuch") == -1) {
- notmuch_path = NULL;
+ if (! (notmuch_path = talloc_asprintf (local, "%s/%s", path, ".notmuch"))) {
- if (asprintf (&xapian_path, "%s/%s", notmuch_path, "xapian") == -1) {
- xapian_path = NULL;
+ if (! (xapian_path = talloc_asprintf (local, "%s/%s", notmuch_path, "xapian"))) {
notmuch->exception_reported = FALSE;
notmuch->path = talloc_strdup (notmuch, path);
notmuch->exception_reported = FALSE;
notmuch->path = talloc_strdup (notmuch, path);
} catch (const Xapian::Error &error) {
fprintf (stderr, "A Xapian exception occurred opening database: %s\n",
error.get_msg().c_str());
} catch (const Xapian::Error &error) {
fprintf (stderr, "A Xapian exception occurred opening database: %s\n",
error.get_msg().c_str());
(static_cast <Xapian::WritableDatabase *> (notmuch->xapian_db))->flush ();
} catch (const Xapian::Error &error) {
if (! notmuch->exception_reported) {
(static_cast <Xapian::WritableDatabase *> (notmuch->xapian_db))->flush ();
} catch (const Xapian::Error &error) {
if (! notmuch->exception_reported) {
* However, we rely on flushing to test atomicity. */
const char *thresh = getenv ("XAPIAN_FLUSH_THRESHOLD");
if (thresh && atoi (thresh) == 1)
* However, we rely on flushing to test atomicity. */
const char *thresh = getenv ("XAPIAN_FLUSH_THRESHOLD");
if (thresh && atoi (thresh) == 1)
} catch (const Xapian::Error &error) {
fprintf (stderr, "A Xapian exception occurred committing transaction: %s.\n",
error.get_msg().c_str());
} catch (const Xapian::Error &error) {
fprintf (stderr, "A Xapian exception occurred committing transaction: %s.\n",
error.get_msg().c_str());