#include <xapian.h>
-#include <glib.h> /* g_strdup_printf, g_free, GHashTable */
+#include <glib.h> /* g_strdup_printf, g_free, GPtrArray, GHashTable */
using namespace std;
err = stat (notmuch_path, &st);
if (err) {
- fprintf (stderr, "Error: Cannot stat %s: %s\n",
- notmuch_path, strerror (err));
+ fprintf (stderr, "Error opening database at %s: %s\n",
+ notmuch_path, strerror (errno));
goto DONE;
}
free (id);
}
- g_ptr_array_free (thread_ids, TRUE);
doc.add_value (NOTMUCH_VALUE_THREAD, thread_id->str);
g_string_free (thread_id, TRUE);
} else if (message_id) {
doc.add_value (NOTMUCH_VALUE_THREAD, thread_id.str);
}
+ g_ptr_array_free (thread_ids, TRUE);
+
free (message_id);
date = notmuch_message_get_header (message, "date");