]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-show.c
test: add tests for notmuch reply From guessing
[notmuch] / notmuch-show.c
index da4a797fbf1e9ed7901301a7c1cb0f3895c3d16e..95427d4fd3096f294714b8a1b4fb069f64fc0503 100644 (file)
@@ -1081,9 +1081,8 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
        return 1;
     }
 
-    notmuch = notmuch_database_open (notmuch_config_get_database_path (config),
-                                    NOTMUCH_DATABASE_MODE_READ_ONLY);
-    if (notmuch == NULL)
+    if (notmuch_database_open (notmuch_config_get_database_path (config),
+                              NOTMUCH_DATABASE_MODE_READ_ONLY, &notmuch))
        return 1;
 
     query = notmuch_query_create (notmuch, query_string);
@@ -1117,7 +1116,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
     }
 
     notmuch_query_destroy (query);
-    notmuch_database_close (notmuch);
+    notmuch_database_destroy (notmuch);
 
     if (params.cryptoctx)
        g_object_unref(params.cryptoctx);