options: avoid using empty 'shadafile'

References https://github.com/neovim/neovim/pull/9907
Fixes https://github.com/neovim/neovim/issues/9912
This commit is contained in:
Marco Hinz
2019-04-16 19:57:44 +02:00
parent aa82f8b88f
commit 773bdd41ec

View File

@ -1542,7 +1542,7 @@ static char *shada_filename(const char *file)
FUNC_ATTR_MALLOC FUNC_ATTR_NONNULL_RET FUNC_ATTR_WARN_UNUSED_RESULT
{
if (file == NULL || *file == NUL) {
if (p_shadafile != NULL) {
if (p_shadafile != NULL && *p_shadafile != NUL) {
file = p_shadafile;
} else {
if ((file = find_shada_parameter('n')) == NULL || *file == NUL) {