lib: clear error message on success in _choose_database_path

Previously we both found a database and returned a message saying that
the database could not be found (along with a success code). This
change should prevent spurious error output.
This commit is contained in:
David Bremner 2023-12-03 14:56:44 -04:00
parent 5a582e8ed9
commit b97cd90040
2 changed files with 5 additions and 1 deletions

View file

@ -249,6 +249,11 @@ _choose_database_path (notmuch_database_t *notmuch,
return NOTMUCH_STATUS_NO_DATABASE;
}
if (*message) {
free (*message);
*message = NULL;
}
return NOTMUCH_STATUS_SUCCESS;
}

View file

@ -376,7 +376,6 @@ EOF
;;
home_mail|maildir_env)
test_begin_subtest "No errors from config list ($config)"
test_subtest_known_broken
notmuch config list 2>OUTPUT 1>/dev/null
test_expect_equal_file /dev/null OUTPUT
;;