if (config == NULL)
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, ¬much))
return 1;
query_str = query_string_from_args (ctx, argc-opt_index, argv+opt_index);
}
notmuch_query_destroy (query);
- notmuch_database_close (notmuch);
+ notmuch_database_destroy (notmuch);
return 0;
}