mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-25 04:18:08 +01:00
lib: return NULL from n_d_get_default_indexopts on error
This is a rare and probably serious programming error, so better not to silently return a default value.
This commit is contained in:
parent
3f8b01a3ef
commit
31dab9b1cd
3 changed files with 2 additions and 2 deletions
|
@ -32,7 +32,7 @@ notmuch_database_get_default_indexopts (notmuch_database_t *db)
|
||||||
char *decrypt_policy;
|
char *decrypt_policy;
|
||||||
notmuch_status_t err = notmuch_database_get_config (db, "index.decrypt", &decrypt_policy);
|
notmuch_status_t err = notmuch_database_get_config (db, "index.decrypt", &decrypt_policy);
|
||||||
if (err)
|
if (err)
|
||||||
return ret;
|
return NULL;
|
||||||
|
|
||||||
if (decrypt_policy) {
|
if (decrypt_policy) {
|
||||||
if ((! (strcasecmp (decrypt_policy, "true"))) ||
|
if ((! (strcasecmp (decrypt_policy, "true"))) ||
|
||||||
|
|
|
@ -2320,6 +2320,7 @@ notmuch_config_list_destroy (notmuch_config_list_t *config_list);
|
||||||
* added to the index. At the moment it is a featureless stub.
|
* added to the index. At the moment it is a featureless stub.
|
||||||
*
|
*
|
||||||
* @since libnotmuch 5.1 (notmuch 0.26)
|
* @since libnotmuch 5.1 (notmuch 0.26)
|
||||||
|
* @retval NULL in case of error
|
||||||
*/
|
*/
|
||||||
notmuch_indexopts_t *
|
notmuch_indexopts_t *
|
||||||
notmuch_database_get_default_indexopts (notmuch_database_t *db);
|
notmuch_database_get_default_indexopts (notmuch_database_t *db);
|
||||||
|
|
|
@ -373,7 +373,6 @@ EOF
|
||||||
test_expect_equal_file EXPECTED OUTPUT
|
test_expect_equal_file EXPECTED OUTPUT
|
||||||
|
|
||||||
test_begin_subtest "get indexopts from closed database"
|
test_begin_subtest "get indexopts from closed database"
|
||||||
test_subtest_known_broken
|
|
||||||
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
|
cat c_head - c_tail <<'EOF' | test_C ${MAIL_DIR}
|
||||||
{
|
{
|
||||||
notmuch_indexopts_t *result;
|
notmuch_indexopts_t *result;
|
||||||
|
|
Loading…
Reference in a new issue