1
0
forked from aniani/vim

patch 8.2.3947: unnecessary check for NULL pointer

Problem:    Unnecessary check for NULL pointer.
Solution:   Remove the check. (closes #9434)
This commit is contained in:
zeertzjq
2021-12-30 13:45:57 +00:00
committed by Bram Moolenaar
parent 1c67f3a977
commit f38aad85cf
2 changed files with 4 additions and 2 deletions

View File

@@ -7411,9 +7411,9 @@ changedir_func(
# endif
new_dir = NameBuff;
}
dir_differs = new_dir == NULL || pdir == NULL
dir_differs = pdir == NULL
|| pathcmp((char *)pdir, (char *)new_dir, -1) != 0;
if (new_dir == NULL || (dir_differs && vim_chdir(new_dir)))
if (dir_differs && vim_chdir(new_dir))
{
emsg(_(e_failed));
vim_free(pdir);